casnkenny I have recently explored this area and spoken to lots of Spanish contacts as well as having received good input here. Sadly the whole area is covered in confusion and variant information even from hacienda offices.
Certainly Capitol Gains Tax is 18% but there seems numerous ways to reduce it. Age, length of time in property, cost of modifications, your tax situation in Spain, etc.
A cuirrent story: Despite my Spanish mother-in-law being 76 years old, having been resident in her flat since 1976 she is being told by the local hacienda that she will be charged CGT although if she completes the right forms possibly at a lower rate. However there is information widely available which states if she is over 65 or has been resident in her only abode prior to 1986 she should be exempt.
On any modifications, if you have made any, it appears this area is another minefield of conflicting information. Of course if you have receipts I would centainly throw them at the authorities. However in Asturias I was told that you should pre-negotiate such reforms in advance with the ayuntamiento.
The final problem would be the calculation of profit. It appears to be a simple subtraction of cost from sale. Hopefully you did not trade ‘black economy’ when buying and thus the purchase price appears reduced. Hopefully you can sell ‘black economy’ and then you will officially have a lower salling price.
Also you may be subject to a tax from the local ayuntamiento based on land value (a sort of rateable value not related to the selling or buying price). I forget what it is called, I was told it is generally not very much. You never know it might be a regional thing but worth checking.
Whatever I would suggest you take nothing at face value and knock on all doors until you get the best deal. The very best of luck and please don’t forget to come back and tell us how you get on.