Media playback is unsupported on your device Media caption Trump: 'Without tariffs we wouldn't be standing here'

After a few hectic final weeks and a last-minute, late-night scramble, the United States, Canada and Mexico have come to an agreement in principle on a revised North American Free Trade Agreement - a resolution 14 months in the making.

The leaders of all three nations took a victory lap on Monday, with US President Donald Trump heralding the still-to-be-ratified agreement as "truly historic".

The original 1994 deal has also been renamed, and is now the United States-Mexico-Canada Agreement, or USMCA.

Industries will now be combing through all 34 chapters of the document to see how it affects their segment of the $1.2tn in annual trade between the three partners.

But even at first glance, there are clear winners - and some who will bear the brunt of the concessions.

Car industry

The two most eye-catching changes to the deal could benefit car-manufacturing workers from all three countries and help spur investment in the North American industry.

The first provision requires that 75% - up from 62.5% - of the parts that go into a vehicle be made in the region to qualify for tariff-free treatment, a move intended to boost production in North America.

The second requires 40-45% of a vehicle be made by workers earning at least $16 an hour - a measure aimed at discouraging firms from shifting work to lower-wage Mexico. (In the US, the average hourly pay for auto manufacturing workers was more than $22 as of June.)

The provisions are directed toward blue-collar workers in US manufacturing states, who share Mr Trump's critique of the deal. But they also offer a win to labourers in Canada and Mexico.

The agreement-in-principle also means Canada will escape potentially devastating national security tariffs on car part imports that have been threatened by President Trump.

Canada's dairy farmers

There was no doubt Canada's dairy sector was in the negotiating crosshairs and, in the end, Canada did grant more access to US producers.

The USMCA will grant them a 3.6% slice of Canada's domestic market. It also scraps a recently implemented milk-pricing policy that had raised the ire of producers in US states like Wisconsin and New York.

The Dairy Farmers of Canada, an industry group, claimed that 220,000 Canadians in the sector were "sacrificed" to secure a deal.

Image copyright Reuters Image caption Canada says dairy farmers will receive compensation for the concessions made in the agreement

"The livelihood of these thousands of Canadians and the future generations of dairy producers is seriously at risk," the group said on Monday.

Still, the concessions were pared down from original demands by the White House.

US negotiators had proposed the dismantling of Canada's 50-year-old protectionist dairy supply management system entirely over the course of a decade. It remains in place.

Canadian Prime Minister Justin Trudeau has promised dairy farmers will receive compensation for the trade deal.

Tech companies and online shoppers

The new agreement raises duty-free shopping limits to $100 to enter Mexico and C$150 ($115) to enter Canada without facing import duties - well above the $50 previously allowed in Mexico and C$20 permitted by Canada.

Image copyright AFP/Getty Images Image caption Canadian Foreign Minister Chrystia Freeland

That's good news for online shoppers in Mexico and Canada - as well as shipping firms and e-commerce companies, especially giants like Amazon.

Consumers are also expected to benefit from faster shipping.

Canadian retailers had argued against raising the limits, fearing a more generous exemption could place them at a disadvantage.

Rules over data storage offer another significant win for Amazon.

Good for Mexico's new leader

By Will Grant, BBC News, Mexico City

Mexico was always unlikely to step away from Nafta - the bedrock of its trade with the North. While Donald Trump made his dissatisfaction with the agreement abundantly clear, even calling it "one of the worst trade deals in history", Mexico was always keen to find enough common ground for a new deal.

Outwardly at least, the government says they're happy with the new arrangement. They reached an agreement with the Americans a full month before Canada did and were apparently perfectly prepared for Nafta to become a bilateral deal if that's what it took.

In the end, salvaging the trilateral relationship under the new USMCA probably suits them better. They undoubtedly made concessions, especially for some of President Trump's more protectionist measures. In particular, in the car industry, where Mexico agreed that a higher percentage of cars destined for cross-border trade would be built in high-wage factories, pushing down its competitive advantage.

But Mexico's negotiators found new impetus in the upcoming change in administration. The president-elect in Mexico, Andres Manuel Lopez Obrador, broadly agreed with President Trump that Nafta needed overhauling - albeit for very different reasons than the US.

It has taken more than a year of often bitter wrangling but at least in trade, if not in politics the 'Three Amigos' - as the Nafta members were first known in 1994 - are friends again.

Steel and aluminium suppliers

In June, the Trump administration imposed tariffs on steel and aluminium imports from key allies in Europe as well as from Canada and Mexico.

The Trump administration had suggested the tariffs against its direct neighbours were tied by to progress achieved on the Nafta negotiations.

Image copyright Reuters Image caption Canada's Prime Minister Justin Trudeau meets with steel workers

Now those tariffs will be dealt with separately.

The United Steelworkers Canadian director, Ken Neumann, said those in the industry have been "left in the lurch from concessions" made at the bargaining table.

Canada "sold out Canadian steel and aluminium workers. So much for the 'win-win-win' deal promised by this government", he said on Monday.

Mr Trudeau says removing the tariffs remains a priority for both Canada and Mexico.

Big pharma

Pharmaceutical companies won 10 years of protection for patents on certain types of treatments known as biologics, as well as an expanded scope of products eligible for protection.

Canada agreed to extend its monopoly period from eight years to 10 years and Mexico from five to 10 years.

Still, that protection is shorter under current US law, which protects drug patents for 12 years.

There are concerns this part of the agreement will raise the cost of drugs in Canada and affect its national healthcare system. The move has faced opposition from generic manufacturers because it would delay getting their products to market.

Trump delivers on promise

Arguments may rage on how much this is merely Nafta repackaged, but it's hard to see this as anything but a partial victory for President Donald Trump.

Never mind that he backed down from some of his original demands - like an automatic expiration clause.

The president will use the deal to boast of his negotiating prowess and delivery of a core campaign promise.

It's not clear exactly what it means for his approval ratings, which have taken a slight hit in areas badly hit by the tariffs tit-for-tat with China.