/* assets/css/product-gallery.css
   Product detail page — main image with a responsive thumbnail
   gallery below it. Clicking a thumbnail fades the main image to
   the new one and highlights the active thumbnail. */

.product-gallery {
  background: #fff;
}

.gallery-main {
  position: relative;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  overflow: hidden;
}

.gallery-main-img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  opacity: 1;
  transition: opacity 0.28s ease;
  will-change: opacity;
}

.gallery-main-img.gallery-fading {
  opacity: 0;
}

.gallery-main-placeholder {
  font-size: 3.5rem;
  color: #e5e7eb;
}

/* Thumbnail strip */
.gallery-thumbs-strip {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.gallery-thumbs-strip::-webkit-scrollbar { display: none; }

.gallery-thumb-btn {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #e5e7eb;
  background: #f9fafb;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.gallery-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumb-btn:hover {
  border-color: var(--gallery-accent, #dc2626);
  transform: translateY(-1px);
}

.gallery-thumb-btn.active {
  border-color: var(--gallery-accent, #dc2626);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

@media (min-width: 640px) {
  .gallery-main { height: 420px; }
  .gallery-thumb-btn { width: 72px; height: 72px; }
}
