/* Fill the existing desktop gallery column beside the product information. */
@media (min-width: 981px) {
  .pdp-layout > .pdp-gallery {
    --rw-pdp-gallery-top: calc(var(--rw-pdp-header-height, var(--rw-header, 124px)) + 16px);
    --rw-pdp-gallery-space: max(1px, calc(100dvh - var(--rw-pdp-gallery-top) - 16px));
    position: sticky;
    top: var(--rw-pdp-gallery-top);
    align-self: start;
    justify-self: start;
    /* Use the whole grid column; viewport height must not leave an empty column. */
    width: 100%;
    min-height: 0;
    align-items: stretch;
  }
  .pdp-layout > .pdp-gallery > .pdp-image-stage {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    min-height: 0;
  }
  .pdp-layout > .pdp-gallery > .pdp-thumbnails {
    /* The stage determines the row height, even for very long photo rails. */
    contain: size;
    min-height: 0;
    max-height: none;
    align-self: stretch;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .pdp-layout > .pdp-gallery > .pdp-thumbnails > .pdp-thumbnail { flex: 0 0 auto; }
  .pdp-layout > .pdp-gallery > .pdp-thumbnails::-webkit-scrollbar { display: none; width: 0; height: 0; }
  .pdp-layout > .pdp-gallery .pdp-image-scroll {
    /* Thumbnail buttons still scroll programmatically. Wheel scrolls the page. */
    overflow: hidden;
  }
}
