/* Product Page Styles */
.product-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.product-gallery {
  display: flex;
  flex-direction: column;
}

.main-image-container {
  margin-bottom: 1rem;
}

#main-image {
  /* FIX : l'image portait son propre cadre (border + radius) À L'INTÉRIEUR
     de la carte .main-image-container (glass.css) qui a déjà bordure,
     radius et overflow:hidden → double cadre décalé, coins « décentrés ».
     Le cadre appartient au conteneur ; l'image est pleine, en block
     (l'inline créait un jeu de ligne de base qui décalait le bas). */
  display: block;
  width: 100%;
  max-height: 500px;
  object-fit: contain;
}

.thumbnail-container {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  /* FIX : l'ombre des vignettes (active/hover) était coupée net par
     l'overflow du conteneur → marge intérieure pour lui laisser la place
     (l'ombre porte ~6px d'offset + 16px de flou vers le bas). */
  padding: 8px 8px 20px;
}

.thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.thumbnail:hover,
.thumbnail.active {
  border-color: #007bff;
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.product-header h1 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 0.5rem;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.product-category {
  margin-bottom: 1rem;
}

.category-tag {
  display: inline-block;
  background: #f8f9fa;
  color: #6c757d;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.product-stock {
  margin-bottom: 1rem;
  font-weight: 500;
}

.product-description {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.product-options {
  border-top: 1px solid #eee;
  padding-top: 1rem;
}

.color-options h3,
.option-selectors h3 {
  margin-bottom: 0.5rem;
  color: #333;
}

.color-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.color-option {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #ddd;
  transition: transform 0.2s ease;
}

.color-option:hover {
  transform: scale(1.1);
}

/* Carte option — harmonisée avec le conteneur produit (mêmes rayons,
   bordure et ombre douces). Remplace l'ancien style inline du pug
   (border #e6e6e6 / radius 4px) et le hover gris plein. */
.option-group {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.option-group:hover {
  background-color: #fff;
  border-color: #d6d9de;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Tables internes des options (en-tête prix, description, stock, quantité) */
.option-group .option-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.option-group .option-table th,
.option-group .option-table td {
  padding: 4px 0;
  font-size: 0.95rem;
}

.option-group .option-table th {
  font-size: 1rem;
}

/* La pastille couleur reste alignée à droite sans casser la ligne */
.option-group .color-option {
  display: inline-block;
  margin-left: auto;
}

.option-details {
  display: flex;
  gap: 1rem;
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: #666;
}

.quantity-selector h3 {
  margin-bottom: 0.5rem;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}


#quantity-input {
  width: 60px;
  padding: 0.5rem;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.add-to-cart {
  margin-top: 1rem;
}


/* Badges */
.product-badges {
  display: flex;
  flex-direction: row;
  /* FIX : 4 badges × 220px + gaps ≈ 930px sans wrap → débordement entre
     769px (fin du mode colonne) et ~950px, réparti des DEUX côtés par le
     justify-content:center du parent (partie gauche inatteignable).
     Le wrap fait passer les cartes en 2×2 puis 1 colonne naturellement. */
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
  gap: 1rem;
}

.badge {
  display: flex;
  flex-direction: column;
  width: 220px;
  align-items: flex-start;
  /* padding: 1rem; */
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.badge-icon {
  font-size: 1.4rem;
  color: #007bff;
  margin-bottom: 0.5rem;
}

.badge-title {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.25rem;
}

.badge-description {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
}


/* Responsive Design */
@media (max-width: 768px) {
  .product-container {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .product-header h1 {
    font-size: 1.5rem;
  }

  .product-price .discounted-price {
    font-size: 1.2rem;
  }

  .thumbnail-container {
    justify-content: flex-start;
  }

  .thumbnail {
    width: 60px;
    height: 60px;
  }

  .product-badges {
    flex-direction: column;
  }

  .badge {
    width: 100%;

  }
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-container {
  animation: fadeIn 0.5s ease-out;
}





/* Dark mode */
@media (prefers-color-scheme: dark) {
  .product-container {
    background: #1c1f24;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid #2d323b;
  }

  .thumbnail {
    border-color: #3a404a;
  }

  .thumbnail:hover,
  .thumbnail.active {
    border-color: #4da6ff;
  }

  .product-header h1 {
    color: #f0f4f8;
  }

  .product-category .category-tag {
    background: #2d323b;
    color: #bdc3c7;
  }

  .product-description {
    color: #dfe6e9;
  }

  /* Pricing */
  .original-price {
    color: #7d8b9b;
  }

  .discounted-price {
    color: #ff6b6b;
  }

  .regular-price {
    color: #f0f4f8;
  }

  /* .discount-badge {
    background: #e74c3c;
    color: white;
  } */

  /* Options & controls */
  .color-option {
    border-color: #3a404a;
  }

  .color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(77, 166, 255, 0.3);
  }

  .option-group {
    background: #252930;
    border: 1px solid #2d323b;
  }

  .option-group:hover {
    background-color: #2a2f37;
    border-color: #3a404a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  }

  .option-details {
    color: #bdc3c7;
  }

  .quantity-controls {
    border: 1px solid #2d323b;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    background: #1c1f24;
  }

  #quantity-input {
    background: #1c1f24;
    border: 1px solid #3a404a;
    color: #f0f4f8;
  }

  /* NB : `.add-to-cart` est le conteneur du bouton, pas le bouton —
     l'ancien padding ici faisait déborder le fond autour du CTA en
     mode sombre. Le bouton `.btn-add-to-cart` gère ses propres
     styles (theme.css / glass.css). */

  /* Stock status */
  .product-stock {
    color: #bdc3c7;
  }

  /* Responsive adjustments in dark mode */
  @media (max-width: 768px) {
    .product-container {
      background: #1c1f24;
    }

    .thumbnail {
      width: 50px;
      height: 50px;
    }
  }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .product-badges {
    padding: 1rem;
  }

  .badge {
    background: #2d323b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  }

  .badge:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  }

  .badge-icon {
    color: #4da6ff;
  }

  .badge-title {
    color: #f0f4f8;
  }

  .badge-description {
    color: #dfe6e9;
  }
}