/* Galerie fiche produit */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
}

.product-gallery__main-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: min(52vh, 28rem);
  padding: clamp(1rem, 3vw, 1.75rem);
  background: #fff;
  border: 1px solid var(--b, #e5e7eb);
  border-radius: var(--r);
}

.product-gallery__main {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Priorité sur .product-hero__img (main.css) quand les deux classes coexistent */
.product-gallery .product-gallery__main.product-hero__img {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-gallery__zoom-btn {
  position: absolute;
  right: var(--space-sm);
  bottom: var(--space-sm);
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--b);
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.92);
  color: var(--p);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease);
}

.product-gallery__zoom-btn:hover {
  background: #fff;
}

.product-gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  list-style: none;
  margin: 0;
  padding: var(--space-xs) 0 0;
}

.product-gallery__thumb {
  padding: 3px;
  border: 2px solid var(--b, #e5e7eb);
  border-radius: var(--r-sm);
  background: #fff;
  cursor: pointer;
  line-height: 0;
}

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

.product-gallery__thumb--variant {
  position: relative;
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: 88px;
}

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

.product-gallery__thumb-variant-label {
  display: block;
  font-size: 0.65rem;
  line-height: 1.2;
  text-align: center;
  color: var(--muted, #6b7280);
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-gallery__thumb-img {
  display: block;
  width: 72px;
  height: 56px;
  object-fit: contain;
  object-position: center;
  border-radius: calc(var(--r-sm) - 2px);
}

.product-gallery__dialog {
  border: none;
  padding: 0;
  max-width: min(96vw, 1100px);
  max-height: 92vh;
  background: transparent;
}

.product-gallery__dialog::backdrop {
  background: rgba(17, 24, 39, 0.72);
}

.product-gallery__dialog-img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  margin: 0 auto;
  border-radius: var(--r);
  background: #fff;
}

.product-gallery__dialog-close {
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--p);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
