/* Shared product media gallery. Loaded after tenant CSS so gallery mechanics cannot be reset. */
.product-detail-gallery .product-gallery-stage,
.product-media-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f1f5f9;
}

.product-media-gallery,
.product-media-gallery--utility {
  overflow: hidden;
  background: #fff;
}

.product-media-track {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.product-detail-gallery .product-gallery-stage .product-media-track,
.product-media-stage .product-media-track {
  height: 100%;
}

.product-media-slide {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  height: 100%;
  cursor: zoom-in;
  touch-action: pan-y pinch-zoom;
}

.product-media-slide:focus-visible {
  outline: 3px solid rgba(22, 120, 189, 0.35);
  outline-offset: -6px;
}

.product-media-stage .product-media-image,
.product-detail-gallery .product-gallery-stage .product-media-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

.product-media-stage .product-image-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #cbd5e1;
  font-size: clamp(56px, 12vw, 118px);
  font-weight: 900;
}

.product-media-gallery--utility .gallery-nav,
.product-media-gallery--utility .product-zoom-button,
.product-detail-gallery .gallery-nav,
.product-detail-gallery .product-zoom-button {
  position: absolute;
  z-index: 12;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
  cursor: pointer;
}

.product-media-gallery--utility .gallery-nav,
.product-detail-gallery .gallery-nav {
  top: 50%;
  width: 46px;
  height: 46px;
  transform: translateY(-50%);
}

.product-media-gallery--utility .gallery-nav-prev,
.product-detail-gallery .gallery-nav-prev {
  left: 14px;
}

.product-media-gallery--utility .gallery-nav-next,
.product-detail-gallery .gallery-nav-next {
  right: 14px;
}

.product-media-gallery--utility .product-zoom-button,
.product-detail-gallery .product-zoom-button {
  right: 16px;
  bottom: 16px;
  width: 48px;
  height: 48px;
  cursor: zoom-in;
}

.product-media-gallery--utility .product-media-label,
.product-media-gallery--utility .product-media-count,
.product-detail-gallery .product-media-count {
  position: absolute;
  z-index: 12;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.product-media-gallery--utility .product-media-label {
  bottom: 16px;
  left: 16px;
  padding: 8px 12px;
  text-transform: uppercase;
}

.product-media-gallery--utility .product-media-count {
  top: 16px;
  right: 16px;
  padding: 8px 12px;
}

.product-detail-gallery .product-media-count {
  top: 16px;
  left: 16px;
  padding: 8px 12px;
}

.product-media-gallery--utility .product-gallery-thumbnails,
.product-detail-gallery .product-gallery-thumbnails {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.product-media-gallery--utility .product-gallery-thumbnails {
  border-top: 1px solid #e2e8f0;
  background: #fff;
  padding: 12px;
}

.product-detail-gallery .product-gallery-thumbnails {
  margin-top: 11px;
}

.product-media-gallery--utility .product-gallery-thumbnails::-webkit-scrollbar,
.product-detail-gallery .product-gallery-thumbnails::-webkit-scrollbar {
  display: none;
}

.product-media-gallery--utility .product-gallery-thumbnails button,
.product-detail-gallery .product-gallery-thumbnails button {
  position: relative;
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  min-width: 44px;
  min-height: 44px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #f1f5f9;
  cursor: pointer;
  opacity: 0.72;
}

.product-media-gallery--utility .product-gallery-thumbnails button:hover,
.product-media-gallery--utility .product-gallery-thumbnails button.is-active,
.product-detail-gallery .product-gallery-thumbnails button:hover,
.product-detail-gallery .product-gallery-thumbnails button.is-active {
  border-color: var(--brand, #16a34a);
  opacity: 1;
}

.product-media-gallery--utility .product-gallery-thumbnails img,
.product-detail-gallery .product-gallery-thumbnails img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-media-gallery--utility .product-gallery-thumbnails span {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #334155;
  font-size: 10px;
  font-weight: 900;
}

.product-media-gallery--utility .product-gallery-thumbnails .is-active span {
  background: var(--brand, #16a34a);
  color: #fff;
}

body .pswp img.pswp__img {
  max-width: none !important;
}

@media (max-width: 640px) {
  .product-media-gallery--utility .gallery-nav,
  .product-detail-gallery .gallery-nav {
    width: 42px;
    height: 42px;
  }

  .product-media-gallery--utility .product-gallery-thumbnails button,
  .product-detail-gallery .product-gallery-thumbnails button {
    flex-basis: 62px;
    width: 62px;
    height: 62px;
  }
}
