Walmart is adapting fairly well. It's just that they have a stigma among wealthier folks, so we don't know about it. Walmart's online selection is often competitive with Amazon, or even cheaper. They have free 2 day shipping, you can ship to the stores, and Walmart is very good at having the right things in stock. I bet they would have had hats if you checked there.
Among Walmart's many stigmas is that they are associated with questionable conservative political causes, carried out now by the current generations that inherited the founder's money.
Paying millions to name a school arena after your daughter who was attending that school, then having no shame when it turns out said daughter was paying her roommate to do her school work - they did that. Bezos' kids are too young to have yet had their chance. I'm from the state where discount city was founded, I've seen this and much more. Before amazon, walmart was the mighty killer or all other retail. Now amazon is mightier.