Daily watering is sometimes counterproductive because people assume more water = better, but the reality is that with Madrid's heat, what happens is you're watering superficially and the water doesn't reach the deep roots properly. Instead of watering every day, try watering less frequently but thoroughly, letting the soil dry out a bit between waterings. That way the roots are forced to go deeper and they handle the heat better. And yeah, the thing about pots heating up is real, but it's not so much that they burn the roots as that they speed up evaporation, so the best thing is to surround the pots with something that shades them at midday - could be white plastic, aluminum foil, or even putting them under an umbrella.
Location is key. They don't need direct sun all day in July in Madrid; getting sun in the morning or at sunset is plenty, and during peak hours (12 to 5pm) they're better off in the shade or with filtered light. If you have them on the terrace with nothing protecting them, that's a big part of the problem right there.
Another thing: make sure your pots have good drainage at the bottom. If water doesn't drain well, even if you're watering correctly, the roots rot from too much moisture (which is the opposite of what seems to be happening to you, but it's worth checking). And if you see they're still declining anyway, a little flower plant fertilizer every two weeks gives them the energy to handle the heat stress.