/* Page edges are owned by storefront-page-shell.css, shared with category pages. */
body#product #wrapper > .tvcmscontainer-layout > .container > .container > .row { margin-inline: 0; }
body#product #content-wrapper { padding-inline: 0; min-width: 0; }
body#product .tvprduct-image-info-wrapper { padding-inline: 0; }

/* The page shell already supplies a 16px mobile gutter. Do not add column gutters. */
@media (max-width: 767px) {
  body#product .tvprduct-image-info-wrapper > .tv-product-page-image,
  body#product .tvprduct-image-info-wrapper > .tv-product-page-content {
    padding-inline: 0;
  }
}

/* The geometry adapter keeps the closed launcher above visible purchase controls. */
@media (max-width: 991px) {
  body#product .motarea-aia:not(.motarea-aia--open) {
    transform: translateY(calc(0px - var(--pdp-agent-clearance, 0px)));
    transition: none;
  }
}

/* Availability shares the adaptive delivery line and follows the owner decision. */
body#product .tv-product-page-content .pdp-availability:not([hidden]) {
  color: #16833b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  flex: 0 0 auto;
}

/* The NACEX owner supplies the stronger delivery promise weight. */
body#product .tv-product-page-content .pdp-delivery-row--nacex .advstockmanager-eta-date,
body#product .tv-product-page-content .nacex-pdp-quote__price {
  font-weight: 600;
}

/* Compact variants and manual relations share this media container in the buybox. */
body#product .pdp-buybox-secondary-slot .motarea-product-variants__media {
  background: #fff;
}

/* A single buybox group uses all four summary rows. Multiple groups keep two each.
   Scope this to collapsed summaries so the owners retain expansion/pagination. */
body#product .pdp-buybox-secondary-slot:not(.pdp-buybox-secondary-slot--dual):not(:has(.pspr-buybox-group ~ .pspr-buybox-group)) .motarea-product-variants__block:not(.pspr-buybox-group--expanded) > .motarea-product-variants__list > .motarea-product-variants__row:nth-child(-n+4):not([hidden]) {
  display: grid !important;
}

/* There is nothing to expand when the four-row summary contains every choice. */
body#product .pdp-buybox-secondary-slot:not(.pdp-buybox-secondary-slot--dual):not(:has(.pspr-buybox-group ~ .pspr-buybox-group)) .motarea-product-variants__block:not(:has(> .motarea-product-variants__list > .motarea-product-variants__row:nth-child(5))) > .motarea-product-variants__more {
  display: none !important;
}

/* The owner is already paging four rows, so a summary toggle adds no choices. */
body#product .pspr-buybox-group[data-pdp-direct-pagination="1"] > [data-pspr-more] {
  display: none !important;
}

/* Keep six products per batch, in two columns until three fit comfortably. */
body#product .tvproduct-tabs-related-col {
  container-type: inline-size;
  container-name: pdp-recommendations;
  min-width: 0;
}
@media (min-width: 768px) {
  body#product .tvproduct-tabs-related-col .pspr-carousel__page,
  body#product .tvproduct-tabs-related-col .pspr-lazy-placeholder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  @container pdp-recommendations (min-width: 744px) {
    body#product .tvproduct-tabs-related-col .pspr-carousel__page,
    body#product .tvproduct-tabs-related-col .pspr-lazy-placeholder {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }
}
