As a Basque local, with similar schedules to those living in the Pyrenees, and specially in small towns:
• Do shops, pharmacies and supermarkets still close midday? Roughly what hours? Lunch is our very main meal of the day and many shops close from around 0130pm or 2pm to around 4 or 5pm. Not for siesta, as many tend to think, but to go home to cook lunch and relax for a while. Our schedule is always around lunch, which is normally relaxed and long (with a first, a second, and a dessert).
• When do locals actually eat lunch and dinner? Is 9pm dinner still normal outside the cities? Lunch is mainly around 2pm, a bit later on weekends, and dinner is much less important. Try to organize your days taking lunch time into account, as we do not care much about dinner (it´s much smaller and in those towns it will be around 9 or 0930pm).
• Is it hard to find food mid-afternoon or early evening, and what do you do if you’re hungry at 5 or 6? If you have a normal lunch at our times, you will not be hungry at those times. But there´s always a place with something to eat on the counter.
• Anything that catches visitors out, like Sundays, holidays or kitchens closing early? If it´s a small town, most shops close on Sundays and public holidays. Sunday lunch is normally later - and bigger and longer, do not be surprised if you see finishing lunch around 5pm or even later, as we love our "sobremesa" time (that time after lunch when you just remain seated at the table and talk and have coffee or a digestif schapps and the conversation goes on and on...). Sunday evening is much quieter and many restaurants close down and do not reopen until Monday.
The "aperitivo" is that time around 12 noon until 3pm on Saturdays and Sundays when everyone is out with family and friends enjoying their drinks and something to eat before lunch. Quite unique to Spain, I think, a very busy time in weekends.