/**
 * Galerie produit [product_gallery]
 */

.product-gallery-container {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(108, 150, 105, 0.12);
  overflow: hidden;
  border: 1px solid #e0f1db;
  margin: 0 0 24px;
}

.product-gallery-main {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 420px;
  overflow: hidden;
  background: #f1f6ef;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-gallery-main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.4s ease;
  cursor: zoom-in;
}

.product-gallery-main:hover .product-gallery-main-image {
  transform: scale(1.03);
}

.product-gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  color: #fff;
  padding: 20px 18px 14px;
  pointer-events: none;
}

.product-gallery-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.product-gallery-counter {
  font-size: 0.85rem;
  opacity: 0.92;
  display: flex;
  align-items: center;
  gap: 6px;
}

.product-gallery-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.95);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  color: #49714b;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  z-index: 10;
}

.product-gallery-controls:hover {
  background: #49714b;
  color: #fff;
}

.product-gallery-prev {
  left: 12px;
}

.product-gallery-next {
  right: 12px;
}

.product-gallery-thumbnails {
  display: flex;
  gap: 8px;
  padding: 14px;
  background: #f8f9fa;
  overflow-x: auto;
}

.product-gallery-thumbnail {
  flex-shrink: 0;
  width: 72px;
  height: 54px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
}

.product-gallery-thumbnail.active,
.product-gallery-thumbnail:hover {
  border-color: #49714b;
}

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

.product-gallery-loading {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 35px;
  height: 35px;
  border: 3px solid #f3f3f3;
  border-top-color: #49714b;
  border-radius: 50%;
  animation: ikn-gallery-spin 1s linear infinite;
}

@keyframes ikn-gallery-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .product-gallery-main {
    max-height: 280px;
  }

  .product-gallery-controls {
    width: 34px;
    height: 34px;
  }
}
