/**
 * Gallery sticky mode. The body class is assigned by the central PHP ID list.
 * Keep the summary in normal flow; the gallery uses native CSS sticky.
 */

.hob-ad-has-sticky-gallery.single-product div.product[id^="product-"] > .summary {
  position: static !important;
  top: auto;
  right: auto;
  left: auto;
  transform: none !important;
  transition: none;
  will-change: auto;
}

@media (min-width: 1201px) {
  .hob-ad-has-sticky-gallery.single-product div.product[id^="product-"] {
    display: grid;
    grid-template-columns: minmax(0, 1.37fr) minmax(0, 1fr);
    align-items: start;
    column-gap: clamp(32px, 4.4vw, 64px);
    overflow: visible;
  }

  .hob-ad-has-sticky-gallery.single-product div.product[id^="product-"]::before,
  .hob-ad-has-sticky-gallery.single-product div.product[id^="product-"]::after {
    display: none;
  }

  .hob-ad-has-sticky-gallery.single-product div.product[id^="product-"] > :not(.hob-ad-product-gallery):not(.summary) {
    grid-column: 1 / -1;
  }

  .hob-ad-has-sticky-gallery.single-product div.product[id^="product-"] > .hob-ad-product-gallery {
    position: sticky;
    top: var(--hob-ad-sticky-gallery-top, 160px);
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    float: none;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
    overflow: visible;
  }

  .hob-ad-has-sticky-gallery.single-product div.product[id^="product-"] > .summary {
    grid-column: 2;
    grid-row: 1;
    float: none;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  /* Longer galleries remain accessible within the available viewport height. */
  .hob-ad-has-sticky-gallery.single-product .hob-ad-product-gallery__main {
    max-height: var(--hob-ad-sticky-gallery-height, calc(100dvh - 184px));
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    border-radius: var(--hob-ad-radius-large, 16px);
  }

  .hob-ad-has-sticky-gallery.single-product .hob-ad-product-gallery__main-slide {
    max-height: var(--hob-ad-sticky-gallery-height, calc(100dvh - 184px));
  }
}

@media (max-width: 1200px) {
  .hob-ad-has-sticky-gallery.single-product div.product[id^="product-"] > .hob-ad-product-gallery {
    position: static;
    top: auto;
  }
}
