/* Woo Custom Min/Max – Styles Frontend
---------------------------------------- */

/* Notices */
.wcmx-notice {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 8px 0;
  color: #78350f;
  font-size: 0.95rem;
}

/* =======================================================
   Bloc + Sélecteurs de dates
   ======================================================= */

.wcmx-dates-block {
  margin: 14px 0 18px;
  padding: 14px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.wcmx-date-select {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wcmx-date-select label {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
  display: block;
}

.wcmx-date-select select {
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%236b7280' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  padding: 10px 36px 10px 12px;
  font-size: 0.95rem;
  color: #111827;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
  cursor: pointer;
}

.wcmx-date-select select:hover {
  border-color: #9ca3af;
}

.wcmx-date-select select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px #2563eb33;
  transform: scale(1.01);
}

/* Option "Trade" (mise en valeur du texte) */
.wcmx-trade-option {
  font-weight: 700;
  color: #b91c1c;
}

/* Petit texte explicatif sous les sélecteurs */
.wcmx-date-select small {
  color: #6b7280;
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Adaptations WooCommerce */
.woocommerce div.product form.cart .wcmx-date-select {
  margin-bottom: 14px;
}

.wcmx-minmax-error {
  color: #dc2626;
  font-weight: 600;
  padding: 6px 0;
}

/* Responsive */
@media (max-width: 680px) {
  .wcmx-date-select {
    gap: 6px;
  }
  .wcmx-date-select select {
    font-size: 0.9rem;
    padding: 8px 32px 8px 10px;
  }
}

/* =======================================================
   BADGE "AFFICHE" – Version ronde sans bordure (top-right)
   ======================================================= */

.wcmx-badge.wcmx-badge--round {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 30;
  width: 78px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .05em;

  /* Dégradé rouge vif */
  background: radial-gradient(circle at 30% 30%, #ff6b6b 0%, #b91c1c 85%);

  /* Forme ronde sans bordure */
  border-radius: 50%;

  /* Relief & ombre douce */
  box-shadow:
    inset 0 3px 6px rgba(255,255,255,0.2),
    inset 0 -3px 8px rgba(0,0,0,0.3),
    0 6px 14px rgba(0,0,0,0.25);

  transform: rotate(10deg);
  animation: wcmx-round-pulse 2.8s ease-in-out infinite;
}

/* Légère brillance interne */
.wcmx-badge.wcmx-badge--round::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.25), transparent 70%);
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* Animation subtile */
@keyframes wcmx-round-pulse {
  0%, 100% { transform: rotate(10deg) scale(1); }
  50%      { transform: rotate(10deg) scale(1.06); }
}

/* Contexte de positionnement pour les cartes produit */
.woocommerce ul.products li.product,
.wc-block-grid__products .wc-block-product,
.wc-block-product {
  position: relative !important;
}

/* =======================================================
   Harmonisation des <select> dans les boucles produits
   ======================================================= */

.wcmx-loop-cart select {
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%236b7280' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  padding: 10px 36px 10px 12px;
  font-size: 0.95rem;
  color: #111827;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
  cursor: pointer;
  width: 100%;
  margin-bottom: 8px;
}

.wcmx-loop-cart select:hover {
  border-color: #9ca3af;
}

.wcmx-loop-cart select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px #2563eb33;
  transform: scale(1.01);
}

.wcmx-loop-cart label {
  font-weight: 600;
  color: #1f2937;
  font-size: 0.9rem;
  margin-bottom: 4px;
  display: block;
}

.wcmx-loop-cart .wcmx-trade-option {
  font-weight: 700;
  color: #b91c1c;
}

/* =======================================================
   Bouton "Ajouter au panier" (grilles & fiche produit)
   ======================================================= */

.wcmx-loop-cart button.button,
.single-product form.cart button.button {
  display: inline-block;
  width: 100%;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-align: center;
  transition:
    background 0.3s ease,
    transform 0.15s ease,
    box-shadow 0.25s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.wcmx-loop-cart button.button:hover,
.single-product form.cart button.button:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}

.wcmx-loop-cart button.button:active,
.single-product form.cart button.button:active {
  transform: translateY(0);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.wcmx-loop-cart button.button:disabled,
.single-product form.cart button.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Petits écrans */
@media (max-width: 680px) {
  .wcmx-loop-cart button.button,
  .single-product form.cart button.button {
    font-size: 0.9rem;
    padding: 9px 12px;
  }
}

/* =======================================================
   VARIANTE ROUGE (produit avec dates Trade)
   S'applique quand le conteneur a .wcmx-has-trade (voir PHP ci-dessous)
   ======================================================= */

/* Bouton "Ajouter au panier" (grille & fiche produit) */
.wcmx-has-trade .wcmx-loop-cart button.button,
.wcmx-has-trade.single-product form.cart button.button {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 3px 8px rgba(185, 28, 28, 0.25);
}

.wcmx-has-trade .wcmx-loop-cart button.button:hover,
.wcmx-has-trade.single-product form.cart button.button:hover {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.35);
}

/* =======================================================
   Amélioration champ QUANTITÉ
   ======================================================= */

/* Fiche produit & grilles (dans notre mini-form) */
.single-product form.cart .quantity input.qty,
.wcmx-loop-cart .quantity input.qty {
  width: 110px;              /* un peu plus large */
  max-width: 100%;
  height: 40px;
  /*padding: 8px 12px;*/
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  transition: box-shadow .2s ease, border-color .2s ease;
}

.single-product form.cart .quantity input.qty:focus,
.wcmx-loop-cart .quantity input.qty:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .25);
}

/* Empêche le champ de se coller au bouton dans certains thèmes */
.single-product form.cart .quantity,
.wcmx-loop-cart .quantity {
  margin: 8px 0 10px;
  text-align: center;
}

/* Sur mobile: un poil plus compact */
@media (max-width: 680px) {
  .single-product form.cart .quantity input.qty,
  .wcmx-loop-cart .quantity input.qty {
    height: 38px;
    font-size: 0.9rem;
  }
}

/* Optionnel : harmonise la ligne du mini-form dans les grilles */
.wcmx-loop-cart select,
.wcmx-loop-cart .quantity input.qty,
.wcmx-loop-cart button.button {
  border-radius: 8px;
}

/* ==== Cartes produits en colonnes & bouton aligné en bas ==== */

/* Cartes classiques WooCommerce */
.woocommerce ul.products li.product {
  display: flex;
  flex-direction: column;
}

/* Cartes des Woo Blocks (wc-block) */
.wc-block-grid__products .wc-block-product,
.wc-block-grid__product {
  display: flex;
  flex-direction: column;
}

/* Empêche l'image/le prix de se compresser */
.woocommerce ul.products li.product a img,
.woocommerce ul.products li.product .price,
.wc-block-grid__product .wc-block-grid__product-price {
  flex: 0 0 auto;
}

/* Le mini-form (selects + qty + bouton) reste collé en bas */
.wcmx-loop-cart {
  margin-top: auto;
}

/* ==== Titre: clamp sur 2 lignes et hauteur constante ==== */

/* Thèmes/classiques */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;

  line-height: 1.3;
  min-height: calc(1.3em * 2); /* réserve 2 lignes */
}

/* Woo Blocks */
.wc-block-grid__product .wc-block-grid__product-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;

  line-height: 1.3;
  min-height: calc(1.3em * 2);
}

/* Optionnel : harmonise les espacements au-dessus du formulaire */
.woocommerce ul.products li.product .price,
.wc-block-grid__product .wc-block-grid__product-price {
  margin-bottom: 12px;
}

/* Cartes Woo Blocks = colonnes */
li.wc-block-product {
  display: flex;
  flex-direction: column;
  position: relative; /* pour la pastille */
}

/* Le wrapper interne des blocks devient aussi une colonne qui remplit la carte */
li.wc-block-product > .wp-block-group {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 100%;
}

/* Titre produit (Woo Blocks): clamp 2 lignes */
li.wc-block-product .wp-block-post-title,
li.wc-block-product .wc-block-grid__product-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;

  line-height: 1.3;
  min-height: calc(1.3em * 2); /* réserve l’espace de 2 lignes */
  margin-bottom: .35rem;       /* petit écart uniforme */
}

/* Empêche image/prix de se comprimer */
li.wc-block-product [data-block-name="woocommerce/product-image"],
li.wc-block-product .wp-block-woocommerce-product-price {
  flex: 0 0 auto;
}

/* Ton mini-form (sélects + qty + bouton) reste collé en bas */
li.wc-block-product .wcmx-loop-cart {
  margin-top: auto;
}

/* La pastille dans le coin (déjà OK) */
.wcmx-badge--round { right: 10px; top: 10px; }

/* (optionnel) petit espace sous le prix pour homogénéiser */
li.wc-block-product .wp-block-woocommerce-product-price {
  margin-bottom: 12px;
}