Resource extraction, trade and waste management : a regional approach to the Spanish socioeconomic metabolism