/* Desktop storefront tiers. The wrap values are in layout pixels, before root
   zoom. Root zoom also scales fixed UI, native form controls and pixel gaps.
   Fixed, curated rows only gain tracks when they have enough items to fill them. */
@media (min-width: 1200px) {
  :root {
    --wide-scale: 1;
    --wide-wrap: min(calc(100% - 56px), clamp(1240px, calc(25vw + 900px), 1280px));
  }
  body, body:is(.category-page,.product-page) { --wrap: var(--wide-wrap); }
}
@media (min-width: 1536px) {
  :root { --wide-wrap: clamp(1280px, calc(62.5vw + 320px), 1320px); }
}
@media (min-width:1600px) {
  :root { --wide-wrap: min(calc(25vw + 920px), 1400px); }
  .breakdance #home .th-a, #home .th-a { grid-template-columns:repeat(6,minmax(0,1fr)); }
  .breakdance #home .th-a .bde-loop-item:nth-child(4) { display:contents; }
  #home .th-a .th-prods .pcard:nth-child(4) { display:flex; }
  .breakdance #home .ptabs-grid:has(.bde-loop-item:nth-child(6)),
  #ptabsGrid:has(>.pcard:nth-child(6)) { grid-template-columns:repeat(6,minmax(0,1fr)); }
}
@media (width < 1600px) {
  .breakdance #home .ptabs-grid .bde-loop-item:nth-child(n+6),
  #ptabsGrid > .pcard:nth-child(n+6) { display:none; }
}

@media (min-width:1600px) {
  .breakdance dialog.vmodal { width:calc(100vw / var(--wide-scale)); height:calc(100dvh / var(--wide-scale)); }
  .vmodal :is(.vm-in,.vm-phone) { max-height:calc(100dvh / var(--wide-scale) - 40px); }
  .breakdance .ar-receipt { width:min(100%,var(--wrap)); }
  .ar-products:has(>:nth-child(5)),
  .breakdance .av-related ul.products:has(>:nth-child(5)) { grid-template-columns:repeat(5,minmax(0,1fr)); }
}
@media (width < 1600px) {
  .ar-products > :nth-child(5), .breakdance .av-related ul.products > :nth-child(5) { display:none; }
}
@media (min-width:1920px) {
  .av-guide-row:has(>:nth-child(4)):not(:has(>:nth-child(5))),
  .gcards:has(>:nth-child(4)):not(:has(>:nth-child(5))) { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media (min-width:1600px) {
  /* Upsells are assigned per product. Keep short selections on their existing tracks. */
  .breakdance .upsells.products ul.products:has(>:nth-child(5)):not(:has(>:nth-child(6))) {
    display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:14px;
  }
  .breakdance .upsells.products ul.products:has(>:nth-child(5)):not(:has(>:nth-child(6))) > li.product {
    width:auto; min-width:0; margin:0;
  }
}

