I am currently the BA undergraduate math major (4th year), and I got ~3.3 cumulative GPA. I'm the average student who likes math a lot, so I took more than 10 graduate courses and higher division undergraduate courses in mathematics. For two courses, I received two C grades in those graduate courses by the same professor (hard exams and finals). I attempted to get better grade in one of those courses, but received the F (because of super hard final and midterm, and because of the same professor). For the undergraduate courses, I got mostly A's and one B+.
Though I still have time to maximize my chance to get into math PhD program by (probably) research experience and great letters of recommendation, I believe that I am more likely not to get into the program (because low grades greatly affect my application). However, I have one question to ask: is it REALLY over for me to get into PhD math program if I receive bad grades in these courses or not? I don't have lots of time to retake such courses, and if I do I will have to waste all money and time on doing so.
I don't aim to get into top-notch universities with excellent PhD programs, like Harvard University. All I expect is a good PhD program for me.