/* Shop / home product grid cards (function gS) */
.product-grid-card-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

/* Product detail gallery — sizes/scroll (Tailwind w-20, flex-nowrap, overflow-x-auto not in build) */
.product-gallery-column {
  width: 100%;
  max-width: 100%;
}

.product-gallery-column .product-img-wrap {
  overflow: hidden;
  max-height: min(90vw, 520px);
}

.product-detail-main-img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* = flex flex-row flex-nowrap gap-3 mt-4 overflow-x-auto pb-4 + hidden scrollbar */
.product-gallery-thumbs {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-bottom: 1rem;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.product-gallery-thumbs::-webkit-scrollbar {
  display: none;
  height: 0;
}

/* = shrink-0 w-20 h-20 aspect-square rounded-lg border-2 … */
.product-gallery-thumb {
  position: relative;
  flex-shrink: 0;
  width: 5rem;
  height: 5rem;
  min-width: 5rem;
  min-height: 5rem;
  max-width: 5rem;
  max-height: 5rem;
  aspect-ratio: 1 / 1;
  padding: 0;
  margin: 0;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  line-height: 0;
  transition:
    opacity 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.product-gallery-thumb:hover {
  opacity: 0.88;
  border-color: #d1d5db;
}

.product-gallery-thumb.is-active {
  border-color: #b56576;
  box-shadow: 0 0 0 1px rgba(181, 101, 118, 0.35);
}

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

/* Override global mobile min-height on buttons */
.product-gallery-thumbs .product-gallery-thumb {
  min-height: 5rem;
}

@media (max-width: 768px) {
  .product-gallery-column .product-img-wrap {
    max-height: 360px !important;
    aspect-ratio: 1 / 1 !important;
    padding: 1rem !important;
  }

  .product-gallery-column .product-detail-main-img {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
  }
}