/* ==========================================================================
   KINGLINPET Product Gallery (single product)
   Loaded only on singular kinglinpet_product pages.
   Uses existing design tokens — no second design system.
   ========================================================================== */

/* Main image */
.product-gallery-main {
  width: 100%;
}

.product-gallery-main-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-soft, 0 12px 32px rgba(44, 44, 44, 0.08));
  background: var(--color-cream, #f5f0eb);
}

.product-gallery-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 400px;
  border-radius: 12px;
  background: var(--color-cream, #f5f0eb);
}

.product-gallery-placeholder span {
  color: var(--color-warm-gray, #8a8178);
  font-size: 1.1rem;
}

/* Thumbnail strip */
.product-gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.product-gallery-thumb {
  width: 80px;
  height: 80px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--color-cream, #f5f0eb);
  border: 2px solid var(--color-beige, #e8e2da);
  border-radius: 8px;
  transition: border-color 0.2s var(--ease-out, cubic-bezier(0.4, 0, 0.2, 1)),
    transform 0.2s var(--ease-out, cubic-bezier(0.4, 0, 0.2, 1));
}

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

.product-gallery-thumb:hover {
  border-color: var(--color-champagne, #c4a87c);
  transform: translateY(-2px);
}

.product-gallery-thumb:focus-visible {
  outline: 2px solid var(--color-champagne, #c4a87c);
  outline-offset: 2px;
}

.product-gallery-thumb.is-active {
  border-color: var(--color-champagne, #c4a87c);
  box-shadow: 0 0 0 1px var(--color-champagne, #c4a87c);
}

/* Related products grid: 4 desktop / 2 mobile */
.product-grid--related {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .product-grid--related {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .product-grid--related {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-gallery-placeholder {
    height: 280px;
  }
}

@media (max-width: 480px) {
  /* Thumbnails become a single horizontally scrollable rail. */
  .product-gallery-thumbs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }

  .product-gallery-thumb {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
  }
}
