WASHINGTON — The Democrats’ stunning defeat in the presidential race and continued struggles in lower-level contests have jolted party leaders into concluding that their emphasis on cultural issues has all but crippled them by diverting voters’ attention from the core Democratic message of economic fairness.

But even as Democrats agree about the need to promote their agenda more aggressively for the middle class and voters of modest means, especially in parts of the country where the party has suffered grievous losses, they are divided over how aggressively to position themselves on the economic left, with battle lines already forming over the lightning-rod issue of foreign trade.

While the country has moved steadily to the left on such social issues as same-sex marriage and gender equity, it is increasingly apparent that Democrats cannot win in much of the country without a more coherent and overriding economic message.

The debate over what that message should be comes not only against the backdrop of Hillary Clinton’s astonishing loss to Donald J. Trump — a race decided by a handful of Rust Belt states that for decades had favored Democratic nominees — but also after the third campaign in the past four election cycles in which the party was routed across vast sections of the nation, leaving Democrats out of power in both chambers of Congress and in most governors’ mansions.