/* Product gallery: main + thumbs + Amazon magnifier */
.pgallery {
  display: grid;
  gap: 0.75rem;
  position: relative;
  z-index: 4;
}
.pgallery__main {
  position: relative;
  margin: 0;
}
.pgallery__stage {
  position: relative;
  overflow: hidden;
  cursor: crosshair;
  border-radius: 2px;
  background: rgba(127, 127, 127, 0.08);
  aspect-ratio: 4 / 5;
}
.pgallery__stage img,
.pgallery__stage [data-gallery-main] {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}
.pgallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  overflow: visible;
  padding-bottom: 0;
}
.pgallery__thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 90px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 2px;
  background: rgba(127, 127, 127, 0.1);
  cursor: pointer;
  overflow: hidden;
}
.pgallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pgallery__thumb.is-active {
  border-color: currentColor;
}
.pgallery__thumb:hover {
  opacity: 0.9;
}

.zoom__lens {
  position: absolute;
  border: 1px solid rgba(0, 0, 0, 0.4);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  pointer-events: none;
  z-index: 2;
}
.zoom__result {
  position: absolute;
  left: calc(100% + 12px);
  top: 0;
  width: min(440px, 36vw);
  height: min(440px, 36vw);
  border: 1px solid rgba(0, 0, 0, 0.14);
  background-repeat: no-repeat;
  background-color: #fff;
  z-index: 40;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}
body.atelier .zoom__result {
  background-color: var(--bg, #0e0d0c);
  border-color: var(--line, rgba(255, 255, 255, 0.14));
}

@media (max-width: 1100px) {
  .zoom__result {
    left: 50%;
    top: auto;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    width: min(280px, 80%);
    height: min(280px, 80%);
  }
}

@media (max-width: 899px), (hover: none) {
  .zoom__lens,
  .zoom__result { display: none !important; }
  .pgallery__stage { cursor: zoom-in; }
}

.zoom-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.zoom-lightbox[hidden] { display: none !important; }
.zoom-lightbox img {
  max-width: min(100%, 1100px);
  max-height: 90vh;
  object-fit: contain;
}
.zoom-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}
