Before President Trump’s “shithole countries” comments leaked, so did the details of a bipartisan immigration fix that would codify Deferred Action for Childhood Arrivals, the Obama-era deportation protections that are set to end on March 5.

Immigration hawks weren’t happy.

“Some of our colleagues have floated a potential plan that, simply put, isn’t serious,” said Sens. Tom Cotton, R-Ark.; Chuck Grassley, R-Iowa; and David Perdue, R-Ga., in a joint statement Thursday night. “It is disingenuous to discuss providing status to, potentially, millions of individuals without taking credible steps to truly protect our borders and secure the interior.”

The trio concluded, “Any deal that does not address the four pillars we have reiterated — ending chain migration, eliminating the outdated visa lottery, increasing border security and solving the DACA situation — is no deal at all.”

Yet members of the Congressional Hispanic Caucus were cool to changes to visa lottery program. Some in the Congressional Black Caucus, noting that over 40 percent of those admitted through the program come from Africa, were outright opposed.

These liberals are clamoring for a partial government shutdown with unpredictable political consequences for both parties in an election year.

Already displeased that a bipartisan working group including Senate Minority Whip Dick Durbin, D-Ill., had accepted Trump’s parameters, even referencing “chain migration,” they were incensed after the “shithole” remark was reported.

Thus the two factions in Congress who arguably care most passionately about the issue — conservative immigration hawks and liberal lawmakers representing immigrant communities — hated the deal, which the White House rejected.

And that was pre-“shithole.”

The biggest shift in immigration reform under Trump is that restrictionist conservatives like Cotton and Perdue, as well as White House domestic policy adviser Stephen Miller, have a place at the table in the negotiations alongside the Democrats and Republicans like Sen. Lindsey Graham, R-S.C., who have participated in past efforts like the Gang of Eight.

Those criticizing Trump on immigration from the Right, like conservative columnist Ann Coulter, argue that his election should put the likes of Cotton and Miller at the head of the table.

But restrictionists don’t have anywhere close to 60 votes in the Senate by themselves. Graham is already taunting Cotton over failing to win over Democrats.

Trump’s reported remarks about countries like Haiti and El Salvador, which the White House did not deny, will complicate efforts to pull immigration talks rightward.

Many Democrats already suspected Trump’s support for new immigration restrictions and scrapping a visa lottery designed to diversify the immigrant pool was motivated by racism. It will be even harder to get them to vote for a deal including such policies if they believe he has made statements confirming these suspicions.

“Certain Washington politicians choose to fight for foreign countries, but President Trump will always fight for the American people," principal deputy White House press secretary Raj Shah said in a statement.

"The president will only accept an immigration deal that adequately addresses the visa lottery system and chain migration — two programs that hurt our economy and allow terrorists into our country,” Shah continued. “Like other nations that have merit-based immigration, President Trump is fighting for permanent solutions that make our country stronger by welcoming those who can contribute to our society, grow our economy, and assimilate into our great nation. He will always reject temporary, weak, and dangerous stopgap measures that threaten the lives of hardworking Americans, and undercut immigrants who seek a better life in the United States through a legal pathway."

As Never Trumper David Frum has put it, “While Canada, Australia, New Zealand, and others choose their immigrants, the United States is content to let immigrants choose America.” Many recent immigrants, and an American working class that is itself disproportionately black and Latino, may benefit from reversing that arrangement.

That’s the sophisticated argument. Trump’s talk was anything but, giving ammunition to those who contend “merit-based” immigration is a code word for “white.”

Trump’s crass characterization of some immigrants’ countries of origin won’t offend his supporters. Why, a few have already asked, is it immoral to deport people to these places if they are paradises?

But Trump needs more than his base to win this fight of his own making. Otherwise, the compromise on the table appears to be admitting a large number of immigrants and then insulting them.

Trump has broadened the immigration debate in the U.S. By also coarsening it, he may undo that achievement.

What a shitshow.