Amazon (AMZN 0.09%) has delivered more than packages over the years -- it's delivered investors huge long-term gains. The e-commerce giant has increased more than 700% over the past decade, for example.

But recent times have been difficult for Amazon. And if you're a new Amazon investor, times probably have been difficult for you, too. The shares have lost more than 40% this year.

Rising inflation, supply chain disruptions, and excess fulfillment capacity have plagued Amazon, and this has weighed on key metrics such as operating income and free cash flow. Amazon's stock performance reflects the turmoil, but is this decline an opportunity? And does that mean investors should buy Amazon on the dip? Let's find out.

The problems today

First, let's take a look at Amazon's problems today. Rising inflation is hurting Amazon in more than one way. First, it's increasing the company's expenses. Higher fuel costs mean Amazon pays more to transport items. And obviously, this is a key part of the e-commerce-company's business.

Second, rising inflation weighs on customers' wallets. As a result, they may have less money to spend on general merchandise on Amazon.com. The impact of inflation on customers doesn't stop there. It extends to Amazon's other big business: cloud computing services.

In last month's third-quarter earnings call, the company said that its Amazon Web Services (AWS) customers have started to rein in spending. AWS revenue growth slowed to 27% in the quarter. That's down from more than 30% in recent quarters.

Finally, global supply chain problems have disrupted Amazon's operations. And the company has struggled to match supply and demand across its massive fulfillment network. Due to enormous demand during the earlier stages of the pandemic, Amazon doubled its fulfillment network in less than two years.

That's all of the bad news. Now let's turn to the good news. The first thing to remember is today's environment of rising inflation and economic woes is temporary. The situation is difficult for Amazon today, but the company has the resources to weather the storm.

Amazon's revenue has continued to rise throughout these tough times. In the third quarter, net sales climbed 15%. And though AWS revenue growth has slowed, AWS still is increasing revenue and operating income in the double digits.

A stronger cost structure

The company also has made progress on cutting costs across its fulfillment network -- and says it's working on a "stronger cost structure," which should be a big plus over the long term. All of these efforts may buoy Amazon until the economic situation improves.

It's also important to remember Amazon is a leader in two growth businesses. E-commerce and cloud computing services are forecast to grow in the double digits over the coming years. Amazon surely will benefit from this.

The company's efforts to attract more and more Prime subscription-service members are working. Prime's recent NFL Thursday Night Football premier sparked the three biggest hours of U.S. Prime sign-ups ever. And AWS continues to expand its infrastructure globally.

Now let's look at Amazon's share price. The stock is trading at less than 2 times sales. This is its lowest by that measure in about six years. At the same time, the company continues to grow its Prime subscription service and e-commerce revenue. And AWS remains a key strength. Historically, it's driven Amazon's total operating income.

As mentioned above, Amazon has what it takes to make it through today's rough patches -- and thrive in the long term. That's why, at today's level, Amazon shares look like a deal -- and one that investors should consider buying on any dips.