Amazon (AMZN -1.64%) saw its share price drop 49% in 2022, its worst performance since the dot-com bubble collapsed more than two decades ago. The stock is still down 45%. That colossal decline has wiped away $800 billion from the company's market capitalization, leaving investors with a difficult question: Is it time to abandon Amazon stock, or is this a once-in-a-generation buying opportunity?

The near-term outlook is grim

Economic headwinds hammered Amazon from every angle last year. The pullback in consumer spending caused by high inflation, coupled with unfavorable foreign exchange rates, led to weak growth on the top line. Meanwhile, climbing operating costs brought on by the rising prices of fuel and electricity, coupled with a decrease in efficiency due to excess fulfillment capacity, cut deeply into profits on the bottom line.

Full year revenue rose just 9% to $514 billion in 2022, a material deceleration from 22% growth in the prior year, and Amazon reported a GAAP loss of $0.27 per diluted share, its first full-year loss since 2014. But management expects the situation to get worse in the near term. Guidance implies revenue will grow between 4% and 8% in the first quarter of 2023, marking a continued deceleration.

Beyond that, shareholders should brace themselves for another difficult year. Inflation is still hovering near a four-decade high, meaning the downward pressure on revenue and the upward pressure on operating expenses will likely persist for some time.

The long-term outlook is bright

In 2023, Amazon surpassed Apple to become the most valuable brand in the world, according to consulting company Brand Finance. That prestigious title reflects its strong presence in three large and growing markets.

E-commerce: Amazon operates the most-popular e-commerce marketplace in the world, drawing nearly twice as many visitors as the next closest online shopping destination. Better yet, the company accounts for approximately 38% of all retail e-commerce sales in the U.S.

Excess fulfillment capacity has been a headwind to profitability of late, but Amazon has doubled its logistics footprint in the last few years, and optimizing those warehouses takes time. However, that infrastructure should ultimately reinforce its leadership in e-commerce, allowing Amazon to extend the shipping benefits of its Prime membership program to third-party websites.

That puts the company in a good spot. Global e-commerce spend is expected to grow at 13% annually to reach $15 trillion by 2030.

Cloud computing: Amazon Web Services (AWS) accounts for 34% of all spending on cloud infrastructure and platform services, meaning it holds more market share than Microsoft Azure and Alphabet's Google Cloud combined. That success can be attributed to two advantages. First, AWS consistently sets the pace for innovation in the cloud computing industry. Second, AWS offers the "greatest breadth and depth of capabilities of any provider," according to research company Gartner.

Those qualities should keep Amazon on the cutting edge of cloud computing, and that bodes well for the company. Roughly 90% to 95% of global IT spend remains on premise today, but more of that money will move to the cloud in the coming years. In fact, cloud computing spend is expected to grow at 16%annually to reach $1.6 trillion by 2030. Better yet, cloud computing comes with much higher margins than retail, meaning Amazon should become increasingly profitable as AWS accounts for a larger portion of total revenue.

Digital advertising: Just as Google and Meta Platforms built advertising empires on top of their popular search and social media platforms, Amazon has followed the same playbook with its online marketplace. The company has become the fourth-largest digital advertiser in the world, and it is steadily taking share from the market leaders. Case in point: Last year, Alphabet grew its ad revenue just 7%, and Meta saw revenue decline 1%, but Amazon increased its ad revenue 21%.

That bodes well for the future. Global digital ad spend is expected to grow at 9% annually to reach $1.3 trillion by 2030. Better yet, digital advertising (like cloud computing) comes with much higher margins than retail. That means Amazon should become more profitable, as advertising revenue accounts for a large part of its top line.

Amazon stock looks cheap

Amazon is well positioned to deliver double-digit top line growth through the end of the decade, while growing its bottom line even more quickly. In that context, its current valuation of 2 times sales -- a bargain compared to the three-year average of 3.6 times sales -- looks quite reasonable. For that reason, patient investors should absolutely buy a few shares of this growth stock today.