The sale of recreational pot will be legal at shops across California starting in January 2018.

But consumers won’t be able to light up or snack on any marijuana products while driving or riding as a passenger in a car.

A new law that goes into effect Jan.1 bans smoking or ingesting any cannabis products while behind the wheel. That includes cannabis edibles like brownies and breakfast bars.

The new law also regulates how and where consumers can store marijuana while in a car, similar to the state's open alcohol container rules.

“It has to be sealed in a container. The seal cannot be broken. And if it is in an open container, it would have to be locked away in a place like the trunk,” California Highway Patrol Sgt. Oscar Chavez said.

Chavez said law enforcement officers won’t stop drivers just because they’re scarfing down a snack or lighting up a possible tobacco product. That’s because it won’t be easy, Chavez said, to distinguish between marijuana edibles and other food or tobacco.

“If someone’s just smoking an E-cigarette, it would be hard for us to justify the fact that I’m stopping you for the cannabis violation and it being just regular nicotine being smoked at the time. It has to be obvious in order for us to make the traffic stop,” the sergeant said.

Chavez said most enforcement of the new law will take place after officers pull motorists over for separate moving violations.

Standing outside a medical cannabis shop in Sacramento, customer Shawn Badger said he has no problem with the ban.

“I agree with it,” he said. “It’s just like drinking and driving as far as that’s concerned. You’re still intoxicated. You’re still not going to have 100 percent mental registration of everything. Your reactions are going to be delayed and what not.”

Chavez said officers are trained to detect impaired drivers, whether those drivers are impaired by alcohol or marijuana. He said the same guidance applies to all drivers — if it’s not safe to drive, don’t get behind the wheel. The same DUI penalties also apply to both sets of drivers.

Violations of the new law banning smoking and ingesting marijuana products while driving will be considered infractions and punishable by a $70 fine.