/* Product Explorer — 3D lightbox + magnifier */

body.pe-lb-open {
  overflow: hidden;
}

.pe-lb {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.pe-lb.is-open {
  opacity: 1;
  pointer-events: auto;
}

.pe-lb__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 40%, rgba(155, 164, 74, 0.16), transparent 60%),
    rgba(5, 5, 4, 0.88);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.pe-lb__stage {
  position: relative;
  z-index: 1;
  width: min(1100px, 94vw);
  perspective: 1400px;
  perspective-origin: 50% 45%;
}

.pe-lb__card {
  position: relative;
  border-radius: 22px;
  padding: 14px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02) 45%, rgba(155, 164, 74, 0.08)),
    rgba(14, 14, 12, 0.94);
  border: 1px solid rgba(196, 205, 110, 0.28);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 40px 80px rgba(0, 0, 0, 0.55),
    0 12px 36px rgba(155, 164, 74, 0.12);
  transform-style: preserve-3d;
  transform: rotateX(10deg) scale(0.92);
  transition: transform 0.45s cubic-bezier(0.22, 0.8, 0.2, 1), opacity 0.3s ease;
  will-change: transform;
}

.pe-lb.is-open .pe-lb__card {
  transform: rotateX(0deg) scale(1);
}

.pe-lb__card.is-swap {
  opacity: 0.72;
  transform: rotateY(8deg) scale(0.98);
}

.pe-lb__media {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #0a0908;
  aspect-ratio: 16 / 10;
  max-height: min(72vh, 720px);
  cursor: crosshair;
  touch-action: none;
}

.pe-lb__zoom {
  width: 100%;
  height: 100%;
  transform-origin: center center;
  will-change: transform;
  transition: transform 0.08s linear;
}

.pe-lb.is-zoomed .pe-lb__zoom {
  transition: none;
}

.pe-lb__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.pe-lb__lens {
  position: absolute;
  width: clamp(120px, 22vw, 180px);
  height: clamp(120px, 22vw, 180px);
  border-radius: 50%;
  border: 2px solid rgba(196, 205, 110, 0.85);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 12px 28px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 2;
}

.pe-lb.is-magnify .pe-lb__lens {
  opacity: 1;
  transform: scale(1);
}

.pe-lb__cap {
  margin: 12px 6px 2px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(245, 240, 232, 0.7);
  line-height: 1.4;
}

.pe-lb__close,
.pe-lb__nav {
  position: absolute;
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(196, 205, 110, 0.35);
  background: rgba(12, 12, 10, 0.75);
  color: #f5f0e8;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.pe-lb__close:hover,
.pe-lb__nav:hover {
  background: rgba(155, 164, 74, 0.28);
  border-color: rgba(196, 205, 110, 0.7);
}

.pe-lb__close:active,
.pe-lb__nav:active {
  transform: scale(0.94);
}

.pe-lb__close svg,
.pe-lb__nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pe-lb__close {
  top: max(14px, env(safe-area-inset-top));
  inset-inline-end: max(14px, env(safe-area-inset-right));
}

.pe-lb__nav--prev {
  left: max(10px, env(safe-area-inset-left));
  top: 50%;
  transform: translateY(-50%);
}

.pe-lb__nav--next {
  right: max(10px, env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
}

.pe-lb__nav--prev:active,
.pe-lb__nav--next:active {
  transform: translateY(-50%) scale(0.94);
}

.pe-lb__hint {
  position: absolute;
  z-index: 2;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.45);
  pointer-events: none;
  text-align: center;
  max-width: 90vw;
}

.pe-lb__tools {
  position: absolute;
  z-index: 3;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(12, 12, 10, 0.72);
  border: 1px solid rgba(196, 205, 110, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pe-lb__tool {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #f5f0e8;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.pe-lb__tool:hover {
  background: rgba(155, 164, 74, 0.28);
}

.pe-lb__tool svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pe-lb__zoom-lbl {
  min-width: 3.2em;
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: rgba(245, 240, 232, 0.75);
}

.pe-slide__img {
  cursor: zoom-in;
}

@media (max-width: 767px) {
  .pe-lb__card { padding: 10px; border-radius: 18px; }
  .pe-lb__media {
    aspect-ratio: 4 / 3;
    max-height: min(62vh, 520px);
  }
  .pe-lb__nav { width: 42px; height: 42px; }
  .pe-lb__lens {
    width: 130px;
    height: 130px;
  }
  .pe-lb__hint { font-size: 10px; letter-spacing: 0.14em; }
}

@media (prefers-reduced-motion: reduce) {
  .pe-lb,
  .pe-lb__card,
  .pe-lb__lens {
    transition: none;
  }
  .pe-lb.is-open .pe-lb__card {
    transform: none;
  }
}
