How much should you spend on a car?

Let us assume you are a regular person (not a car enthusiast), you need a car. You can't buy something very cheap (third hand Maruti 800) since you need to keep up appearances, but you also don't want to overspend (like buy a 25 lakhs car on a 50k salary) How many months' salary should you spend on a car? 6? 12? 18? How should you calculate your EMI? 10% of your salary? 30%?

There are a lot of influencers on youtube giving rules about how to calculate a reasonable car budget, does this sub have one?