Look, this guy sounds like a socially inept creep and I want you to know that his behavior is not your fault.
However, your response to him is important, because you might be unwittingly encouraging him to continue treating you inappropriately. I recommend that you
put your hair up and cultivate a less flirty demeanor.
A nervous giggle or awkward sideways glance sends the message that this person can continue harassing you and you'll just demurely flutter your lashes in disbelief or discomfort. The way you're describing the interaction on this thread suggests to me that you responded this way.
The correct response to that kind of inappropriate comment is to either blithely ignore it (I mean, really truly act as if you didn't even hear it) or challenge them politely. Looking someone straight in the eyes and saying "Excuse me? What was that you just said?" in a calm and confident voice can be remarkably effective.
👍