How important are major-relevant grades to admissions?

I’m interested in majoring in computer science.

I have low to mid 90’s in my computer science class, but low 80’s to 70’s in my math class (honors trigonometry). My science average is in the low 90’s. I admit that I’ve slacked off a little this year (sophomore) year, but I’m wondering whether the damage done to my GPA is fixable. My dream schools are Carnegie Mellon, MIT, Stanford, and UC Berkeley.

The problem is how relevant CS and math grades are in my intended major. Do colleges look at this if they look at my application and would they pay special attention to them because of their relevance in CS? So would that mean that if I wanted a math-science major but my math and science grades weren’t extremely high, that would show that I wasn’t capable, even if I have ECs on the topic? Do they take into account the difficulty of your honors courses? (my school’s math honors program is very good) I just want to know how important these relevant grades are in admissions.

If I were to pick it up significantly next year, get a 2300+ SAT score and 800’s on my SAT II, would that land me at a high enough academic candidate?

I do know extracurriculars come into play, but if I do what I mentioned above, and have mediocre ECs, would I have a chance at these schools? I’m not a URM, legacy, etc., but I am female, if that has anything to do with mathy fields.

Thanks.