With Wal-Mart (NYSE:WMT), BJ's Wholesale Club (NYSE:BJ), and Target (NYSE:TGT) all reporting softness in their business (to varying degrees) over the past few months, I had assumed that Stock Advisor selection Costco (NASDAQ:COST) was also bound to feel some pain eventually. Although it has drifted lower the last few weeks, today appears to be the day that the bad news comes home to roost.

The bad news comes in two parts. The first is lower-than-expected gross margins and the second is an accrual to reserve for income taxes. The income tax item is expected to come in at $0.03 per share and should be one-time in nature. There is a chance it will not be as expensive as management expects, but the company believes it will owe an additional $0.03 per share in taxes in one of its foreign markets, and accounting rules require recognizing the expense now, when management believes payment is probable.

The more distressing issue is the gross margin decline. The concern is somewhat mitigated by the fact that Costco tends to attract higher-income customers than many of its competitors, and by the fact that gross margins were running a bit higher than normal recently. However, during the last few years, the company has seen growth in its sales of large hard-line goods such as appliances, flat-screen televisions, and furniture. If the economy is slowing, I believe it is reasonable to expect that Costco's sales in this area will slow as well. Sales of jewelry (another expensive item) have also begun to slow and show some margin weakness.

Costco doesn't issue guidance, but it does comment on the estimates that are out there in the marketplace on a quarterly basis. Generally these comments mention whether the consensus estimate is below, in line with, or above what the company expects it can achieve in the next quarter or year. Originally management stated that the consensus estimate of $0.77 per share for the fourth quarter and $2.33 for the year was at the high end of what it thought it could achieve, but it now believes these results are unattainable and that $0.68 to $0.71 for the fourth quarter and $2.23 to $2.26 for the year are what investors should expect.

In the rest of Costco's business, it appears that margins remain on track. Management stated that sundries were fine and fresh foods declined slightly in margin, but sales were strong. This is a little bit of additional evidence that the sales and margin decline is focused on the more expensive big-ticket items.

The other item that should have a positive effect on results is new store openings. Costco has opened 25 stores this year and expects to open 35 next year, with approximately 20 of next year's openings expected to happen in the first fiscal quarter. This means the stores should be in place and somewhat stabilized before the important holiday shopping period. While this year's holiday shopping period is shaping up to be slower than those of the last couple years, I believe we're still seeing a strong business that should continue to gradually expand.

A final note to consider from today's conference call: The same-store sales number for September is a bit of a tough comparison, because of additional sales made last year in the aftermath of Hurricane Katrina. This is to be expected, and Costco isn't the first business that has referenced the tough comparison.

That said, the business is about a lot more than one month's worth of same-store sales or one quarter's worth of earnings. In the long term, the company still looks like a force to be reckoned with. The malaise and uncertainty around Costco and retail in general just might create the first attractive buying opportunity for these shares in almost a year. If you can stomach a bumpy ride in the short term, the potential long-term results are once again starting to look attractive.

Wal-Mart is a Motley Fool Inside Value selection. Looking for undervalued top-shelf stocks? Finding and recommending them is Inside Value's specialty. Try it outfree for 30 days.

At the time of publication Nathan Parmelee owned shares of Costco, but had no financial interest in any of the other companies mentioned. The Motley Fool has an ironclad disclosure policy.