/* Bounded media frames keep complete gear visible, including on mobile Safari. */
.card-gallery { min-width: 0; }
.card-media { touch-action: pan-y pinch-zoom; }
[data-card-rail] .card-media { touch-action: pan-x pan-y pinch-zoom; }
.card-media, .product-card-visual.card-media { display: block; position: relative; width: 100%; height: auto; min-height: 0; max-height: none; aspect-ratio: 1; overflow: hidden; padding: 0; border-radius: 6px; background: var(--mist); }
.card-photo-slide { position: absolute; inset: 0; width: auto; height: auto; }
.card-image-frame { display: block; position: absolute; inset: 20px; width: auto; height: auto; padding: 0; }
/* Single-view cards use the frame as the direct product link. Override the
   older full-size anchor rules so its insets bound all four edges. */
.card-media.product-card-visual > .card-image-frame { display: block; width: auto; height: auto; min-width: 0; min-height: 0; padding: 0; }
.card-image-frame > .responsive-photo { display: block; position: absolute; inset: 0; width: auto; height: auto; }
.card-image-frame img, .product-card-visual .card-image-frame img { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; transform: none; transition: none; }
.card-image-frame > .bundle-visual { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 8px; width: auto; height: auto; min-height: 0; padding: 0; aspect-ratio: auto; }
.card-image-frame .bundle-visual > .responsive-photo { display: block; position: relative; flex: 1 1 0; min-width: 0; width: 0; height: auto; }
.card-image-frame .bundle-visual > .responsive-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.card-photo-controls { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; gap: 4px; padding: 8px 0 0; }
.card-photo-arrow, .card-rail-navigation .icon-button { min-width: 44px; width: 44px; min-height: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); }
.card-previous-icon { transform: rotate(180deg); }
.card-photo-position { display: grid; justify-items: center; min-width: 0; }
.card-photo-label { display: block; max-width: 100%; text-align: center; color: var(--muted); font-size: 10px; line-height: 1.5; }
.card-photo-dots { display: flex; justify-content: center; gap: 0; }
.card-photo-dot { display: grid; place-items: center; min-width: 44px; width: 44px; min-height: 44px; height: 44px; padding: 0; }
.card-photo-dot > span { display: block; width: 6px; height: 6px; border: 1px solid var(--ink); border-radius: 50%; background: transparent; }
.card-photo-dot[aria-pressed=true] > span { background: var(--ink); }
.product-card-actions { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: stretch; margin-top: 18px; }
.product-card-actions .button { min-height: 48px; padding: 12px 16px; font-size: 13px; gap: 10px; }
.product-card-actions .card-add-button { justify-content: space-between; }
.product-card-actions .card-details-link { padding-inline: 13px; gap: 7px; }
.product-card-info { padding-top: 14px; }
.product-card-meta { min-height: 34px; padding-bottom: 9px; }
.bundle-card .card-gallery { padding-inline: 18px; }
.bundle-card .card-media { aspect-ratio: 4/3; }
.bundle-card .bundle-image-link { display: none; }
.bundle-detail-media .card-media { aspect-ratio: 1; }
.bundle-detail-media .gallery-note { line-height: 1.8; }
.bundle-card .bundle-actions { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.bundle-card .bundle-actions .button { min-height: 48px; font-size: 13px; padding: 12px 16px; gap: 10px; }
.bundle-card .bundle-actions .button.dark { justify-content: space-between; }
.card-rail { min-width: 0; }
.card-rail-controls { display: none; }
.product-stage { display: block; position: relative; width: 100%; height: auto; max-height: none; min-height: 0; aspect-ratio: 1; padding: 0; }
.product-stage > .responsive-photo { display: block; position: absolute; inset: 18px 18px 72px; width: auto; height: auto; min-height: 0; }
.product-stage > .responsive-photo > img { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.product-stage .inspect-button { position: absolute; inset: auto auto 14px 18px; z-index: 1; margin: 0; }
.straw-shopping-media > .responsive-photo { position: relative; display: block; width: 100%; height: auto; aspect-ratio: 1; }
.straw-shopping-media > .responsive-photo > img { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); aspect-ratio: auto; object-fit: contain; }
.offer-thumbnail img, .cart-line > a > img, .search-result > img { object-fit: contain; object-position: center; }
.card-gallery button:focus-visible, .card-rail-controls button:focus-visible { outline: 3px solid #4f8390; outline-offset: 3px; }
@media(max-width:760px) {
 .product-grid[data-card-rail], .bundle-grid[data-card-rail] { display: flex; position: relative; flex-wrap: nowrap; gap: 16px; width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 0; scrollbar-width: none; padding-bottom: 6px; align-items: stretch; }
 .product-grid[data-card-rail]::-webkit-scrollbar, .bundle-grid[data-card-rail]::-webkit-scrollbar { display: none; }
 .product-grid[data-card-rail] > .product-card, .bundle-grid[data-card-rail] > .bundle-card { flex: 0 0 calc(100% - 32px); width: calc(100% - 32px); max-width: calc(100% - 32px); min-width: 0; scroll-snap-align: start; scroll-snap-stop: normal; }
 .product-grid[data-card-rail].rail-single > .product-card, .bundle-grid[data-card-rail].rail-single > .bundle-card { flex-basis: 100%; width: 100%; max-width: 100%; }
 .card-media, .product-card-visual.card-media { aspect-ratio: 4/3; height: auto; min-height: 0; max-height: none; }
 .card-image-frame { inset: 16px; }
 .card-photo-label { font-size: 10px; line-height: 1.5; }
 .card-photo-controls { gap: 2px; padding-top: 7px; }
 .product-card-info h3 { font-size: 19px; line-height: 1.35; overflow-wrap: normal; }
 .product-card-info { grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding-top: 10px; }
 .product-card-info .small { font-size: 11px; line-height: 1.7; }
 .card-price { font-size: 15px; }
 .product-card-actions { gap: 8px; margin-top: 16px; }
 .product-card-actions .button { min-height: 48px; padding: 12px; font-size: 12px; gap: 7px; }
 .card-details-link .icon { width: 16px; }
 .card-rail-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 18px; }
 .card-rail-hint { font-size: 11px; color: var(--muted); line-height: 1.7; }
 .card-rail-navigation { display: inline-flex; align-items: center; gap: 12px; }
 .card-rail-navigation > span { min-width: 34px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
 .bundle-card .card-gallery { padding-inline: 12px; }
 .bundle-card .bundle-card-copy { padding: 16px; }
 .bundle-card .bundle-actions { grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
 .bundle-card .bundle-actions .button { padding: 12px; min-height: 48px; font-size: 12px; }
 .bundle-card h3 { font-size: 24px; line-height: 1.3; }
 .bundle-detail-media { padding: 16px; }
 .bundle-detail-media .card-media { aspect-ratio: 4/3; }
 .straw-shopping-media > .responsive-photo { aspect-ratio: 4/3; height: auto; }
 .straw-shopping-media > .responsive-photo > img { aspect-ratio: auto; }
 .product-stage { aspect-ratio: 1; height: auto; max-height: none; }
}
@media(max-width:359px) {
 .product-grid[data-card-rail] > .product-card, .bundle-grid[data-card-rail] > .bundle-card { flex-basis: calc(100% - 22px); width: calc(100% - 22px); max-width: calc(100% - 22px); }
 .card-image-frame { inset: 12px; }
 .product-card-info { grid-template-columns: minmax(0,1fr); gap: 7px; }
 .product-card-actions { grid-template-columns: minmax(0,1fr) auto; }
 .product-card-actions .card-details-link { padding-inline: 10px; }
 .card-details-link .icon { display: none; }
 .bundle-card .bundle-actions { grid-template-columns: minmax(0,1fr); }
 .bundle-card .bundle-actions .button { width: 100%; }
 .card-photo-dot { min-width: 44px; width: 44px; }
}
@media(prefers-reduced-motion:reduce) { [data-card-rail] { scroll-behavior: auto; } }
