/* --- Barre de boutons en bas --- */
.top-buttons {
  max-width: 1000px;
  margin: 50px auto 0;
  padding: 10px 20px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.top-buttons button,
.top-buttons a.btn {
  background-color: #1e1c70;
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 0.85rem;
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 3px 6px rgba(30, 28, 112, 0.25);
  white-space: nowrap;
}

.top-buttons button:hover,
.top-buttons a.btn:hover {
  background-color: #3836b0;
  box-shadow: 0 6px 14px rgba(56, 54, 176, 0.5);
}

.top-buttons i {
  font-size: 1rem;
}

/* Conteneur pour le formulaire du panier avec position relative */
.basket-form-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-left: auto;
}

.top-buttons form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.top-buttons form input[type="number"] {
  width: 50px;
  height: 30px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 0.85rem;
}

/* Conteneur de l'image avec le stock en dessous */
.product-image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

/* Conteneur du stock centré */
.stock-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 15px;
}

/* Texte "EN STOCK" */
.stock-status {
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  font-family: 'Montserrat', sans-serif;
  text-align: center;
  margin: 0;
}

.in-stock {
  color: #2e7d32;
}

.in-stock-last {
  color: #e09431;
}

.out-of-stock {
  color: #d32f2f;
}

/* --- Partie produit --- */
.product-detail {
  max-width: 1000px;
  margin: 50px auto;
  padding: 30px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  font-family: 'Roboto', sans-serif;
  color: #333;
}

.product-main {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: center;
  margin-bottom: 0;
}

.share-container {
  position: relative;
  display: inline-block;
}

.tooltip-copy {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background-color: #21ad57;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(30, 28, 112, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10000;
}

.tooltip-copy::before {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #21ad57 transparent transparent transparent;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tooltip-copy.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-20px);
  pointer-events: auto;
}

.tooltip-copy.show::before {
  opacity: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px; 
  height: 1px; 
  padding: 0; 
  margin: -1px; 
  overflow: hidden; 
  clip: rect(0,0,0,0); 
  white-space: nowrap; 
  border: 0;
}

.product-info {
  display: flex;
  gap: 30px;
  width: 100%;
  max-width: 1000px;
  background: #f9f9fb;
  padding: 25px 30px;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(30, 28, 112, 0.12);
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #2c2c2c;
  line-height: 1.65;
  align-items: flex-start;
}

.product-image {
  max-width: 350px;
  width: 100%;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border: 3px solid #1e1c70;
  margin-top: 50px;
}

.product-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-family: 'Poppins', 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 2.8rem;
  color: #1e1c70;
  margin-bottom: 12px;
  text-transform: none;
  letter-spacing: 0.03em;
}

.price {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1e1c70;
  background: #d0d4ff;
  box-shadow: 0 6px 16px rgba(30, 28, 112, 0.25);
  padding: 0;
  border-radius: 4px;
  min-width: 160px;
  text-align: center;
  user-select: none;
  font-family: 'Montserrat', sans-serif;
  border-left: 4px solid #1e1c70;
}

.product-small-desc {
  font-style: italic;
  font-size: 1.15rem;
  color: #666a85;
  margin-bottom: 22px;
  border-left: 4px solid #1e1c70;
  padding-left: 12px;
}

.product-description {
  font-size: 1.1rem;
  color: #44475a;
  margin-bottom: 28px;
  white-space: pre-line;
}

.product-info p strong {
  color: #1e1c70;
  font-weight: 600;
}

.product-info p {
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.product-tech {
  border-top: 2px solid #1e1c70;
  padding-top: 25px;
}

.product-tech h2 {
  font-family: 'Montserrat', sans-serif;
  color: #1e1c70;
  margin-bottom: 15px;
  font-size: 1.6rem;
}

.product-tech table {
  width: 100%;
  border-collapse: collapse;
}

.product-tech th,
.product-tech td {
  padding: 12px 15px;
  border-bottom: 1px solid #ddd;
  text-align: left;
  vertical-align: top;
}

.product-tech th {
  background-color: #f2f4ff;
  color: #1e1c70;
  width: 180px;
  font-weight: 700;
}

/* Tooltip style, position au-dessus du bouton */
.tooltip-fav {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background-color: #e63946; /* rouge vif */
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10000;
  user-select: none;
  box-shadow: 0 2px 8px rgba(30, 28, 112, 0.4); /* même ombre que tooltip-copy */
}

/* Petit triangle en bas */
.tooltip-fav::before {
  content: '';
  position: absolute;
  bottom: -12px; /* sous la tooltip */
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #e63946 transparent transparent transparent; /* rouge avec triangle pointant vers le bas */
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Affichage / apparition */
.tooltip-fav.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(-20px);
}

.tooltip-fav.show::before {
  opacity: 1;
}

/* Icône cœur dans la tooltip */
.tooltip-fav i {
  font-size: 18px;
  transition: transform 0.4s ease, color 0.4s ease, opacity 0.4s ease;
  color: white;
  flex-shrink: 0;
}

/* Tooltip pour le panier - maintenant centrée sur le conteneur */
.tooltip-basket {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background-color: #21ad57; /* vert par défaut */
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(30, 28, 112, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
  z-index: 10000;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tooltip-basket::before {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #21ad57 transparent transparent transparent; /* Couleur par défaut */
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Affichage / apparition */
.tooltip-basket.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(-20px);
}

.tooltip-basket.show::before {
  opacity: 1;
}

/* Classe pour triangle rouge en cas d'erreur */
.tooltip-basket.error::before {
  border-color: #e63946 transparent transparent transparent;
}


/* Animations coeur dans tooltip */
@keyframes heart-pop {
  10% {
    transform: scale(0.5) rotate(-15deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.3) rotate(15deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes heart-break {
  10% {
    transform: scale(0.5) rotate(-15deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.3) rotate(15deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.heart-pop {
  animation: heart-pop 0.4s forwards;
  color: #e63946;
}

.heart-break {
  animation: heart-break 0.4s forwards;
  color: #e63946;
}

/* Responsive produit */
@media (max-width: 768px) {
  .product-main {
    gap: 20px;
  }

  .product-info {
    flex-direction: column;
    padding: 20px;
  }

  .product-image {
    max-width: 100%;
    border: 3px solid #1e1c70;
    margin-bottom: 20px;
  }
  
  .product-image-container {
    width: 100%;
  }
  
  .stock-container {
    margin-top: 10px;
  }
}

/* Responsive top-buttons */
@media (max-width: 600px) {
  .top-buttons {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 15px 10px;
  }

  .top-buttons button,
  .top-buttons a.btn,
  .top-buttons form {
    flex: 1 1 100%;
    justify-content: center;
    font-size: 1rem;
    padding: 14px 0;
  }

  .top-buttons form input[type="number"] {
    width: 80px;
    height: 40px;
  }
}

/* Responsive prix + quantité */
@media (max-width: 480px) {
  .price {
    font-size: 1.8rem;
  }
}