Thermodynamic aspects of selective complexation of heavy metal ions of environmental interest : fundamentals and applications