AZ:
>C. A merchant, or a merchant's agent or employee, with reasonable cause, may detain on the premises in a reasonable manner and for a reasonable time any person who is suspected of shoplifting as prescribed in subsection A of this section for questioning or summoning a law enforcement officer.
https://www.azleg.gov/ars/13/01805.htm
i.e. all they need is reasonable cause to suspect you are shoplifting. When I was detained no one ever saw me steal anything, I openly grabbed the cat litter, scanned it at the machine, paid for it, grabbed the receipt, then refused to show it to the receipt-checker (not about to slow down for that bullshit since it is now my property) so they just sent some dudes out to grab the cart out of my hands.
The store here almost certainly overstepped the law, and you allowed it to happen.
Makes me wonder if maybe you're being accurate, since you'll telling an unusual story and inventing reasons not to seek redress.
Also it'd be a criminal matter, not just a civil one -- having their LP have to get bailed out of the county jail sends a message.
Also many stores have shot themselves in the foot by placing items for sale outside the front doors... thus a shoplifter could claim they just stuck something in their pocket because they forgot they needed a pumpkin and thus needed a cart, or something to that effect.
If you stop someone and can't document these four points, they can challenge the stop, and you're up for a LOT more losses from the unlawful detainment suit.
So basically, they value upselling people at entrances more than limiting liability, and a savvy shoplifter can sue for a lot of money if the store allows reusable bags, since that removes the ability to charge for "concealment" given that by selling Safeway or whatever branded opaque bags, you have implicitly consented to "concealment" of merchandise.