You are getting ripped off on that price, I know you are in love with the car but please try to do some research.
http://www.buyanad.com/ViewItem.asp?ID=87905&fromsite=auto - $13,500 33k mi
http://www.showauto.com/viewfull.asp?ID=1295181&FromSearch=Yes - $16,800 23k mi
http://www.showauto.com/viewfull.asp?ID=1131067&FromSearch=Yes $16,900 11k mi
Don't let them play that number game with your trade. Sell your trade to a friend for what they are offering you on trade. They should be giving you at least 5k for your trade if they want to stick to that 18k sticker on the used MSP. Don't let them tell you the extra mods add value to the car, mods take away value of the car because the car is not complete.
Call a mazda dealership and get prices for all the parts which have been modified. Have them deduct the sum from what they are asking as it will cost you this price to get the car back to stock form.