I don't like the thought of resorting to violence, especially not for the oft depicted woman slapping man for offending her. But in circumstances where you feel threatened I think it could be justifiable self defence.
However, women and girls are socialised to accept unwanted attention and unwanted proximity, to not tell people to fuck off because their intentions might have been good, or they maybe misread the signals or whatever other bullshit excuses people (usually men) have for being entitled to treat women as public property. Young women can be so frightened of being rude that they don't feel empowered to have boundaries.
If you had no fear for your own safety and were putting him down because he offended you then you could have been unreasonable.
If you felt you were threatened by his sexual harassment, then whilst unpleasant, I think it was quick thinking self defence.
I 'allowed' myself to be kissed on the cheek by a man in the street once whilst handing out leaflets. I was just so blindsided by the request I didn't know how to get out of the situation, I thought I had to be polite (I suffered from depression and anxiety badly at the time, my partner who I was there to support and the other volunteers were a little bit away or busy speaking to people - I wasn't confident about doing what I was meant to be doing, let alone responding to harassment).
And because he asked and I allowed him to do that, he probably thought it was completely consensual. But I felt sick about it.
Had I slapped him or sworn at him it surely would have been viewed by him and passers by as an over reaction to an older man being overly familiar. But allowing him to do it felt like such a dangerous under-reaction, I really worried about what I was capable of being pressured into without a fight.
(No offence at all intended to women who have been subjected to attacks and froze, I can imagine how it happens
)