He was obviously being a smart ass to the officer. If he felt like he was wrongly treated he could have brought it up in court. I would assume in a parking lot there would be a lot of witnesses if harm was done to someone who was detained. Cops live their lives in fear every day they go to work. They don't know what will happen the next time they stop a vehicle. Your tone of voice or initiation of what seems to be a confrontation... An officer would likely want to diffuse the situation as soon as possible. Smart move on the cop's part, for all he knew you would have been the psycho that managed to pull a fast one on him and shot him with your unloaded weapons. Happens often enough to police offers, and I don't blame him for detaining you so that he could feel safe. After all, he likely has a family to go back to. Would you question your boss that way? Would you talk that way to your mother? What about a judge? Whether you like it or not, police are an authority and you respect them as such. If you weren't such a jerk he would have probably just taken you to the station and given you a slap on the wrist anyway. As it is, our judicial system is bogged down and fortunately for you, they would have likely immediately dismissed the case if it was your first real offense. This is all coming from someone who doesn't even agree with our current CJ system.
About your dogs... Really. What a stupid question to ask. Would you leave a baby, a toddler, or even just a younger child in the car unsupervised for 20 minutes? Would you feel comfortable if you saw someone leave their baby in the car while they went inside to pick up a few items in the store? That is how some of us normal people feel about dogs as well. My husband and I drove over 12 hours to visit family in another state, and we took our dog with us. Know how many times the dog was unsupervised? Not Once. You or your wife could have stayed in the car, while the other adult went inside the store to deal with whatever business needed. Here, let me tell you the moral of the story: don't be an idiot. Stop. Think.