So you want to buy a car, but you picked the worst possible time to do it.

Car prices are at record highs and inventories are at record lows right thanks to a global supply chain disruption that’s impacted countless sectors of the economy. Auto manufacturers can’t get the microchips and materials they need to build new cars, which means there are fewer vehicles on dealership lots. That has led to increased demand for used cars — and those are in shorter supply, too.

What this means is that if you’re in the market for any sort of car, you’re not likely to see many special deals out there.

But that doesn’t mean you can’t still be a smart shopper. Here are some tips on buying a car in a bad market from Matt Degan, an editor with Kelley Blue Book.

Decide whether you really need it.

Look at your budget, your driving needs and the state of your current car. Car prices are likely to stay high for months, maybe even a year or more. “If you can make your car last and invest in that and get it running, then maybe that’s the better option,” Degan said.

Related: The cost of the pandemic: How Tampa Bay lost billions from COVID-19

Do your research.

That’s obvious. But in a market where cars are selling for above the manufacturer’s suggested retail price, it’s more important than ever to know what people are really paying. “Set a budget,” Degan said. “Know that you can afford this vehicle.”

If you’re selling or trading in, shop around and be firm. “If you’re in the position to sell a car, it’s a great time,” Degan said. “You’re going to get top dollar for it.” Flip the script, though. Instead of asking around to see which dealer can offer you the best price, ask how much they’re willing to pay for your car. And if you’re trading in, treat your purchase and sale as separate transactions. While dealers aren’t offering discounts these days, “there can be some wheeling and dealing there,” Degan said.

Eric Pumphrey a salesman at Julian’s Auto Showcase, lowers the roof on a convertible while working, Thursday, Nov. 18, 2021 in New Port Richey. [ MARTHA ASENCIO-RHINE | Times ]

Leasing is still an option.

If you’re looking to ride out the supply shortage for the next couple of years, leasing is a viable option. “For some who just need that low monthly payment, leasing can work for them,” Degan said. “There’s also benefits in not having to worry so much about maintenance, as you’re getting a car with all the new technology.”

Related: 3 ways to make quick money on your leased car

Be patient.

Odds are it’ll be a lot harder to find the exact car you want at the exact price you want. Don’t get too frustrated, especially at salespeople. “This isn’t necessarily a picnic for dealers right now,” Degan said. “The one thing they want to do is sell cars, and a lot of them aren’t getting enough cars on the lot to sell. That’s pretty vexing for them. So patience for everyone is something we suggest.”