Consumer spending remains resilient, but retailers’ latest earnings offered a glimpse into worrying shifts in shopping habits.