How much money you should bring is a very difficult and personal question to answer. it mainly depends on your budget.

If you want to spend money, there's not doubt that you can spend lots of money here.

As an example, you can go to the typical gift shops, were a "made in china" fan can cost you 3€ and a real handcrafted fan made in spain can cost up to 30€.

Like Madridman said, forget about the high tec stuff, because most likely it won't work back home, and it's more expensive anyways. He really gave you some good ideas to spend on.

If your into expensive or high end stuff, there are alot of internationally recognized Spanish designer clothes which always made great gifts and there are also very good art painters that you can invest in.

So really how much money you need to bring all depends on how much money you really want to spend. Whatever you do, set yourself a budget on what you can afford to spend and go for it.

Enjoy your stay