(CNN) — With lots of worries out there — inflation, Covid, interest rates, Ukraine, stock volatility — consumers are willing to pay a premium when seeking comfort in the form of sweet treats like Coca-Cola. And investors are seeking a safe haven in the company’s stock.

Coca-Cola reported first quarter earnings and sales Monday that easily topped forecasts: Sales surged 16% to $10.5 billion, beating Wall Street’s expectations of $9.8 billion. Profits of $2.8 billion, or 64 cents a share, rose 24% from a year ago — surpassing consensus estimates of 58 cents a share.

Price hikes were a major driver of the solid numbers. Coca-Cola said its price/mix, a measure of how much it charges customers, was up 7% globally and 11% in North America.

Shares of Coca-Cola rose slightly Monday morning on the strong results, even as the broader market was slumping again following Friday’s massive slide. The company also reaffirmed its outlook for the rest of the year — despite inflation worries that have raised the price of aluminum and other commodities Coke uses.

“The overall inflationary environment is going to be here for awhile. For exactly how long, nobody knows,” Coke chief financial officer John Murphy said in an interview with CNN Business Monday morning.

Pressure on commodity prices and wages will continue, Murphy said. But he added the company has the flexibility to raise prices, especially as it introduces more premium products.

Coca-Cola recognizes, though, that some consumers are feeling the pinch from higher prices more than others.

That’s why CEO James Quincey said during a conference call with analysts Monday that the company is experimenting with refillable packaging in Latin America and Africa and returnable glass bottles in parts of the Southwest United States.

Quincey said the goal of these initiatives is to reduce waste and give consumers financial incentives to use reusable bottles.

Murphy added that Coke has to “earn the right” to hike prices by constantly innovating and ensuring sure it’s on top of changing trends.

To that end, Coke has been busy developing quirky new flavors — and eliminating some old favorites such as Tab, which was one of hundreds of brands Coke has shuttered in the past two years — as the company tries to remain relevant with younger consumers.

“When I look back on the past couple of years, one of the biggest outcomes has been that we used that time to clean out the cupboard. Now we are building it back up again,” Murphy said. “It’s important to stay disciplined and keep a close eye on brands that are performing well. We need to keep the portfolio pruned.”

Investors are pleased with the strategy. Coca-Cola stock has now gained 11% so far in 2022 —making it one of the better performers in the Dow, which has fallen 8% this year.

Traders have flocked to stodgy consumer staples companies like Coca-Cola because they offer sales and earnings stability at a time of geopolitical turmoil, worries about the Federal Reserve’s rate hikes and inflation. Coke also pays a steady dividend that yields nearly 3%.

And Berkshire Hathaway, the company led by Warren Buffett — famously a huge fan of the company, as well as Cherry Coke — is Coke’s largest shareholder with a more than 9% stake.

Coke is continuing to do well internationally even as the latest spike in Covid-19 cases is worrying investors. The company’s sales leaped 34% in Latin America and 13% in Europe, the Middle East and Africa.

As part of its global strategy, Coke is continuing to invest heavily in emerging markets, Murphy said.

“We have to stay close to these markets and adapt as necessary,” Murphy said. “Investing through volatile times will allow you to prevail.”