select.wcvs-hidden {
  position: absolute !important;
  left: -9999px !important;
}

/* Masquer le premier affichage de prix (plage) pour les produits variables */
.summary.entry-summary > p.price {
  display: none !important;
}

/* Respecter les sauts de ligne et espaces dans la description courte */
.woocommerce-product-details__short-description,
.woocommerce-product-details__short-description p {
  white-space: pre-line !important;
}

.woocommerce-product-details__short-description p {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Réduire les espacements dans la fiche produit */
.single-product .container {
  padding-top: 0 !important;
}

.summary.entry-summary {
  padding: 0 !important;
}

.summary.entry-summary > * {
  margin-bottom: 0.5rem !important;
}

.summary.entry-summary h1.product_title {
  margin-bottom: 0.5rem !important;
}

.woocommerce-product-details__short-description {
  margin-bottom: 0.8rem !important;
}

.variations_form {
  margin-top: 0.5rem !important;
}

/* Alignement vertical du label et de la liste déroulante */
.variations tr {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-bottom: 0.5rem !important;
}

.variations td.label {
  flex: 0 0 auto !important;
  padding: 0 !important;
  margin: 0 !important;
}

.single-product .variations_form table.variations tbody tr td.value {
  flex: 1 !important;
  padding: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
}

.variations select {
  width: 100% !important;
  max-width: 300px !important;
  margin: 0 !important;
  vertical-align: middle !important;
}

.variations td.label label {
  margin: 0 !important;
  line-height: normal !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

.wcvs-swatches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0.3rem 0 0.5rem;
}

.wcvs-swatch {
  border: 3px solid #ddd;
  background: #fff;
  padding: 2px;
  border-radius: 6px;
  width: 100px!important;
  height: 100px!important;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.wcvs-swatch img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  display: block;
  transition: transform 0.3s ease;
}

.wcvs-swatch.is-selected {
  border-color: #3F4488;
  border-width: 4px;
  box-shadow: 0 0 0 3px rgba(63, 68, 136, 0.3);
  transform: scale(1.05);
}

.wcvs-swatch.is-selected img {
  transform: scale(1.05);
}

/* Ajouter un indicateur visuel de sélection */
.wcvs-swatch.is-selected::after {
  content: "✓";
  position: absolute;
  top: -8px;
  right: -8px;
  background: #3F4488;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.wcvs-swatch.is-disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Style spécifique quand les vignettes nécessitent une sélection préalable */
.wcvs-swatch.is-requires-selection {
  opacity: .5;
  cursor: not-allowed;
  position: relative;
}

.wcvs-swatch.is-requires-selection:hover {
  opacity: .6;
}

/* Message d'aide au-dessus des vignettes désactivées */
.wcvs-swatches.requires-selection {
  position: relative;
  /* Ajouter de l'espace en haut pour le message positionné en absolu */
  padding-top: 65px;
}

.wcvs-swatches.requires-selection::before {
  content: attr(data-message);
  display: block;
  position: absolute;
  top: -30px; /* Positionner au-dessus du grid */
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #F0F3FF 0%, #F7F9FF 100%);
  border: 2px solid #C5D0F0;
  border-radius: 10px;
  padding: 12px 20px;
  color: #3F4488;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  font-weight: 400;
  text-align: center;
  line-height: 1.5;
  animation: fadeInMessage 0.3s ease-out;
  box-shadow: 0 2px 8px rgba(63, 68, 136, 0.1);
  z-index: 1;
}

.wcvs-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Styliser le titre du module produits similaires */
.related.products > h2,
.upsells.products > h2 {
  font-family: 'Lato', sans-serif !important;
  color: #EA5F6D !important;
  font-size: 28px !important;
  margin-bottom: 30px !important;
  text-align: center !important;
}

/* Améliorer le design des produits similaires */
.related.products,
.upsells.products {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  clear: both !important;
}

.related.products ul.products,
.upsells.products ul.products {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  list-style: none !important;
}

/* Supprimer le ::before qui crée une colonne vide */
.related.products ul.products::before,
.upsells.products ul.products::before,
.related.products ul.products::after,
.upsells.products ul.products::after {
  display: none !important;
  content: none !important;
}

.related.products .product,
.upsells.products .product {
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease !important;
  background: white !important;
  width: 100% !important;
  float: none !important;
}

.related.products .product:hover,
.upsells.products .product:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Image du produit */
.related.products .product .woocommerce-loop-product__link,
.upsells.products .product .woocommerce-loop-product__link {
  position: relative !important;
  display: block !important;
  overflow: hidden !important;
}

.related.products .product img,
.upsells.products .product img {
  width: 100% !important;
  height: auto !important;
  transition: transform 0.3s ease, opacity 0.3s ease !important;
  display: block !important;
}

.related.products .product:hover img,
.upsells.products .product:hover img {
  transform: scale(1.08) !important;
  opacity: 0.85 !important;
}

/* Overlay au hover sur l'image */
.related.products .product .woocommerce-loop-product__link::after,
.upsells.products .product .woocommerce-loop-product__link::after {
  content: "Voir le produit" !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) scale(0) !important;
  background: rgba(63, 68, 136, 0.95) !important;
  color: white !important;
  padding: 12px 24px !important;
  border-radius: 25px !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  transition: transform 0.3s ease !important;
  white-space: nowrap !important;
  z-index: 2 !important;
}

.related.products .product:hover .woocommerce-loop-product__link::after,
.upsells.products .product:hover .woocommerce-loop-product__link::after {
  transform: translate(-50%, -50%) scale(1) !important;
}

/* Masquer tous les anciens effets hover qui créent des conflits */
.related.products .product .onsale,
.upsells.products .product .onsale,
.related.products .product .woocommerce-placeholder,
.upsells.products .product .woocommerce-placeholder,
.related.products .product .added_to_cart,
.upsells.products .product .added_to_cart,
.related.products .product .woocommerce-loop-product__link .attachment-woocommerce_thumbnail::before,
.upsells.products .product .woocommerce-loop-product__link .attachment-woocommerce_thumbnail::before,
.related.products .product .woocommerce-loop-product__link::before,
.upsells.products .product .woocommerce-loop-product__link::before {
  display: none !important;
  content: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Supprimer les overlays de thème par défaut */
.related.products .product .woocommerce-loop-product__link .overlay,
.upsells.products .product .woocommerce-loop-product__link .overlay,
.related.products .product img + *:not(.woocommerce-loop-product__title),
.upsells.products .product img + *:not(.woocommerce-loop-product__title) {
  display: none !important;
}

/* Titre du produit */
.related.products .product .woocommerce-loop-product__title,
.upsells.products .product .woocommerce-loop-product__title,
.related.products .product h2,
.related.products .product h3,
.upsells.products .product h2,
.upsells.products .product h3 {
  font-family: 'Lato', sans-serif !important;
  color: #333 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  margin: 15px 15px 10px !important;
  transition: color 0.3s ease !important;
}

.related.products .product:hover .woocommerce-loop-product__title,
.upsells.products .product:hover .woocommerce-loop-product__title,
.related.products .product:hover h2,
.related.products .product:hover h3,
.upsells.products .product:hover h2,
.upsells.products .product:hover h3 {
  color: #3F4488 !important;
  text-decoration: none !important;
}

/* Retirer le soulignement des liens dans les titres */
.related.products .product a,
.upsells.products .product a,
.related.products .product a:hover,
.upsells.products .product a:hover {
  text-decoration: none !important;
}

/* Prix du produit */
.related.products .product .price,
.upsells.products .product .price {
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #3F4488 !important;
  margin: 0 !important;
  padding: 0 15px 15px 15px !important;
  display: block !important;
}

/* Bouton ajouter au panier */
.related.products .product .button,
.upsells.products .product .button {
  background: #EA5F6D !important;
  color: white !important;
  border: none !important;
  padding: 10px 20px !important;
  border-radius: 4px !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
  margin: 0 15px 15px !important;
  display: inline-block !important;
}

.related.products .product .button:hover,
.upsells.products .product .button:hover {
  background: #3F4488 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(63, 68, 136, 0.3) !important;
}

/* Responsive */
@media (max-width: 768px) {
  .related.products ul.products,
  .upsells.products ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
  }

  .related.products > h2,
  .upsells.products > h2 {
    font-size: 24px !important;
    margin-bottom: 20px !important;
  }
}

@media (max-width: 480px) {
  .related.products ul.products,
  .upsells.products ul.products {
    grid-template-columns: 1fr !important;
  }
}

/* Afficher le prix en bleu roi sur les fiches produits */
.single-product .summary p.price,
.single-product .summary p.price .amount,
.single-product .summary .woocommerce-variation-price .price,
.single-product .summary .woocommerce-variation-price .amount {
  color: #3F4488 !important;
}

/* Style personnalisé pour le message "aucun produit ne correspond" */
.wc-no-matching-variations.woocommerce-info {
  background: linear-gradient(135deg, #FFF5F7 0%, #FFF9FA 100%) !important;
  border: 2px solid #EA5F6D !important;
  border-radius: 8px !important;
  padding: 15px 20px !important;
  margin: 15px 0 !important;
  color: #EA5F6D !important;
  font-family: 'Lato', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  position: relative !important;
  box-shadow: 0 2px 8px rgba(234, 95, 109, 0.15) !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

/* Icône avant le message */
.wc-no-matching-variations.woocommerce-info::before {
  content: "⚠" !important;
  font-size: 20px !important;
  font-weight: bold !important;
  color: #EA5F6D !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
}

/* Animation d'apparition */
@keyframes fadeInMessage {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wc-no-matching-variations.woocommerce-info {
  animation: fadeInMessage 0.3s ease-out !important;
}

/* Style au hover pour montrer que c'est interactif */
.wc-no-matching-variations.woocommerce-info:hover {
  border-color: #3F4488 !important;
  box-shadow: 0 4px 12px rgba(63, 68, 136, 0.2) !important;
  transition: all 0.3s ease !important;
}

/* Responsive */
@media (max-width: 768px) {
  /* Mettre les labels au-dessus des options sur mobile */
  .variations tr {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 5px !important;
  }

  .variations td.label {
    width: 100% !important;
    margin-bottom: 10px !important;
  }

  .single-product .variations_form table.variations tbody tr td.value {
    width: 100% !important;
  }

  .variations select {
    max-width: 100% !important;
  }

  .wc-no-matching-variations.woocommerce-info {
    font-size: 13px !important;
    padding: 12px 15px !important;
  }

  .wc-no-matching-variations.woocommerce-info::before {
    font-size: 18px !important;
  }
}
