Retail stocks have been annihilated recently, even though the economy is eking out growth. The fundamentals of the retail business look horrible: Sales are stagnating, and profitability is getting worse with every passing quarter.

Jeff Bezos and Amazon get most of the credit, but this credit is misplaced. Today, online sales represent only 8.5% of total retail sales. Amazon, at $80 billion in sales, accounts only for 1.5% of total U.S. retail sales, which at the end of 2016 were around $5.5 trillion. Though it's human nature to look for the simplest explanation, in truth, the confluence of a half-dozen unrelated developments is responsible for weak retail sales.

sign that says closing down sale hanging in store window

Image source: Getty Images.

First, our consumption needs and preferences have changed significantly. Ten years ago we spent a pittance on cellphones. Today Apple sells roughly $100 billion worth of i-goods in the U.S., and about two-thirds of those sales are iPhones. Apple's U.S. market share is about 44%, thus the total smart mobile phone market in the U.S. is $150 billion a year. Add spending on smartphone accessories (cases, cables, glass protectors, etc.), and we are probably looking at $200 billion total spending a year on smartphones and accessories.

Ten years ago (before the introduction of the iPhone), smartphone sales were close to zero. Nokia was the king of dumb phones, with sales in the U.S. in 2006 of $4 billion. The total dumb cellphone handset market in the U.S. in 2006 was probably closer to $10 billion.

Consumer income has not changed much since 2006, which mean over the last 10 years, $190 billion in consumer spending was diverted toward mobile phones.

It gets more interesting. In 2006, a cellphone was a luxury only affordable by adults, but today 7-year-olds have iPhones. Our phone bill per household more than doubled over the last decade. Not to bore you with too many data points, but Verizon's wireless's revenue in 2006 was $38 billion. Fast-forward 10 years, and it is $89 billion -- a $51 billion increase. Verizon's market share is about 30%, thus the total spending increase on wireless services is close to $150 billion.

Between phones and their services, this is $340 billion that will not be spent on T-shirts and shoes.

But we are not done. The combination of mid-single-digit healthcare inflation and the proliferation of high-deductible plans has increased consumer direct healthcare costs and further chipped away at our discretionary dollars. Healthcare spending in the U.S. is $3.3 trillion, and just 3% of that figure is almost $100 billion.

All this brings us to a hard and sad reality: The U.S. is over-retailed. We simply have too many stores. Americans have four or five times more square footage per capita than other developed countries. This bloated square footage was created for different consumers -- the ones who in in the '90s and '00s were borrowing money against their homes and spending it at their local shopping malls.

Today's post-Great Recession consumer is deleveraging, paying off debt, spending money on new necessities such as mobile phones, and paying more for the old necessities such as healthcare.

Yes, Amazon and online sales do matter. Ten years ago only 2.5% of retail sales took place online, and today that number is 8.5% -- about a $300 billion change. Some of these online sales were captured by brick-and-mortar online sales, some by e-commerce giants like Amazon, and some by brands selling directly to consumers.

But as you can see, online sales are just one piece of a complex retail puzzle. All the aforementioned factors combined explain why, when gasoline prices declined by almost 50% (gifting consumers hundreds of dollars of discretionary spending a month), retailers' profitability and consumer spending did not flinch; those savings were more than absorbed by other expenses.

Understanding that online sales (when we say this we really mean Amazon) are not the only culprit behind horrible retail numbers is crucial in the analysis of retail stocks. If you're only solving "who can fight back the best against Amazon?" you are only solving for one variable in a multivariable problem: consumers' habits have changed; the U.S. is over-retailed; and consumer spending is being diverted to different parts of the economy.

As value investors, we are naturally attracted to hated sectors. However, we demand a much greater margin of safety from retail stocks, because estimating their future cash flows (and thus fair value) is becoming increasingly difficult. Warren Buffett has said that you want to own a business that can be run by an idiot, because one day it will be. A successful retail business in today's world cannot be run by by an idiot. It requires Bezos-like qualities: being totally consumer-focused, taking risks, and thinking long-term.

So how does one invest in this overvalued market? Our strategy is spelled out in this fairly lengthy article.

The Motley Fool owns shares of and recommends Amazon. The Motley Fool has a disclosure policy.

Vitaliy N. Katsenelson, CFA is the CIO at Investment Management Associates, which is anything but your average investment firm. (Seriously, take a look.) Smitten by this article? Don't let your love remain unrequited. Sign up here to get my latest articles in your inbox.