Aren't people are getting their linguistic knickers (or pants, if you prefer) in a twist here. Surely 'gender' is masculine / feminine (or some combination thereof) and is culturally determined. 'Sex', on the other hand, is male / female (and all points in between) and is biologically determined (that's not to say that claims about what constitutes that 'biology' are not, or have not been, problematic: see, e.g., Andreas Vesalius' anatomical drawings).
(Of course, confusingly, 'sex' can also mean that range of intimate activities in which males and females (and all points in between) engage in various combinations. But the less said about that the better.

)