/* Product image viewer: keep the original image sharp while allowing detail inspection. */
.product-gallery-section .thumbnails {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  overflow: visible;
  padding-bottom: 0;
}

.product-gallery-section .thumbnail {
  width: 100%;
  height: auto;
  min-width: 0;
  aspect-ratio: 1;
  flex: none;
  border: 1px solid #dce3e9;
  border-radius: 9px;
}

.product-gallery-section .thumbnail img {
  display: block;
  object-fit: contain;
  background: #fff;
}

@media (max-width: 1024px) {
  .product-gallery-section .thumbnails {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }
}

.lightbox {
  cursor: default;
  overscroll-behavior: contain;
  z-index: 20000;
}

.lightbox-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
}

.lightbox-stage.is-zoomed {
  cursor: grab;
}

.lightbox-stage.is-zoomed:active {
  cursor: grabbing;
}

.lightbox-stage #lightbox-image {
  display: block;
  max-width: min(90vw, 1600px);
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  animation: none;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

.lightbox-zoom-controls {
  position: absolute;
  left: 22px;
  bottom: 24px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: rgba(0, 0, 0, .58);
  border-radius: 24px;
  padding: 4px;
}

.lightbox-zoom-controls button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-zoom-controls button:hover,
.lightbox-zoom-controls button:focus-visible {
  background: rgba(255, 255, 255, .22);
}

.lightbox-zoom-controls span {
  min-width: 45px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}

.lightbox-close {
  border: 0;
  background: none;
}

@media (max-width: 768px) {
  .lightbox-stage #lightbox-image {
    max-width: 96vw;
    max-height: 78vh;
  }

  .lightbox-zoom-controls {
    left: 12px;
    bottom: 12px;
  }

  .lightbox-counter {
    bottom: 18px;
  }
}
