/* GX-SP-02 gallery geometry shared by product hero sections. */
.glx-product-hero-standard__gallery > :is(
  .gx-main, .glx-led01__main-media, .glx12f__main-media,
  .glx-led12e__main-media, .lp10-gallery__stage, .glx-ae-main-media,
  .wd3__main-media, .glx-e20-gallery__stage, .glx-wsh__image-box,
  .glx-part-v3__main, .glx-pp20v2-gallery__stage
) {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 1;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: #fff;

  > img {
    position: static;
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    padding: 0;
    object-fit: contain;
  }
}

:is(
  .gx-thumbs, .glx-led01__thumbs, .glx12f__thumbs,
  .glx-led12e__thumbs, .wd3__thumbs, .lp10-gallery__thumbs,
  .glx-wsh__thumbs, .glx-e20-gallery__thumbs, .glx-ae-gallery-strip-v3,
  .glx-part-v3__thumbs, .glx-pp20v2-gallery__thumbs
) {
  --glx-gallery-columns: 5;
  --glx-gallery-gap: 12px;
  display: flex;
  align-items: flex-start;
  gap: var(--glx-gallery-gap);
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;

  &::-webkit-scrollbar { display: none; }

  > button {
    box-sizing: border-box;
    flex: 0 0 calc((100% - (var(--glx-gallery-columns) - 1) * var(--glx-gallery-gap)) / var(--glx-gallery-columns));
    width: calc((100% - (var(--glx-gallery-columns) - 1) * var(--glx-gallery-gap)) / var(--glx-gallery-columns));
    min-width: 0;
    height: auto;
    min-height: 0;
    aspect-ratio: 1;
    align-self: flex-start;
    overflow: hidden;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
    cursor: pointer;
    scroll-snap-align: start;

    > img {
      display: block;
      width: 100%;
      height: 100%;
      aspect-ratio: 1;
      object-fit: contain;
      background: #fff;
    }

    &:is(.active, .is-active) { border-color: var(--glx-purple, #6d28d9); }
    &:hover:not(.active, .is-active) { border-color: var(--glx-purple-line, #e3d7f2); }
    &:focus-visible { outline: 2px solid var(--glx-purple, #6d28d9); outline-offset: 2px; }
  }
}

.gx-thumbs > .gx-thumb > img { object-fit: cover; }

.glx-product-gallery-nav {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}
.glx-product-gallery-nav--single { grid-template-columns: minmax(0, 1fr); }
.glx-product-gallery-nav--single > :is(.glx-part-v3__thumbs, .glx-pp20v2-gallery__thumbs) {
  width: calc(100% - 112px);
  margin-inline: auto;
}
.glx-product-gallery-nav__arrow {
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #532497;
  font: inherit;
  font-size: 15.5px;
  line-height: 1;
  cursor: pointer;
}
.glx-product-gallery-nav__arrow:focus-visible { outline: 2px solid #6635df; outline-offset: 2px; }

:is(.gx-gallery-nav, .glx-led12e__thumb-row, .lp10-gallery__rail, .wd3__thumb-strip, .glx-e20-gallery__rail, .glx-wsh__gallery-row) {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}
:is(.gx-arrow, .glx-led12e__thumb-arrow, .lp10-gallery__arrow, .wd3__arrow, .glx-e20-gallery__arrow, .glx-wsh__gallery-arrow) {
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  place-items: center;
}

/* Stock Shopify gallery, for products that do not use a Glonyx hero. */
.thumbnail-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.thumbnail-list::-webkit-scrollbar { display: none; }
.thumbnail-list__item {
  flex: 0 0 calc((100% - 48px) / 5);
  width: calc((100% - 48px) / 5);
  aspect-ratio: 1;
  scroll-snap-align: start;
}
.thumbnail-list__item .thumbnail {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 12px;
}
.thumbnail-list__item .thumbnail[aria-current] { border-color: var(--glx-purple, #6d28d9); }

@media (max-width: 749px) {
  .glx-product-gallery-nav__arrow {
    font-size: 15px;
  }
  :is(.gx-thumbs, .glx-led01__thumbs, .glx12f__thumbs, .glx-led12e__thumbs, .wd3__thumbs, .lp10-gallery__thumbs, .glx-wsh__thumbs, .glx-e20-gallery__thumbs, .glx-ae-gallery-strip-v3, .glx-part-v3__thumbs, .glx-pp20v2-gallery__thumbs) {
    --glx-gallery-columns: 4;
  }
  .thumbnail-list__item {
    flex-basis: calc((100% - 36px) / 4);
    width: calc((100% - 36px) / 4);
  }
}
