/* ================================================================
   cart.css — Page panier + tunnel checkout (L2 panier — mai 2026)
   Charte EP : variables --ep-* uniquement (cf. memo §13)
   ================================================================ */

/* ─── Layout général ────────────────────────────────────────── */
.ep-cart-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--ep-space-lg) var(--ep-space-md);
  /* L7.3m — Force le rendu clair même si le navigateur/OS est en dark mode.
     Le panier est conçu en charte claire (gold/blanc) ; sans ça, le dark
     mode du téléphone écrase les fonds de démarcation des kits. */
  color-scheme: light;
}

.ep-cart-title {
  font-family: var(--ep-font-display);
  font-size: var(--ep-fs-h1);
  font-weight: 700;
  color: var(--ep-text);
  margin: var(--ep-space-md) 0 var(--ep-space-lg);
}

/* Breadcrumb (réutilise pattern produit) */
/* ─── Breadcrumb : style centralisé dans layout.css (27/05/2026)
   Les règles .ep-breadcrumb / .ep-breadcrumb a / :hover ont été RETIRÉES
   d'ici car elles utilisaient des variables fantômes (--ep-fs-xs,
   --ep-space-md, --ep-gold-dark) non définies dans theme.css → fallback
   navigateur ~16px, ce qui rendait le breadcrumb anormalement gros.
   Conservé : .ep-breadcrumb-sep et .ep-breadcrumb strong (utiles, pas en conflit). */
.ep-breadcrumb-sep {
  margin: 0 var(--ep-space-xs);
  color: var(--ep-text-muted);
}
.ep-breadcrumb strong {
  color: var(--ep-text);
  font-weight: 600;
}

/* ─── Grid 2 colonnes ──────────────────────────────────────── */
.ep-cart-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--ep-space-lg);
  align-items: start;
}
@media (max-width: 900px) {
  .ep-cart-grid { grid-template-columns: 1fr; }
}
.ep-cart-lines-col { min-width: 0; }

/* ─── Lignes panier ────────────────────────────────────────── */
.ep-cart-lines {
  display: flex;
  flex-direction: column;
  gap: var(--ep-space-sm);
}

.ep-cart-line {
  background: var(--ep-bg-card);
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius);
  padding: var(--ep-space-md) var(--ep-space-md);
  transition: border-color 0.15s ease;
}
.ep-cart-line:hover {
  border-color: var(--ep-gold-dark);
}

.ep-cart-line-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--ep-space-md);
  align-items: start;
  margin-bottom: var(--ep-space-sm);
}
@media (max-width: 600px) {
  .ep-cart-line-top { grid-template-columns: 1fr; }
}

.ep-cart-line-info { min-width: 0; }
.ep-cart-line-ref {
  font-family: var(--ep-font-mono);
  font-size: var(--ep-fs-xs);
  color: var(--ep-text-muted);
  margin: 0 0 var(--ep-space-xs);
}
.ep-cart-line-ref a {
  color: var(--ep-gold-dark);
  text-decoration: none;
}
.ep-cart-line-ref a:hover { text-decoration: underline; }
.ep-cart-line-name {
  font-size: var(--ep-fs-sm);
  font-weight: 600;
  color: var(--ep-text);
  margin: 0;
  line-height: 1.4;
}

.ep-cart-line-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--ep-space-xs);
}
.ep-cart-line-qty {
  display: flex;
  align-items: center;
  gap: var(--ep-space-xs);
}
.ep-cart-line-qty label {
  font-size: var(--ep-fs-xs);
  color: var(--ep-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.ep-cart-qty-input {
  width: 60px;
  padding: 6px 8px;
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius-sm);
  font-size: var(--ep-fs-sm);
  text-align: center;
  font-family: var(--ep-font-body);
}
.ep-cart-qty-input:focus {
  outline: none;
  border-color: var(--ep-gold);
}
.ep-cart-line-remove {
  background: none;
  border: none;
  color: var(--ep-danger);
  font-size: var(--ep-fs-xs);
  cursor: pointer;
  padding: 0;
  font-family: var(--ep-font-body);
}
.ep-cart-line-remove:hover { text-decoration: underline; }

/* ─── Tableau prix ─────────────────────────────────────────── */
.ep-cart-price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ep-fs-sm);
  border-top: 1px solid var(--ep-border-light);
  padding-top: var(--ep-space-xs);
}
.ep-cart-price-table th {
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  color: var(--ep-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 4px 8px;
}
.ep-cart-price-table th:first-child {
  text-align: left;
}
.ep-cart-price-table td {
  text-align: right;
  padding: 4px 8px;
  color: var(--ep-text);
}
.ep-cart-price-table td:first-child {
  text-align: left;
  color: var(--ep-text-muted);
}
.ep-cart-price-table .ep-cart-discount {
  color: var(--ep-gold-dark);
  font-weight: 600;
}
.ep-cart-line-total {
  font-weight: 700;
  color: var(--ep-text);
}

/* ─── Récap (colonne droite) ───────────────────────────────── */
.ep-cart-recap {
  background: var(--ep-bg-card);
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius);
  padding: var(--ep-space-md);
  position: sticky;
  top: 90px;
}
.ep-cart-recap-title {
  font-size: var(--ep-fs-md);
  font-weight: 700;
  color: var(--ep-text);
  margin: 0 0 var(--ep-space-md);
  font-family: var(--ep-font-display);
}

.ep-cart-recap-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--ep-fs-sm);
  margin-bottom: var(--ep-space-xs);
  color: var(--ep-text);
}
.ep-cart-recap-row.brut { color: var(--ep-text-muted); }
.ep-cart-recap-row.discount {
  color: var(--ep-gold-dark);
  font-weight: 600;
}
.ep-cart-recap-row.ht {
  color: var(--ep-text);
  font-weight: 600;
  border-top: 1px solid var(--ep-border-light);
  padding-top: var(--ep-space-xs);
  margin-top: 4px;
}
.ep-cart-recap-row.vat {
  color: var(--ep-text-muted);
  font-size: var(--ep-fs-xs);
}
.ep-cart-recap-row.total {
  font-size: var(--ep-fs-lg);
  font-weight: 700;
  color: var(--ep-text);
  border-top: 1px solid var(--ep-border);
  padding-top: var(--ep-space-sm);
  margin-top: 4px;
}

.ep-cart-recap-note {
  font-size: var(--ep-fs-xs);
  color: var(--ep-text-muted);
  margin-top: var(--ep-space-sm);
  padding: var(--ep-space-xs) var(--ep-space-sm);
  background: var(--ep-bg-soft);
  border-radius: var(--ep-radius-sm);
  line-height: 1.5;
}

.ep-cart-cta {
  width: 100%;
  margin-top: var(--ep-space-md);
  text-align: center;
}

.ep-cart-recap-disclaimer {
  font-size: 11px;
  color: var(--ep-text-muted);
  text-align: center;
  margin-top: var(--ep-space-sm);
  line-height: 1.5;
}

/* ─── Panier vide ───────────────────────────────────────────── */
.ep-cart-empty {
  text-align: center;
  padding: var(--ep-space-xl) var(--ep-space-md);
  background: var(--ep-bg-card);
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius);
}
.ep-cart-empty-icon {
  color: var(--ep-text-muted);
  margin-bottom: var(--ep-space-md);
}
.ep-cart-empty-text {
  font-size: var(--ep-fs-md);
  color: var(--ep-text-muted);
  margin-bottom: var(--ep-space-md);
}

/* ─── Bloc contact ──────────────────────────────────────────── */
.ep-cart-contact-block {
  background: var(--ep-text);
  border-radius: var(--ep-radius);
  padding: var(--ep-space-md);
  margin-top: var(--ep-space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ep-space-md);
  flex-wrap: wrap;
}
.ep-cart-contact-text p {
  margin: 0 0 4px 0;
  font-size: var(--ep-fs-sm);
  color: var(--ep-text-muted);
}
.ep-cart-contact-text strong { color: #fff; }
.ep-cart-contact-actions {
  display: flex;
  gap: var(--ep-space-xs);
  flex-wrap: wrap;
}
.ep-cart-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--ep-radius-sm);
  font-size: var(--ep-fs-sm);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}
.ep-cart-contact-btn.primary {
  background: var(--ep-gold);
  color: var(--ep-text);
}
.ep-cart-contact-btn.primary:hover {
  background: var(--ep-gold-light);
}
.ep-cart-contact-btn.secondary {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.ep-cart-contact-btn.secondary:hover {
  border-color: var(--ep-gold);
  color: var(--ep-gold);
}

/* ─── Icône panier dans le menu (badge compteur) ───────────── */
.ep-cart-icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--ep-radius-sm);
  color: var(--ep-text);
  text-decoration: none;
  transition: background 0.15s ease;
}
.ep-cart-icon-link:hover {
  background: var(--ep-bg-soft);
  color: var(--ep-gold-dark);
}
.ep-cart-icon-link svg {
  width: 22px;
  height: 22px;
}
.ep-cart-icon-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--ep-gold);
  color: var(--ep-text);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.ep-cart-icon-badge[data-count="0"] { display: none; }

/* ─── Bouton Ajouter au panier sur fiche produit ─────────────── */
.ep-buybox-add-cart {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ep-buybox-add-cart svg {
  width: 18px;
  height: 18px;
}
.ep-buybox-add-cart.is-loading {
  opacity: 0.6;
  pointer-events: none;
}
.ep-buybox-added-msg {
  margin-top: var(--ep-space-sm);
  padding: var(--ep-space-xs) var(--ep-space-sm);
  background: #d4edda;
  color: #155724;
  border-radius: var(--ep-radius-sm);
  font-size: var(--ep-fs-sm);
  text-align: center;
  display: none;
}
.ep-buybox-added-msg.is-visible { display: block; }
.ep-buybox-added-msg a {
  color: #155724;
  font-weight: 700;
  text-decoration: underline;
}

/* ================================================================
   L5 — Panier tableur (vue pro) — drag&drop + lignes texte
   ================================================================ */

.ep-cart-table-wrap {
  background: var(--ep-white, #fff);
  border: 1px solid var(--ep-border, #E5E5E5);
  border-radius: var(--ep-radius-md, 8px);
  overflow: hidden;
}
.ep-cart-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  table-layout: fixed; /* L5b : pour aligner les colonnes entre lignes article et texte */
}

/* Largeurs colonnes via colgroup (L5b) */
.ep-cart-table .cg-drag { width: 30px; }
.ep-cart-table .cg-ref  { width: 100px; }
.ep-cart-table .cg-des  { width: auto; }      /* flexible */
.ep-cart-table .cg-qty  { width: 88px; }
.ep-cart-table .cg-pv   { width: 90px; }
.ep-cart-table .cg-disc { width: 80px; }
.ep-cart-table .cg-pau  { width: 90px; }
.ep-cart-table .cg-pat  { width: 100px; }
.ep-cart-table .cg-act  { width: 60px; }
.ep-cart-table th {
  text-align: left; padding: 10px 8px;
  font-size: 11px; font-weight: 600;
  color: var(--ep-text-muted, #6B6B6B);
  text-transform: uppercase; letter-spacing: 0.4px;
  background: var(--ep-bg-soft, #FAFAFA);
  border-bottom: 1px solid var(--ep-border, #E5E5E5);
}
.ep-cart-table td {
  padding: 8px;
  border-bottom: 1px solid var(--ep-border-soft, #F0F0F0);
  vertical-align: middle;
}
.ep-cart-table .ta-r { text-align: right; }
.ep-cart-table .ta-c { text-align: center; }

/* Drag handle */
.ep-ct-drag, .ep-ct-drag-handle {
  width: 24px; padding: 0 4px;
  color: var(--ep-text-subtle, #999);
  cursor: grab; user-select: none; text-align: center;
  font-size: 14px; line-height: 1;
}
.ep-ct-drag-handle:hover { color: var(--ep-text, #1A1A1A); }
.ep-ct-row.sortable-chosen { background: var(--ep-bg-soft, #FAFAFA); }
.ep-ct-row.sortable-drag { opacity: 0.85; }
.ep-ct-ghost {
  background: #fffdf5 !important;
  border: 2px dashed #C9A24A !important;
  opacity: 0.5;
}

/* Cellules ref / désignation */
.ep-ct-ref {
  width: 110px;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  /* L7.3m — Réf longue : passe à la ligne dans sa colonne au lieu de
     déborder sur la désignation. */
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.ep-ct-ref-link {
  color: var(--ep-text, #1A1A1A); text-decoration: none;
  display: inline-block;
  max-width: 100%;
}
.ep-ct-ref-link:hover { color: #A8842F; text-decoration: underline; }
.ep-ct-des { min-width: 160px; vertical-align: top; }
.ep-ct-des-name { color: var(--ep-text, #1A1A1A); }
.ep-ct-comment-toggle {
  background: none; border: none; cursor: pointer;
  padding: 2px 6px; font-size: 13px;
  margin-left: 6px; opacity: 0.4;
  transition: opacity 0.15s;
}
.ep-ct-comment-toggle:hover { opacity: 1; }

/* Colonnes prix */
.ep-ct-qty { width: 88px; }
.ep-ct-qty-input {
  width: 74px; padding: 5px 6px;
  border: 1px solid var(--ep-border, #E5E5E5);
  border-radius: 4px;
  font-size: 13px; text-align: center;
  font-family: inherit;
  box-sizing: border-box;   /* le padding ne grignote plus la largeur utile */
}
.ep-ct-qty-input:focus { outline: none; border-color: #C9A24A; }
.ep-ct-pv, .ep-ct-pau { white-space: nowrap; width: 90px; }
.ep-ct-pat { white-space: nowrap; width: 100px; color: var(--ep-text, #1A1A1A); }
.ep-ct-disc { white-space: nowrap; width: 70px; }
.ep-ct-discount-badge {
  display: inline-block; padding: 2px 6px;
  border-radius: 4px;
  background: #FAF3E1; color: #A8842F;
  font-weight: 700; font-size: 12px;
}
.ep-ct-discount-none { color: var(--ep-text-subtle, #999); }
.ep-ct-act { width: 60px; }

/* Bouton remove */
.ep-ct-btn-remove {
  background: none; border: 1px solid var(--ep-border, #E5E5E5);
  border-radius: 4px; padding: 3px 8px;
  cursor: pointer; color: var(--ep-text-muted, #6B6B6B);
  font-size: 13px; transition: all 0.15s;
}
.ep-ct-btn-remove:hover {
  background: var(--ep-red-light, #FCEBEB);
  border-color: var(--ep-red, #CD212A);
  color: var(--ep-red-dark, #A01820);
}

/* Lignes texte (sur fond beige) */
.ep-ct-row-text { background: #fffdf5; }
.ep-ct-row-text:hover { background: #fff8e6; }
.ep-ct-text-cell { padding: 6px 8px; }
.ep-ct-text-input {
  width: 100%; padding: 6px 10px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px; font-style: italic;
  color: var(--ep-text, #1A1A1A);
  font-family: inherit; font-weight: 600;
}
.ep-ct-text-input:focus {
  outline: none; background: var(--ep-white, #fff);
  border-color: #C9A24A;
  font-style: normal;
}
.ep-ct-text-input::placeholder { color: var(--ep-text-subtle, #999); }

/* Ligne commentaire (cachée par défaut, visible si data) */
.ep-ct-comment-row { display: none; background: var(--ep-bg-soft, #FAFAFA); }
.ep-ct-comment-row.is-visible { display: table-row; }
.ep-ct-comment-row td { padding: 6px 8px; }
.ep-ct-comment-input {
  width: 100%; padding: 5px 10px;
  border: 1px solid var(--ep-border, #E5E5E5);
  border-radius: 4px; font-size: 12px; font-style: italic;
  color: var(--ep-text-muted, #6B6B6B);
  font-family: inherit;
}
.ep-ct-comment-input:focus {
  outline: none; border-color: #C9A24A;
  font-style: normal; color: var(--ep-text, #1A1A1A);
}

/* Lignes d'insertion (le + qui apparaît au hover) */
.ep-ct-insert-row { height: 0; }
.ep-ct-insert-row td {
  padding: 0; border: none;
  position: relative;
  height: 0;
  overflow: visible;
}
.ep-ct-insert-btn {
  position: absolute; top: -10px; left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 22px;
  background: #C9A24A; color: var(--ep-text, #1A1A1A);
  border: 2px solid var(--ep-white, #fff);
  border-radius: 50%; cursor: pointer;
  font-size: 14px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
  opacity: 0; transition: opacity 0.15s;
  z-index: 5;
}
.ep-ct-insert-row:hover .ep-ct-insert-btn,
.ep-ct-row:hover + .ep-ct-insert-row .ep-ct-insert-btn,
.ep-ct-insert-btn:focus {
  opacity: 1;
}

/* Ligne d'insertion en fin de tableau (toujours visible, plus large) */
.ep-ct-insert-row-end td {
  padding: 14px 8px;
  text-align: center;
  background: var(--ep-bg-soft, #FAFAFA);
  border-top: 1px solid var(--ep-border, #E5E5E5);
}
.ep-ct-insert-btn-end {
  position: static; transform: none;
  width: auto; height: auto;
  padding: 8px 18px;
  border-radius: var(--ep-radius, 6px);
  background: transparent;
  color: #A8842F;
  border: 1px dashed #C9A24A;
  opacity: 1;
  font-size: 13px;
  font-weight: 600;
}
.ep-ct-insert-btn-end:hover {
  background: #fffdf5;
  border-style: solid;
}
.ep-ct-insert-btn-end span { margin-left: 4px; }

/* Mobile : cache certaines colonnes */
@media (max-width: 800px) {
  .ep-ct-pv, .ep-ct-pau, .ep-ct-disc { display: none; }
  .ep-cart-table th.ep-ct-pv, .ep-cart-table th.ep-ct-pau, .ep-cart-table th.ep-ct-disc { display: none; }
  .ep-cart-table th, .ep-cart-table td { padding: 6px 4px; font-size: 12px; }
}



/* =================================================================
   ███  SECTION KITS (ex-cart-kits.css) — fusionnée le 19/05/2026
   ███  Patch L7.3b→L7.3j : sous-total kit, badge ×N, kit figé, etc.
   ███  Placée APRÈS le CSS panier de base pour priorité en cas de
   ███  doublon de sélecteur. Fini les 2 fichiers = fini les désyncs
   ███  de cache qui cassaient l'alignement.
   ================================================================= */


/* ─── Border-left rouge sur toutes les lignes d'un kit ──────── */
.ep-ct-row-kit > td:first-child {
  position: relative;
}
.ep-ct-row-kit > td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--ep-red);
}

/* Coin haut arrondi pour la 1ère ligne du kit */
.ep-ct-row-kit-start > td:first-child::before {
  top: 4px;
  border-top-left-radius: var(--ep-radius-sm);
}

/* Coin bas arrondi pour la dernière ligne du kit */
.ep-ct-row-kit-end > td:first-child::before {
  bottom: 4px;
  border-bottom-left-radius: var(--ep-radius-sm);
}

/* La ligne d'en-tête du kit (is_text_only avec kit_id) reste en fond crème
   mais avec une typo plus marquée. On ne casse pas le style existant. */
.ep-ct-row-kit-start.ep-ct-row-text .ep-ct-text-input {
  font-weight: 700;
  color: var(--ep-text);
}

/* ─── L7.3j — Footer récap kit : approche table NATIVE (fini le flex) ── */
.ep-ct-row-kit-footer > td {
  padding: 12px 14px;
  background: var(--ep-bg-soft);
  border: none;
  border-bottom: 1px solid var(--ep-border-soft);
}
.ep-ct-row-kit-footer > td.ep-ct-kit-footer-label-cell {
  border-left: 3px solid var(--ep-red);
  border-bottom-left-radius: var(--ep-radius-sm);
  font-size: 13px;
  color: var(--ep-text);
  text-align: left;
  vertical-align: middle;
}
.ep-ct-row-kit-footer > td.ep-ct-kit-footer-total-cell {
  border-bottom-right-radius: var(--ep-radius-sm);
  font-size: 15px;
  color: var(--ep-text);
  text-align: right !important;
  vertical-align: middle;
  white-space: nowrap;
}
.ep-ct-kit-footer-label-cell strong {
  color: var(--ep-text);
  font-weight: 700;
}
.ep-ct-kit-footer-icon {
  font-size: 16px;
  margin-right: 6px;
}
.ep-ct-kit-footer-saved {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 8px;
  background: var(--ep-red-light);
  color: var(--ep-red-dark);
  border-radius: var(--ep-radius-sm);
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}

/* ─── L7.3j — Lien cliquable sur le libellé du kit ──────────── */
.ep-ct-kit-header-link {
  text-decoration: none;
  transition: color 0.15s ease;
}
.ep-ct-kit-header-link:hover {
  color: var(--ep-red) !important;
  text-decoration: underline;
}

/* ─── L7.3j — Bouton ✓ d'application du ×N ──────────────────── */
.ep-ct-kit-mult-apply {
  margin-left: 6px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--ep-red);
  background: var(--ep-red);
  color: var(--ep-white);
  border-radius: var(--ep-radius-sm);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.15s ease;
}
.ep-ct-kit-mult-apply:hover {
  background: var(--ep-red-dark);
  border-color: var(--ep-red-dark);
}

/* ─── L7.3d — En-tête kit non-éditable (mémo §47) ──────────── */
.ep-ct-kit-header-text {
  display: inline-block;
  padding: 6px 10px;
  font-weight: 700;
  font-style: italic;
  color: var(--ep-text);
  font-size: 14px;
  /* Pas de bordure, pas d'effet input — c'est un titre de groupe */
}

/* ─── L7.3d — Drag-handle figé pour composants kit ─────────── */
.ep-ct-drag-locked {
  cursor: not-allowed !important;
  opacity: 0.25;
  color: var(--ep-text-subtle);
}
.ep-ct-drag-locked:hover {
  opacity: 0.35;
  background: transparent !important;
}

/* ─── L7.3d — Drag-handle d'en-tête kit (déplace tout le groupe) ── */
.ep-ct-drag-kit-header {
  cursor: grab;
  color: var(--ep-red);
}
.ep-ct-drag-kit-header:active {
  cursor: grabbing;
}

/* ─── L7.3d — Icône lock à la place du ✕ sur composants kit ── */
.ep-ct-btn-remove-locked {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  color: var(--ep-text-subtle);
  font-size: 14px;
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── L7.3d — ✕ d'en-tête kit (rouge, plus visible) ────────── */
.ep-ct-btn-remove-kit {
  color: var(--ep-red) !important;
  font-weight: 700;
}
.ep-ct-btn-remove-kit:hover {
  color: var(--ep-red-dark) !important;
  background: var(--ep-red-light) !important;
}

/* ─── L7.3d — Hint "min N" sous le champ qty pour composants kit ── */
.ep-ct-qty-min-hint {
  font-size: 10px;
  color: var(--ep-text-subtle);
  text-align: center;
  margin-top: 2px;
  line-height: 1.2;
}

/* ─── L7.3i — Quantité composant kit en lecture seule ──────── */
/* Style principal en inline (cart_table.php) pour contourner le cache.
   Ici juste un fallback léger. */
.ep-ct-qty-locked {
  display: inline-block;
  min-width: 32px;
  text-align: center;
  font-weight: 700;
  color: var(--ep-text);
  cursor: default;
}

/* ─── L7.3i — Sélecteur ×N (nombre de kits) sur l'en-tête ───── */
.ep-ct-kit-mult-cell {
  white-space: nowrap;
  vertical-align: middle;
}
.ep-ct-kit-mult-label {
  font-size: 11px;
  color: var(--ep-text-muted);
  margin-right: 6px;
}
.ep-ct-kit-mult-x {
  font-weight: 700;
  color: var(--ep-red);
  font-size: 15px;
  margin-right: 2px;
}
.ep-ct-kit-mult-input {
  width: 56px;
  padding: 5px 6px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--ep-text);
  border: 1px solid var(--ep-red);
  border-radius: var(--ep-radius-sm);
  background: var(--ep-white);
}
.ep-ct-kit-mult-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--ep-red-light);
}

/* ─── Espacement après le footer (respiration avant ligne suivante) ── */
.ep-ct-row-kit-footer {
  /* Marge visuelle via padding-bottom de la cellule + bordure */
}
.ep-ct-row-kit-footer + .ep-ct-insert-row {
  /* Plus d'air entre fin de kit et début du contenu suivant */
  margin-top: 8px;
}
.ep-ct-row-kit-footer + .ep-ct-insert-row > td {
  padding-top: 12px;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ep-ct-kit-footer-label-cell {
    font-size: 12px;
  }
  .ep-ct-kit-footer-total-cell {
    font-size: 14px;
  }
  .ep-ct-kit-mult-label {
    display: none; /* gain de place sur mobile, le × reste visible */
  }
}


/* =================================================================
   ███  L7.3k — MODÈLE KIT DÉPLIABLE (remplace footer + ×N custom)
   ███  Ligne maîtresse = comme une ref. Composants = enfants
   ███  masquables, italic, petite police, lecture seule.
   ================================================================= */

/* ─── Ligne maîtresse du kit ─────────────────────────────────── */
.ep-ct-row-kit-master {
  background: var(--ep-bg-soft, #FAFAFA);
}
.ep-ct-row-kit-master > td {
  border-top: 2px solid var(--ep-red);
  border-bottom: 1px solid var(--ep-red);
}
.ep-ct-row-kit-master > td:first-child {
  position: relative;
}
.ep-ct-row-kit-master > td:first-child::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--ep-red);
}

/* Cellule titre fusionnée (réf + désignation) */
.ep-ct-kit-master-title {
  vertical-align: middle;
}
.ep-ct-kit-master-name {
  font-weight: 700;
  font-style: italic;
  color: var(--ep-text, #1A1A1A);
  font-size: 14px;
  text-decoration: none;
  margin-left: 4px;
}
a.ep-ct-kit-master-name:hover {
  color: var(--ep-red) !important;
  text-decoration: underline;
}

/* Bouton déplier/replier — BIEN VISIBLE (fond + contour) */
.ep-ct-kit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--ep-red);
  color: var(--ep-white, #fff);
  border: none;
  border-radius: var(--ep-radius-sm, 4px);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.15s ease;
  vertical-align: middle;
}
.ep-ct-kit-toggle:hover {
  background: var(--ep-red-dark, #8B2A35);
}
.ep-ct-kit-toggle-icon {
  font-size: 10px;
  line-height: 1;
}
.ep-ct-kit-toggle-open {
  background: var(--ep-red-dark, #8B2A35);
}

/* ─── Lignes composants (enfants) ────────────────────────────── */
.ep-ct-kit-child {
  background: var(--ep-white, #fff);
}
.ep-ct-kit-child > td {
  font-style: italic;
  font-size: 12px;
  color: var(--ep-text-muted, #6B6B6B);
  padding-top: 5px;
  padding-bottom: 5px;
  border-bottom: 1px dashed var(--ep-border-soft, #F0F0F0);
}
.ep-ct-kit-child > td:first-child {
  position: relative;
}
.ep-ct-kit-child > td:first-child::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--ep-red);
  opacity: 0.6;
}
.ep-ct-kit-child .ep-ct-ref-link {
  font-style: italic;
  color: var(--ep-text-muted, #6B6B6B);
}
.ep-ct-kit-child .ep-ct-des-name {
  font-style: italic;
}
.ep-ct-kit-child-qty {
  display: inline-block;
  width: 56px;
  padding: 5px 8px;
  text-align: center;
  font-weight: 600;
  box-sizing: border-box;
}
