Container Query
The same product card looks great in the wide main column, but gets squished inside the narrow sidebar even though the desktop screen is wide.
@media only sees the 1280px desktop window and cramps the sidebar copy. Declaring container-type: inline-size on the slot wrapper and styling with @container lets the card switch between stacked and horizontal layouts automatically. Container queries complement page-level viewport breakpoints rather than replacing full-page navigation rules.You can say this to an AI Agent
Ready to paste into Cursor, Claude Code, or CodexThis card is reused in both the wide main column and the narrow sidebar. Switch it to CSS container queries: add `container-type: inline-size` on the slot wrapper and use `@container (min-width: 380px)` to toggle between stacked and horizontal layouts instead of `@media`. Verify both the wide column and narrow sidebar on desktop afterward.
