/* Shared product-page surface and hero geometry.
   Availability and pack contents may change behaviour, never the page shell. */
html:has(body#product #main.wg-pack-page),
html body#product:has(#main.wg-pack-page),
html body#product:has(#main.wg-pack-page) #wrapper,
html body#product:has(#main.wg-pack-page) #wrapper > .container,
html body#product:has(#main.wg-pack-page) #content-wrapper,
html body#product:has(#main.wg-pack-page) #main.wg-pack-page {
  background: #fff !important;
}

html body#product #main.wg-pack-page .wg-pack-hero {
  align-items: start !important;
}

@media (min-width: 992px) {
  html body#product #main.wg-pack-page .wg-pack-gallery {
    height: 632px !important;
    min-height: 632px !important;
    max-height: 632px !important;
    align-self: start !important;
  }
}

/* Mobile product pages remain complete storefront pages. Recommendations,
   trust benefits, newsletter and footer must not be cut from the document. */
@media (max-width: 767px) {
  html body#product #main > :is(.wg-prod-cross, .wg-prod-same, .wg-recent) {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  html body#product footer#footer.js-footer {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  html body#product footer#footer.js-footer > :is(.wg-trustbar, .wg-newsletter, footer.wg-footer) {
    display: block !important;
  }
}

@media (max-width: 575px) {
  html body#product #main > .wg-recent {
    padding: 32px 16px !important;
    overflow: hidden !important;
  }

  html body#product #main > .wg-recent .wg-recent__head {
    margin: 0 0 22px !important;
  }

  html body#product #main > .wg-recent .wg-recent__grid {
    display: grid !important;
    width: calc(100% + 16px) !important;
    margin: 0 !important;
    padding: 0 16px 10px 0 !important;
    grid-template-columns: none !important;
    grid-auto-flow: column !important;
    grid-auto-columns: 174px !important;
    gap: 10px !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain !important;
    scroll-snap-type: inline mandatory !important;
    scrollbar-width: none !important;
  }

  html body#product #main > .wg-recent .wg-recent__grid::-webkit-scrollbar {
    display: none !important;
  }

  html body#product #main > .wg-recent .wg-recent__card {
    width: 174px !important;
    min-width: 174px !important;
    max-width: 174px !important;
    height: 282px !important;
    min-height: 282px !important;
    max-height: 282px !important;
    scroll-snap-align: start !important;
    border-radius: 12px !important;
  }

  html body#product #main > .wg-recent .wg-recent__media {
    height: 150px !important;
    min-height: 150px !important;
    max-height: 150px !important;
  }

  html body#product #main > .wg-recent .wg-recent__media img {
    width: 110px !important;
    height: 132px !important;
    object-fit: contain !important;
  }

  html body#product #main > .wg-recent .wg-recent__body {
    height: 132px !important;
    min-height: 132px !important;
    max-height: 132px !important;
    padding: 10px !important;
    gap: 4px !important;
  }

  html body#product #main > .wg-recent .wg-recent__brand {
    font-size: 9px !important;
    line-height: 12px !important;
  }

  html body#product #main > .wg-recent .wg-recent__name {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    overflow: hidden !important;
    font-size: 13px !important;
    line-height: 17px !important;
  }

  html body#product #main > .wg-recent .wg-recent__price {
    padding-top: 0 !important;
    font-size: 20px !important;
    line-height: 23px !important;
  }

  html body#product #main.wg-pack-page .wg-pack-gallery {
    width: 390px !important;
    height: 340px !important;
    min-height: 340px !important;
    max-height: 340px !important;
    margin: 0 !important;
    align-self: start !important;
  }

  html body#product #main.wg-pack-page .wg-pack-summary {
    margin-top: 0 !important;
    background: #fff !important;
  }
}
