hat=капелюх! Isn't it?
Капелюх is for hats like fedora or panama and шапка is for hats like beanie or fur hat
So kinda like Polish "kapelusz" for "summer" hat and "czapka" for winter hat or cap.
I guess this is why Zelena from the fairy tales is green. Lol
We've always used "капелюх" to signify women's hats (fancy), and "шапка" to signify men's hats/caps/toques, etc. (Women & kids can wear "шапка's" too.)