Wait...did you know this about mirrors?

I’m so confused, I thought the z axis in space would be front and back just like she said (don’t even lol) bc I was taught the x axis is right / left and the y axis is up/down.  That leaves the z axis to be front / back… Right?   But no!  I looked it up and in Cartesian geometry (3D space) the z axis is up and down perpendicular to the ground like a flagpole.  Like I said, I’m so confused, or-well at least the 7th grade to high school me is.  😅.