The restaurant industry is in a prolonged slump, and no segment is having a harder time than the fast-casual niche. Once the darling of the restaurant space, fast-casual chains are struggling mightily to keep pace with even traditional quick-serve restaurants.

The fast-casual concept tapped into customers looking for a meal that was a step up from fast food with fresher, healthier ingredients that were served quickly, in a pleasing environment, at a reasonable price. The growing trend was epitomized by chains like Chipotle Mexican Grill (NYSE:CMG) and Panera Bread (NASDAQ:PNRA), which applied those concepts to Mexican food and sandwiches, respectively.

Man with a food tray in a fast casual restaurant.

Image source: Getty Images.

Although both of those chains have faced unique challenges more recently -- and just this month Panera agreed to be taken private by JAB Holdings in a $7.2 billion deal -- the problems affecting the restaurant industry have spread broadly into the fast-casual niche. According to the Black Box Intelligence Report, restaurants saw same-store sales decline 1.6% during the first quarter of 2017, with customer traffic down 3.6%, this now makes the fifth straight quarter comps have been down. Notably, fast-casual chains fared even worse, lagging the industry in six of the past eight weeks.

While it is a broad-based malaise afflicting the fast-casual segment, not every business is doing poorly, and some continue to grow. And not just in sales, but in getting customers to come back again and again.

Chowing down on opportunity

How these eatery's develop such customer loyalty is one of the things that interests the folks at brand consultancy Brand Keys, which last year surveyed 42,792 consumers from nine U.S. Census regions about the emotional engagement companies register with their customers.

Looking at 740 brands in 83 categories, of which fast-casual dining was one, the customer engagement research firm compiled its Customer Loyalty Engagement Index for 2017 to help determine how consumers view a brand, comparing that brand to other brands, and how engaging that brand is with the consumer.

It's not without reason that Brand Keys wants to gain those insights. It found customer loyalty and emotional engagement are leading-indicators of consumer behavior toward a brand, no matter the category, and the brands that are most successful are the brands that best understand that "emotional connections serve as surrogates for added value."

So, knowing that brand loyalty is a meaningful driver of profits for a business, which fast-casual restaurants ranked highest -- and which was last?

Better for you burgers and fries from Shake Shack.

Image source: Shake Shack.

A healthy development

Perhaps a bit surprising, half of the top four fast-casual chains are in the better burger segment, while the other half are in sandwiches. Shake Shack (NYSE:SHAK) came in fourth with its legendary cult following that sees people line up for blocks when a new Shack opens. From its original New York City roots, Shake Shack is now in expansion mode and spreading beyond just the major metropolitan areas into the heartland and around the globe.

Au Bon Pain has been a staple of shopping mall food courts, college campuses, and office building eateries for years, serving up sandwiches with its fresh-baked bread and croissants to its faithful customers. That it came in third place on the Brand Keys list for fast-casual customer loyalty shouldn't raise any eyebrows, nor should Panera Bread coming in at second shock anyone. The fresh breads and ingredients has, as mentioned earlier, come to define the fast-casual segment.

Arguably one of the original national fast-casual joints, Five Guys has been hand-making better burgers and fresh-cut fries since 1986, and what started off with a single shop in the Washington, D.C. area has grown into a national phenomenon with more than 1,000 locations. It might not come with the glitz of a Shake Shack and its celebrity chef founder Danny Meyer, but the Murrell family's burger joints have their own cult-like following who appreciate the limited menu it offers. Do one thing and do it well seems to be the key to success, here.

A Chipotle Mexican Grill restaurant as seen from behind the serving station.

Image source: Chipotle Mexican Grill.

A bad case of indigestion

OK, so that's the best of the best, but which companies rank at the bottom? Which fast-casual chain went from first place in customer loyalty in 2015 to dead last today? You probably already guessed Chipotle Mexican Grill, and you're right. The chain which, like Panera, came to represent what fast-casual dining was all about suddenly was the poster child for what is wrong with the niche as it hemorrhaged sales, profits, and customers.

Chipotle's troubles are well known. It suffered a series of back-to-back foodborne illness crises that at first blush seemed to be a transient issue, considering how strongly the chain responded to the problems. But Chipotle found itself trapped in a paradox of highlighting the changes it made to its food safety protocols served only to remind customers of why they left the chain in the first place. It also made it difficult to highlight that its ingredients were really "better for you."

So, can Chipotle ever make a comeback? Many are beginning to think so, and recently analysts began upgrading the stock ahead of its earnings report. While unit level sales remain down, comparable sales are expected to be in double-digit territory. By themselves the gains aren't as important since it has easy numbers from last year to beat, but it could signal the Mexican food chain has finally put its troubles behind it and can once again work on winning back customer loyalty.

Rich Duprey has no position in any stocks mentioned. The Motley Fool owns shares of and recommends Chipotle Mexican Grill. The Motley Fool owns shares of Panera Bread. The Motley Fool is short Shake Shack. The Motley Fool has a disclosure policy.