/* ==========================================================================
   WSL Product Zoom — desktop lens zoom + mobile pinch/fullscreen viewer
   File: css/wsl-zoom.css
   ========================================================================== */

.wsl-zoom-wrapper {
  position: relative;
  overflow: visible;
  cursor: zoom-in;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.wsl-zoom-wrapper img.wsl-zoom-img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none; /* lens/wrapper handles events, avoids native drag ghost */
}

/* Little "zoom" badge hint, bottom-right of the main image */
.wsl-zoom-badge {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  pointer-events: none;
  z-index: 5;
}

/* -------------------- Desktop hover lens -------------------- */
.wsl-zoom-lens {
  position: absolute;
  width: 160px;
  height: 160px;
  background-color: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.25);
  pointer-events: none;
  display: none;
  z-index: 6;
}

.wsl-zoom-result {
  position: absolute;
  top: 0;
  left: calc(100% + 24px);
  width: 480px;
  height: 480px;
  max-width: 40vw;
  background-color: #fff;
  background-repeat: no-repeat;
  border: 1px solid #e5e5e5;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  display: none;
  z-index: 50;
}

/* Only show hover-lens UI on devices that actually support hover */
@media (hover: none), (pointer: coarse) {
  .wsl-zoom-lens,
  .wsl-zoom-result {
    display: none !important;
  }
}

/* -------------------- Fullscreen viewer (desktop click + mobile tap) -------------------- */
.wsl-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 99999;
  display: none;
  flex-direction: column;
  touch-action: none;
}

.wsl-viewer.wsl-viewer-active {
  display: flex;
}

.wsl-viewer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  color: #fff;
  font-size: 13px;
  flex: 0 0 auto;
}

.wsl-viewer-counter {
  opacity: 0.8;
}

.wsl-viewer-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wsl-viewer-close:hover { background: rgba(255, 255, 255, 0.22); }

.wsl-viewer-stage {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wsl-viewer-track {
  display: flex;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.wsl-viewer-slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.wsl-viewer-slide img {
  max-width: 100%;
  max-height: 100%;
  will-change: transform;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
}

.wsl-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.wsl-viewer-nav:hover { background: rgba(255, 255, 255, 0.22); }
.wsl-viewer-prev { left: 16px; }
.wsl-viewer-next { right: 16px; }

@media (hover: none), (pointer: coarse) {
  .wsl-viewer-nav { display: none; } /* mobile uses swipe instead */
}

.wsl-viewer-thumbs {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 16px 16px;
  overflow-x: auto;
  justify-content: center;
}

.wsl-viewer-thumbs img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  opacity: 0.55;
  cursor: pointer;
  border: 2px solid transparent;
}

.wsl-viewer-thumbs img.wsl-active {
  opacity: 1;
  border-color: #fff;
}

body.wsl-viewer-open {
  overflow: hidden;
}
