Do you speak Spanish?
Buying a bike can be a very personal thing, fit, style accesories etc. and if you don't speak the language you will encounter some probs. The sporting goods stores abroad are as good as in the USA,bikes are pretty much the same as they all come from China or Taiwan, and are the full range of prices
Taking a bike abroad isn't that bothersome, and not costly, it goes free as part of your baggage allowance
Do you have a def departure date?
I'm planning a trip to Spain, spent 10 weeks in Europe last year had a great time, and wouldn't mind traveling with someone this year,speak a bit of Spanish, have Trek and camping gear, will do some Hostels and Bn Bs but has to be cheap.
Have been told camp grounds in Spain are numerous and inexpensive
My route is to be Madrid, Toledo, Escorial,5 days, then by train to Barcelona for 5 days then ride west to Gibraltar doing the historical places along the way, the white hill towns,and spend maybe 2 days going across to Tangiers 4-6 weeks total
I'll send you some web sites for Info later this eve