Men have to wear a rag on their heads. The women would complain if they had to wear the rag on their heads.
Men’s headgear is not restricted. However, sleeveless shirts and shorts are not permitted.
https://cheetah-adventures.com/iran-dress-code/