/* Rewaa Phase 2B: scoped gallery behavior, after 42.5 and 2A.
   Deliberately does not change the main image dimensions, fit, heading, or header. */
@media (min-width: 851px) {
  .p384-page .product-hero-grid > .p384-gallery {
    top: var(--rw-p2b-sticky-top, calc(var(--header-h, 68px) + 16px));
  }
}
/* The zoom setting in the product editor must not leave a dead zoom button. */
.p384-page .p384-gallery[data-zoom="0"] [data-p384-open] {
  display: none;
}
.p384-page .p384-gallery[data-zoom="0"] .p384-main,
.p384-page .p384-gallery[data-zoom="0"] .p384-main > img {
  cursor: default;
}
/* Single-image products must not show empty previous/next controls. */
.p384-page .p384-lightbox-stage > button[hidden] {
  display: none !important;
}
.p384-page .p384-lightbox-stage.rw-p2b-single-image {
  grid-template-columns: minmax(0, 1fr);
}
.p384-page .p384-lightbox-stage.rw-p2b-single-image .p384-lightbox-image-wrap {
  grid-column: 1;
}
/* Constrain touch/scroll inside the native fullscreen viewer only while open. */
html.rw-p2b-modal-open,
html.rw-p2b-modal-open body {
  overflow: hidden;
  overscroll-behavior: none;
}
.p384-page .p384-lightbox[open] {
  overscroll-behavior: contain;
}
@media (max-width: 850px) {
  .p384-page .p384-gallery .p384-thumbs {
    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;
  }
  .p384-page .p384-gallery .p384-thumbs > .gallery-thumb {
    scroll-snap-align: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  .p384-page .p384-gallery .p384-thumbs {scroll-behavior: auto;}
}
