/* ========================================
   PDP GALLERY
   ======================================== */
.pdp-gallery {
  padding: 8px 20px 0;
  position: relative;
  overflow: hidden;
}

.gallery-viewport {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  touch-action: pan-y pinch-zoom;
}

.gallery-track {
  display: flex;
  transition: transform 0.3s ease-out;
  will-change: transform;
}

.gallery-track.swiping {
  transition: none;
}

.gallery-slide {
  flex: 0 0 100%;
  min-width: 0;
}

.gallery-slide img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center center;
  border-radius: var(--radius);
  background: var(--border);
  cursor: zoom-in;
}

/* Thumbnail strip */
.pdp-thumbs {
  display: flex;
  gap: 10px;
  padding: 16px 4px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pdp-thumbs::-webkit-scrollbar {
  display: none;
}

.pdp-thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  object-position: center center;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  background: var(--border);
  border: none;
  padding: 0;
}

.pdp-thumb.active {
  opacity: 1;
  outline: 2px solid var(--clay);
  outline-offset: 2px;
}

/* ========================================
   FULLSCREEN LIGHTBOX
   ======================================== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.lightbox-overlay.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.lightbox-track {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease-out;
  will-change: transform;
}

.lightbox-track.swiping {
  transition: none;
}

.lightbox-slide {
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 16px;
}

.lightbox-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

/* Lightbox controls */
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 510;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  padding: 0;
}

.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 510;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  font-size: 20px;
  padding: 0;
}

.lightbox-nav:hover {
  background: rgba(0, 0, 0, 0.6);
}

.lightbox-prev {
  left: 12px;
}

.lightbox-next {
  right: 12px;
}

.lightbox-counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 510;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

/* Hide nav arrows on touch devices */
@media (hover: none) {
  .lightbox-nav {
    display: none;
  }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (min-width: 1024px) {
  .pdp-gallery {
    padding: 8px 0 0;
  }
}
