On Tuesday afternoon, ailing fast-casual pioneer Chipotle Mexican Grill (NYSE:CMG) reported respectable results for the fourth quarter of 2017. Adjusted earnings per share came in at $1.34, $0.02 ahead of the average analyst estimate. That figure was up significantly from just $0.55 a year earlier, when Chipotle was still in the early stages of recovering from its late-2015 food safety scandal.

Investors weren't impressed, though. Shares of Chipotle plunged more than 10% on Wednesday over fears that its recovery is stalling out. Nevertheless, I plan to hold on to all of my Chipotle stock, as I believe that the company still has huge untapped opportunities to drive a more robust comeback.

Solid margin expansion despite weak traffic

Last quarter, Chipotle posted a 0.9% comp sales increase, in line with its third-quarter trend. Excluding the impact of Chipotle's limited-time 2016 rewards program, comp sales growth would have been 1.5% in the fourth quarter.

The interior of a Chipotle restaurant

Traffic remained weak at Chipotle last quarter. Image source: Chipotle Mexican Grill.

For investors, this relatively modest level of comp sales growth was troubling for two reasons. First, Chipotle rolled out its long-awaited queso offering in September. Queso wasn't nearly as big a hit as expected, but it still boosted Chipotle's average check by about 2 percentage points last quarter. Second, the impact of menu price increases from the past year boosted comp sales by an additional 2.4 percentage points.

The upshot is that the underlying same-store transaction count declined by about 3% last quarter. In other words, fewer people are going to each Chipotle restaurant. This drop caused Chipotle's trailing sales volume per restaurant to decline to $1.94 million from $1.95 million a quarter earlier and $1.96 million as of mid-year.

Despite the sluggish sales trends, Chipotle was able to expand its profit margin significantly in the fourth quarter. Food costs declined to 34.2% of revenue from 35.3% a year earlier, driven in part by Chipotle's menu price increases. Overhead costs also fell significantly because of lower stock compensation -- the result of missing performance targets in 2017 -- and lower legal costs.

Only slight improvement expected, for now

Chipotle experienced a broad slowdown in customer traffic beginning last July, after a norovirus outbreak linked to one restaurant and a rodent infestation at a second location ignited another food-safety scare. Traffic trends haven't changed much since then.

As a result, management is maintaining a conservative outlook for 2018 customer traffic. Chipotle's full-year forecast calls for low-single-digit comp sales growth. Higher menu prices and the queso rollout are expected to offset lower traffic in the first half of the year. During the second half of 2018, the benefit from menu prices and queso will fade, but year-over-year traffic comparisons will become much easier.

Chipotle still has a lot of upside

Chipotle's initial forecast for 2018 implies that investors can expect high single-digit revenue growth and a stable or slightly higher operating margin. Chipotle will get an additional earnings boost from corporate tax reform. Even so, the stock may look absurdly expensive at its current valuation of more than 40 times trailing earnings.

However, Chipotle has a number of potential levers to reinvigorate sales and earnings growth. First, it continues testing possible new menu times, though management warned investors this week that broadening the menu will be challenging from an operations perspective.

Second, marketing chief Mark Crumpacker confirmed that in the second half of the year, Chipotle will roll out a permanent loyalty program, a key weapon for boosting customer frequency in the long run. The loyalty program will also complement the company's ongoing investments in digital ordering and targeted marketing.

Third, Chipotle hasn't tapped into opportunities such as drive-through locations or breakfast, both of which have been very successful for other fast-food chains. Either one has the potential to boost sales per restaurant dramatically, albeit at the cost of significant operational complexity.

Many investors seem to be frustrated that the company isn't moving more urgently to pursue any of these options. However, it's important to remember that Chipotle is in the midst of a search for a new CEO. Once the company has a new long-term leader in place, I expect it to move faster to drive growth and rebuild its profit margin. A patient approach is still likely to pay off for Chipotle shareholders.

Adam Levine-Weinberg owns shares of Chipotle Mexican Grill. The Motley Fool owns shares of and recommends Chipotle Mexican Grill. The Motley Fool has a disclosure policy.