Yes, but in general it's won by the popular vote. Only 5 times has it not been. That's usually a sign of tampering like gerrymandering and not a healthy sign dfor a democracy. And, yes, the US is a democratic republic and it can be fairly described as a democracy despite the right wing talking points which are just apologies for fascism.