Canadian Prime Minister Justin Trudeau and President Trump at the White House in February. (Kevin Lamarque/Reuters)

Canada enters crucial talks in Washington on the ­renegotiation of the North American Free Trade Agreement this week with a complex mix of self-confidence and dread about possible damage to its most important trading relationship.

The country’s economy and currency are showing surprising strength, and Canadians are basking in the attention being showered on them and their popular prime minister, Justin Trudeau, in the United States and elsewhere.

Trudeau has not been immune to criticism at home, but he is credited with using his considerable charm to build a positive relationship with the mercurial U.S. leader and his family while avoiding the unpleasantness that has marred exchanges between President Trump and allies such as Australian Prime Minister Malcolm Turnbull and Mexican President Enrique Peña Nieto.

He has made frequent visits to the United States, attending a Canada-themed musical on Broadway with Ivanka Trump and most recently making a pitch for free trade at the National Governors Association conference in Rhode Island in July.

“Free trade has worked. It’s working now,” Trudeau told the governors, as he urged Americans to avoid a move toward protectionism. “If anything, we’d like a thinner border for trade, not a thicker one.”

But Canadian officials don’t expect it will be all plain sailing in Washington when the three-way talks begin Wednesday.

Although they think that Trump’s major trade gripes are with Mexico, they remain concerned about U.S. efforts to gain concessions in such politically contentious sectors as lumber, dairy and wine, as well as a threat by the Americans to weaken the dispute-settlement mechanism, which Canada achieved only with difficulty in its original free-trade talks with the United States in the 1980s.

There is also pressure from all sides to modernize the agreement to deal more adequately with trade in services and the digital economy.

“Canadians should be prepared for tough, difficult and rather unpleasant negotiations,” Larry Herman, a Toronto trade lawyer, said. “I don’t think there’s any basis for complacency.”

Herman said that the work of the teams from Canada, Mexico and the United States is complicated by the presence of two “gorillas” in the room. The first is Congress, which has signaled its intention to be more involved in the talks than it was in the original NAFTA negotiations. The second is Trump himself.

“One tweet from the president can upset a lot of the U.S. negotiating strategy,” Herman said.

Michael Kergin, a former Canadian ambassador to Washington, said that the Trudeau government has handled relations with the White House well so far but that once detailed talks begin, that may not make much difference. “There are no friendships in foreign policy, only interests,” he said.

Despite years of efforts to broaden its trading relationships, including the recent signing of a free-trade pact with the European Union, Canada remains highly dependent on trade south of the border.

Three-quarters of Canadian exports flow to U.S. customers, while only 18 percent of U.S. exports go to Canada, although Canada remains the single largest customer for U.S. goods.

Of the three partners in the original 1994 NAFTA deal, Canadians are by far the most upbeat about its benefits.

According to a Pew Research Institute poll published in May, 74 percent of Canadians said that the agreement had been “a good thing” for their country, compared with 17 percent who said that it had been bad.

Among Mexicans, 60 percent said NAFTA was a good thing for Mexico, while 33 percent said it was bad. Americans were the most negative, with 51 percent agreeing that the trade pact was good for their country, while 39 percent said it was bad.

And while politics plays a big role in American views on ­NAFTA — 68 percent of Democrats view it as good for the United States, vs. 30 percent of Republicans — large majorities of Canadians view the trade deal positively, no matter their political affiliation, according to Pew.

That cross-party consensus was on display this month when Foreign Minister Chrystia Freeland announced the members of a new 13-person advisory council on the NAFTA talks.

Included were Rona Ambrose, the former interim Conservative Party leader, and Brian Topp, a leading member of the left-leaning New Democratic Party.

“I do think it is smart for the government to cast a wide net and to listen widely, and that’s what I hope they do,” Topp told the Globe and Mail newspaper.

The advisory council includes business leaders; the head of the Canadian Labour Congress, a union federation; and the national chief of the Assembly of First Nations, an indigenous group.

The Trudeau government has also recruited Canada’s provincial premiers in a drive to promote Canada’s pro-NAFTA views with governors in U.S. states dependent on trade with Canada for jobs. And there has been a push to win congressional support in districts where Canadian companies have large operations.

If economic relationships are seen through the prism of trade balances alone, Canada isn’t much of a problem for Americans. In 2016, the United States had a relatively small deficit in goods with Canada — $12 billion, compared with a $65 billion goods deficit with Mexico. If trade in services is included, the United States had a $12.5 billion surplus in its trade with Canada last year.

In any case, according to a study by the Bank of Montreal, NAFTA accounts for only 10 percent of the U.S. goods trade deficit.

Half of America’s $737 billion trade deficit in goods last year was with China, the report said.

In a Jan. 27 call to Mexico’s Peña Nieto, a transcript of which was published recently by The Washington Post, Trump made clear that he was not concerned about Canada’s trading relationship with the United States.

“Canada is no problem,” Trump said. “We have a very fair relationship with Canada. It has been more balanced and much more fair. So we do not have to worry about Canada. We do not even think about Canada.”

Despite those reassurances, Trump lashed out at Canada in a tweet three months later for protectionist agricultural trade policies he said were making life difficult for dairy farmers in Wisconsin. “We will not stand for this,” he warned.

About the same time, his administration hit Canadian softwood lumber producers exporting to the United States with duties averaging 20 percent, reviving a cross-border dispute that has been festering for 35 years.

The Trump administration has also made clear that it wants more access for U.S. companies to Canadian government contracts while retaining its ability to block Canadian firms bidding on U.S. government work through the continuation of Buy America policies.

In addition, it wants Canada to allow more goods purchased by individuals online to be free of taxes and duties, a measure opposed by Canadian retailers.

Kergin, the former ambassador, says patience is essential.

“These trade negotiations are so complicated, and there are a lot of hang-ups in the fine print,” he said.

While there is pressure to wrap the talks up before the U.S. midterm elections and the Mexican presidential vote in July 2018, he is not optimistic: “I’d be surprised if it’s done by next summer.”