Heritage Auctions / file

Have insomnia? Work unusual hours?

Or just woke up in the middle of the night and suddenly realized you forgot someone’s birthday and want to send them a case of wine?

Well, the way Arizona Attorney General Mark Brnovich sees it, you can’t get on your computer and order booze between 2 and 6 a.m., even if your order won’t be delivered until more reasonable hours — and even if the order is going out of state.

The reason this became a legal issue is because of questions raised by John Cocca, director of the state Department of Liquor Licenses and Control. He said the way people buy beer, wine and liquor is changing.

“There are a lot more internet sales and a lot more people ordering alcohol over the internet or via the computer or over the phone,” he said.

Websites in particular operate on a 24/7 basis.

But here’s the thing: Arizona law makes it illegal to sell, dispose of, deliver or give alcoholic beverages between 2 a.m. and 6 a.m.

That, in Cocca’s mind, raised the question: What exactly does it mean to “sell” alcohol?

“There’s no difference in the law whether it’s a brick-and-mortar store or the computer,” he said. “The laws are the same for alcohol sales and delivery.”

So he asked Brnovich for guidance.

The attorney general, for his part, said he views the word “sell” to include not just delivering something.

“It also expressly includes soliciting or receiving an order,” Brnovich said.

And that means a business “sells” alcoholic beverages when it takes the order.

Moreover, the attorney general said it’s irrelevant whether the seller charges the customer’s debit or credit card at that time, or when the products are delivered.

Cocca said the only time that counts is what’s on the clock in Arizona, not whether someone is ordering from an out-of-state winery where it might be 7 in the morning.

But don’t worry that one of Cocca’s enforcement officers will show up at your door if you happen to successfully place an order in your pajamas.

He said Arizona’s liquor laws apply not to individuals but instead to the sellers, who all have to be licensed by the state. That includes out-of-state firms that need to get a permit before delivering their products here.

And that means it’s the retailer who took that order at 3 a.m., Arizona time, who could wind up in legal hot water.