/* ── PRODUCT HERO GALLERY THUMBNAILS ─────────────────────────────────── */

.product-hero-inner.has-gallery {
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 48px;
  align-items: center;
}

.ph-gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

.ph-gallery-track-wrap {
  height: calc(3 * 80px + 2 * 8px); /* 3 thumbs + 2 gaps */
  overflow: hidden;
  position: relative;
}

.ph-gallery-track {
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.3s ease;
}

.ph-gallery-thumb {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  background: none;
  transition: border-color 0.2s;
}

.ph-gallery-thumb:hover {
  border-color: rgba(255, 255, 255, 0.55);
}

.ph-gallery-thumb.is-active {
  border-color: rgba(255, 255, 255, 0.8);
}

.ph-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.ph-gallery-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
  line-height: 1;
}

.ph-gallery-chevron:hover {
  color: var(--white);
}

.ph-gallery-chevron:disabled {
  opacity: 0.2;
  cursor: default;
}

.ph-gallery-chevron .material-icons {
  font-size: 20px;
}


/* ── LIGHTBOX ─────────────────────────────────────────────────────────── */

.ph-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

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

.ph-lightbox.is-visible {
  opacity: 1;
}

.ph-lb-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 85vh;
}

.ph-lb-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

.ph-lb-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: background 0.2s, color 0.2s;
}

.ph-lb-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.ph-lb-close .material-icons {
  font-size: 20px;
}

.ph-lb-prev,
.ph-lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: background 0.2s, color 0.2s;
}

.ph-lb-prev {
  left: 24px;
}

.ph-lb-next {
  right: 24px;
}

.ph-lb-prev:hover,
.ph-lb-next:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.ph-lb-prev .material-icons,
.ph-lb-next .material-icons {
  font-size: 28px;
}

.ph-lb-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
}


/* ── RESPONSIVE ──────────────────────────────────────────────────────── */

/* Tablet: narrower thumbs */
@media (max-width: 1024px) {
  .product-hero-inner.has-gallery {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr 68px;
    gap: 32px;
  }

  .ph-gallery-thumb {
    width: 68px;
    height: 68px;
  }

  .ph-gallery-track-wrap {
    height: calc(3 * 68px + 2 * 8px);
  }
}

/* Mobile: gallery moves below text as a horizontal strip */
@media (max-width: 767px) {
  .product-hero-inner.has-gallery {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .ph-gallery {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .ph-gallery-track-wrap {
    height: 64px;
    flex: 1;
    overflow: hidden;
  }

  .ph-gallery-track {
    flex-direction: row;
    gap: 8px;
    transition: transform 0.3s ease;
  }

  .ph-gallery-thumb {
    width: 64px;
    height: 64px;
  }

  /* Rotate chevrons to point left/right on horizontal layout */
  .ph-gallery-prev .material-icons {
    transform: rotate(-90deg);
  }

  .ph-gallery-next .material-icons {
    transform: rotate(-90deg);
  }

  /* Lightbox nav on small screens */
  .ph-lb-prev {
    left: 12px;
  }

  .ph-lb-next {
    right: 12px;
  }

  .ph-lb-prev,
  .ph-lb-next {
    width: 40px;
    height: 40px;
  }

  .ph-lb-prev .material-icons,
  .ph-lb-next .material-icons {
    font-size: 22px;
  }
}
