Spain in September could probably go both ways!
I have done 40C on the plains, but then blizzards and hail at the top of the Picos a few days later. So prep for both extremes. I've almost had heatstroke in Rukka gear, and almost frozen in mesh gear (also Rukka, but not the point)
For this kind of trip and presuming you have heated grips already, I would take a mesh jacket, a rukka/klim down inner liner (or cheap micro down jacket from mountain whorehouse), a lightweight waterproof overshell (Scott/RST etc), a pair of waterproof jeans such as Rukka Revolution (or normal bike jeans and a pair of lightweight waterproof overs) and a pair of merino leggings.
Hopefully you will be riding in the mesh jacket and jeans all the time, but if it gets cold you can add the insulating layers, and if it gets wet you can add the waterproof stuff. The bonus is that everything apart from the main pair of jeans and mesh jacket packs up really small and you can easily go from full hot to to full cold and rainy depending on the weather forecast.
Edited to add: for boots, any decent boot will do. Preferably waterproof. If you have a mesh jacket, you'll never get so hot that your feet will be the things killing you - and even if they smell, you can always wash your socks. If it's cold, then you won't be sorry that you brought good boots. Actually, once you have boots sorted, socks become important. Get a good pair or two of lightweight, merino hiking socks.
For gloves.....and again assuming you have heated grips (potentially very important at the top of the Picos), Rukka Viriums will see you right for all but the hottest of weather. For that, something that flows air like Rukka AFT gloves, but probably again not necessary - sweaty hands won't kill you either. The main point is to keep your core at a decent temperature, extremities are better at fending for themselves.