China, which for years has been goading consumers to spend their hard-earned yuan as the country seeks to modernize its economy, faces an all-too-American problem: too many shopping malls, and not enough people to shop there.

The world's second-largest economy has some 4,600 malls -- more than four times the U.S. total -- and accounts for more than half the malls built worldwide in each of the past three years, according to real estate firm CBRE. Last year, 61 million square feet of new retail space opened in China. By comparison, the U.S. has 1,100 malls and, by population, remains the most overstored nation in world; the largest mall in the U.S. -- the Mall of America in Minnesota -- alone has 5.6 million square feet of building space. But China is catching up: 7 of the 10 busiest cities for retail development are in China.

The Pentagonal Mall, a replica of the U.S. Pentagon building, was completed on the outskirts of Shanghai in 2009, ahead of Expo 2010. The building is now vacant. Getty Images

In large part, China's retail boom has been driven by construction spending and local governments seeking to build their tax base. All that's lacking is shoppers who prefer malls to smartphones. As a result, as many as one-third of the country's malls could close in the next five years, according to the Chinese Academy of Social Sciences.

Get Breaking News Delivered to Your Inbox

As in the U.S., which is seeing its own contraction of brick-and-mortar stores, a major culprit in China is changing consumer habits. Fact: Chinese consumers are more likely to buy online than shoppers in other parts of the world, according to data from PwC. As China's middle class grows, many people are bypassing physical stores entirely, a quickfire evolution of the retail landscape that mirrors the country's turbocharged economic shift.

Source: PwC

"The Chinese skipped the first generation of retail," said Edwin Keh, an expert on supply chains and operations who teaches at the University of Pennsylvania's Wharton School of Business. Last year, he noted, 80 percent of online purchases in China were done via a mobile phone. Mobile devices are the primary way of getting on the internet for a large chunk of China's youth, and for many of them, that's the way they consume.

More than half of Chinese consumers say they shop via mobile daily or weekly; only 46 percent say they shop at brick-and-mortar stores with the same frequency. They're also more likely to use their mobile phone than people in other countries, with more Chinese shoppers using their phone for things like paying for a purchase or researching a product. Last year, online consumer sales racked up the equivalent of $610 billion. But they accounted for only 12 percent of all consumer goods sold -- meaning it's got plenty of room to grow.

Source: PwC

Changing consumer habits are bad news for the malls in China that are in development, which, thanks to the time investment required for a real-estate venture, continue to be built even as the rate of new retail construction slows. In 2016, the amount of new retail space that opened in China declined for the second year in a row.

Meanwhile, many existing malls are struggling to survive. More than 10 percent of retail space in second-tier cities, like Qingdao, Shenyang and Tianjin, is vacant, CBRE found. One of the country's more ambitious shopping centers -- a replica of the Pentagon, but twice as big, that was completed on the outskirts of Shanghai in 2009 -- is abandoned. At 123 acres, it has the distinction of being the largest vacant building in China, according to the People's Daily. The state-owned newspaper notes it was left fallow because of its location and confusing layout.

A general view of a slide measuring about 170 feet inside a five-story shopping mall in Shanghai, China, February 16, 2016. Aly Song/Getty Images

As business suffers, many malls in China are having to get creative and expand beyond the retail mainstays of apparel or department stores. In Beijing and Shanghai, some landlords "have started to adapt existing malls for small office purposes," CBRE said. Shopping complexes are also putting more nightlife destinations, including restaurants, on the ground floor as a way to draw people in from the street.

Other mall operators add wackier attractions, like a 177-foot spiral slide that takes a shopper five floors in 16 seconds and haunted houses. Another featured a polar bear named "Pizza" that became known as "the world's saddest polar bear" after his captivity in a Guangzhou mall drew protests from activists and scientists.