Workers perform routine maintenance at the DeAcero steel mill in Mexico. The company melts down scrap metal from Mexico and the United States to produce steel beams, fencing and other products, mostly for the North American market. (Josh Partlow/The Washington Post)

The glowing metal pulsing at 2,912 degrees Fahrenheit in the DeAcero company’s colossal new steel mill here is recycled from old auto parts, barges and broken-down dishwashers bought from scrap yards here and in Texas.

The company’s metal is shipped back across the border to Missouri, to a plant that produces nails sold at Home Depot and Lowe’s stores across America. The nails compete for shelf space with products pumped out by the world’s dominant steelmaking power, China.

On the campaign trail, Donald Trump blasted the North American Free Trade Agreement as “the worst trade deal ever” and threatened to rip it up. And yet the North American economy is a vast interlocking web of enterprises that would not be easy to unravel.

Mexican manufacturing has enjoyed a boom under NAFTA. At the same time, U.S. farmers ship oceans of grain to Mexico. Countless products, like those nails, result from manufacturing chains that straddle both countries. American companies profit from the trade — Walmart is Mexico’s biggest employer — and that helps to prop up Americans’ 401(k) accounts. American-made parts that are assembled into cars in Mexico and sold back across the border mean fewer jobs in Detroit, but cheaper cars for all Americans.

“It’s not a one-sided thing,” said Sam Vale, a McAllen, Tex., businessman who owns and operates a commercial bridge across the Rio Grande. “Is the American public willing to spend 30 to 40 percent more for an automobile just because these guys lost their jobs?”

President-elect Trump’s rejection of NAFTA has placed American manufacturing at a crossroads and caused alarm south of the border. Trump has warned American companies against moving operations abroad, and some have reversed plans to do so. On Tuesday, Carrier, a manufacturer of air conditioners, promised to keep nearly 1,000 jobs in Indiana that had been intended for Mexico.

If Trump’s anti-free-trade convictions are carried into his presidency, he could unravel the economic and geopolitical consensus that has guided relations in North America for the past quarter-century. Economists and rattled business leaders say the return of tariffs would sledgehammer the border-crossing supply chains that have pushed bilateral trade to more than $500 billion a year, potentially wiping out millions of jobs in both countries.

Mexico has made undeniable economic gains in the 22 years since the start of NAFTA. A muscular new manufacturing belt of steel mills, auto factories and electronics plants has arisen in the parched northern scrublands, where workers earning $2 or $3 an hour make things that used to roll off assembly lines in Ohio, Indiana and the factory towns of the American Rust Belt.

Trump triumphed in those states with the message that America’s losses were Mexico’s gains, vowing to avenge them with import tariffs and penalties on U.S. companies that move jobs south. He points to the $61 million trade deficit with Mexico as evidence that NAFTA is a loser for the American economy.

But untangling the labyrinth of benefits, profits and cost savings is not simple, since so much cross-border commerce is driven by major U.S. companies. Business executives on both sides of the border can’t quite think that a U.S. president would tear up an agreement whose benefits to American corporations and consumers seem obvious.

“If you close the border for one day, all the industry in the Midwest stops,” said economist Luis de la Calle, who worked on NAFTA’s implementation at Mexico’s embassy in Washington. “The level of integration is much more profound than people think or than Trump imagines.”

Mexico’s economy is showing signs of stress from Trump’s win. The Mexican peso has lost nearly 10 percent of its value, and a new report by Mexico’s second-largest bank predicts the country will enter a recession if Trump follows through on his threats to scrap NAFTA, which would scare away foreign investment.

But the potential pain to the U.S. economy has received less attention. Key sectors are powered by trade with Mexico. Mexico is the second-largest destination for U.S. exports, and iconic American companies such as Caterpillar, Ford and General Electric often send U.S.-made components over the border to Mexico for assembly, shipping back finished products duty-free. The factories and manufacturing plants of northern Mexico are increasingly powered by natural gas piped in from Texas.

According to the U.S. Chamber of Commerce, 6 million American jobs depend on trade with Mexico, and about 40 percent of Mexico’s exports are made from U.S. parts, components and other “inputs.”

This model has allowed American firms to compete and thrive, sending their stock prices soaring while helping them fend off competition from European and Asian manufacturers that also outsource to assembly plants in China and other low-wage nations. Although these high-end manufacturing jobs in Mexico pay less than in the United States, they also act as a magnet keeping Mexicans from migrating to the United States. Migration rates for Mexicans are at their lowest levels in decades.

“Globalization has its shortcomings and problems, I agree, and we need to address them,” said Fernando Elizondo, a top official in Mexico’s industrial powerhouse state of Nuevo Leon. “But going back to a world of isolationism makes no sense. Are we all going to live on farms again, raising chickens and pigs?”

Expectations and uncertainty

More than a dozen U.S. and Mexican companies that assemble or manufacture products in northern Mexico declined to respond to questions about the potential effects on their businesses from new trade barriers, in what may be a sign of anxiety that Trump may follow through on his threats.

Company representatives who agreed to discuss the issue argued that technology and robotics are rapidly replacing U.S. manufacturing jobs, so trying to force companies to leave Mexico wouldn’t restore American factories to their former glory. Instead, the breakdown of NAFTA probably would bring a trade war. During his campaign Trump threatened to slap 35 percent tariffs on cars and auto parts imported from Mexico. Mexico could quickly retaliate by raising tariffs of its own.

American companies find Mexico attractive because of low labor costs, but also because of valuable incentive packages provided by Mexican authorities in tax breaks, land and infrastructure. Cardone, an auto-parts manufacturer that was widely criticized for its plans to relocate a plant from Pennsylvania to northern Mexico, said the move was needed to “improve competitiveness in an industry where price sensitivity is critically important,” company executive George Zauflik said in a statement.

“Cardone is constantly seeking new ways to design and remanufacture auto parts that provide greater value for our customers. As a result, we are devoting significant investment dollars to innovation, particularly on high-tech, higher-wage engineering jobs, almost all of which are in the U.S.,” he said.

A bulwark against China

In 2012, along a desolate expanse of creosote brush west of Monterrey, the DeAcero company built a state-of-the-art $750 million steel mill. The company melts down scrap metal to produce beams, rebar and cables, mostly for the Mexican construction industry. But it also ships products such as barbed wire and fencing to the United States.

The company acquired a nail manufacturing plant in Poplar Bluff, Mo., in 2012, and by sourcing its raw materials from Mexico it has remained competitive with the Chinese firms that dominate the U.S. market.

Company executive Juan Antonio Reboulen said that if a Trump administration imposed new tariffs on the steel rods it ships north, the 700 workers at plants in Missouri and Texas could lose their jobs.

“The United States would be shooting itself in the foot,” he said.

On the world stage, Mexican firms see themselves as a natural partner for the United States in the larger competition with China, which is expanding its trade and influence in the Western Hemisphere. A week after Trump’s win, Chinese President Xi Jinping arrived in South America with promises to double foreign investment in the region.

China accounts for half of the world’s steel production, making eight times more than the United States and Mexico combined. China’s notorious dumping practices, in which state-subsidized products are sold for export below cost, is the real threat to U.S. and Mexican producers — not NAFTA, DeAcero’s executives say.

They want Trump to see Mexico as a partner, not a rival.

“If we don’t join forces to strengthen North America, we will be flooded with imports from China and Korea,” Reboulen said.