Scotland basks in 27C temperatures in end of summer heatwave