/**
 * MAM DDM - styles front (bloc fiche produit + pastille panier).
 * Repris de la maquette produit_2.html. Variables redeclarees localement pour
 * etre autonome du theme (pas de dependance au :root du theme).
 */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=DM+Sans:wght@400;500;600;700&display=swap');

.ddm-module,
.ddm-pill,
.product-variants {
  --coral-50: #FFE9EA;
  --coral-700: #C9333A;
  --navy: #41556B;
  --navy-900: #1A2738;
  --cream: #FBF6EF;
  --paper: #FFFFFF;
  --ink-2: #4A5468;
  --muted: #8B94A6;
  --line: #E8E2D6;
  --line-soft: #F1EAD9;
  --success: #2E8259;
  --r-lg: 24px;
  --r-pill: 999px;
  --f-display: 'Fraunces', 'Georgia', serif;
  --f-body: 'DM Sans', system-ui, sans-serif;
}

/* ---- Bloc fiche produit ---- */
.ddm-module {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  font-family: var(--f-body);
}
.ddm-module::before {
  content: ''; position: absolute;
  top: 0; right: 0; bottom: 0; width: 6px;
  background: linear-gradient(to bottom, #4ECB8A, #2E8259);
}
.ddm-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.ddm-icon-circle {
  width: 44px; height: 44px; border-radius: 50%;
  background: #DDEFE3; color: var(--success);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ddm-head-text { flex: 1; }
.ddm-head-text .top {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--success);
  margin-bottom: 2px;
}
.ddm-head-text .date {
  font-family: var(--f-display);
  font-size: 20px; font-weight: 600;
  color: var(--navy-900); line-height: 1.1;
}
.ddm-rel {
  font-family: var(--f-body);
  font-size: 13px; font-weight: 500; color: var(--muted);
}
.ddm-status-pill {
  background: #DDEFE3; color: var(--success);
  padding: 6px 12px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  white-space: nowrap;
}

/* Frise visuelle "fraicheur" */
.ddm-bar {
  position: relative;
  height: 10px; border-radius: var(--r-pill);
  background: var(--line-soft);
  overflow: hidden;
  margin-bottom: 12px;
}
.ddm-bar .fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: #4ECB8A;
  border-radius: var(--r-pill);
  transition: width .3s ease;
}
.ddm-gauge-label {
  font-size: 11px; color: var(--muted); font-weight: 500;
  letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: 6px;
}
.ddm-explain {
  display: flex; align-items: flex-start; gap: 10px;
  padding-top: 12px; border-top: 1px dashed var(--line);
  font-size: 13px; color: var(--ink-2); line-height: 1.5;
}
.ddm-explain svg { color: var(--navy); flex-shrink: 0; margin-top: 2px; }
.ddm-explain strong { color: var(--navy-900); }

/* ---- Etats (au-dela de la maquette : recolore proche / antigaspi) ---- */
.ddm-module[data-state="proche"]::before { background: linear-gradient(to bottom, #F4C95D, #E8932B); }
.ddm-module[data-state="proche"] .ddm-icon-circle,
.ddm-module[data-state="proche"] .ddm-status-pill { background: #FDF0D8; color: #B5710F; }
.ddm-module[data-state="proche"] .ddm-head-text .top { color: #B5710F; }
.ddm-module[data-state="proche"] .ddm-bar .fill { background: #E8932B; }

.ddm-module[data-state="antigaspi"]::before { background: linear-gradient(to bottom, #F08D4D, #C9333A); }
.ddm-module[data-state="antigaspi"] .ddm-icon-circle,
.ddm-module[data-state="antigaspi"] .ddm-status-pill { background: var(--coral-50); color: var(--coral-700); }
.ddm-module[data-state="antigaspi"] .ddm-head-text .top { color: var(--coral-700); }
.ddm-module[data-state="antigaspi"] .ddm-bar .fill { background: var(--coral-700); }

/* ---- Pastille panier ---- */
.ddm-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--cream);
  border-radius: var(--r-pill);
  padding: 4px 10px;
  font-size: 11px; font-weight: 600;
  color: var(--navy);
  font-family: var(--f-body);
}
.ddm-pill.short { background: var(--coral-50); color: var(--coral-700); }
.ddm-pill .icon { color: currentColor; }

/* ---- Sélecteur de déclinaisons (dates DDM) — style liste-carte ---- */
.product-variants .product-variants-item { margin-bottom: 18px; }
.product-variants .form-control-label {
  display: block;
  font-size: 15px; font-weight: 600; color: var(--navy-900);
  margin-bottom: 10px; padding: 0;
}
.product-variants ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
  overflow: hidden;
}
.product-variants li.input-container {
  position: relative; float: none !important; margin: 0; display: block;
  border-top: 1px solid var(--line-soft);
}
.product-variants li.input-container:first-child { border-top: none; }
.product-variants li.input-container:hover { background: var(--cream); }
.product-variants .input-radio {
  position: absolute; inset: 0;
  width: 100% !important; height: 100% !important;
  margin: 0; opacity: 0; cursor: pointer; z-index: 2;
}
.product-variants .radio-label {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; cursor: pointer;
  font-family: var(--f-body); font-size: 15px; color: var(--navy-900);
}
/* case à cocher carrée */
.product-variants .radio-label::before {
  content: ''; width: 22px; height: 22px; flex-shrink: 0;
  border: 2px solid var(--line); border-radius: 6px; background: var(--paper);
  transition: background .15s ease, border-color .15s ease;
}
.product-variants .input-radio:checked + .radio-label { font-weight: 700; }
.product-variants .input-radio:checked + .radio-label::before {
  background: var(--navy-900); border-color: var(--navy-900);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 14px; background-position: center; background-repeat: no-repeat;
}

/* ---- Sélecteur custom des dates (prix + badge anti-gaspi) ---- */
.mam-ddm-selector { margin: 16px 0 22px; }
.mam-ddm-selector,
.mam-ddm-pill { } /* (hérite des tokens via .ddm-* / .product-variants) */
.mam-ddm-selector { --line:#E8E2D6; --line-soft:#F1EAD9; --paper:#FFFFFF;
  --cream:#FBF6EF; --navy-900:#1A2738; --muted:#8B94A6;
  --coral-50:#FFE9EA; --coral-700:#C9333A; --coral:#FF5A5F;
  --r-lg:24px; --r-pill:999px; --f-body:'DM Sans',system-ui,sans-serif; }
.mam-ddm-selector-label {
  font-family: var(--f-body);
  font-size: 15px; font-weight: 600; color: var(--navy-900);
  margin-bottom: 10px;
}
.mam-ddm-options {
  border: 1.5px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; background: var(--paper);
}
.mam-ddm-option {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; cursor: pointer;
  border-top: 1px solid var(--line-soft);
  font-family: var(--f-body);
  transition: background .15s ease;
}
.mam-ddm-option:first-child { border-top: none; }
.mam-ddm-option:hover { background: var(--cream); }
.mam-ddm-check {
  width: 22px; height: 22px; flex-shrink: 0;
  border: 2px solid var(--line); border-radius: 6px; background: var(--paper);
  transition: background .15s ease, border-color .15s ease;
}
.mam-ddm-option.selected .mam-ddm-check {
  background: var(--navy-900); border-color: var(--navy-900);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 14px; background-position: center; background-repeat: no-repeat;
}
.mam-ddm-opt-main { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.mam-ddm-opt-date { font-size: 15px; color: var(--navy-900); }
.mam-ddm-option.selected .mam-ddm-opt-date { font-weight: 700; }
.mam-ddm-opt-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--coral-700); background: var(--coral-50);
  padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap;
}
.mam-ddm-opt-price { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.mam-ddm-badge {
  background: var(--coral); color: #fff; font-weight: 700; font-size: 13px;
  padding: 2px 8px; border-radius: 8px;
}
.mam-ddm-opt-old { color: var(--muted); text-decoration: line-through; font-size: 14px; }
.mam-ddm-opt-now { font-weight: 700; color: var(--navy-900); font-size: 16px; }
