All of Spain was on a heatwave alert on Friday, while the weather agency warned that much of the country was at "very high to extreme risk" from wildfires.