Booking Holdings (BKNG 0.53%) stock just hit an all-time high, but it might not be too late for investors to jump on board. Strong first-quarter results, fueled by continued enthusiasm around travel after COVID-19 lockdowns, sent shares to a new all-time high in May. Shares have continued to trade around that level since.

While room nights and gross bookings reached new highs, Booking's bottom line hasn't recovered to pre-pandemic levels. It's moving higher -- the 158% year-over-year improvement in operating income is a testament to that -- but it's going to be a while before Booking returns to the mid-30% operating margin it produced before 2020.

When it gets there, though -- and it's on a path to get there -- it will be a much bigger and more profitable company than ever before.

Spending big to get ahead of the market

It seems like just about everyone is eager to go out and travel more these days. COVID restrictions have eased, and more and more people are comfortable with traveling again. That's led to phenomenal results for Booking and other travel companies. Gross bookings increased 44% year over year for Booking Holdings in the first quarter.

But the company plans to keep its marketing and merchandising spend in line as a percentage of gross bookings. That said, it saw a 20-basis-point improvement in the first quarter, compared to the same period last year. Management reiterated its expectation that it should end the year with marketing and merchandising expenses at roughly the same level relative to gross bookings.

With such strong growth on the top line, that's a lot of money funneled back into future growth. But management's confident there's even more goodness coming in 2024. "We still expect to be leaning into marketing and merchandising because we believe there's recovery in the travel market available to us," CFO David Goulden said during Booking's first-quarter earnings call.

That means the company will likely start producing operating leverage from its marketing spend starting in 2024. Spending heavily to attract customers, while more consumers than ever are booking their first big trip in years, should pay dividends in the long run.

Evolving into a real travel agency

Booking's properties can help you book a hotel or flight for your next vacation, but the company is seeking to provide a seamless experience to book an entire trip: flights, hotels, attractions, dining, and transportation once you get to your destination. It calls the strategy the "connected trip."

In order to provide that experience, Booking has started shifting to processing payments itself. That allows it to offer more hotels and short-term rentals that may not be able to take the variety of payment types Booking's platform can process.

Unfortunately, processing payments directly comes with added costs: personnel, payment processing, chargebacks, and other expenses. That shows up in Booking's "sales and other expenses" line item, which grew 60% year over year in the first quarter. Additionally, it will result in more bookings of flights, event tickets, and other services with lower commissions, producing lower operating margins.

In the short term, that comes with the benefit of improved cash flow. Since Booking collects payments directly, it doesn't have to wait for a service provider to pay out its commission. In the long run, it should result in more bookings as the company can provide a wider variety of services and, ultimately, its vision for the "connected trip."

As the business scales, though, Booking should be able to return to the days of the mid-30% operating margin range. But it'll do so with a much bigger revenue base.

Although the stock just hit an all-time high, the price is less than 17x analysts' 2024 earnings expectations. With the overall stock market trading at a valuation closer to 20x forward earnings, Booking stock looks like a great opportunity for investors.