:root {
  --sdm-blue: #1B2D6B;
  --sdm-grey: #77756E;
  --sdm-green: #4caf50;
}

/* === Masquage automatique Flatsome/WooCommerce quand abonnement actif === */
body.sdm-mode-abonnement-active .ux-quantity,
body.sdm-mode-abonnement-active form.cart .quantity,
body.sdm-mode-abonnement-active form.cart .ux-quantity__button,
body.sdm-mode-abonnement-active form.cart input.qty {
  display: none !important;
}


/* === Conteneur des boutons === */
.sdm-mode-buttons {
  display: flex !important;
  flex-direction: column !important; 
  gap: 12px !important;
  margin-bottom: 15px !important;
}

/* === Bouton individuel === */
.sdm-mode-btn {
  position: relative !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 14px 16px !important;
  background: #fff !important;
  background-color: #fff !important;
  border: 1px solid rgba(31, 33, 46, 0.12) !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: -1% !important;
  color: #272624 !important;
  transition: all 0.2s ease !important;
  margin: 0px !important;
}
.sdm-mode-btn:hover {
  border-color: #bbb !important;
}
.sdm-mode-btn.active {
  border-color: rgba(0, 0, 0, 1) !important;
  color: var(--sdm-blue) !important;
}
.sdm-mode-btn.active .sdm-summary-title {
  color: var(--sdm-blue) !important;
}

/* === Petit bouton radio === */
.sdm-mode-btn .sdm-mode-main-line::before {
  content: "";
  flex-shrink: 0 !important;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0.8px solid var(--sdm-blue);
  background: #fff;
  transition: all 0.25s ease;
}

/* Radio quand actif */
.sdm-mode-btn.active .sdm-mode-main-line::before {
  border-color: #1B2D6B !important;
  background: radial-gradient(circle at center, #1B2D6B 30%, transparent 46%) !important;
}

.sdm-subscription-panel {
  margin-top: 15px !important;
}

.sdm-opt-wrapper {
  font-family: 'Figtree', sans-serif;
}

/* === Mise en ligne du sélecteur + bouton === */
.sdm-subscribe-row {
  display: flex;
  align-items: stretch; 
  gap: 10px;
  justify-content: flex-start;
  margin-top: 10px;
}

.sdm-mode-btn,
.sdm-summary-title,
.sdm-summary-subtext,
.sdm-summary-choice,
.sdm-summary-note,
.sdm-next-payment,
.sdm-learn-more {
  text-transform: none;
  letter-spacing: -0.01em;
  text-align: left;
  white-space: normal;
}

/* Bloc quantité compact */
.sdm-custom-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 20%;
  border: 1px solid #D7D8DA;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  font-weight: 500;
  color: rgb(84, 88, 102);
}

/* === Boutons +/- === */
.sdm-custom-qty .sdm-qty-btn {
  flex: 0 0 33%;
  height: 100%;
  padding: 0px;
  background: #fff; 
  border: none;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  font-weight: 600;
  margin-bottom: 0px !important;
  margin-right: 0px !important;
  transition: background 0.15s ease;
}
.sdm-custom-qty .sdm-qty-btn:hover {
  background: #f2f2f2;
}

/* === Champ numérique central === */
.sdm-custom-qty .sdm-qty-input {
  flex: 1;
  height: 100%;
  text-align: center;
  border: none;
  font-size: 16px;
  font-weight: 500;
  background: #fff;
  outline: none;
  box-shadow: none;
  margin-bottom: 0px !important;
}

/* Supprime les flèches natives du input number */
.sdm-custom-qty .sdm-qty-input::-webkit-outer-spin-button,
.sdm-custom-qty .sdm-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.sdm-custom-qty .sdm-qty-input[type=number] {
  -moz-appearance: textfield;
}

/* === Bouton S’abonner === */
.sdm-subscribe-btn {
  flex: 1 0 70%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
  background: var(--sdm-blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
  padding: 0 20px;
  margin-bottom: 0px !important;
  line-height: 100%;
}
.sdm-subscribe-btn:hover {
  background: #0C1A4C;
}


/* === Bouton Abonnement : base === */
.sdm-mode-abonnement {
  position: relative;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  padding: 16px;
}

.sdm-mode-content form p {
  margin-bottom : 0px;
}

/* Ligne principale toujours visible */
.sdm-mode-main-line {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 16px;
}

.sdm-main-line-content {
  display: flex;
  justify-content: space-between;
  flex: 1; 
}

/* Bloc gauche (titre + badge + sous-texte) */
.sdm-summary-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sdm-summary-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sdm-summary-title {
  font-weight: 600;
  color: #222;
  font-size: 14px;
  line-height: 1.4em;
}

.sdm-discount-badge {
  background: #498084;
  color: #fff;
  font-size: 12px;
  border-radius: 100px;
  padding: 4px 8px;
  font-weight: 500;
  line-height: 15px;
}

.sdm-summary-subtext {
  font-size: 12px;
  font-weight: 400;
  color: #42413D;
  line-height: 1.4em;
  margin-bottom : 0px;
}

/* Bloc droite (prix) */

.sdm-opt-wrapper span.amount {
  color: inherit !important;
  font-weight: inherit !important;
  white-space: normal !important;
}

.sdm-summary-right {
  text-align: right;
  min-width: 140px;
}

.sdm-price-row {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.sdm-price-old {
  text-decoration: line-through;
  color: #7B7E84;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.4em;
}

.sdm-price-new {
  color: var(--sdm-blue);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  line-height: 1.4em;
}

.sdm-price-note {
  font-size: 12px;
  color: var(--sdm-grey);
  font-weight: 400;
  line-height: 1.4em;
  margin-bottom : 0px;
}

/* Détails supplémentaires : masqués par défaut */
.sdm-abonnement-details {
  display: none;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

/* Affichés uniquement quand le bouton est actif */
.sdm-mode-abonnement.active .sdm-abonnement-details {
  display: flex;
}

/* Texte descriptif */
.sdm-summary-choice {
  font-size: 13px;
  color: #272624;
  line-height: 1.4em;
  font-weight: 400;
  margin-bottom: 4px;
}

.sdm-summary-note {
  font-size: 12px;
  font-style: italic;
  color: var(--sdm-grey);
  font-weight: 400;
  line-height: 1.4em;
  letter-spacing: -0.01em;
  text-transform: none;
  margin-bottom: 0;
}

/* Ligne du prochain prélèvement + lien */
.sdm-summary-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(31, 33, 46, 0.12);
}

.sdm-next-payment {
  font-size: 13px;
  color: #272624;
  line-height: 1.4em;
  font-weight: 400;
  margin-bottom: 0;
}

.sdm-learn-more {
  font-size: 12px;
  color: var(--sdm-grey);
  text-decoration: underline;
  cursor: pointer;
  line-height: 1.4em;
  font-weight: 400;
}

/* Liste des bénéfices */
.sdm-subscription-benefits {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: 'Inter', sans-serif;
  text-transform: none;
  font-weight: 400;
  font-size: 12px;
  color: var(--sdm-blue);
  letter-spacing: -0.02em;
  margin-bottom: 0;
}

.sdm-benefit {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4em;
  margin-bottom: 0;
  text-align: left;
}

.sdm-benefit .check {
  color: #4caf50;
  font-weight: bold;
}

.sdm-qty-input {
  color: #1B2D6B !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #1B2D6B !important;
  background-color: #fff !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
}

.sdm-qty-input::placeholder {
  color: #1B2D6B !important;
}

.sdm-qty-input {
  font-size: 16px !important;
  line-height: 1 !important;
  height: 32px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  text-align: center !important;
  background: #fff !important;
}

.sdm-qty-input {
  -webkit-appearance: textfield !important;
  appearance: textfield !important;
}


/* =============================================================
   === CARTOUCHES-RECHARGES : Styles spécifiques ===
   ============================================================= */

/* --- Masquage .hydro-consumable-choice sur les pages cartouches --- */
/* Utilise :has() car .hydro-consumable-choice précède .sdm-opt-wrapper dans le DOM */
form.cart:has(.sdm-opt-wrapper[data-is-cartouches="1"]) .hydro-consumable-choice {
  display: none !important;
}

/* --- Masquer le panel ±/S'abonner pour cartouches --- */
.sdm-opt-wrapper[data-is-cartouches="1"] .sdm-subscription-panel {
  display: none !important;
}

/* --- Ligne qty dans le bouton achat unique --- */
.sdm-achat-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(31, 33, 46, 0.08);
}

.sdm-achat-qty-label {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #272624;
  line-height: 1.4em;
  flex: 1;
}

.sdm-achat-qty-slot {
  flex: 0 0 auto;
  min-width: 100px;
}

/* Le qty natif Woo déplacé dans le slot garde son style */
.sdm-achat-qty-slot .quantity,
.sdm-achat-qty-slot .ux-quantity {
  display: flex !important;
  margin: 0 !important;
}

/* --- Bloc résumé remise (près du add-to-cart) --- */
.sdm-discount-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: #f5f7fa;
  border: 1px solid rgba(31, 33, 46, 0.08);
  border-radius: 8px;
  font-family: 'Figtree', sans-serif;
  text-align: center;
}

.sdm-discount-summary.has-discount {
  background: #eef7ee;
  border-color: rgba(76, 175, 80, 0.2);
}

.sdm-discount-summary-percent {
  font-size: 15px;
  font-weight: 700;
  color: var(--sdm-grey);
  line-height: 1;
}

.sdm-discount-summary.has-discount .sdm-discount-summary-percent {
  color: var(--sdm-green);
}

.sdm-discount-summary-label {
  font-size: 13px;
  font-weight: 500;
  color: #272624;
  line-height: 1;
}

.sdm-discount-summary-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--sdm-grey);
  line-height: 1;
  margin-left: 2px;
}

.sdm-discount-summary-count::before {
  content: "\2022";
  margin-right: 6px;
}

/* --- Radios cartouches dans le panneau abonnement --- */
.sdm-cartouches-radios {
  display: flex;
  flex-direction: row;
  gap: 12px;
}

.sdm-cartouche-radio {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid rgba(31, 33, 46, 0.12);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.sdm-cartouche-radio:hover {
  border-color: #bbb;
}

.sdm-cartouche-radio.active {
  border-color: var(--sdm-blue);
  background: #f8f9fd;
}

/* Cacher l'input radio natif */
.sdm-cartouche-radio input[type="radio"] {
  display: none !important;
}

/* Indicateur radio custom */
.sdm-radio-indicator {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(31, 33, 46, 0.25);
  background: #fff;
  transition: all 0.25s ease;
}

.sdm-cartouche-radio.active .sdm-radio-indicator {
  border-color: var(--sdm-blue);
  background: radial-gradient(circle at center, var(--sdm-blue) 30%, transparent 46%);
}

/* Contenu info de la cartouche */
.sdm-cartouche-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
  gap: 10px;
}

.sdm-cartouche-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.sdm-cartouche-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sdm-cartouche-name {
  font-size: 14px;
  font-weight: 600;
  color: #272624;
  line-height: 1.4em;
}

.sdm-cartouche-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sdm-cartouche-price-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.sdm-cartouche-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--sdm-blue);
  line-height: 1.4em;
}

.sdm-cartouche-price span.amount {
  color: inherit !important;
  font-weight: inherit !important;
}

.sdm-cartouche-duration {
  font-size: 12px;
  font-weight: 400;
  color: var(--sdm-grey);
  line-height: 1.4em;
}

.sdm-cartouche-old-price {
  font-size: 12px;
  font-weight: 400;
  color: #7B7E84;
  text-decoration: line-through;
  line-height: 1.4em;
}

.sdm-cartouche-old-price span.amount {
  color: inherit !important;
  font-weight: inherit !important;
}

/* --- Add-to-cart : garantir une hauteur correcte même sans qty voisin --- */
.sdm-opt-wrapper[data-is-cartouches="1"] ~ .single_add_to_cart_button,
form.cart .single_add_to_cart_button {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
  min-height: 44px !important;
  box-sizing: border-box !important;
}

/* --- Add-to-cart full-width en mode abonnement cartouches --- */
body.sdm-abo-fullwidth form.cart .single_add_to_cart_button {
  width: 100% !important;
  flex: unset !important;
}

body.sdm-abo-fullwidth form.cart .quantity,
body.sdm-abo-fullwidth form.cart .ux-quantity {
  display: none !important;
}

/* Masquer le qty natif quand il est dans son emplacement original et que le mode abo cartouches est actif */
body.sdm-abo-fullwidth .sdm-achat-qty-row {
  display: none !important;
}

/* --- FunnelKit mini-cart : verrouiller qty abonnements (renfort CSS) --- */
.fkcart-item[data-sdm-qty-locked] .fkcart-qty-wrap,
.fkcart-item[data-sdm-qty-locked] .fkcart-quantity-selector,
.fkcart-item[data-sdm-qty-locked] .fkcart-qty {
  pointer-events: none !important;
  opacity: 0.5 !important;
  user-select: none !important;
}

.fkcart-item[data-sdm-qty-locked] .fkcart-qty-btn,
.fkcart-item[data-sdm-qty-locked] .fkcart-quantity__button {
  pointer-events: none !important;
  opacity: 0.3 !important;
}

/* ============================================================
   Bloc paliers de réduction progressifs (achat unique)
   ============================================================ */

.sdm-discount-tiers-bar {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Ligne des 3 blocs */
.sdm-tiers-boxes {
  display: flex;
  gap: 10px;
}

/* Bloc individuel — état inactif */
.sdm-tier-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 4px;
  background: rgba(73, 128, 132, 0.10);
  transition: background 0.2s ease, color 0.2s ease;
}

.sdm-tier-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.sdm-tier-discount {
  font-family: Figtree, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #366063;
  line-height: 20px;
}

.sdm-tier-label {
  font-family: Figtree, sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #366063;
  line-height: 1.3;
  letter-spacing: -0.12px;
  text-align: left;
}

/* Icône check — cachée par défaut */
.sdm-tier-check {
  display: none;
  width: 14px;
  height: 14px;
  min-width: 14px;
  border-radius: 50%;
  background: #fff;
  color: #366063;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Bloc actif */
.sdm-tier-box.is-active {
  background: #366063;
}

.sdm-tier-box.is-active .sdm-tier-discount,
.sdm-tier-box.is-active .sdm-tier-label {
  color: #FEFEFE;
}

.sdm-tier-box.is-active .sdm-tier-check {
  display: inline-flex;
}

/* Barre de progression */
.sdm-tiers-progress {
  height: 6px;
  background: rgba(73, 128, 132, 0.15);
  border-radius: 3px;
  overflow: hidden;
}

.sdm-tiers-progress-fill {
  height: 100%;
  background: #366063;
  border-radius: 3px;
  transition: width 0.35s ease;
  width: 0%;
}

/* === Bloc achat-only (sans option abonnement) : masquer le radio indicator === */
.sdm-mode-achat--only .sdm-mode-main-line::before {
  display: none !important;
}

/* Pas de curseur pointer ni d'effet hover sur le bloc achat-only */
.sdm-mode-achat--only {
  cursor: default !important;
  pointer-events: none;
}

/* Réactiver les events sur les enfants interactifs (qty) */
.sdm-mode-achat--only .sdm-achat-qty-row,
.sdm-mode-achat--only .sdm-achat-qty-slot,
.sdm-mode-achat--only .sdm-achat-qty-slot * {
  pointer-events: auto;
}

/* =============================================================
   RESPONSIVE MOBILE
   ============================================================= */

@media (max-width: 480px) {

  /* Eviter le débordement horizontal du wrapper */
  .sdm-opt-wrapper,
  .sdm-mode-buttons,
  .sdm-mode-btn {
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* 1. Achat unique : sdm-achat-qty-row en colonne */
  .sdm-achat-qty-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .sdm-achat-qty-slot {
    width: 100%;
  }

  /* 2a. Abonnement : sdm-main-line-content en colonne alignée à gauche */
  .sdm-main-line-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* Bloc prix droit : aligner à gauche aussi */
  .sdm-summary-right {
    min-width: 0;
    text-align: left;
  }

  .sdm-price-row {
    justify-content: flex-start;
  }

  /* sdm-summary-title-row peut wrapper (badge sous le titre si besoin) */
  .sdm-summary-title-row {
    flex-wrap: wrap;
  }

  /* sdm-summary-subtext : pas de débordement */
  .sdm-summary-subtext {
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
  }

  /* 2b. Radios cartouches : colonne */
  .sdm-cartouches-radios {
    flex-direction: column;
  }

  /* 2c. sdm-summary-choice : pas de débordement */
  .sdm-summary-choice {
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
  }

  /* 2d. Bénéfices : pas de débordement */
  .sdm-subscription-benefits {
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal !important;
  }

  .sdm-benefit {
    display: grid !important;
    grid-template-columns: auto 1fr !important;
    gap: 6px !important;
    align-items: start !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .sdm-benefit .check {
    flex-shrink: 0;
    white-space: normal !important;
  }
}

