/* Final production overrides. This file loads after the legacy stylesheet so
   the approved hero and native horizontal-scrolling behavior stay deterministic. */
.hero--compact .hero__visual {
  min-height: 0;
  aspect-ratio: 1012 / 640;
  overflow: visible;
}

.hero--compact .hero-product--supplied img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
}

.home-featured__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.home-featured__heading > p {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 750;
  letter-spacing: -.035em;
}

.home-featured__controls {
  display: flex;
  gap: 9px;
}

.home-featured__controls button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0 0 3px;
  border: 1px solid rgb(0 0 0 / 10%);
  border-radius: 50%;
  background: #f5f5f7;
  color: #1d1d1f;
  font: 500 1.55rem/1 system-ui;
  cursor: pointer;
}

.home-featured__controls button:disabled {
  opacity: .28;
  cursor: default;
}

.home-featured__rail {
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
}

.home-featured-card {
  background: #fff;
  box-shadow: 0 18px 42px rgb(0 0 0 / 8%);
  transform: translateZ(0);
}

.home-featured-card:hover {
  transform: translateY(-2px);
}

.home-featured-card--accessories {
  background: #fff;
}

.home-featured-card--accessories img {
  background: #fff;
}

@media (max-width: 820px) {
  .home-featured .shell {
    width: min(100% - 32px, var(--content));
  }

  .home-featured__rail {
    width: calc(100% + 16px);
    grid-auto-columns: min(80vw, 404px);
    gap: 12px;
    padding-right: 16px;
    scroll-snap-type: x mandatory;
  }

  .home-featured-card {
    border-radius: 22px;
    box-shadow: 0 12px 28px rgb(0 0 0 / 8%);
  }
}

.product-card,
.product-card__media {
  background: #fff;
}

/* Every Home category uses one identical, clipped white media tile. */
.home-page .most-wanted__item > span {
  overflow: hidden;
  background: #fff;
}

.home-page .most-wanted__item > span img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.catalog-page .filter-row--categories {
  scroll-padding-inline: 4px;
  padding-inline: 4px;
}

.catalog-page .filter-row--categories .filter-chip {
  scroll-margin-inline: 4px;
}

.repair-hero {
  min-height: 460px;
}

.repair-hero__copy {
  padding-block: clamp(38px, 5vw, 62px);
}

.repair-hero__media {
  min-height: 380px;
}

.repair-type {
  min-height: 150px;
  padding: 18px;
}

.repair-type__icon {
  margin-bottom: 18px;
  color: #1d1d1f;
}

.repair-type__icon [data-is-icon] {
  width: 23px;
  height: 23px;
}

.repair-types-section,
.repair-request-section {
  padding-block: clamp(48px, 6vw, 74px);
}

.repair-form-wrap {
  gap: clamp(24px, 5vw, 64px);
}

.repair-form-wrap .trust-list [data-is-icon] {
  width: 17px;
  height: 17px;
  color: #16833e;
}

.repair-form {
  gap: 12px;
  padding: clamp(20px, 3vw, 30px);
}

.repair-form textarea {
  min-height: 92px;
}

.repair-request-section + .section {
  padding-block: clamp(42px, 5vw, 62px);
}

.repair-request-section + .section .policy-card {
  padding: 22px;
}

.repair-request-section + .section .policy-card::before {
  margin-bottom: 20px;
}

.page-hero {
  padding-block: clamp(38px, 5vw, 68px);
}

.page-hero h1 {
  font-size: clamp(2.45rem, 6vw, 4.9rem);
}

.editorial-rail--official .editorial-card {
  background: #f5f5f7;
}

.editorial-rail--official .editorial-card img {
  inset: auto 0 0;
  width: 100%;
  height: 78%;
  padding: 20px;
  object-fit: contain;
}

.editorial-rail--official .editorial-card--wide img {
  height: 72%;
  padding: 10px;
}

.official-asset-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 290px);
  gap: 14px;
  margin-top: 28px;
  padding: 2px 2px 16px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.official-asset-rail::-webkit-scrollbar {
  display: none;
}

.official-asset-card {
  display: grid;
  grid-template-rows: 270px auto;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgb(0 0 0 / 6%);
  border-radius: 26px;
  background: #f5f5f7;
  color: #1d1d1f;
  scroll-snap-align: start;
  text-decoration: none;
}

.official-asset-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.official-asset-card span {
  display: grid;
  gap: 4px;
}

.official-asset-card small {
  color: #6e6e73;
}

:is(
  .home-featured__rail,
  .most-wanted__rail,
  .product-rail,
  .editorial-rail,
  .budget-grid,
  .home-utilities__grid
) {
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
}

:is(
  .home-featured__rail,
  .most-wanted__rail,
  .product-rail,
  .editorial-rail,
  .budget-grid,
  .home-utilities__grid
)::-webkit-scrollbar {
  display: none;
}

:is(
  .home-featured__rail,
  .most-wanted__rail,
  .product-rail,
  .editorial-rail,
  .budget-grid,
  .home-utilities__grid
) > * {
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

@media (max-width: 820px) {
  .hero--compact .hero__visual {
    min-height: 0;
    aspect-ratio: 1012 / 640;
    overflow: visible;
  }

  .hero--compact .hero-product--supplied img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
  }

  .home-featured__heading {
    margin-bottom: 12px;
  }

  .home-featured__heading::after { content: none; }

  .home-featured__controls {
    display: none;
  }

  .home-page [data-featured-products] {
    grid-auto-columns: min(70vw, 264px);
    gap: 12px;
  }

  .home-page [data-featured-products] .product-card--editorial {
    min-height: 350px;
  }

  .home-page [data-featured-products] .product-card__media {
    min-height: 205px;
    padding: 18px;
  }

  .repair-hero {
    min-height: 0;
  }

  .repair-hero__copy {
    padding-block: 32px 26px;
  }

  .repair-hero__media {
    min-height: 260px;
  }

  .repair-type-grid {
    gap: 8px;
  }

  .repair-type {
    min-height: 124px;
    padding: 15px;
  }

  .repair-type__icon {
    width: 36px;
    height: 36px;
    margin-bottom: 13px;
  }

  .repair-types-section,
  .repair-request-section {
    padding-block: 42px;
  }

  .repair-form-wrap {
    gap: 22px;
  }

  .repair-request-section + .section .how-grid {
    gap: 8px;
  }

  [data-related-products] {
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    touch-action: pan-x pan-y pinch-zoom;
    -webkit-overflow-scrolling: touch;
  }

  [data-related-products]::-webkit-scrollbar {
    display: none;
  }

  [data-related-products] > * {
    scroll-snap-align: start;
    scroll-snap-stop: normal;
  }

  .official-asset-rail {
    width: calc(100% + 18px);
    grid-auto-columns: min(82vw, 300px);
    padding-right: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(
    .home-featured__rail,
    .most-wanted__rail,
    .product-rail,
    .editorial-rail,
    .budget-grid,
    .home-utilities__grid,
    [data-related-products]
  ) {
    scroll-behavior: auto;
  }
}

/* Compact, progressive order review: products first on mobile, optional fields on demand. */
.cart-summary__checkout {
  display: block;
  margin: 0 0 14px;
  padding-top: 0;
  border-top: 1px solid var(--line);
}

.cart-summary__checkout > summary {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  font-size: .88rem;
  font-weight: 760;
}

.cart-summary__checkout > summary::-webkit-details-marker {
  display: none;
}

.cart-summary__checkout > summary::after {
  content: "+";
  font-size: 1.15rem;
  font-weight: 500;
}

.cart-summary__checkout[open] > summary::after {
  content: "−";
}

.cart-summary__checkout > summary span {
  margin-left: auto;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 600;
}

.cart-summary__checkout-fields {
  display: grid;
  gap: 10px;
  padding: 2px 0 14px;
}

.sidecart__footer {
  gap: 7px;
  padding-top: 12px;
}

.sidecart__footer .button {
  min-height: 44px;
}

@media (max-width: 820px) {
  .cart-page .cart-items {
    grid-row: 1;
  }

  .cart-page .cart-summary {
    grid-row: 2;
    position: static;
    padding: 17px;
  }

  .cart-summary__total {
    padding-block: 14px;
  }

  .cart-summary__note {
    margin-block: 8px 2px;
  }
}

@media (max-width: 520px) {
  .sidecart__header {
    min-height: 64px;
  }

  .sidecart__footer {
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  }

  .sidecart-continue {
    min-height: 44px;
    font-size: .76rem;
  }
}

/* Explicit boxes prevent intrinsic image height from overflowing grid tracks. */
[hidden] { display: none !important; }
.product-card__media { min-height: 0; aspect-ratio: 1 / .9; position: relative; }
.product-card__media img { position: absolute; inset: 8%; width: 84%; height: 84%; max-width: 84%; max-height: 84%; object-fit: contain; transform: none !important; }
.product-card__image-note { z-index: 1; }
.product-group-visual { overflow: visible; }
.product-group-visual picture { width: 100%; min-width: 0; height: 100%; display: grid; place-items: center; }
.product-group-visual img { width: 100%; height: 100%; max-height: 540px; object-fit: contain; }
.product-group-summary .product-device-details { margin: 12px 0 0; gap: 6px 14px; display: flex; flex-wrap: wrap; }
.product-group-summary .product-device-details > div { border: 0; padding: 0; display: flex; gap: 6px; font-size: .8rem; }
.product-unit-reference { color: var(--muted); font-size: .69rem; margin: 10px 0; }
.group-device { min-width: 0; }
.group-device small { overflow-wrap: anywhere; }
.sidecart { height: 100dvh; max-height: 100dvh; grid-template-rows: auto minmax(0, 1fr) auto; }
.sidecart__body { min-height: 0; overscroll-behavior: contain; }
.sidecart-item__media, .cart-item__image { background: #fff; }
.quantity button:disabled, .sidecart-item__controls button:disabled { opacity: .35; cursor: not-allowed; }
.cart-summary[hidden] { display: none !important; }
.finder-form { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.finder-form label { display: grid; gap: 8px; flex: 1 1 200px; font-size: .9rem; font-weight: 600; }
.finder-form select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px; font: inherit; }
.discovery-table { min-width: 0; width: 100%; }
.discovery-table th, .discovery-table td { white-space: normal; }

@media (max-width: 820px) {
  .home-featured .home-featured__rail { grid-auto-columns: 78vw; width: calc(100% + 18px); grid-template-columns: none; gap: 12px; padding: 2px 18px 12px 0; margin: 0; scroll-padding-inline: 0; }
  .home-featured-card { min-width: 0; }
  .home-featured { padding-block: 32px; }
  .home-page .most-wanted--first .most-wanted__rail { grid-auto-columns: 104px; width: calc(100% + 18px); margin: 0; gap: 12px; padding: 2px 18px 10px 0; scroll-padding-inline: 0; }
  .home-page [data-featured-products] .product-card--editorial { min-height: 0; }
  .home-page [data-featured-products] .product-card__media { min-height: 0; aspect-ratio: 1 / .9; }
  .product-group-visual { height: 260px; min-height: 0; padding: 10px; }
  .product-group-visual img { max-height: 240px; }
  .discovery-table th, .discovery-table td { padding: 12px 8px; font-size: .8rem; }
  .seo-hero .page-hero__aside { display: none; }
  .seo-hero { padding-block: 28px; }
  .seo-hero h1 { font-size: clamp(2rem, 8vw, 2.8rem); }
  .seo-collection { padding-block: 28px; }
}
