People are beginning to wonder why the Republican Party can’t get its act together and repeal and replace ObamaCare. The question reveals a category mistake, the assumption that there is such a thing as the “Republican Party.”

In fact, there are three of them, and they’re all distinct. That became clear from a remarkable new analysis of voter preferences by Lee Drutman at the Voter Survey Group. Drutman asked voters to identify whom they voted for and how they felt about various economic and social issues. He then mapped this out in a diagram.

We’ve been told that Republicans are extreme and Democrats moderate. Drutman’s diagram shows that the opposite is true. Democratic voters congregated at the very economically and socially liberal corner. By contrast, the Republicans were all over the place.

The next surprise was the strength of Republican social conservatism. That’s something our “growth and opportunity” Republican establishment, and all the smart people at right-wing think tanks, never figured out. They saw the world only on an economic axis. How fellow Republicans might have felt about same-sex marriage and abortion was simply an embarrassment.

It turns out, however, that the Republican voter, unlike the party establishment, is socially conservative and economically middle of the road. In fact, there are a lot of left-of-center Republicans on economic issues such as free trade and Social Security.

But here’s Drutman’s big surprise. The sweet spot in American politics, the place where elections are won, is the socially conservative and economically liberal quadrant. And the winner is going to be the fellow who’s not going to touch Social Security and who promises to nominate a judge in the mold of Antonin Scalia.

Donald Trump, in other words.

Trump placed himself to the left of the other Republican candidates on a variety of economic issues. And when it came to the socially conservative “values voter,” the Democrats were locked in to their extremely liberal base, particularly with Hillary Clinton as the nominee.

Right now the Democrats know they’re in a bind. They want to learn how to connect with the forgotten voter in the heartland. Drutman’s little diagram tells them how they can do so. And also why they can never do so. They’re never going to be able to walk away from liberal identity politics, from full abortion rights, from the gender-benders. They’re stuck in the loser quadrant.

Catholics in particular are troubled by abortion, and they’re the swing constituency in American politics. Formerly they were an integral part of the Democratic coalition but in 2016 they were plus-7 for Trump. White Catholics were plus-23 for Trump, and were an important reason for Trump’s victories in Pennsylvania, Ohio, Michigan and Wisconsin. Yet new DNC chair Tom Perez has said his party has no room for candidates who don’t share its position on abortion.

But what about the divided Republican Party? Can Trump’s cohort unite with the economic and social conservatives who back Ted Cruz and Mike Lee? That’s what the ObamaCare fight is all about, and we don’t yet know the answer. But I can see the possibility of a compromise, especially if social issues are paramount.

And on economic issues, it would help to realize that we already have one of the most generous welfare systems in the world, and that a country’s economic freedom depends much more on such things as fiscal policies and the size of the regulatory state, issues on which Trump and Cruz Republicans both agree.

That leaves the marginal third Republican Party, the socially liberal but economically conservative world inhabited by libertarians. That’s the home of Charles Koch and of the politicians and academics in his network of support. They make a lot of noise, but they’re playing above their weight, an army of generals without any troops behind them.

So here’s my solution to the ObamaCare debate. The Ted Cruz Party should abandon the narcissism of petty differences. And everyone should turn down the poisoned chalice of Koch support.

F.H. Buckley is a professor at Scalia Law School at George Mason University and the author of “The Way Back: Restoring the Promise of America.”