We are in the heart of the first earnings season of 2024, and the most shocking report so far may have been from Starbucks (SBUX -2.99%). The coffee giant posted a sharp downturn in traffic and comparable-store sales, leading the stock to stumble even further. Shares are now down 25% year to date, while the S&P 500 is up 9%.

A once-beloved stock, Starbucks has underperformed the S&P 500 over the last five and 10-year periods. It now trades at a discounted earnings multiple as investors sour on the company's growth prospects in North America and China. But does this create an opportunity for contrarian investors looking to buy the dip?

Let's take a closer look to see if Starbucks is a buy right now.

SBUX Total Return Level Chart

Data by YCharts.

Lower transactions, consumer fatigue with price increases

The first quarter for Starbucks was ugly. Comparable-store sales -- a measure of revenue growth from existing stores -- declined 4% year over year globally. This was a sharp change from the previous quarter's comparable-sales growth of 5%. North American comparable sales declined 3%, while China (the brand's second most important market) saw comps decline 11%. This is perhaps the most important metric for a restaurant, which is why Starbucks stock fell so precipitously after posting these numbers.

In North America, consumers seem to be fed up with the company's price hikes with management saying shoppers have transitioned to buying at-home coffee. Essentially, they are trading down to cheaper options as the price of a Starbucks drink climbs to $5 or higher in many locations. You can see this in the first-quarter data: North American price per ticket grew 4% year over year, but total transactions fell 7%.

In China, Starbucks is facing heavy competitive pressure from low-cost providers such as Luckin Coffee. The hypercompetitive market is posing an issue for the foreign brand, leading to the extremely ugly comps decline of 11% in the quarter. For reference, Luckin Coffee opened 2,342 stores in China in the first quarter alone. There is a flood of coffee shops hitting the Chinese market, a major headwind for Starbucks going forward.

Another concern is the persistent wage inflation hitting Starbucks' margin. In the first quarter, store operating expenses grew 2.4% year over year while revenue fell 1.8%, leading to operating deleverage. Operating margin fell to 12.8% compared to 15.2% in the same period a year ago.

Is this just a short-term blip?

Every company goes through bad quarters. Investors need to figure out whether these Starbucks numbers are simply a short-term blip or a long-term concern for the global coffee brand. Let's dive into each market again to see whether these problems are fixable.

In North America, food inflation has hit consumer spending at restaurants, and it now looks like coffee consumers are changing their habits too. This is a fixable problem for Starbucks: It has stop hiking prices so quickly. It isn't facing cost inflation from its food or products, either; product and distribution costs decreased 5.5% in the first quarter. A pause on price hikes is necessary to win back consumers in the company's home market.

The problem from an investment perspective is that this will hamper sales growth and profit margins. For years, Starbucks was able to grow its comparable sales by raising prices. The future may not be so easy. It's unclear at the moment when the inflationary pressure causing consumers to reduce their restaurant spending will ease, but right now, it's a major obstacle for Starbucks stock.

In China, the problem looks completely outside of Starbucks' control. It can maintain a premium brand position (which management says is its strategy for the market), but if competitors continue to flood every city with coffee shops, Starbucks could find it difficult to grow in the country. For this reason, there is a ton of uncertainty around the company's ambitions in that region.

SBUX PE Ratio Chart

Data by YCharts.

The stock looks cheap, but is it a buy?

Today, Starbucks trades at a trailing price-to-earnings ratio (P/E) of 20. This is lower than the S&P 500 average of 27, and it marks one of the lowest levels Starbucks has seen in recent years. If the future ends up looking a lot like the past -- steady revenue growth, strong margins, growing store count -- Starbucks stock would likely be a buy here.

But prospective investors should have concerns the company's future is not like its past. It may have finally hit a ceiling on price increases, and the Chinese market is getting saturated with coffee shops quickly.

Even though the stock looks cheap, Starbucks is in a rough spot that may persist for many years. Don't be surprised if this stock continues to trail the broad market going forward, just as it has for the last decade.