The holiday season has been a little less merry for car owners in Mexico as gasoline shortages in many parts of the country have forced grumbling customers to contend with hours-long lines.

In hard-hit parts like Leon, in Guanajuato state, filling up your tank often means driving around from one station to the next just to find one that has fuel.

"It's chaos," said Guadalupe Lopez, a customer service worker in Leon who visited eight stations on a recent day before she finally found a pump that wasn't dry. "One worker told me they had gone a day and a half without supply."

Rumors are swirling of gas station owners purportedly hoarding fuel ahead of a price deregulation that takes effect Sunday, and will let them sell it for as much as 20 percent more. Stories abound of Mexicans stocking up as much as they can before the hike kicks in.

Officials are largely downplaying the problems, citing factors such as pipeline theft, increased holiday demand and unforeseen shipping delays, and have sought to reassure consumers that they're working hard to get the fuel flowing. But even with conditions improved somewhat since Christmas, analysts say a neglected fuel infrastructure is finally catching up with the country, and there's no quick fix in sight.

Jorge Pinon, an energy expert at the University of Texas, Austin, said Mexico is refining less than 1 million barrels of crude per day this year, down from 1.65 million per day last year. More and more the country is importing its gasoline — about half its current consumption — but state oil company Petroleos Mexicanos, or Pemex, lacks adequate distribution and storage capacity.

"We are up against a total collapse of the refining system of Pemex," Pinon said.

As examples, he pointed to tankers backed up in the Gulf of Mexico because the port of Veracruz is a bottleneck for offloading, and said pipelines that carry gasoline to central parts of the country are in poor shape and vulnerable to illegal taps.

Fuel theft is big business for organized crime groups such as the Zetas drug cartel, which has a strong presence in the oil-producing Gulf coast region, and officials estimate it accounts for $1.4 billion in losses per year.

In mid-December the Mexican Gas Station Owners' Association warned that refineries were not operating at full capacity and imported gasoline was not being offloaded from ship because of delayed payments.

"The entire system of refining and distribution is rotten," said Miriam Grunstein, an energy analyst at Rice University.

Pemex has acknowledged supply deficiencies in four central and western states, though Mexican media reported problems in 13 of the country's 31 states.

That includes San Luis Potosi, where Mexico City resident Ignacio Lanzagorta shot a widely seen video of dozens of vehicles and people with jerry cans on the side of a highway, waiting for their turn at a Pemex station in the town of Salinas de Hidalgo. Lanzagorta told the AP he made the video Monday while driving from the capital to the central state of Zacatecas.

Pemex says tankers have been stranded in the Gulf by bad weather and unable to unload their shipments on time. It also cited the fuel thefts, which force pipelines offline, and said consumer stockpiling and panic-buying only exacerbated the shortages.

The federal consumer protection agency announced on Wednesday that it was investigating whether some stations may be hoarding fuel until January, as is widely rumored.

"The problem is that there has not been enough investment in infrastructure for the storage and transportation of fuels, which has increased the risk of shortages," the Mexican government said in a statement debunking "myths" about gasoline that was also retweeted by Pemex. "Going forward, the government will be obligated to increase minimum storage capacity to 15 days of total national consumption."

Pemex executive Carlos Murriet said in recent days that the country currently has six days' worth in storage.

Grunstein called that "ridiculously low" and a sign of short-term thinking by the company.

"With Pemex there is no planning ... and simply fixing small holes ends up being more expensive," she said.

The 2017 price deregulation — part of a broader energy reform passed two years ago under President Enrique Pena Nieto allowing some private investment and ending more than seven decades of state monopoly over the sector — establishes 90 different tariff zones where prices will be allowed to fluctuate.

Officials say it's time for Mexicans to pay market prices for gasoline and longtime subsidies are not sustainable especially with the peso's dramatic fall against the U.S. dollar. Earlier this year, the first gas stations run by companies other than Pemex began operating as part of the reform, on the theory that injecting competition will level the field for consumers. They are still far outnumbered by Pemex stations, however.

In a second phase in 2017, other companies will be also allowed to import and distribute gasoline instead of Pemex handling the entire supply chain.

Pricing will no longer be a government decision but rather "a result of what happens in the market," Treasury Secretary Jose Antonio Meade told Radio Formula on Thursday.

But many Mexicans are skeptical that a dose of capitalism is a good thing for the energy sector, which was nationalized in 1938 and has long been considered part of the national patrimony. Opposition politicians on the left have lent support to calls for protests against the deregulation.

One message that circulated on social media called on people to fill their tanks before New Year's and boycott gas purchases the first three days of the year as a "peaceful revolution."

Pinon said as long as the country suffers from its logistical limitations, Mexicans will be paying "an internal overpricing" at the pumps. "I don't see a near-term solution," he said.

He added that Pemex badly needs restructuring, and Grunstein said the company is weighed down by a powerful and corrupt union that obstructs attempts at reform.

"Anyone saying gas is going to rise because of competition is crazy," Grunstein said. "It will go up because of the lack of competition and lousy management."