LONDON—Fashion retailers have found a way to make their shops dazzle customers again: make them more like Apple stores.

Brands including H&M and Zara have closed hundreds of stores in recent years to cut costs as more shoppers turn to e-commerce. Now they are investing in those that remain to woo customers in ways they can’t online.

The new-look stores are typically larger and more spacious, offer services such as beauty salons, repair stations and coffee shops, and enable new digital features such as apps that allow shoppers to rummage virtually through the storeroom.

“Now it’s about engaging with consumers and giving them an experience,” said Henrik Nordvall, manager of H&M’s U.K. business.

At the brand’s recently redesigned store on London’s Regent Street, foot traffic matters more than sales figures, Nordvall said. While in-store sales are still strong, many customers spend time there developing an affinity with the brand and then buy clothes online later, he added.

The refurbished store is home to a floor-to-ceiling TV screen that the company says is the biggest in any store in Europe, a beauty bar for customers to book nail or eyelash treatments, and a rental section where shoppers can borrow selected items, especially relatively expensive clothes from H&M’s designer collaborations.

Since the changes, the average duration of a customer visit has increased substantially, said Nordvall, who declined to provide specific numbers.

By turning their stores into destinations that shoppers actively seek out and spend time in—a model that Apple honed with its roomy, landmark stores filled with usable gadgets—the fashion retailers are redefining the clothing store for the digital age.

Retailers once needed a large network of stores “to reach people, but now they have the internet for that,” said Patricia Cifuentes, an analyst at the asset manager Bestinver. “Now stores are about brand image. They’re like tourist destinations.”

Not every retailer is following the approach of the big global fashion brands. Macy’s, for example, is opening smaller stores as a way of bringing its brand to places where customers run their daily errands. The electronics chain Best Buy is closing larger locations and opening small stores instead.

But for global fashion’s heavy hitters the shift toward fewer but better stores is well under way. While the investment could backfire if the stores fail to draw sustained traffic, for now the strategy appears to be working.

Inditex, the parent of Zara, has eliminated a quarter of its stores since 2018 and now has 5,745 locations across its brand stable, which also includes Bershka and Massimo Dutti. Yet the Spanish group’s total revenue from stores increased 8% in 2022 compared with four years earlier, with each store selling 30% more on average, Chief Executive Officer Oscar Garcia Maceiras said on a recent earnings call.

After closing its weaker locations and upgrading the rest, “We have been left with a network of bigger, better and more beautiful stores in the best retail destinations globally,” Garcia said.

Despite operating fewer stores overall, Inditex increased its capital expenditure budget for 2023 by 14% to 1.6 billion euros, equivalent to about $1.7 billion, half of which is earmarked to make improvements to stores.

Much of that money is being spent on the rollout of a new Zara store design—including at new U.S. locations in Baton Rouge, La., and San Antonio—to make the shopping experience more enjoyable.

Essential to the new layouts is making stores feel roomier by having more open space between displays so customers don’t feel crowded. With more open space, stores will increasingly have discrete in-store boutiques to highlight individual collections.

Zara has a team of in-house architects who design its stores, and uses pilot stores at its headquarters in Spain to experiment with new layouts.

Garcia, who regularly visits Zara stores around the world, said in a recent interview that store managers routinely tell him they want to expand because only larger stores are able to accommodate most or all of Zara’s range.

The Zara store in Miami is one beneficiary of the move toward bigger and better: It is doubling in size, according to Garcia, to provide the more spacious experience the company wants to deliver.

Bigger stores are more productive, Zara has found. Though stores are getting larger, sales per square foot is now up 16% relative to 2019, Garcia said.

Zara is cramming its stores with new tech such as automatic return and collection points, as well as self-checkout areas. Customers can use the Zara app to check the contents of the storeroom to see if an item is available in their sizes, for example.

H&M has shrunk its store count 14% from its 2019 peak to 4,375 outlets today. The company doesn’t break down its revenue into physical and online, and says the two parts of the business are complementary.

Increasingly, stores “are a way for our customers to get inspiration,” CEO Helena Helmersson said in a recent interview.

H&M upped its capital spending budget 43% for 2023 to roughly $1 billion, partly to push ahead with store modernization.

Even before the Covid-19 pandemic, H&M’s leaders recognized it was time to update the physical store to offer a more engaging experience, said Nordvall, the U.K. manager. When the pandemic led to a surge in online sales, the company accelerated its effort to redesign its stores, he said.

The revamp of the Swedish brand’s store on London’s Regent Street was aimed at encouraging customers to spend more time there. It has a secondhand area, Lego sculptures in the children’s section and fitting rooms with a built-in selfie function.

H&M also uses the store to host events for shoppers who sign up for its membership program. In November, it held a party to mark the launch of a collaboration with the fashion house Rabanne.

The Japanese brand Uniqlo is still expanding in Western markets, where its footprint is significantly smaller than H&M and Zara, but it is also opening so-called destination stores.

The chain’s recently opened store in London’s Covent Garden is located in a converted Victorian-era carriage works building, where shop floors loop around a brightly sunlit courtyard beneath a vaulted glass roof. There is a Japanese tea shop upstairs with a rooftop balcony, and a florist downstairs.

Visitors can use a machine to print their own T-shirt designs, have clothes altered or mended at the store’s repair station, and lounge in comfy chairs while browsing coffee-table books.

While online sales are growing, destination stores “have become the driver of European earnings,” as well as places where the brand communicates what it stands for, said Taku Morikawa, the CEO of Uniqlo Europe, during a recent earnings presentation.

Only a memorable in-store experience will make customers trust and admire your brand, he said.

Write to Trefor Moss at Trefor.Moss@wsj.com