Source: (NASDAQ:AMZN) stock is down by nearly 20% from its highs of the year, as investors seem clearly disappointed with the company's lack of profitability lately. But that's no reason to despair; on the contrary, short-term weakness could provide an attractive buying opportunity for long-term investors. Heading into the crucial Black Friday season, Amazon stock itself could be the best Amazon Black Friday bargain for 2014.

Wall Street is losing its patience
Wall Street is not particularly tolerant, and many analysts seem to be losing their patience with Amazon's widening losses. Profit margins have been declining over the last several quarters, Amazon reported an operating loss of $544 million for the third quarter, and earnings per share were also below Wall Street forecasts during the period.

However, it's of the utmost importance to understand why the company is operating in the red, and what it means in the context of Amazon's long-term vision.

Gross profit margins are actually improving; the company is making more money per unit sold after deducting cost of sales. Amazon delivered expanding gross margins during the last quarter, reaching 40.7% of sales versus 38.2% of revenue in the same quarter last year.

However, items such as "fulfillment" and "technology and content" are dragging on operating margins in a big way. This is because Amazon is aggressively investing in areas like building its distribution network, digital content, and its AWS cloud computing division, among several others.

Cash flows from operations have grown consistently over the last several years, but rising capital expenditures are absorbing most of the increase in operating cash flows, especially since 2010.

AMZN Cash from Operations (TTM) Chart

AMZN Cash from Operations (TTM) data by YCharts

It's important to note that these investments are mostly targeted at consolidating Amazon's leadership position in promising growth areas such as online retail and cloud computing. Costs are rising because Amazon is investing for future growth, not because the business is becoming more expensive to run or the competition is eroding profit margins. This makes a big difference when assessing a business and its long-term potential.

The opportunity
Amazon is betting on the future growth over current profitability and there is no reason to expect a change in strategy anytime soon. This means investors have little or no visibility regarding how profit margins may evolve over the coming quarters, which can understandably be a reason for concern.

On the other hand, the size of the opportunity is truly amazing. E-commerce sales still account for only 6.4% of retail sales in the U.S., which provides enormous room for expansion in the years ahead. Amazon is not only the major beneficiary from growing e-commerce sales in the long term; it is also one of the main driving forces behind the online retail revolution.

US E-Commerce Sales as Percent of Retail Sales Chart

US E-Commerce Sales as Percent of Retail Sales data by YCharts

To put some numbers in perspective, Wal-Mart (NYSE:WMT) is expected to generate sales in the neighborhood of $487 billion during the current fiscal year, while Amazon revenues are expected to be around $89.5 billion. Amazon could be several times its current size if it approaches the size of Wal-Mart in the future.

While Wal-Mart is struggling with stagnant same-store sales, especially in the U.S., Amazon reported a vigorous 20.4% increase in revenues during the third quarter. Online is the name of the game when it comes to the retail industry, and everyone is fighting an uphill battle against Amazon.

Amazon has nearly 260 million active customer accounts, and active seller accounts are nearly two million. The business is a textbook example of the network effect being at play, buyers and sellers attract each other to the platform, the bigger Amazon gets, the more valuable it becomes for parties at both ends of a transaction.  

Scale is a crucial advantage in discount retail, as it provides negotiating power with suppliers. In addition, Amazon to gets to spread its fixed costs on a growing amount of units, reducing fixed costs per unit and generating cost advantages for the company.

Customers just love Amazon's competitive prices and efficient service. The company has ranked in the first in its industry in the American Customer Satisfaction Index during every year from 2000 to 2013. Based on the 2013 ranking, Amazon has a score of 88, materially higher than the industry average of 78 for online retailers.

Valuation can be tricky for such a particular company. However, when looking at Amazon in terms of its price to sales ratio over the last five years, the entry price seems clearly attractive.

AMZN PS Ratio (TTM) Chart

AMZN PS Ratio (TTM) data by YCharts

Amazon is a particularly risky stock, and it's clearly not the best option for investors who prefer companies delivering predictable and consistent earnings. On the other hand, the company is one of the most dynamic and innovative names in the market, and short-term weakness is providing an attractive entry point for investors looking to own a piece of this disruptive growth leader.