Does a low score in mathematics on transcripts affect graduate admissions? (CS PhD USA)
In the US a doctoral application is based on a variety of things, including GPA and individual course grades in a major field of study. But letters of recommendation are much more important here than in some other places. They need to be from people who know you well and will attest to the high probability of your success.
You also need a good Statement of Purpose, stating your short and longer term goals and how you are prepared to achieve them.
But getting a MS in the US is probably not going to be an advantage for you since it is unlikely to come with any funding, though doctoral study (as a TA) normally does.
My advice would be to apply to several universities for doctoral programs. Make the search fairly broad, not just concentrated in the top ranked schools. But the admission committees will look at everything and some good things might help to overcome some other not as good things.