/* =========================================================
   Product gallery
   ========================================================= */

.product-gallery {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 1rem;
  align-items: start;
}

.product-gallery--single {
  grid-template-columns: 1fr;
}

.product-gallery__thumbs {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.product-gallery__thumb {
  display: block;
  width: 48px;
  height: 48px;
  padding: 0;
  margin:0 auto;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.product-gallery__thumb:hover {
  transform: translateY(-1px);
  border-color: var(--primary, #111);
}

.product-gallery__thumb.is-active {
  border-color: var(--primary, #111);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .08);
}

.product-gallery__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery__stage {
  min-width: 0;
}

.product-gallery__zoom {
  display: block;
  width: 100%;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  cursor: zoom-in;
}

.product-gallery__img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
}

.product-gallery__placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 16px;
  background: linear-gradient(180deg, #f7f7f7, #efefef);
}

@media (max-width: 767px) {
  .product-gallery {
    grid-template-columns: 1fr;
  }

  .product-gallery__thumbs {
    order: 2;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: .25rem;
  }

  .product-gallery__thumb {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
  }

  .product-gallery__stage {
    order: 1;
  }
}