@Zone4flaneur thank you for taking the time to explain, that's very interesting about coffee shops being men only, and certainly helps explain why I was made to feel so unwelcome. Though, to be honest, it's just made me view it even more negatively, in that it wasn't that we were unlucky, it's that women are universally unwelcome in coffee shops! Interesting also that you say that Turkey is the same, however when we visited there I felt incredibly welcome everywhere we went (including numerous coffee shops).
We realise that the Medina is a real place where locals live and work - that's exactly why we wanted to venture out of the touristy area, so we could see it! When we travel to a country, we want to see the real country!
I'm sure you are right that we could have made the experience easier by me not getting a drink in the first place we saw when I was thirsty, or daring to need the toilet, or sticking to the tourist tat areas, but that's definitely not the sort of holiday I'm interested in, so I will stick to countries/cultures where I am made to feel welcome (which has been everywhere else I've ever been so far!).
I am genuinely pleased that you enjoy living there however, and I really was blown away how beautiful much of the country was. I'm sure there are many positives to Tunisia, but, as a woman, I definitely won't be returning.