The stock market has been going through a rough stretch with the S&P 500 down 17% from its all-time high reached in early 2022. But that doesn't necessarily mean there's cause for alarm -- long-term investors can look to buy shares of high-quality companies at a potential discount.

Delving deeper into a company's fundamentals remains the key to unlocking these gems. Does Williams-Sonoma (WSM 1.67%), with its stock 47% lower than its November 2021 record price, represent a bargain? Let's look closer to discover if it's truly a value stock.

People shopping for a bed.

Image source: Getty Images.

Premium brands

Besides Williams-Sonoma, the company also owns Pottery Barn. Both have developed a reputation for high-quality kitchen and home furnishings. With their higher prices in general, these appeal to higher-income consumers.

The strong housing market over the past few years has helped Williams-Sonoma, with people rushing to buy items like cookware and furniture. Fiscal 2022's same-store sales (comps) increased by 6.5%. This was for the period ended on Jan. 29 this year. However, I see signs that things might slow down.

The Federal Reserve has waged a campaign against inflation by raising interest rates, and many economists believe this will lead to a recession. Already, higher mortgage rates have hurt the housing market. Although February's existing-home sales increased by 14.5%, there were 12 consecutive monthly declines. Should a recession occur and people lose their jobs, the housing market will likely feel the impact.

Management cited a weak housing market and potential recession, among other factors, that could hurt near-term results. In the fourth quarter, comps fell by 0.6%, and the company expects flat revenue for this year.

Increasing payouts

The news isn't all grim, though. The board of directors raised quarterly dividends by 15% to $0.90. Typically, that's a good signal about long-term prospects given companies' reluctance to cut payments.

And Williams-Sonoma has plenty of free cash flow (FCF) to support these payments. Last year's FCF was $698.7 million, and dividends totaled $217.3 million. At its current price, the stock pays a 3.1% dividend yield, nearly double the S&P 500's 1.7% payout.

Valuation

The lower stock price has created a compelling valuation. The price-to-earnings ratio (P/E) stands at 7 compared to well over 20 in early 2021. By comparison, the S&P 500 has a P/E of 21.

As Williams-Sonoma is a cyclical business, the lower P/E reflects concerns about the company's prospects. And it undoubtedly faces short-term challenges. But these remain outside of its control. As it has proved with robust results over the past couple of years, the company has certain competitive advantages. These include its in-house products and strong digital presence.

Patient investors can collect dividends while waiting for prospects to improve. It could take a while if the housing market performs poorly and we enter into a recession, but things will turn around, and you'll set yourself up for nice gains with Williams-Sonoma as part of your portfolio.