With the S&P 500 and Nasdaq Composite in a bear market, many investors may find their investment portfolios down big. Yet, as bad as the broader markets are doing, the retail space has fared much worse.

The SPDR S&P Retail ETF is one of the largest exchange-traded funds in that industry. So far this year, it's down over 30%. Similarly, consumer discretionary has been the single worst sector in the stock market -- also down over 30% year to date.

Target (TGT 1.19%) shares have fallen around 37% over that same period and are hovering around a 52-week low. Still, there's reason to believe that the sell-off in the stock could present an excellent, long-term buying opportunity for patient investors. Here's why.

A person has their back turned while looking out over an open dirt road that leads into a bright sunrise.

Image source: Getty Images.

Disappointing results

There's no sugarcoating the fact that Target finds itself in dire straits. The big-box retailer posted weak earnings and shaky guidance in mid-May. But the news has only gotten worse since then. Three weeks after reporting its first-quarter 2022 results, Target cut its full-year profit outlook and is now guiding for a 2% operating margin in Q2 and a 6% operating margin in the second half of 2022. For context, it usually posts an operating margin in the high single digits.

Target's margins are under pressure because consumers are pulling back on discretionary spending, leaving it with too much inventory. In response, the retailer released additional back-to-school savings and promoted a Target Deal Days sale from July 11 to July 13. The company's goal is to move product in time for the fall season and then cut back on inventory if demand keeps weakening in the second half of the year.

Target, like other retailers, is feeling the pain of inflation. And even if it navigates its oversupplied inventory issue, it could still face margin compression if shipping costs and other expenses remain high in the second half of the year.

E-commerce success

While the company has its hands full with short-term challenges, it also stands out as a great long-term buy at a reasonable value. Part of that has to do with its success with e-commerce.

Target's investments in e-commerce give it plenty of growth potential. In 2019, digital sales made up just 8.8% of total sales. In 2020, they made up 17.9% of total sales, largely due to higher e-commerce growth due to the COVID-19 pandemic. However, the most impressive stat came in 2021, when digital sales made up 18.9% of total sales even as customers returned to stores. 

By leaning into e-commerce, Target can use its stores as showrooms and warehouses -- which customers can engage with in the best way for them. Having a strong e-commerce presence lets the company compete with other retailers on cost. Its large existing store footprint makes the return process much simpler for online orders. Plus, unlike Amazon -- which processes returns without the potential for a follow-up sale -- when customers return items to Target, they may be tempted to do extra in-store shopping since they are already there.

Five years ago, its big criticism was how it would hold up in an increasingly digital age. Target has so far proven that it can attract customers from different age groups in store and online. Its results also show that digital native customers still value the in-store experience of shopping at Target.

An attractive valuation

Target stock has a price-to-earnings ratio of just 12. To put that number into perspective, consider that its current valuation is lower than its 10-year, seven-year, five-year, and three-year median P/E ratio.

TGT PE Ratio Chart

TGT PE Ratio data by YCharts

Part of that has to do with the company coming off of a strong 2021 paired with its lower stock price. However, the numbers indicate that it could report lower net income in 2022 and still be a good value.

What's more, Target is a Dividend King -- which is an S&P 500 component that has paid and raised its dividend for at least 50 consecutive years. Target stock currently has a dividend yield of 3% -- which is far higher than the S&P 500 average dividend yield of 1.7%. 

A well-rounded winner

Target is an industry-leading company with an attractive valuation and a strong dividend. Yet, there's no denying that the company's results are being tested by 40-year-high inflation and will likely worsen during a full-blown recession.

However, long-term investing isn't about bobbing and weaving around risk. Rather, it entails finding quality businesses at a good price and owning them for years. In this vein, Target stands out as a reliable, blue chip dividend stock to buy today.