﻿/* Carte produit */
.product-card {
  --card-halo: 38, 210, 118; /* fleurs (vert) par dÃ©faut */
  position: relative;
  background: radial-gradient(circle at 50% 33%, rgba(var(--card-halo), 0.75) 0%, rgba(var(--card-halo), 0.4) 15%, transparent 38%), #462C83;
  border-radius: 16px;
  padding: 0 20px 20px 20px;
  transition: all 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-card[data-collection="resines-cbd"]     { --card-halo: 255, 128, 0; }
.product-card[data-collection="huiles-cbd"]      { --card-halo: 255, 238, 0; }
.product-card[data-collection="accessoires-cbd"] { --card-halo: 53, 182, 180; }

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

/* Cercles top-left : drapeau, promo, affluence */
.product-badges-left {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

/* Scope: alignement centré uniquement dans la card (le promo 44px et les autres 36px s'alignent sur le même axe vertical).
   Sur la page produit, on garde l'alignement à gauche pour que les labels textes restent alignés. */
.product-card .product-badges-left {
  align-items: center;
}

.badge-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple);
  font-weight: 700;
  font-size: 0.75rem;
  overflow: hidden;
}

.badge-circle svg {
  width: 80%;
  height: 80%;
  overflow: visible;
}

.badge-circle.badge-bestseller svg {
  width: 55%;
  height: 55%;
}

.badge-circle.badge-cbd {
  font-size: 0.75rem;
}

.badge-circle.badge-cbd .cbd-value {
  font-weight: 800;
}

/* Badges emoji (reco / rupture) — cercle vert hérité, emoji plus gros */
.badge-circle.badge-emoji {
  font-size: 1.15rem;
  line-height: 1;
}

/* Badges Promo & New : sticker festonné rouge */
.badge-circle.badge-promo,
.badge-circle.badge-new {
  background: transparent;
  color: var(--white);
  overflow: visible;
  position: relative;
}

.badge-circle.badge-promo::before,
.badge-circle.badge-new::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #ff2020;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><g fill='black'><circle cx='50' cy='50' r='42'/><circle cx='50' cy='8' r='8'/><circle cx='71' cy='14' r='8'/><circle cx='86' cy='29' r='8'/><circle cx='92' cy='50' r='8'/><circle cx='86' cy='71' r='8'/><circle cx='71' cy='86' r='8'/><circle cx='50' cy='92' r='8'/><circle cx='29' cy='86' r='8'/><circle cx='14' cy='71' r='8'/><circle cx='8' cy='50' r='8'/><circle cx='14' cy='29' r='8'/><circle cx='29' cy='14' r='8'/></g></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><g fill='black'><circle cx='50' cy='50' r='42'/><circle cx='50' cy='8' r='8'/><circle cx='71' cy='14' r='8'/><circle cx='86' cy='29' r='8'/><circle cx='92' cy='50' r='8'/><circle cx='86' cy='71' r='8'/><circle cx='71' cy='86' r='8'/><circle cx='50' cy='92' r='8'/><circle cx='29' cy='86' r='8'/><circle cx='14' cy='71' r='8'/><circle cx='8' cy='50' r='8'/><circle cx='14' cy='29' r='8'/><circle cx='29' cy='14' r='8'/></g></svg>");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  pointer-events: none;
}

/* Badge Promo : sticker agrandi pour respirer + "promo" petit + -XX% gros */
.badge-circle.badge-promo {
  width: 44px;
  height: 44px;
  flex-direction: column;
  gap: 0;
}
.badge-circle.badge-promo .promo-label {
  position: relative;
  font-family: var(--font-body);
  font-size: 0.45rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.3;
}
.badge-circle.badge-promo .promo-value {
  position: relative;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}

/* Badge New : "NEW" centré */
.badge-circle.badge-new {
  font-family: var(--font-head);
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}
.badge-circle.badge-new .badge-new-label {
  position: relative;
  line-height: 1;
}

/* Note + Ã©toile blanche top-right */
.product-rating-mini {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--white);
  font-family: var(--font-head);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
  z-index: 10;
}

.product-rating-mini span {
  display: inline-block;
  line-height: 1;
  transform: translateY(3px);
}

.product-rating-mini svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* Image produit (le halo vert est portÃ© par .product-card) */
.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0px 30px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

/* Informations produit */
.product-info {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: -35px;
  flex: 1;
}

.product-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}

/* Liens vers page produit */
.product-image-link,
.product-name-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

/* Wrapper du nom : reserve la hauteur de 2 lignes et centre verticalement le nom (1 ou 2 lignes) */
.product-name-link {
  min-height: calc(2.5rem * 0.85 * 2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
}

/* Nom du produit â€” line-clamp a 2 lignes max (truncate avec â€¦ si plus long) */
.product-name {
  font-family: var(--font-head);
  font-size: 2.5rem;
  font-weight: 400;
  margin: 0;
  padding: 0 15px;
  line-height: .85;
  color: var(--white);
  text-align: center;
  word-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* SÃ©lecteur variante */
.product-variants {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.select-wrapper {
  position: relative;
  display: block;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 10px;
  height: 6px;
  background-color: var(--green);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform: translateY(-50%);
  pointer-events: none;
  transition: transform 0.2s ease;
  z-index: 3;
}


.variant-select {
  width: 100%;
  min-height: 46px;
  padding: 5px 25px 5px 20px;
  background: transparent;
  border: 2px solid var(--green);
  border-radius: 9999px;
  color: transparent;
  font-family: var(--font-head);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
  text-align-last: center;
  position: relative;
  z-index: 1;
}

.variant-select:hover {
  background: rgba(38, 210, 118, 0.1);
}

.variant-select:focus {
  outline: none;
}

.variant-select option {
  color: var(--white);
  background-color: var(--purple);
  font-family: var(--font-body);
  font-size: 1rem;
  font-style: normal;
  font-variant: normal;
  line-height: normal;
  letter-spacing: normal;
  text-align: left;
  text-align-last: left;
  text-transform: none;
  text-shadow: none;
  text-decoration: none;
  cursor: default;
  padding: 4px 8px;
}

.variant-select option:disabled {
  color: rgba(255, 255, 255, 0.5);
}

.variant-display {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--green);
  font-family: var(--font-head);
  font-size: 2rem;
  line-height: 1;
  padding: 5px 25px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}

.variant-display .variant-sep {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.3rem;
  margin: 0 6px;
  vertical-align: middle;
  opacity: 0.9;
}

.variant-display .variant-unit-price {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-style: italic;
  margin: 0 12px 0 0;
  vertical-align: middle;
}

/* Bouton "A partir de X" */
.btn-add-to-cart {
  width: 100%;
  padding: 5px 25px 5px 20px;
  background: #327D78;
  color: var(--purple);
  border: 2px solid transparent;
  border-radius: 9999px;
  font-family: var(--font-head);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: block;
  text-align: center;
  white-space: nowrap;
}

.btn-add-to-cart:not(:disabled) {
  background: var(--green);
  color: var(--purple);
}

.btn-add-to-cart:disabled {
  cursor: not-allowed;
}

/* Séparateur rond entre "Ajouter au panier" et le prix — dessiné en CSS car la police head custom n'a pas de glyphe propre pour · (rendu carré et désaligné en fallback système).
   radial-gradient plutôt que border-radius car à 4×4px le sub-pixel rounding du navigateur produit un losange/quasi-carré ; le gradient donne un cercle anti-aliasé propre. */
.cta-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: radial-gradient(circle, currentColor 50%, transparent 52%);
  vertical-align: middle;
  margin: 3px;
}

/* .price-strike est defini dans main.css (utilise sur cards + recap commande) */

/* TOOLTIP */
.btn-wrapper {
  position: relative;
  display: var(--home-display, inline-block);
}

.tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: white;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

/* Affiche tooltip uniquement si bouton disabled */
.btn-wrapper:hover .btn-add-to-cart:disabled + .tooltip {
  opacity: 1;
}

/* Messages */
.no-variant {
  text-align: center;
  padding: 16px;
  opacity: 0.6;
  font-size: 1rem;
  font-style: italic;
}

/* Ã‰tat "tout en rupture" : croix SVG corner-to-corner (anti-aliasÃ©e), select violet */
/* Couleur stroke = var(--purple) (#2F156C) â€” encodÃ©e en dur car les variables CSS ne sont pas supportÃ©es dans une data URI */
.select-wrapper.is-rupture {
  border-radius: 9999px;
  overflow: hidden;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><line x1='0' y1='0' x2='100' y2='100' stroke='%232F156C' stroke-width='2' vector-effect='non-scaling-stroke'/><line x1='100' y1='0' x2='0' y2='100' stroke='%232F156C' stroke-width='2' vector-effect='non-scaling-stroke'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.select-wrapper.is-rupture::after {
  display: none;
}

.select-wrapper.is-rupture .variant-select,
.select-wrapper.is-rupture .variant-select:hover,
.select-wrapper.is-rupture .variant-select:disabled {
  border-color: var(--purple);
  background: transparent;
  cursor: not-allowed;
  opacity: 1;
}

.select-wrapper.is-rupture .variant-display {
  color: var(--purple);
}

/* Bouton "Rupture de stock" */
.btn-add-to-cart.btn-rupture,
.btn-add-to-cart.btn-rupture:disabled {
  background: var(--purple);
  color: var(--white);
}

/* Carte produit en rupture totale : overlay sur toute la card + fade badges/nom (les actions restent normales) */
.product-card.is-rupture:hover {
  transform: none;
  box-shadow: none;
}

.product-card.is-rupture:hover .product-image img {
  transform: none;
}

/* Overlay sombre sur toute la carte : couvre image + halo radial du fond.
   z-index 1 le place sous les badges (z:10) et sous .product-info (z:2 = nom + actions). */
.product-card.is-rupture::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(47, 21, 108, 0.55); /* var(--purple) avec alpha */
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}

/* Fade badges (cercles gauche + note droite) et nom du produit */
.product-card.is-rupture .product-badges-left,
.product-card.is-rupture .product-rating-mini,
.product-card.is-rupture .product-name {
  opacity: 0.45;
}
