/* =========================================================
   PRODUCT CATALOG V16 — FINAL DESKTOP RHYTHM + MOBILE CARD EXPAND
   This file is loaded after catalog-redesign.css so carousel
   geometry and motion have one final source of truth.
   ========================================================= */

.storefront-catalog .catalog-carousel {
  --catalog-card-width-px: 17rem;
  --catalog-card-height: 27.15rem;
  --catalog-card-gap: 1rem;
  --catalog-arrow-size: 3.45rem;
  --catalog-arrow-gutter: 4.15rem;
  --catalog-motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  min-width: 0;
}

.storefront-catalog .catalog-carousel-content {
  min-width: 0;
  position: relative;
  overflow-anchor: none;
}

.storefront-catalog .catalog-carousel-rail {
  display: grid !important;
  grid-template-columns: var(--catalog-arrow-gutter) minmax(0, 1fr) var(--catalog-arrow-gutter) !important;
  align-items: center;
  gap: 0.7rem !important;
  min-width: 0;
  transition: grid-template-columns 420ms var(--catalog-motion-ease), gap 420ms var(--catalog-motion-ease);
}

.storefront-catalog .catalog-carousel-viewport {
  position: relative;
  min-width: 0;
  width: 100%;
  padding: 0.8rem 0 1.1rem !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory;
  scroll-behavior: auto !important;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  perspective: 1100px;
  isolation: isolate;
}

.storefront-catalog .catalog-carousel-viewport::-webkit-scrollbar {
  display: none;
}

.storefront-catalog .catalog-grid {
  display: grid !important;
  grid-auto-flow: column !important;
  grid-auto-columns: var(--catalog-card-width-px) !important;
  grid-template-columns: none !important;
  grid-template-rows: var(--catalog-card-height) !important;
  grid-auto-rows: var(--catalog-card-height) !important;
  gap: var(--catalog-card-gap) !important;
  width: max-content !important;
  min-width: 100%;
  align-items: stretch;
  transform: translate3d(0, 0, 0);
  transform-origin: left center;
  will-change: auto;
}

.storefront-catalog .catalog-grid > .catalog-product-card.product-showcase-card,
.storefront-catalog .catalog-grid > .product-showcase-card:nth-child(odd) {
  width: var(--catalog-card-width-px) !important;
  min-width: var(--catalog-card-width-px) !important;
  max-width: var(--catalog-card-width-px) !important;
  height: var(--catalog-card-height) !important;
  min-height: var(--catalog-card-height) !important;
  grid-row: auto !important;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  opacity: 1;
  filter: none;
  translate: 0 0;
  scale: 1;
  transform-style: preserve-3d;
  animation: none;
  transition:
    border-color 220ms ease,
    box-shadow 300ms var(--catalog-motion-ease),
    translate 300ms var(--catalog-motion-ease),
    scale 300ms var(--catalog-motion-ease),
    opacity 220ms ease,
    filter 280ms ease;
}

/* Teaser: a deliberately softened peek, not a broken half card. */
.storefront-catalog .catalog-carousel:not(.is-expanded) .catalog-product-card.is-teaser {
  opacity: 0.72;
  filter: blur(0.65px) saturate(0.78) contrast(0.96);
  scale: 0.968;
  transform-origin: left center;
}

.storefront-catalog .catalog-carousel:not(.has-interacted):not(.is-expanded) .catalog-product-card.is-teaser {
  animation: catalog-v14-teaser-peek 2.4s var(--catalog-motion-ease) 780ms 2 both;
}

.storefront-catalog .catalog-carousel.has-interacted:not(.is-expanded) .catalog-product-card.is-teaser {
  opacity: 0.8;
  filter: blur(0.45px) saturate(0.84);
  scale: 0.975;
}

@keyframes catalog-v14-teaser-peek {
  0%, 100% { translate: 0 0; }
  36% { translate: -0.55rem 0; }
  62% { translate: -0.18rem 0; }
}

/* Directional stage effect, deliberately visible but short-lived. */
/* The old full-viewport sweep created a compositing seam while the
   scroll container moved. Motion is now carried by the cards themselves. */
.storefront-catalog .catalog-carousel-viewport::before {
  content: none !important;
  display: none !important;
}

/* Readable slide motion without animating every card on every frame. */
.storefront-catalog .catalog-carousel.is-gliding .catalog-product-card.is-slide-origin {
  animation: catalog-v14-slide-origin 420ms ease-out both;
}

.storefront-catalog .catalog-carousel.is-gliding .catalog-product-card.is-slide-target {
  animation: catalog-v14-slide-target 560ms var(--catalog-motion-ease) both;
}

.storefront-catalog .catalog-carousel.is-gliding .catalog-product-card.is-slide-focus .product-showcase-card-media {
  animation: catalog-v14-slide-media 620ms var(--catalog-motion-ease) both;
}

.storefront-catalog .catalog-product-card.is-slide-settled {
  animation: catalog-v14-slide-settle 380ms var(--catalog-motion-ease) both;
}

@keyframes catalog-v14-slide-origin {
  0% { opacity: 1; translate: 0 0; scale: 1; filter: saturate(1); }
  100% { opacity: 0.38; translate: -0.7rem 0; scale: 0.94; filter: blur(1.2px) saturate(0.82); }
}

@keyframes catalog-v14-slide-target {
  0% { opacity: 0.2; translate: 1.15rem 0; scale: 0.925; filter: blur(4px) saturate(0.72); }
  68% { opacity: 1; translate: -0.16rem 0; scale: 1.018; filter: blur(0) saturate(1.06); }
  100% { opacity: 1; translate: 0 0; scale: 1; filter: blur(0) saturate(1); }
}

.storefront-catalog .catalog-carousel[data-slide-direction='previous'] .catalog-product-card.is-slide-origin {
  animation-name: catalog-v16-slide-origin-previous;
}

.storefront-catalog .catalog-carousel[data-slide-direction='previous'] .catalog-product-card.is-slide-target {
  animation-name: catalog-v16-slide-target-previous;
}

@keyframes catalog-v16-slide-origin-previous {
  0% { opacity: 1; translate: 0 0; scale: 1; filter: saturate(1); }
  100% { opacity: 0.38; translate: 0.7rem 0; scale: 0.94; filter: blur(1.2px) saturate(0.82); }
}

@keyframes catalog-v16-slide-target-previous {
  0% { opacity: 0.2; translate: -1.15rem 0; scale: 0.925; filter: blur(4px) saturate(0.72); }
  68% { opacity: 1; translate: 0.16rem 0; scale: 1.018; filter: blur(0) saturate(1.06); }
  100% { opacity: 1; translate: 0 0; scale: 1; filter: blur(0) saturate(1); }
}

@keyframes catalog-v14-slide-media {
  0% { translate: 1rem 0; scale: 0.965; filter: saturate(0.82); }
  72% { translate: -0.16rem 0; scale: 1.025; filter: saturate(1.08); }
  100% { translate: 0 0; scale: 1; filter: saturate(1); }
}

@keyframes catalog-v14-slide-settle {
  0% { translate: 0 0; scale: 1; }
  52% { translate: 0 -0.28rem; scale: 1.012; }
  100% { translate: 0 0; scale: 1; }
}

.storefront-catalog .catalog-carousel.is-gliding .catalog-product-card {
  pointer-events: none;
}

/* Arrows keep their shape even when disabled. */
.storefront-catalog .catalog-carousel-arrow {
  position: relative !important;
  inset: auto !important;
  z-index: 25;
  justify-self: center;
  pointer-events: auto !important;
  touch-action: manipulation;
  width: var(--catalog-arrow-size) !important;
  height: var(--catalog-arrow-size) !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--catalog-primary) 78%, var(--catalog-border)) !important;
  border-radius: 999px !important;
  color: #fff !important;
  background: var(--catalog-primary) !important;
  box-shadow: 0 7px 16px color-mix(in srgb, var(--catalog-primary) 16%, transparent) !important;
  opacity: 1 !important;
  transform: none !important;
  transition:
    translate 220ms var(--catalog-motion-ease),
    scale 220ms var(--catalog-motion-ease),
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 220ms ease !important;
}

.storefront-catalog .catalog-carousel-arrow.is-prev,
.storefront-catalog .catalog-carousel-arrow.is-next {
  left: auto !important;
  right: auto !important;
}

.storefront-catalog .catalog-carousel-arrow.is-prev {
  grid-column: 1 !important;
}

.storefront-catalog .catalog-carousel-arrow.is-next {
  grid-column: 3 !important;
}

.storefront-catalog .catalog-carousel-arrow svg {
  width: 1.2rem;
  height: 1.2rem;
}

.storefront-catalog .catalog-carousel-arrow:hover:not(:disabled) {
  translate: 0 -3px;
  scale: 1.045;
  color: #fff !important;
  background: var(--catalog-primary-hover) !important;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--catalog-primary) 22%, transparent) !important;
}

.storefront-catalog .catalog-carousel-arrow:disabled {
  cursor: default;
  color: var(--catalog-text-muted) !important;
  background: var(--catalog-surface-soft) !important;
  border-color: var(--catalog-border-strong) !important;
  box-shadow: none !important;
  opacity: 1 !important;
  scale: 1 !important;
  translate: 0 0 !important;
}

/* Expanded desktop: preserve the slideshow viewport width and card geometry. */
@media (min-width: 768px) {
  .storefront-catalog .catalog-carousel.is-expanded .catalog-carousel-rail {
    grid-template-columns: var(--catalog-arrow-gutter) minmax(0, 1fr) var(--catalog-arrow-gutter) !important;
    gap: 0.7rem !important;
  }

  .storefront-catalog .catalog-carousel.is-expanded .catalog-carousel-arrow {
    visibility: hidden;
    pointer-events: none;
  }

  .storefront-catalog .catalog-carousel.is-expanded .catalog-carousel-viewport {
    overflow: visible !important;
    scroll-snap-type: none;
  }

  .storefront-catalog .catalog-carousel.is-expanded .catalog-grid {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    grid-auto-flow: row !important;
    grid-template-columns: repeat(auto-fill, var(--catalog-card-width-px)) !important;
    grid-template-rows: none !important;
    grid-auto-columns: unset !important;
    grid-auto-rows: var(--catalog-card-height) !important;
    justify-content: start;
    align-items: start;
    gap: var(--catalog-card-gap) !important;
  }
}

.storefront-catalog .catalog-carousel.is-layout-animating .catalog-product-card,
.storefront-catalog .catalog-carousel.is-mobile-switching .catalog-product-card {
  pointer-events: none;
}

.storefront-catalog .catalog-carousel-footer {
  position: relative;
  z-index: 8;
  display: grid !important;
  grid-template-columns: minmax(6.5rem, 1fr) auto;
  align-items: center;
  gap: 1rem;
  margin-top: 0.45rem;
}

.storefront-catalog .catalog-carousel.is-expanded .catalog-carousel-navigation {
  display: flex !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.storefront-catalog .catalog-expand-toggle {
  grid-column: 2;
  justify-self: end;
}

.storefront-catalog .catalog-carousel:not(.has-navigation):not(.has-expand) .catalog-carousel-footer {
  display: none !important;
}

.storefront-catalog .catalog-carousel-navigation {
  min-height: 2.7rem;
  border: 1px solid var(--catalog-border);
  border-radius: 999px;
  background: var(--catalog-surface);
  box-shadow: 0 10px 24px rgba(31, 64, 48, 0.06);
}

.storefront-catalog .catalog-expand-toggle:not([hidden]) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.58rem;
}

.storefront-catalog .catalog-expand-toggle {
  min-height: 3.1rem;
  padding: 0.75rem 1.05rem 0.75rem 1.15rem;
  border: 1px solid var(--catalog-primary) !important;
  border-radius: 0.95rem !important;
  color: #fff !important;
  background: var(--catalog-primary) !important;
  box-shadow: 0 12px 26px color-mix(in srgb, var(--catalog-primary) 18%, transparent) !important;
  font-weight: 760;
  letter-spacing: -0.01em;
  transition:
    translate 220ms var(--catalog-motion-ease),
    background-color 180ms ease,
    box-shadow 220ms ease !important;
}

.storefront-catalog .catalog-expand-toggle::before {
  content: '';
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  background:
    linear-gradient(currentColor 0 0) 0 0 / 0.38rem 0.38rem no-repeat,
    linear-gradient(currentColor 0 0) 100% 0 / 0.38rem 0.38rem no-repeat,
    linear-gradient(currentColor 0 0) 0 100% / 0.38rem 0.38rem no-repeat,
    linear-gradient(currentColor 0 0) 100% 100% / 0.38rem 0.38rem no-repeat;
  opacity: 0.88;
}

.storefront-catalog .catalog-expand-toggle:hover {
  translate: 0 -2px;
  background: var(--catalog-primary-hover) !important;
  box-shadow: 0 16px 32px color-mix(in srgb, var(--catalog-primary) 24%, transparent) !important;
}

.storefront-catalog .catalog-expand-toggle[aria-expanded='true']::before {
  background:
    linear-gradient(currentColor 0 0) 0 50% / 100% 0.16rem no-repeat;
}

/* Compact mobile catalogue is separate markup, never a squeezed desktop card. */
.storefront-catalog .catalog-mobile-products {
  display: grid;
  gap: 0.75rem;
  width: 100%;
}

.storefront-catalog .catalog-mobile-products[hidden] {
  display: none !important;
}

.storefront-catalog .catalog-mobile-product {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr);
  min-height: 8.4rem;
  overflow: hidden;
  border: 1px solid var(--catalog-border);
  border-radius: 1rem;
  background: var(--catalog-surface);
  box-shadow: 0 10px 24px rgba(31, 64, 48, 0.055);
}

.storefront-catalog .catalog-mobile-product-media {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background: var(--catalog-surface-soft);
}

.storefront-catalog .catalog-mobile-product-media img,
.storefront-catalog .catalog-mobile-product-placeholder {
  width: 100%;
  height: 100%;
  min-height: 8.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  color: var(--catalog-primary);
  font-size: 2rem;
}

.storefront-catalog .catalog-mobile-product-badge {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  max-width: calc(100% - 1.1rem);
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.34rem 0.48rem;
  overflow: hidden;
  border: 1px solid var(--catalog-border);
  border-radius: 999px;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.58rem;
  line-height: 1;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: color-mix(in srgb, var(--catalog-surface) 92%, transparent);
  backdrop-filter: blur(8px);
}

.storefront-catalog .catalog-mobile-product-badge svg {
  width: 0.72rem;
  height: 0.72rem;
  flex: 0 0 auto;
}

.storefront-catalog .catalog-mobile-product-badge.is-instant {
  color: var(--catalog-primary);
}

.storefront-catalog .catalog-mobile-product-badge.is-manual {
  color: #8a622e;
  border-color: #e9c98d;
  background: #fff7e7;
}

.storefront-catalog .catalog-mobile-product-main {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 0.58rem;
  padding: 0.82rem;
}

.storefront-catalog .catalog-mobile-product-main h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--catalog-text);
  font-family: var(--catalog-sans);
  font-size: 0.92rem;
  line-height: 1.25;
  font-weight: 790;
  letter-spacing: -0.02em;
}

.storefront-catalog .catalog-mobile-product-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.55rem;
  padding-top: 0.52rem;
  border-top: 1px solid var(--catalog-border);
}

.storefront-catalog .catalog-mobile-product-price span {
  color: var(--catalog-text-muted);
  font-size: 0.62rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.storefront-catalog .catalog-mobile-product-price strong {
  color: var(--catalog-primary);
  font-size: 1rem;
  line-height: 1;
  font-weight: 820;
  white-space: nowrap;
}

.storefront-catalog .catalog-mobile-product-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.45rem;
}

.storefront-catalog .catalog-mobile-product-actions > * {
  min-width: 0;
  min-height: 2.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.45rem;
  border: 1px solid var(--catalog-border-strong);
  border-radius: 0.72rem;
  overflow: hidden;
  white-space: nowrap;
  color: var(--catalog-text);
  background: var(--catalog-surface);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 760;
  text-decoration: none;
}

.storefront-catalog .catalog-mobile-product-actions a {
  color: #fff;
  border-color: var(--catalog-primary);
  background: var(--catalog-primary);
}

.storefront-catalog .catalog-mobile-product-actions .catalog-mobile-product-stock {
  color: #a44747;
  border-color: #edcaca;
  background: #fff2f2;
}


/* Mobile expanded state uses responsive product cards, not thumbnail rows. */
@media (max-width: 767px) {
  .storefront-catalog .catalog-mobile-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.72rem;
  }

  .storefront-catalog .catalog-mobile-product {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    border-radius: 1rem;
    overflow: hidden;
  }

  .storefront-catalog .catalog-mobile-product-media {
    min-height: 0;
    aspect-ratio: 1 / 0.92;
    flex: 0 0 auto;
  }

  .storefront-catalog .catalog-mobile-product-media img,
  .storefront-catalog .catalog-mobile-product-placeholder {
    min-height: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 0.92;
    object-fit: cover;
  }

  .storefront-catalog .catalog-mobile-product-main {
    flex: 1 1 auto;
    align-content: start;
    grid-template-rows: minmax(2.25rem, auto) auto auto;
    gap: 0.62rem;
    padding: 0.75rem;
  }

  .storefront-catalog .catalog-mobile-product-main h3 {
    min-height: 2.25rem;
    font-size: 0.84rem;
    line-height: 1.28;
  }

  .storefront-catalog .catalog-mobile-product-price {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.22rem;
    padding-top: 0.52rem;
  }

  .storefront-catalog .catalog-mobile-product-price strong {
    font-size: 1.05rem;
  }

  .storefront-catalog .catalog-mobile-product-actions {
    grid-template-columns: 1fr;
    gap: 0.42rem;
  }

  .storefront-catalog .catalog-mobile-product-actions > * {
    min-height: 2.45rem;
    width: 100%;
    padding-inline: 0.45rem;
    font-size: 0.7rem;
  }

  .storefront-catalog .catalog-carousel-footer {
    grid-template-columns: 1fr;
  }

  .storefront-catalog .catalog-carousel-navigation,
  .storefront-catalog .catalog-expand-toggle {
    grid-column: 1;
  }

  .storefront-catalog .catalog-expand-toggle {
    justify-self: stretch;
  }
}

@media (max-width: 339px) {
  .storefront-catalog .catalog-mobile-products {
    grid-template-columns: 1fr;
  }

  .storefront-catalog .catalog-mobile-product-media {
    aspect-ratio: 16 / 8.5;
  }

  .storefront-catalog .catalog-mobile-product-media img,
  .storefront-catalog .catalog-mobile-product-placeholder {
    aspect-ratio: 16 / 8.5;
  }
}

/* Dark mode keeps the same component hierarchy. */
html[data-theme='dark'] body.storefront-catalog .catalog-carousel-navigation,
html[data-theme='dark'] body.storefront-catalog .catalog-mobile-product,
html[data-theme='dark'] body.storefront-catalog .catalog-mobile-product-actions > * {
  border-color: var(--catalog-border);
  background: var(--catalog-surface);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

html[data-theme='dark'] body.storefront-catalog .catalog-carousel-arrow:disabled {
  color: var(--catalog-text-muted) !important;
  background: var(--catalog-surface-soft) !important;
  border-color: var(--catalog-border-strong) !important;
}

html[data-theme='dark'] body.storefront-catalog .catalog-mobile-product-media {
  background: var(--catalog-surface-soft);
}

html[data-theme='dark'] body.storefront-catalog .catalog-mobile-product-badge.is-manual {
  color: #e6c68e;
  border-color: #5d4930;
  background: rgba(76, 57, 32, 0.92);
}

html[data-theme='dark'] body.storefront-catalog .catalog-mobile-product-actions a {
  color: #0b1710;
  background: var(--catalog-primary);
  border-color: var(--catalog-primary);
}

html[data-theme='dark'] body.storefront-catalog .catalog-mobile-product-actions .catalog-mobile-product-stock {
  color: #efaaaa;
  border-color: #6c3b3b;
  background: rgba(92, 42, 42, 0.68);
}

@media (max-width: 767px) {
  .storefront-catalog .catalog-carousel {
    --catalog-card-height: 25.2rem;
    --catalog-card-gap: 0.72rem;
    --catalog-arrow-gutter: 0;
  }

  .storefront-catalog .catalog-carousel-rail {
    display: block !important;
  }

  .storefront-catalog .catalog-carousel-arrow,
  .storefront-catalog .catalog-carousel-arrow[hidden] {
    display: none !important;
  }

  .storefront-catalog .catalog-carousel-viewport {
    padding: 0.7rem 0 0.95rem !important;
    scroll-padding-inline: 0;
  }

  .storefront-catalog .catalog-grid {
    min-width: 0;
  }

  .storefront-catalog .catalog-carousel:not(.has-interacted):not(.is-expanded).has-teaser .catalog-carousel-viewport::after {
    content: 'Geser';
    position: sticky;
    right: 0.7rem;
    bottom: 0.7rem;
    z-index: 22;
    float: right;
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    margin-top: -2.6rem;
    padding: 0.36rem 0.6rem;
    border: 1px solid color-mix(in srgb, var(--catalog-primary) 45%, var(--catalog-border));
    border-radius: 999px;
    color: var(--catalog-primary);
    background: color-mix(in srgb, var(--catalog-surface) 90%, transparent);
    box-shadow: 0 8px 20px rgba(31, 64, 48, 0.08);
    backdrop-filter: blur(10px);
    font-size: 0.68rem;
    font-weight: 760;
    pointer-events: none;
  }

  .storefront-catalog .catalog-carousel-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.72rem;
    margin-top: 0.25rem;
  }

  .storefront-catalog .catalog-carousel-navigation {
    justify-self: center;
  }

  .storefront-catalog .catalog-expand-toggle {
    width: 100%;
    justify-content: center;
  }

  .storefront-catalog .catalog-mobile-products {
    gap: 0.68rem;
  }
}

@media (max-width: 359px) {
  .storefront-catalog .catalog-mobile-product {
    grid-template-columns: 4.9rem minmax(0, 1fr);
  }

  .storefront-catalog .catalog-mobile-product-media img,
  .storefront-catalog .catalog-mobile-product-placeholder {
    min-height: 8rem;
  }

  .storefront-catalog .catalog-mobile-product-main {
    padding: 0.7rem;
  }

  .storefront-catalog .catalog-mobile-product-actions {
    gap: 0.35rem;
  }

  .storefront-catalog .catalog-mobile-product-actions > * {
    padding-inline: 0.3rem;
    font-size: 0.66rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .storefront-catalog .catalog-carousel:not(.has-interacted) .catalog-product-card.is-teaser,
  .storefront-catalog .catalog-carousel.is-gliding .catalog-carousel-viewport::before {
    animation: none !important;
  }

  .storefront-catalog .catalog-grid > .catalog-product-card.product-showcase-card,
  .storefront-catalog .catalog-carousel-arrow,
  .storefront-catalog .catalog-expand-toggle {
    transition-duration: 1ms !important;
  }
}

/* =========================================================
   V16 FINAL MOBILE EXPANDED CARDS
   Kept at the end so older compact-row media queries cannot
   squeeze the expanded catalogue back into thumbnail rows.
   ========================================================= */
@media (max-width: 767px) {
  .storefront-catalog .catalog-mobile-products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch;
    gap: 0.72rem !important;
  }

  .storefront-catalog .catalog-mobile-product {
    display: flex !important;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-radius: 1rem;
  }

  .storefront-catalog .catalog-mobile-product-media {
    width: 100%;
    min-height: 0 !important;
    aspect-ratio: 1 / 0.92;
    flex: 0 0 auto;
  }

  .storefront-catalog .catalog-mobile-product-media img,
  .storefront-catalog .catalog-mobile-product-placeholder {
    width: 100%;
    height: 100%;
    min-height: 0 !important;
    aspect-ratio: 1 / 0.92;
    object-fit: cover;
  }

  .storefront-catalog .catalog-mobile-product-main {
    flex: 1 1 auto;
    display: grid;
    grid-template-rows: minmax(2.25rem, auto) auto auto;
    align-content: start;
    gap: 0.62rem;
    padding: 0.75rem !important;
  }

  .storefront-catalog .catalog-mobile-product-main h3 {
    min-height: 2.25rem;
    font-size: 0.84rem;
    line-height: 1.28;
  }

  .storefront-catalog .catalog-mobile-product-price {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.22rem;
    padding-top: 0.52rem;
  }

  .storefront-catalog .catalog-mobile-product-price strong {
    font-size: 1.05rem;
  }

  .storefront-catalog .catalog-mobile-product-actions {
    grid-template-columns: 1fr !important;
    gap: 0.42rem !important;
  }

  .storefront-catalog .catalog-mobile-product-actions > * {
    width: 100%;
    min-height: 2.45rem;
    padding-inline: 0.45rem !important;
    font-size: 0.7rem !important;
  }
}

@media (max-width: 339px) {
  .storefront-catalog .catalog-mobile-products {
    grid-template-columns: 1fr !important;
  }

  .storefront-catalog .catalog-mobile-product-media,
  .storefront-catalog .catalog-mobile-product-media img,
  .storefront-catalog .catalog-mobile-product-placeholder {
    aspect-ratio: 16 / 8.5;
  }
}

/* Keep footer controls anchored to the same edges in both states. */
@media (min-width: 768px) {
  .storefront-catalog .catalog-carousel-navigation {
    width: fit-content !important;
    justify-self: start;
  }

  .storefront-catalog .catalog-expand-toggle {
    min-width: 13rem;
  }
}

/* =========================================================
   PRODUCT CATALOG V17 — ESSENTIAL MOTION + HISTORY-SAFE UI
   ========================================================= */

/* Keep description and price in one stable vertical rhythm in both themes. */
.storefront-catalog .catalog-product-card .product-showcase-card-copy {
  min-height: 3.05rem;
  padding-bottom: 0.2rem;
}

.storefront-catalog .catalog-product-card .product-showcase-card-footer,
.storefront-catalog .catalog-product-card .product-card-v2-footer.product-showcase-card-footer {
  width: 100%;
  margin-top: auto;
  padding-top: 0.72rem !important;
  border-top: 1px solid var(--catalog-border-strong) !important;
}

html[data-theme='dark'] body.storefront-catalog .catalog-product-card .product-showcase-card-footer,
html[data-theme='dark'] body.storefront-catalog .catalog-product-card .product-card-v2-footer.product-showcase-card-footer {
  border-top-color: color-mix(in srgb, var(--catalog-border-strong) 82%, transparent) !important;
}

.storefront-catalog .catalog-mobile-product-description {
  min-width: 0;
  min-height: 2.05rem;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--catalog-text-soft);
  font-size: 0.7rem;
  line-height: 1.45;
  font-weight: 560;
}

html[data-theme='dark'] body.storefront-catalog .catalog-mobile-product-description {
  color: var(--catalog-text-muted);
}

@media (max-width: 767px) {
  .storefront-catalog .catalog-mobile-product-main {
    grid-template-rows: minmax(2.25rem, auto) minmax(2.05rem, auto) auto auto !important;
    gap: 0.5rem !important;
  }

  .storefront-catalog .catalog-mobile-product-description {
    -webkit-line-clamp: 2;
  }
}

/* Reduced-motion remains accessible, but essential navigation never becomes an
   unexplained instant jump. Decorative card choreography stays disabled while
   JS keeps a short scroll/height transition for spatial context. */
@media (prefers-reduced-motion: reduce) {
  .storefront-catalog .catalog-carousel-viewport {
    scroll-behavior: auto !important;
  }

  .storefront-catalog .catalog-carousel.is-gliding .catalog-product-card,
  .storefront-catalog .catalog-carousel.is-layout-animating .catalog-product-card {
    animation: none !important;
    filter: none !important;
  }
}


/* =========================================================
   PRODUCT CATALOG V18 — MOBILE VISIBILITY + CLEAN MOTION
   ========================================================= */

/* The mobile breakpoint forces the rail to display:block. Respect the hidden
   attribute explicitly so slideshow and expanded cards can never render at the
   same time after the crossfade finishes. */
.storefront-catalog .catalog-carousel-rail[hidden],
.storefront-catalog .catalog-mobile-products[hidden] {
  display: none !important;
}

.storefront-catalog .catalog-carousel.is-mobile-switching .catalog-carousel-content {
  pointer-events: none;
}

/* Parent compositor outlines caused the page-wide white line and the apparent
   second divider in dark mode. Motion remains on the cards/scroll position. */
.storefront-catalog .catalog-carousel.is-gliding .catalog-carousel-viewport,
.storefront-catalog .catalog-carousel.is-layout-animating .catalog-carousel-viewport,
html[data-theme='dark'] body.storefront-catalog .catalog-carousel.is-gliding .catalog-carousel-viewport,
html[data-theme='dark'] body.storefront-catalog .catalog-carousel.is-layout-animating .catalog-carousel-viewport {
  box-shadow: none !important;
}

.storefront-catalog .catalog-carousel.is-layout-animating .catalog-carousel-viewport::before,
.storefront-catalog .catalog-carousel.is-layout-animating .catalog-carousel-viewport::after {
  content: none !important;
  display: none !important;
  animation: none !important;
}

.storefront-catalog .catalog-carousel.is-gliding .catalog-carousel-rail,
.storefront-catalog .catalog-carousel.is-layout-animating .catalog-carousel-rail {
  filter: none !important;
}

/* Repeated arrow clicks no longer restart blur/filter animations on every card.
   The rail movement stays visible and responsive, followed by one light settle. */
.storefront-catalog .catalog-carousel.is-gliding .catalog-product-card.is-slide-origin,
.storefront-catalog .catalog-carousel.is-gliding .catalog-product-card.is-slide-target,
.storefront-catalog .catalog-carousel.is-gliding .catalog-product-card.is-slide-focus .product-showcase-card-media {
  animation: none !important;
  filter: none !important;
}

/* Exactly one divider belongs between description and price. */
.storefront-catalog .catalog-product-card .product-showcase-card-copy {
  border: 0 !important;
  box-shadow: none !important;
}

.storefront-catalog .catalog-product-card .product-showcase-card-footer,
.storefront-catalog .catalog-product-card .product-card-v2-footer.product-showcase-card-footer {
  margin-top: auto !important;
  padding-top: 0.68rem !important;
  border-top: 1px solid var(--catalog-border-strong) !important;
  box-shadow: none !important;
}

html[data-theme='dark'] body.storefront-catalog .catalog-product-card .product-showcase-card-footer,
html[data-theme='dark'] body.storefront-catalog .catalog-product-card .product-card-v2-footer.product-showcase-card-footer {
  border-top-color: var(--catalog-border-strong) !important;
}
