/* ================================================
   Product Gallery — vertical thumb strip
   Mobile-first
   ================================================ */

.product-hero__gallery {
  position: static;
}

@media (min-width: 960px) {
  .product-hero__gallery {
    position: static;
  }
}

.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Horizontal thumbnail strip (below) ──────────────── */

.product-gallery__thumbstrip {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.product-gallery__thumbstrip::-webkit-scrollbar {
  height: 3px;
}

.product-gallery__thumbstrip::-webkit-scrollbar-track {
  background: transparent;
}

.product-gallery__thumbstrip::-webkit-scrollbar-thumb {
  background: var(--border);
}

.product-gallery__thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border: 1px solid transparent;
  padding: 0;
  background: var(--surface);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease);
}

@media (min-width: 960px) {
  .product-gallery__thumb {
    width: 80px;
    height: 80px;
    flex: 0 0 80px;
  }
}

.product-gallery__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery__thumb:hover {
  border-color: var(--border-warm);
}

.product-gallery__thumb--active {
  border-color: var(--ink);
}

/* ── Main image ──────────────────────────────────────── */

.product-gallery__main {
  position: relative;
  background: none;
  overflow: hidden;
}

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

.product-gallery__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease);
}

.product-gallery__slide--active {
  opacity: 1;
  pointer-events: auto;
}

.product-gallery__image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: top center;
  background: none;
}

.product-gallery__toolbar {
  position: absolute;
  right: var(--space-sm);
  bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  z-index: 2;
  pointer-events: none;
}

.product-gallery__toolbar > * {
  pointer-events: auto;
}

.product-gallery__counter {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.45rem;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.product-gallery__counter-separator {
  color: var(--ink-soft);
}

.product-gallery__download {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease);
}

.product-gallery__download:hover {
  background: var(--white);
  color: var(--ink);
}

.product-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  opacity: 1;
  transition: opacity var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
  z-index: 2;
}

@media (min-width: 960px) {
  .product-gallery__nav {
    width: 42px;
    height: 42px;
    opacity: 0;
  }

  .product-gallery__main:hover .product-gallery__nav {
    opacity: 1;
  }
}

.product-gallery__nav:hover {
  background: var(--white);
}

.product-gallery__nav--prev {
  left: var(--space-sm);
}

.product-gallery__nav--next {
  right: var(--space-sm);
}

/* ── View Featured Options ──────────────────────────── */

.product-gallery__secondary-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 0.35rem;
}

.product-gallery__featured-link {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  cursor: pointer;
}

.product-gallery__featured-link:hover {
  color: var(--ink-soft);
}

/* ── Featured Options popup ────────────────────────── */

.product-featured-options {
  position: fixed;
  inset: 0;
  z-index: 10005;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.product-featured-options[hidden] { display: none; }

.product-featured-options__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.product-featured-options__panel {
  position: relative;
  width: 320px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--white);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: var(--space-lg);
}

.product-featured-options__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.product-featured-options__title {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--ink);
}

.product-featured-options__close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
}

.product-featured-options__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.product-featured-options__row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.product-featured-options__thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  background: var(--surface);
  flex: 0 0 64px;
}

.product-featured-options__info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.product-featured-options__name {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
}

.product-featured-options__type {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* ── Placeholder ─────────────────────────────────────── */

.product-gallery__placeholder {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}

@media (min-width: 960px) {
  .product-gallery__placeholder {
    aspect-ratio: 3 / 4;
  }
}

.product-gallery__placeholder span {
  font-family: var(--font-display);
  font-size: 5rem;
  color: var(--ink-faint);
  opacity: 0.35;
}

/* ── Lightbox ────────────────────────────────────────── */

.product-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.product-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.product-lightbox__content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
}

.product-lightbox__image {
  display: block;
  max-width: 85vw;
  max-height: 85vh;
  object-fit: contain;
}

.product-lightbox__image[hidden] {
  display: none;
}

.product-lightbox__close {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--white);
  cursor: pointer;
}

.product-lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--white);
  cursor: pointer;
}

.product-lightbox__nav--prev { left: var(--space-lg); }
.product-lightbox__nav--next { right: var(--space-lg); }


/* Wireframe alignment overrides */

.product-gallery {
  gap: 0.9rem;
}

.product-gallery__main {
  position: relative;
  border: none;
  background: none;
  aspect-ratio: 1 / 1;
}

.product-gallery__main::before {
  content: '';
  display: block;
  padding-top: 100%;
}

@media (min-width: 960px) {
  .product-gallery__main {
    aspect-ratio: 1 / 1;
  }
}

.product-gallery__main > .product-gallery__slide,
.product-gallery__slide--active {
  position: absolute;
  inset: 0;
}

.product-gallery__zoom {
  position: absolute;
  inset: 0;
}

.product-gallery__image {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  background: var(--surface);
  object-fit: contain;
  object-position: center;
}

.product-gallery__thumbstrip {
  justify-content: flex-start;
  gap: 0.55rem;
}

.product-gallery__thumb {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  border-color: var(--border);
  background: #f4f0e9;
}

@media (min-width: 960px) {
  .product-gallery__thumb {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
  }
}

.product-gallery__thumb:hover,
.product-gallery__thumb--active {
  border-color: var(--ink);
}

.product-gallery__toolbar {
  display: none;
}

.product-gallery__placeholder {
  background: #f4f0e9;
}
