Spanish law prohibits smoking in indoor public spaces. Smoking is only permitted in certain outdoor areas. You may smoke on your balcony or terrace if your accommodation is so equipped, but rooms have smoke detectors, so keep doors into the apartment closed while smoking.