What happened

Shares of Chipotle Mexican Grill (CMG 2.41%) rose as much as 14.2% this week, according to data from S&P Global Market Intelligence. The Mexican fast-casual chain posted a mixed quarterly report, but investors still were excited about the news and sent the stock soaring in the last few trading days. As of 2:08 p.m. ET on July 28, the stock is up 13.7% this week.

So what

Chipotle reported its second-quarter earnings on July 26. Revenue was up 17% year over year to $2.2 billion, driven by comparable-store sales growth of 10.1% and new restaurant openings. According to management, inflation is hitting the business hard with rising costs of things like beef and avocados, but the company has been able to mitigate these concerns by raising prices for customers.

Even so, revenue came in below analyst expectations, which were for $2.24 billion in revenue for the quarter. However, earnings per share (EPS) beat analyst expectations, hitting $9.30 for the period compared to an expected $9.04. While not a huge deal for long-term investors, this earnings beat is likely why Chipotle stock soared over 10% the day following its earnings release.

Even more important, Chipotle is seeing strong operating leverage, with operating margin rising to 15.3% in Q2, up from 13% a year ago. This leverage is coming from more sales volume through each of its stores and a mix away from food delivery orders. Food delivery orders, which are serviced through DoorDash, have much lower margins because of how much money Chipotle needs to pay delivery drivers. As concerns about the COVID-19 pandemic begin to ease in the United States, delivery is becoming less popular for consumers because of its high costs. If this trend continues, it will likely help with Chipotle's consolidated operating margin.

Now what

As of this writing, Chipotle has a market cap of $43 billion. Over the last 12 months, it has generated $950 million in operating income, giving the stock a trailing price-to-operating income (P/OI) of 45. This looks expensive compared to a lot of other stocks. However, investors need to consider that trailing operating margin will likely be much lower over the next few years if Q2 is any indication. This could help Chipotle bring down its P/OI quickly, making its current price much more palatable.

If you believe Chipotle's revenue can keep growing at 10% or more a year and that margins can climb higher than 15%, now could be a great time to buy some shares of this popular restaurant chain.