it literally means good luck, but used as congratulations. the word for wishing "good luck" to someone is בהצלחה (be-hatz-la-kha)
Someone else explained on another page that it doesn't mean "Have good luck" as "good luck" does in English, but more like "you have had good luck", hence it actually is used like the English "Congratulations!" Scroll up to OmryRozen for more information.
Congrats is commonly used as a short form of Congratulations. Why is this not accepted?
נפלא! תודה רבה. אבל כנראה, אחרי שרואים את הדגל ההוא' זאת אומרת dannebrøg, måske burde jeg siger mange tak!
I saw in this movie "the fiddler on the roof" a wedding scene, where there was a glass on the floor and the groom stepped on it. Everyone shouted mazal tov, so I figured it means "watch out" or "that'll be a fiver, clumsy".
The Jewish tradition is for the groom to step on a glass at the end of a wedding ceremony. https://www.myjewishlearning.com/article/breaking-the-glass-at-a-jewish-wedding/