(Reuters) - The United States and Canada forged a last-gasp deal on Sunday to salvage a three-country, $1.2 trillion open-trade zone agreement with Mexico that had been about to collapse after nearly a quarter century.

Mexican senator Ricardo Moreal (L) shakes hands with Juan Carlos Baker, Mexico's Undersecretary of Foreign Trade, after he announced a trilateral pact on NAFTA during a news conference at the Senate building in Mexico City, Mexico September 30, 2018. REUTERS/Henry Romero

Here are some of the details in the agreement, which will change its name from NAFTA to the United States-Mexico-Canada Agreement (USMCA) and must be ratified by each country’s legislature before it takes effect:

RETAIL

The deal would raise Canada’s minimum duty-free shipment threshold, but by less than the United States had wanted, a relief for Canadian retailers facing competition from online stores based in the United States. Canadian residents buying from U.S. retailers will not pay duty on purchases below C$150 and will not pay Canadian sales tax on purchases under C$40, according to the draft text. Mexico had agreed to a single $100 threshold.

PHARMACEUTICALS

The deal sets a 10-year period of protection for biologic drugs, a class that includes many of the world’s top-selling drugs like rheumatoid arthritis treatment Humira and cancer drug Avastin. That means Canadian patients will have to wait longer for cheaper generic alternatives, called biosimilars, to hit the market.

Canada previously had an eight-year period of protection for those drugs, according to University of Ottawa law professor Michael Geist. He said the longer period would likely result in higher drug prices and higher healthcare costs in Canada.

WHEAT GRADING

Canada and the United States agreed that wheat imported from the other country would not be treated less favorably than similar domestic wheat. U.S. farmers have complained that their wheat automatically receives the lowest price under Canada’s grading system.

DAIRY

Canada agreed to provide U.S. dairy farmers access to about 3.5 percent of its approximately $16 billion annual domestic dairy market, Canadian sources said, adding that the Canadian government was prepared to offer compensation to dairy farmers hurt by the deal.

Under the agreement, Canada has agreed to eliminate its Class 6 and Class 7 milk categories and associated pricing schedules for skim milk, skim milk proteins and other components and ultrafiltered milk, within six months after the USMCA goes into force.

U.S. farmers said those schedules had effectively pushed them out of the Canadian dairy market.

The agreement will increase U.S. access to Canada’s dairy market beyond Trans-Pacific Partnership levels, a senior Trump administration official said.

CHICKEN AND EGGS

The United States gets tariff-free access to Canada for 57,000 tonnes of chicken by year six of the deal, growing 1 percent for an additional 10 years.

Canada gives the United States access for 10 million dozen eggs and egg-equivalent products in year one, growing 1 percent for 10 more years.

COPYRIGHT

Copyright protection will extend for 70 years past an author’s death, in line with current U.S. law. In Canada, copyright generally extends for 50 years past death.

DISPUTE RESOLUTION

The deal will preserve a trade dispute settlement mechanism that Canada fought hard to maintain in order to protect its lumber industry and other sectors from U.S. anti-dumping tariffs.

No substantial changes appear to have been made to the Chapter 19 trade dispute settlement mechanism, nor the state-to-state dispute settlement.

But the agreement limits investor-state dispute settlement to preferential treatment cases and certain sectors dominated by state firms, such as energy and telecoms and infrastructure.

Keeping Chapter 19 will not affect Washington’s enforcement of anti-dumping and anti-subsidy laws, said a U.S. official.

AUTOS SIDE LETTER

A side letter to the agreement showed that U.S. President Donald Trump preserved the ability to impose threatened 25 percent global tariffs on autos while largely exempting passenger vehicles, pickup trucks and auto parts from Canada and Mexico.

If Trump imposes so-called Section 232 auto tariffs on national security grounds, Mexico and Canada would each get a tariff-free passenger vehicle quota of 2.6 million passenger vehicles exported to the United States annually, well above their current export levels.

Pickup trucks built in both countries will be exempted entirely.

Additionally, Mexico will get an auto parts quota of $108 billion annually, while Canada will get a parts quota of $32.4 billion annually in the event of U.S. auto tariffs.

RULES OF ORIGIN FOR AUTOS

The deal set a five-year transition period after the agreement enters into force for the regional value content requirement for autos to increase to 75 percent, from the current 62.5 percent.

It requires 40 percent of vehicle value to be made in

high-wage areas paying $16 an hour, requiring significant

automotive production in the United States and Canada.

The pact also requires that vehicle manufacturers source at least 70 percent of their steel and aluminum from within the three countries.

ENERGY

Reflecting the concerns of Mexico’s incoming government that the agreement would limit the country’s control over its oil resources, the deal states that Mexico has the direct, inalienable and imprescriptible ownership of all

hydrocarbons in its subsoil.

Despite the strongly worded language, the energy chapter does not prevent foreign oil companies from producing oil in Mexico under a liberalization of the industry passed by the outgoing government.