Parenting is a role that no-one can really prepare you for, and moments like these are integral to it.
I read loads of books both through my pregnancy and during the really early years when my twins weren't sleeping a wink, even though I was ill with exhaustion. You see, like every other mum I have met, I too wanted to get a good routine and be a good mother. Reading the books was a sure fire way of getting it right. Or so I thought.
Later when the kids got to about four-years-old, I stopped paying as much attention to the parenting books because some of the things just didn't sit well with me. Without realising it, I slowly learnt to trust my own instinct.
It was something that happened as I gained confidence in being a mother. I think what you did at the shop was something you felt you had to do. Disciplining children can be as complex or as simple as we like. Your obvious retrospective guilt is a very normal feature of parenting. We all have guilt on our shoulders, just like our own parents, and their parents and so on. No-one escapes the guilt, unless of course they are devoid of the most basic human emotions, so you are very normal.
I think you should give yourself a break, It's obvious that you love your child very much to worry about whether you got it right. That alone is a a sign of an intelligent, caring and learning mother, someone who really cares about doing the best for her child.
Take care