/* ---------- 商品图片灯箱（782 预览 → 原图 + 上一张/下一张） ---------- */

.product-gallery__zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.product-gallery__zoom .product-gallery__image {
  transition: opacity 0.2s ease;
}

.product-gallery__zoom:hover .product-gallery__image {
  opacity: 0.94;
}

.product-gallery__zoom:focus-visible {
  outline: 3px solid #1769aa;
  outline-offset: 4px;
}

/* 详情富文本里的图片同样可点击放大 */
.product-description__content img[data-lightbox-group] {
  cursor: zoom-in;
}

.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 17, 17, 0.93);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.media-lightbox[hidden] {
  display: none;
}

.media-lightbox.is-open {
  opacity: 1;
}

.media-lightbox__figure {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
}

.media-lightbox__image {
  width: auto;
  height: auto;
  max-width: min(94vw, 1400px);
  max-height: 86vh;
  background: #111;
  object-fit: contain;
  transition: opacity 0.18s ease;
}

.media-lightbox__image.is-loading {
  opacity: 0.55;
}

.media-lightbox__spinner {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: media-lightbox-spin 0.9s linear infinite;
  pointer-events: none;
}

.media-lightbox__spinner[hidden] {
  display: none;
}

@keyframes media-lightbox-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.media-lightbox__close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.media-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.media-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.media-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

.media-lightbox__nav[hidden] {
  display: none;
}

.media-lightbox__nav--prev {
  inset-inline-start: 12px;
}

.media-lightbox__nav--next {
  inset-inline-end: 12px;
}

.media-lightbox__counter {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  margin: 0;
  color: #fff;
  font-size: 0.8125rem;
  text-align: center;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .media-lightbox,
  .media-lightbox__image {
    transition: none;
  }

  .media-lightbox__spinner {
    animation: none;
  }
}
