/* Viewport height matters as much as width on laptops and rotated phones. */
.price-line strong,.price-line del { white-space:nowrap; }
/* Added products retain the whole portrait frame in cart and checkout. */
.cart-item .cart-thumb,
.checkout-page .checkout-item-thumb {
  height:auto;
  aspect-ratio:9 / 16;
  background:transparent;
  border:0;
  box-shadow:none;
}
.cart-item img.cart-thumb,
.checkout-page .checkout-item-thumb img {
  display:block;
  object-fit:contain;
  background:transparent;
  border:0;
  box-shadow:none;
}
/* Show the whole upsell frame in a portrait 9:16 preview in every layout. */
.upsell-item > .upsell-media {
  display:block;
  position:relative;
  width:48px;
  height:auto;
  aspect-ratio:9 / 16;
  min-width:0;
  padding:0;
  overflow:hidden;
  border:0;
  border-radius:6px;
  background:transparent;
  box-shadow:none;
}
.upsell-section .upsell-item > .upsell-media > img {
  display:block;
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:contain;
  object-position:center;
  border:0;
  border-radius:inherit;
  background:transparent;
  box-shadow:none;
}
.upsell-item > .upsell-media:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:3px;
}
.upsell-cards .upsell-item > .upsell-media { width:100%;height:auto; }
@media (max-width:480px) {
  .upsell-compact .upsell-item > .upsell-media {
    grid-column:1;
    grid-row:1 / 3;
    align-self:start;
    width:64px;
    height:auto;
    min-height:0;
  }
}
/* Surface prices must not inherit the green tint intended for media overlays. */
body[data-color="light"] { --old-price-color:#62626e; }
body[data-color="light"] :is(.upsell-item,.cart-item,.checkout-cart-item,.quantity-offer-price,.flow-price) del,
body[data-color="light"] [data-product-form] .price-line del[data-compare-price],
body[data-color="light"] .related-grid .price-line del {
  color:var(--old-price-color);
}
@media (max-width:380px) {
  body.theme-flow.store-page.view-grid .flow-main > [data-flow-feed] > .product-card .card-info {
    grid-template-columns:minmax(0,1fr) !important;
    row-gap:6px !important;
  }
  body.theme-flow.store-page.view-grid .flow-main > [data-flow-feed] > .product-card .price-line {
    grid-column:1 !important;
    grid-row:2 !important;
    flex-direction:row;
    flex-wrap:wrap;
  }
  body.theme-flow.store-page.view-grid .flow-main > [data-flow-feed] > .product-card .buy-button {
    grid-column:1 !important;
    grid-row:3 !important;
    width:100%;
  }
}
@media (min-width:761px) {
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-container {
    --desktop-feed-height: clamp(120px,calc(100dvh - var(--flow-head) - 106px),900px);
  }
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-detail {
    height: var(--flow-video-height,var(--desktop-feed-height));
  }
}
@media (min-width:761px) and (max-height:550px) {
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-main > [data-flow-feed] {
    height: var(--desktop-feed-height);
    max-width: none;
    aspect-ratio: auto;
  }
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-main > [data-flow-feed] > .product-card .card-info { display:none; }
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-detail {
    gap:12px;
    overflow-y:auto;
    overscroll-behavior-y:contain;
  }
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-detail > h2 { font-size:22px; }
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-description-preview { min-height:90px; padding-top:12px; }
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-description-excerpt { overscroll-behavior-y:auto; }
}
@media (max-width:760px) {
  body.theme-flow.store-page .flow-main > [data-flow-feed] { min-height:0; }
}
@media (max-width:760px) and (max-height:500px) {
  body.theme-flow.store-page .flow-main > [data-flow-feed] .product-video { object-fit:contain; }
  body.theme-flow.store-page:not(.view-grid) .flow-main > [data-flow-feed] > .product-card .card-info { bottom:12px; }
  body.theme-flow.store-page:not(.view-grid) .flow-main > [data-flow-feed] > .product-card h3 { font-size:18px; line-height:1.25; }
  body.theme-flow.store-page.view-grid .flow-main > [data-flow-feed] { --compact-row-height:max(210px,calc(var(--feed-height) - 16px)); }
  .product-page .product-detail,.product-page.product-layout-below .product-detail {
    max-width:none;
    grid-template-columns:minmax(130px,.65fr) minmax(0,1fr);
    grid-template-areas:"media heading" "media details";
    grid-template-rows:auto 1fr;
    gap:12px 20px;
  }
  .product-page .product-detail > .product-media,.product-page.product-layout-below .product-detail > .product-media {
    position:sticky;
    top:calc(var(--flow-head,58px) + 12px);
    max-width:min(100%,calc((100dvh - var(--flow-head,58px) - var(--flow-nav,66px) - 24px) * 9 / 16));
  }
  .product-page .product-heading h1 { font-size:22px; }
  .product-page .product-media .video-topbar { flex-wrap:wrap; gap:4px; }
  .product-page .product-media .video-tools { right:6px; bottom:8px; gap:4px; }
  .product-page .product-media .video-tools :is(button,a) { width:32px; height:32px; padding:6px; }
  .product-page .product-description .product-purchase { padding:12px; }
}

/* Grow the storefront with large desktops instead of freezing it at laptop widths.
   The saved design width remains the baseline; video size also respects height. */
@media (min-width:1601px) {
  body:is(.store-page,.product-page) {
    --wide-shell-width:calc(var(--max,1440px) + 40px + (100vw - 1600px) * .8);
    --wide-rail-width:clamp(190px,calc(190px + (100vw - 1600px) * .06),320px);
    --wide-gap:clamp(42px,2.6vw,80px);
    --wide-gutter:clamp(36px,2.25vw,80px);
    --wide-copy-size:clamp(15px,calc(15px + (100vw - 1600px) * .004),22px);
    --wide-heading-size:clamp(38px,calc(38px + (100vw - 1600px) * .006),52px);
    --wide-media-limit:calc(420px + (100vw - 1600px) * .35);
  }
  body:is(.store-page,.product-page) .site-header {
    padding-inline:max(var(--wide-gutter),calc((100% - var(--wide-shell-width)) / 2 + var(--wide-gutter)));
  }
  body.store-page .store-container,
  body.theme-flow.store-page .flow-container,
  body.theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-container,
  .product-page.has-store-sidebar .product-shell,
  .product-page:not(.has-store-sidebar) .product-container {
    max-width:var(--wide-shell-width);
    padding-inline:var(--wide-gutter);
  }
  body:is(.store-page,.product-page) #store-footer .store-footer-row {
    max-width:var(--wide-shell-width);
    padding-inline:var(--wide-gutter);
  }
  .product-page.has-store-sidebar .product-shell {
    grid-template-columns:var(--wide-rail-width) minmax(0,1fr);
    gap:var(--wide-gap);
  }
  .product-page .product-container {
    --wide-product-media:min(44%,var(--wide-media-limit),calc((100dvh - var(--product-sticky-top) - 88px) * 9 / 16));
  }
  .product-page:not(.product-layout-below) .product-detail,
  .product-page.has-store-sidebar:not(.product-layout-below) .product-detail {
    grid-template-columns:minmax(260px,var(--wide-product-media)) minmax(0,1fr);
    column-gap:var(--wide-gap);
  }
  .product-page .product-detail > .product-media {
    max-width:min(100%,var(--wide-media-limit),calc((100dvh - var(--product-sticky-top) - 88px) * 9 / 16));
  }
  .product-page.product-layout-below .product-detail {
    grid-template-columns:minmax(0,min(100%,calc(750px + (100vw - 1600px) * .35)));
  }
  .product-page.product-layout-below .product-detail > .product-media {
    max-width:min(80%,calc(400px + (100vw - 1600px) * .35),calc((100dvh - var(--product-sticky-top) - 88px) * 9 / 16));
  }
  .product-page .product-heading h1,
  .product-page.has-store-sidebar .product-heading h1 {
    font-size:var(--wide-heading-size);
  }
  body:is(.store-page,.product-page) .prose {
    font-size:var(--wide-copy-size);
  }
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-container {
    --desktop-feed-height:clamp(120px,calc(100dvh - var(--flow-head) - 106px),calc(900px + (100vw - 1600px) * .55));
  }
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-layout {
    grid-template-columns:var(--wide-rail-width) minmax(280px,var(--desktop-media-width)) minmax(320px,1fr);
    gap:var(--wide-gap);
  }
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-detail > h2 {
    font-size:var(--wide-heading-size);
  }
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-description-excerpt {
    font-size:var(--wide-copy-size);
  }
  body.theme-flow.store-page.view-grid .flow-layout,
  .theme-flow.store-page:not([data-columns="1"]):not(.view-single) .flow-layout {
    grid-template-columns:var(--wide-rail-width) minmax(0,1fr);
    gap:var(--wide-gap);
  }
  body:is(.store-page,.product-page) .flow-rail :is(.flow-discovery,.flow-categories) > a {
    font-size:clamp(13px,calc(13px + (100vw - 1600px) * .0025),18px);
  }
  body.store-page:not(.theme-flow):is(.view-single,[data-columns="1"]) .product-grid[data-catalog-stream] > .product-card {
    max-width:min(100%,calc(920px + (100vw - 1600px) * .8));
    grid-template-columns:minmax(260px,min(48%,calc((100dvh - 160px) * 9 / 14))) minmax(0,1fr);
    gap:var(--wide-gap);
  }
}

/* Keep secondary actions compact at every viewport width. */
.product-page .product-secondary-actions {
  justify-items:center;
}
.product-page .product-secondary-actions .button {
  width:auto;
  min-width:150px;
  max-width:100%;
}
@media (max-width:760px) {
  .product-page .product-description .product-actions :is([data-add-product],[data-order-now]) {
    max-width:320px;
    justify-self:center;
  }
}

/* One shared centre line for readable content and compact purchasing controls. */
@media (min-width:761px) {
  body:is(.store-page,.product-page) {
    --detail-copy-width:clamp(680px,calc(680px + (100vw - 1600px) * .15),900px);
  }
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-detail > h2,
  .product-page .product-detail > .product-heading {
    width:100%;
    max-width:var(--detail-copy-width);
    justify-self:center;
    text-align:center;
    text-wrap:balance;
  }
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-purchase {
    width:100%;
    max-width:680px;
    justify-self:center;
    flex-direction:row;
    flex-wrap:nowrap;
    align-items:center;
    justify-content:center;
    gap:clamp(16px,1.5vw,28px);
    padding:20px;
  }
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-price {
    flex:0 1 auto;
    justify-content:center;
  }
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-buy {
    flex:0 1 240px;
    align-self:center;
    width:240px;
    max-width:100%;
    min-width:128px;
    min-height:50px;
  }
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-description-preview {
    width:100%;
    max-width:var(--detail-copy-width);
    justify-self:center;
  }
  .theme-flow.store-page:not(.view-grid):is(.view-single,[data-columns="1"]) .flow-description-excerpt,
  .product-page .product-description-content .prose {
    margin-inline:auto;
    overflow-wrap:anywhere;
  }
  .product-page .product-description .product-purchase {
    width:100%;
    max-width:680px;
    margin-inline:auto;
    padding:20px;
  }
  .product-page .product-price-stock .price-line.large {
    justify-content:center;
  }
  .product-page .product-description .product-actions {
    grid-template-columns:112px minmax(0,320px);
    justify-content:center;
  }
  .product-page .product-description .product-actions [data-add-product] {
    min-height:50px;
  }
  .product-page .product-description > :is(.product-description-content,.product-attributes,.product-reference,.inline-quick) {
    width:100%;
    max-width:var(--detail-copy-width);
    margin-inline:auto;
  }
  .product-page .product-secondary-actions {
    width:100%;
    max-width:680px;
    margin-inline:auto;
  }
}
