I view gender as mostly a cultural construct, though in more mainstream literature (as well as certain legal contexts) it’s regarded as a social one.
The concept of gender is “newer” than its biological analogue (sex) in both science and, seemingly, pop discourse. As such, the collective understanding of the former is less-developed in Western society.
As a socio-cultural concept, then, gender is closer to character (a social concept) than to temperament (biological). By definition, the idea of sex becomes more relevant to one’s temperament than to character.