。
You're wearing a weird hat.
Literal
Weird hat wearing [observation-な].
変な modifies 帽子 as a な-adjective: 'a weird hat.' かぶってる is the contracted form of かぶっている (wearing on the head). The sentence-final な is a masculine observation particle — the speaker is noting something aloud, talking half to themselves.