Carlos Mendoza didn’t get many opportunities to deploy his optimal Mets lineup during spring training.

Between Francisco Lindor’s hand surgery and Juan Soto’s absence for the World Baseball Classic, the Mets were without their top two hitters for much of camp.

But everyone was available in time for Opening Day, and Mendoza likes how the Mets’ new-look lineup came together.

“We saw it the last week of camp,” the manager said Thursday before opening the season against the Pittsburgh Pirates at Citi Field.

“It’s just a dynamic lineup. It’s an offense that is going to be able to put together some professional at-bats; guys that put the ball in play when we need to. The versatility and the balance. You’re looking at having lefties, switch-hitters, righties, and then the depth.”

As expected Thursday, the shortstop Lindor and the left fielder Soto occupied the first two spots in the Mets’ revamped batting order, followed by third baseman Bo Bichette and first baseman Jorge Polanco.

How Mendoza would draw up the rest of the lineup against flame-throwing Pirates ace Paul Skenes was more of a question mark.

Mendoza opted to bat center fielder Luis Robert fifth, designated hitter Brett Baty sixth, second baseman Marcus Semien seventh, rookie right fielder Carson Benge eighth and catcher Francisco Alvarez ninth.

“I could have gone a lot of different ways, and that goes to show you that we’ve got a deep lineup,” Mendoza said.

“When we’re talking about having a decision whether you hit Alvy ninth or fifth, it goes to show you that they’re capable of hitting anywhere in the lineup. I just thought that [this was the way to go] with how Luis looked in spring training, the track record when he’s healthy, and just continue to create balance here.”

After missing the playoffs at 83-79 last year, the Mets overhauled their roster in the offseason, trading away Brandon Nimmo and Jeff McNeil while watching Pete Alonso leave for the Baltimore Orioles in free agency.

Bichette, Polanco, Robert, and Semien were all offseason additions, while Thursday marked the MLB debut of the 23-year-old Benge, one of the organization’s top prospects.

Replacing the production of Alonso and Nimmo — who combined for 63 home runs and 218 RBI last year — won’t be easy, but the Mets feel good about the length and balance of this year’s lineup.

Thursday’s staggered batting order featured two switch-hitters (Lindor and Polanco) and did not have any righties or lefties hitting back to back.

The biggest new addition is Bichette, a 28-year-old two-time All-Star who hit .311 with 18 home runs, 94 RBI and an .840 OPS last season with the Toronto Blue Jays. He signed a three-year, $126 million contract with opt-outs after the first two seasons.

But Polanco, Semien and Robert — a bounce-back candidate who hit 38 home with an .857 OPS in 2023 — each boast at least one All-Star selection.

“Every Opening Day is different,” Mendoza said. “It is a privilege. It is an exciting day, whether you have the same team, whether you have new faces, big-time turnover … with coaches, with players, you just feel good about your chances every time you get to this point.”