I am going to Spain for a couple of weeks soon. Rick Steve's guide recommends bringing an unlocked phone, buying a relatively inexpensive SIM card in Spain, and your phone works on a cell network at domestic European rates.

My current phone (iPhone 5) is probably locked to a domestic-only U.S. service. If I can't get it unlocked, can anyone recommend an inexpensive phone that would work in Spain? My needs are fairly modest, telephone service, email, Web, and Google Maps/GPS for finding my way around. I don't care about anything fancy or cutting edge, I just want it to work.

Also, can anyone recommend what SIM to buy, on what network, and whether I should buy it in the U.S., or buy it when we arrive in Spain.