Inflation and a growing preference among consumers to shop online to find the cheapest deals took a toll on brick-and-mortar retailers in 2024.