/* =========================================================================
   LAYOUT.CSS
   1.  Reset & variables
   2.  Base
   3.  Loader global
   4.  Header
   5.  Barre de recherche
   6.  Hamburger
   7.  Menu catégories
   8.  Dropdown simple
   9.  Mega menu
   10. Boutons d'action (dont "Masquer les prix"), panier & mini-panier
   11. Messages
   12. Pop-up CGV
   13. Footer
   14. Responsive
       14a. Petit desktop     (<= 1280px)
       14b. Tablette paysage  (<= 1100px)
       14b-bis. En-tête resserré (> 1100px, si débordement : menu.js)
       14c. Mobile & tablette (<= 1100px) → menu hamburger
       14d. Petit mobile      (<= 480px)
       14e. Très petit mobile (<= 360px)
   15. Thème clair
   16. Prix masqués
   ========================================================================= */


/* =========================================================================
   1. RESET & VARIABLES
   ========================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Couleurs de marque */
  --dark:   #555555;
  --light:  #efefef;
  --accent: #FED900;

  /* Fonds */
  --bg-page:    #3d3d3d;
  --bg-surface: #1e1e1e;
  --bg-deep:    #1a1a1a;
  --bg-hover:   #2a2a2a;

  /* Bordures */
  --border:       #2e2e2e;
  --border-light: #5d5d5d;

  /* Textes secondaires */
  --text-muted:  #888888;
  --text-subtle: #cfcfcf;

  /* Polices */
  --font-body:    'Inter', sans-serif;
  --font-display: 'Manrope', sans-serif;

  /* Divers */
  --header-height: 80px;
  --radius-md:     10px;
}


/* =========================================================================
   2. BASE
   ========================================================================= */

html {
  scroll-padding-top: var(--header-height);
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    background: var(--bg-page);
    color: var(--light);
    padding-top: var(--header-height);
}

main {
    min-height: 70dvh;
}

.container {
  width: 80%;
  margin: 0 auto;
}

/* Focus clavier visible sur tous les éléments interactifs */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline-offset: 2px;
  border-radius: 4px;
}

.search-bar__input:focus,
.search-bar__input:focus-visible {
  outline: none;
  box-shadow: none;
}


/* =========================================================================
   3. LOADER GLOBAL
   Affiché soit pendant le chargement initial (classe is-loading sur <html>,
   posée par le script inline du <head>), soit pendant une requête en cours
   (classe is-active sur la div, posée par loader.js).
   ========================================================================= */

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

html.is-loading .page-loader,
.page-loader.is-active {
  opacity: 1;
  visibility: visible;
}

.page-loader__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.page-loader__spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: page-loader-spin .8s linear infinite;
}

.page-loader__text {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--light);
}

@keyframes page-loader-spin {
  to { transform: rotate(360deg); }
}


/* =========================================================================
   4. HEADER
   ========================================================================= */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-height);
  padding: 0 40px;
  box-sizing: border-box;
  background: var(--bg-surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.header__logo img {
  display: block;
  height: 52px;
  width: auto;
  border-radius: 10px;
}

/* flex-shrink 0.5 : la recherche rétrécit avant le code client */
.ccode-header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0.5;
  gap: 50px;
}

.ccode-header a, strong {
    color: #FED900;
}

.header__logo {
  flex-shrink: 0;
}

/* Menu toujours sur une ligne (au-dessus de 1100px) : l'écart et la taille
   du texte diminuent avec la largeur de l'écran au lieu de passer à la ligne.
     écart  : 50px à 1920px → 14px minimum
     texte  : 18px à 1440px → 13px minimum
   Si l'en-tête déborde malgré tout (libellés longs en espagnol ou néerlandais),
   menu.js le resserre : voir « En-tête resserré » en section 14. */
.header__nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;   /* le menu ne se comprime pas : c'est la recherche qui rétrécit */
  gap: clamp(14px, 2.6vw, 50px);
  margin-right: clamp(0px, 1.6vw, 30px);
}

/* inline-flex : la flèche reste accrochée au dernier mot si le libellé passe à la ligne */
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(13px, 1.25vw, 18px);
  color: #ffffffec;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s;
}

.nav-link:hover {
  color: #fff;
}

/* Les enfants (recherche, langue, boutons) sont des éléments du header :
   chacun garde sa largeur minimale (recherche à 130px). Dans un bloc à
   min-width: 0, ils pouvaient déborder et le panier sortait de l'écran.
   Les marges auto répartissent l'espace libre comme un space-between
   entre logo | menu | code client | recherche + boutons. */
.header__actions {
  display: contents;
}

.header__nav,
.ccode-header,
.search-bar {
  margin-left: auto;
}

/* =========================================================================
   BANNIÈRE D'URGENCE
   Affichée sur tout le site quand config.bannieres.alert = true
   Reprise par le bandeau « EDI désactivé » du layout (EDI_ENABLED=false, clients connectés)
   ========================================================================= */

.urgent-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 40px;
  background: #c2410c;
  border-bottom: 3px solid #c2410c;
  color: #fff;
}

.urgent-banner__icon {
  flex-shrink: 0;
}

.urgent-banner__text {
  max-width: 900px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  white-space: pre-line; /* un retour à la ligne dans le message (\n) est respecté */
}

.urgent-banner__text a {
  color: inherit;
  text-decoration: underline;
}

@media (max-width: 900px) {
  .urgent-banner {
    justify-content: flex-start;
    padding: 10px 16px;
  }

  .urgent-banner__text {
    font-size: 14px;
  }
}


/* =========================================================================
   5. BARRE DE RECHERCHE
   ========================================================================= */

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-page);
  border: 1.5px solid transparent;
  border-radius: 8px;
  transition: border-color .2s, background .2s;
  flex: 0 1 auto;   /* rétrécit quand la place manque… */
  min-width: 130px; /* …sans descendre sous 130px */
}

.search-bar:focus-within {
  background: #4d4d4d;
  border-color: var(--bg-page);
}

.search-bar__icon {
  flex-shrink: 0;
}

.search-bar__input {
  width: 280px;
  min-width: 0;
  flex: 1 1 auto;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--light);
}

.search-bar__input::placeholder {
  color: #aaa;
}

/* --- Suggestions --- */
.search-results {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 260;
  width: min(380px, calc(100vw - 32px));
  list-style: none;
  background: var(--bg-surface);
  border-top: 3px solid var(--accent);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  /* Jusqu'à 20 suggestions : 40 % de la hauteur de l'écran au plus, défilement dans la liste */
  max-height: 40vh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Largeurs des colonnes Réf / OEM, mesurées par recherche.js (alignerColonnes) */
  --col-ref: max-content;
  --col-oem: max-content;
  --entete-h: 32px;
  /* La ligne choisie au clavier ne passe pas sous la ligne de titres */
  scroll-padding-top: var(--entete-h);
}

.search-results[hidden] {
  display: none;
}

/* Titres et suggestions : mêmes colonnes Réf / Libellé / OEM */
.search-results__entete,
.search-results__item {
  display: grid;
  grid-template-columns: var(--col-ref) minmax(0, 1fr) var(--col-oem);
  column-gap: 12px;
  align-items: baseline;
}

/* Ligne de titres : reste en haut quand on fait défiler les suggestions */
.search-results__entete {
  position: sticky;
  top: 0;
  z-index: 1;
  height: var(--entete-h);
  align-items: center;
  padding: 0 16px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: default;
}

.search-results__entete > :last-child {
  text-align: right;
}

.search-results__item {
  padding: 11px 16px;
  cursor: pointer;
  transition: background .12s;
}

.search-results__item + .search-results__item {
  border-top: 1px solid var(--border);
}

.search-results__item:hover,
.search-results__item.is-active {
  background: var(--bg-hover);
}

/* Liseré jaune sur la ligne sélectionnée au clavier */
.search-results__item.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.search-results__ref {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--light);
}

.search-results__lib {
  min-width: 0;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Référence OEM (à droite, après le libellé) : la partie tapée par le client est en jaune.
   Le libellé prend la place restante ; une OEM très longue est coupée (colonne à 45 % au plus). */
.search-results__oem {
  min-width: 0;
  text-align: right;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-results__match {
  background: none;
  color: var(--accent);
}

.search-results__empty {
  padding: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}


/* =========================================================================
   6. HAMBURGER
   ========================================================================= */

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  margin-left: -8px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 300;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--light);
  border-radius: 2px;
  transition: transform .25s, opacity .25s, background .25s;
}

.hamburger.is-open span { background: var(--accent); }
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* =========================================================================
   7. MENU CATÉGORIES (ouverture au clic, deux colonnes)
   ========================================================================= */

.nav-item,
.nav-item--mega {
  position: relative;
}

.nav-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  vertical-align: middle;
  transition: transform .2s;
}

.nav-item--mega.is-open .nav-arrow { transform: rotate(180deg); }
.nav-item--drop:hover .nav-arrow   { transform: rotate(180deg); }

/* --- Panneau --- */
.cat-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 200;
  max-width: calc(100vw - 32px);
  background: var(--bg-surface);
  border-top: 3px solid var(--accent);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.cat-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cat-panel__main {
  display: flex;
  align-items: stretch;
}

/* --- Colonnes --- */
.cat-col {
  display: flex;
  flex-direction: column;
}

.cat-col--main {
  width: 320px;
}

/* Colonne 2 : repliée tant qu'aucune catégorie n'est sélectionnée */
.cat-col--sub {
  width: 0;
  overflow: hidden;
  border-left: 1px solid var(--border);
  transition: width .2s ease;
}

.cat-panel.has-sub .cat-col--sub {
  width: 280px;
}

/* Largeur figée du contenu : évite la déformation pendant l'ouverture */
.cat-col--sub .cat-panel__head,
.cat-col--sub .cat-list {
  width: 280px;
}

/* --- En-têtes --- */
.cat-panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 63px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
}

.cat-panel__title {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: .01em;
  color: var(--light);
  white-space: nowrap;
}

.cat-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background .15s ease;
}

.cat-panel__close:hover {
  background: var(--bg-hover);
}

/* --- Listes --- */
.cat-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  max-height: 70vh;
  overflow-y: auto;
  scrollbar-color: var(--border-light) transparent;
  scrollbar-width: thin;
}

.cat-list::-webkit-scrollbar {
  width: 10px;
}

.cat-list::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 10px;
  border: 3px solid var(--bg-surface);
}

/* --- Lignes --- */
.cat-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 18px;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  text-decoration: none;
  color: var(--light);
  cursor: pointer;
  transition: background .12s ease;
}

.cat-row + .cat-row {
  border-top: 1px solid var(--border);
}

.cat-row:hover,
.cat-row.is-active {
  background: var(--bg-hover);
}

/* Liseré jaune sur la catégorie ouverte */
.cat-row.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.cat-row__icon {
  flex: 0 0 24px;
  display: inline-flex;
  color: var(--light);
}

.cat-row__icon svg {
  display: block;
}

.cat-row__label {
  flex: 1;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.cat-row__chevron {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--accent);
}

/* Sous-catégories : puce à la place de l'icône */
.cat-row--sub {
  padding-left: 22px;
}

.cat-row--sub::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.cat-row--sub .cat-row__label {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--text-subtle);
}

/* Apparition des sous-catégories */
@keyframes catFade {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: none; }
}

.cat-list--fade {
  animation: catFade .18s ease;
}


/* =========================================================================
   8. DROPDOWN SIMPLE
   ========================================================================= */

.nav-item--drop {
  position: relative;
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  min-width: 180px;
  background: var(--bg-surface);
  border-top: 3px solid var(--accent);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
  overflow: hidden;
}

.nav-dropdown.is-open {
  display: block;
}

.nav-dropdown a {
  display: block;
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--light);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-light);
  opacity: .95;
  transition: opacity .12s;
}

.nav-dropdown a:last-child {
  border-bottom: none;
}

.nav-dropdown a:hover {
  opacity: 1;
}


/* =========================================================================
   9. MEGA MENU
   ========================================================================= */

.mega-menu {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  z-index: 200;
  flex-direction: row;
  gap: 0;
  padding: 32px 80px;
  background: var(--bg-surface);
  border-top: 3px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
}

.mega-menu.is-open {
  display: flex;
}

.mega-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 0 24px;
  border-right: 1px solid var(--border-light);
}

.mega-col:first-child { padding-left: 0; }
.mega-col:last-child  { border-right: none; }

.mega-title {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .01em;
  color: var(--light);
}

.mega-col a {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  color: var(--light);
  text-decoration: none;
  white-space: nowrap;
  opacity: .9;
  transition: opacity .2s;
}

.mega-col a:hover {
  opacity: 1;
}


/* =========================================================================
   10. BOUTONS D'ACTION, PANIER & MINI-PANIER
   ========================================================================= */

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .2s;
}

.action-btn:hover {
  opacity: .7;
}

.action-btn__label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: #ffffffec;
  white-space: nowrap;
}

/* --- Sélecteur de langue (details/summary : fonctionne sans JS) --- */
.lang-switch {
  position: relative;
}

.lang-switch > summary {
  list-style: none;
}

.lang-switch > summary::-webkit-details-marker {
  display: none;
}

.lang-switch__flag {
  display: block;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25);
}

.lang-switch__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 200;
  min-width: 180px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--bg-surface);
  border-top: 3px solid var(--accent);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  overflow: hidden;
}

.lang-switch__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--light);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.lang-switch li:last-child .lang-switch__item {
  border-bottom: none;
}

.lang-switch__item:hover,
.lang-switch__item:focus-visible {
  background: var(--bg-hover);
}

.lang-switch__item.is-active {
  color: var(--accent);
}

/* --- Bouton "Masquer les prix" (à droite du drapeau) ---
   Un <button> qui reprend l'aspect des liens .action-btn.
   Prix affichés : œil barré + "Masquer les prix".
   Prix masqués  : œil jaune + "Afficher les prix" (le mode actif se voit).
   Bascule par la classe prix-masques de <html> (voir section 16). */
.prix-toggle {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: #ffffffec;
}

.prix-toggle__icone {
  display: block;
}

.prix-toggle__icone--afficher,
.prix-toggle__label--afficher,
html.prix-masques .prix-toggle__icone--masquer,
html.prix-masques .prix-toggle__label--masquer {
  display: none;
}

html.prix-masques .prix-toggle__icone--afficher,
html.prix-masques .prix-toggle__label--afficher {
  display: block;
}

html.prix-masques .prix-toggle__icone--afficher {
  color: var(--accent);
}

/* --- Bouton thème clair / sombre (à droite de "Masquer les prix") ---
   Même aspect que .prix-toggle. Il propose l'autre mode :
   thème sombre : soleil + "Mode clair" ; thème clair : lune + "Mode sombre".
   Bascule par data-theme de <html> (posé par le serveur : pas de flash). */
.theme-bouton {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: #ffffffec;
}

.theme-bouton__icone {
  display: block;
}

.theme-bouton__icone--sombre,
.theme-bouton__label--sombre,
:root[data-theme="light"] .theme-bouton__icone--clair,
:root[data-theme="light"] .theme-bouton__label--clair {
  display: none;
}

:root[data-theme="light"] .theme-bouton__icone--sombre,
:root[data-theme="light"] .theme-bouton__label--sombre {
  display: block;
}

.cart-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent);
  color: #333;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
}

/* Petit rebond du badge à l'ajout d'un article */
.cart-badge.is-pulse {
  animation: cartPulse .5s ease;
}

@keyframes cartPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.45); }
  100% { transform: scale(1); }
}

/* --- Mini-panier --- */
.mini-cart-wrap {
  position: relative;
}

.mini-cart [hidden] {
  display: none !important;
}

.mini-cart {
  position: absolute;
  top: calc(100% + 14px);
  right: -12px;
  z-index: 250;
  width: min(360px, calc(100vw - 32px));
  background: var(--bg-surface);
  border-top: 3px solid var(--accent);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

/* Pont invisible : garde le survol actif entre l'icône et le panneau */
.mini-cart::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 17px;
}

.mini-cart.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mini-cart__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
}

.mini-cart__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--light);
}

.mini-cart__count {
  font-size: 13px;
  color: var(--text-muted);
}

/* Liste des articles */
.mini-cart__list {
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-color: var(--border-light) transparent;
  scrollbar-width: thin;
}

.mini-cart__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 18px;
}

.mini-cart__item + .mini-cart__item {
  border-top: 1px solid var(--border);
}

.mini-cart__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.mini-cart__ref {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--light);
  overflow-wrap: anywhere;
}

.mini-cart__price {
  font-size: 15px;
  font-weight: 600;
  color: var(--light);
  white-space: nowrap;
}

.mini-cart__meta {
  font-size: 13px;
  color: var(--text-muted);
}

.mini-cart__carcasse {
  font-size: 13px;
  color: var(--text-subtle);
  white-space: nowrap;
}

/* Ligne d'actions : − qté + / prix unitaire / supprimer */
.mini-cart__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.mini-cart__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}

.mini-cart__qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--light);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background .12s, color .12s;
}

.mini-cart__qty-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--accent);
}

.mini-cart__qty-val {
  min-width: 32px;
  padding: 0 4px;
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  font-size: 14px;
  font-weight: 600;
  line-height: 28px;
  text-align: center;
  color: var(--light);
}

.mini-cart__unit {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.mini-cart__delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .12s, color .12s;
}

.mini-cart__delete:hover:not(:disabled) {
  background: rgba(220, 38, 38, .15);
  color: #f87171;
}

.mini-cart__qty-btn:disabled,
.mini-cart__delete:disabled {
  opacity: .35;
  cursor: not-allowed;
}

/* Pendant une modification */
.mini-cart__list {
  transition: opacity .15s;
}

.mini-cart.is-busy .mini-cart__list {
  opacity: .6;
}

.mini-cart__empty {
  padding: 24px 18px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

/* Pied : total + bouton */
.mini-cart__foot {
  padding: 14px 18px 18px;
  background: var(--bg-deep);
  border-top: 1px solid var(--border-light);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.mini-cart__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--light);
}

.mini-cart__total strong {
  font-size: 18px;
  color: var(--accent);
}

.mini-cart__dont {
  margin-top: 4px;
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
}

.mini-cart__btn {
  display: block;
  margin-top: 14px;
  padding: 11px;
  border-radius: 8px;
  background: var(--accent);
  color: #111;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  transition: filter .15s;
}

.mini-cart__btn:hover {
  filter: brightness(.92);
}


/* =========================================================================
   11. MESSAGES
   Le conteneur est fixe et plein écran en largeur : sans
   pointer-events:none il intercepte la souris sur toute sa
   surface, même vide, et bloque la sélection de texte.
   ========================================================================= */

#messages {
  position: fixed;
  top: 15%;
  left: 50%;
  z-index: 999;
  width: min(520px, calc(100% - 32px));
  max-height: 70vh;
  overflow-y: auto;
  transform: translateX(-50%);
  pointer-events: none;
}

/* Les messages eux-mêmes redeviennent cliquables */
#messages .msg { pointer-events: auto; }

.msg {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem 1rem;
  border: 1.5px solid;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity .3s, transform .3s;
}

.msg + .msg { margin-top: .5rem; }

.msg__texte {
  flex: 1;
  white-space: pre-line;
}

.msg__fermer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: -.125rem -.375rem 0 0;
  padding: 0;
  background-color: rgba(0, 0, 0, .08);
  border: none;
  border-radius: 50%;
  color: inherit;
  opacity: .7;
  cursor: pointer;
  transition: opacity .15s, background-color .15s;
}

.msg__fermer:hover,
.msg__fermer:focus-visible {
  background-color: rgba(0, 0, 0, .16);
  opacity: 1;
}

.msg--success { background: #DCFCE7; border-color: #16A34A; color: #14532D; }
.msg--warning { background: #FEF9C3; border-color: #CA8A04; color: #713F12; }
.msg--error   { background: #FEE2E2; border-color: #DC2626; color: #7F1D1D; }

.msg--sortie {
  opacity: 0;
  transform: translateY(-8px);
}


/* =========================================================================
   12. POP-UP CGV
   Affichée quand la version des CGV acceptée par le client est
   différente de la version en vigueur (voir main.js).
   Deux choix : accepter, ou refuser et se déconnecter.
   ========================================================================= */

/* Bloque le défilement de la page tant que la pop-up est ouverte */
html.cgv-lock {
  overflow: hidden;
}

.cgv-modal {
  width: min(520px, calc(100% - 32px));
  margin: auto; /* le reset met margin:0, ce qui casse le centrage du <dialog> */
  padding: 0;
  border: 0;
  border-top: 3px solid var(--accent);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--bg-surface);
  color: var(--light);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}

.cgv-modal::backdrop {
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(3px);
}

.cgv-modal__head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
}

.cgv-modal__title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.3;
}

.cgv-modal__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 22px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-subtle);
}

.cgv-modal__link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cgv-modal__error {
  padding: 10px 12px;
  border-radius: 8px;
  background: #FEE2E2;
  color: #7F1D1D;
  font-size: 14px;
}

.cgv-modal__foot {
  display: flex;
  gap: 10px;
  padding: 14px 22px 20px;
  background: var(--bg-deep);
  border-top: 1px solid var(--border-light);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.cgv-modal__btn {
  flex: 1;
  padding: 12px;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #111;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: filter .15s, opacity .15s, background .15s, color .15s;
}

.cgv-modal__btn:hover:not(:disabled) {
  filter: brightness(.92);
}

/* Bouton secondaire : refuser */
.cgv-modal__btn--ghost {
  border-color: var(--border-light);
  background: transparent;
  color: var(--light);
  font-weight: 700;
}

.cgv-modal__btn--ghost:hover:not(:disabled) {
  filter: none;
  background: var(--bg-hover);
}

.cgv-modal__btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}


/* =========================================================================
   13. FOOTER
   ========================================================================= */

.footer {
  background: var(--bg-deep);
  color: #ccc;
}

.footer__top {
  display: flex;
  gap: 48px;
  padding: 52px 10%;
  border-bottom: 1px solid var(--border);
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer__col--brand {
  max-width: 500px;
}

.footer__logo {
  height: 64px;
  width: 64px;
  object-fit: cover;
  border-radius: 12px;
}

.footer__desc {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
}

.footer__socials {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-hover);
  color: #aaa;
  text-decoration: none;
  transition: background .2s, color .2s;
}

.social-btn:hover {
  background: var(--accent);
  color: #111;
}

.footer__title {
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #fff;
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__links a {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}

.footer__links a:hover {
  color: #fff;
}

.footer__contact {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer__contact li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
}

.footer__contact a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer__contact span:hover {
  text-decoration: underline;
}

.footer__contact svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 10%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dark);
}

.footer__legal {
  display: flex;
  gap: 24px;
}

.footer__legal a {
  color: var(--dark);
  text-decoration: none;
  transition: color .15s;
}

.footer__legal a:hover {
  color: #aaa;
}


/* =========================================================================
   14a. PETIT DESKTOP (<= 1280px)
   On resserre les espacements pour que tout tienne sur une ligne.
   ========================================================================= */

@media (max-width: 1280px) {
  .header {
    gap: 20px;
    padding: 0 24px;
  }

  /* .header__nav : écart et marge déjà fluides (section 4) */
  .ccode-header {
    gap: 32px;
  }

  .search-bar__input {
    width: 200px;
  }

  .footer__top {
    padding: 48px 6%;
  }

  .footer__bottom {
    padding: 20px 6%;
  }
}


/* =========================================================================
   14b. TABLETTE PAYSAGE (<= 1100px)
   Les libellés des boutons d'action passent en "visually hidden" :
   invisibles à l'écran mais toujours lus par les lecteurs d'écran.
   ========================================================================= */

@media (max-width: 1100px) {
  .action-btn__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .action-btn {
    padding: 6px;
  }

  /* Footer : la colonne marque passe au-dessus, les 3 autres en ligne */
  .footer__top {
    flex-wrap: wrap;
    gap: 32px 48px;
  }

  .footer__col--brand {
    flex: 1 1 100%;
    max-width: none;
  }
}


/* =========================================================================
   14b-bis. EN-TÊTE RESSERRÉ (> 1100px, classes posées par menu.js)
   Seulement quand l'en-tête déborde réellement (libellés longs, écran moyen) :
     1. header--icones : libellés des boutons d'action masqués (comme <= 1100px)
     2. header--serre  : en plus, les libellés du menu passent sur deux lignes
   ========================================================================= */

@media (min-width: 1101px) {
  .header--icones .action-btn__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .header--icones .action-btn {
    padding: 6px;
  }

  .header--serre .header__nav {
    flex-shrink: 1;
  }

  .header--serre .nav-link {
    line-height: 1.2;
    text-align: center;
    white-space: normal;
  }
}


/* =========================================================================
   14c. MOBILE & TABLETTE (<= 1100px)
   Disposition du header :
     ligne 1 : [☰] [logo] ...... [langue] [contact] [compte] [panier]
     ligne 2 : [ barre de recherche pleine largeur              ]
     ligne 3 : [ code client ]
   Le menu s'ouvre en panneau par-dessus la page, sous le header.
   Seuil à 1100px (et non 900px) : entre les deux, le menu sur une ligne
   sortait de l'écran (tablette paysage 1024px, libellés longs en espagnol).
   Garder la même valeur dans menu.js (matchMedia).
   ========================================================================= */

@media (max-width: 1100px) {

    body{
        padding-top: 0;
    }

  /* --- Header --- */
  .header {
    flex-wrap: wrap;
    gap: 12px 14px;
    height: auto;
    min-height: 64px;
    padding: 10px 16px 12px;
    position: relative;
  }

  .hamburger {
    display: flex;
    order: 1;
  }

  /* margin-right: auto pousse les boutons d'action (langue comprise) à droite */
  .header__logo {
    order: 2;
    margin-right: auto;
  }

  .header__logo img {
    height: 40px;
  }

  /* Les enfants de .header__actions sont des éléments du header (section 4),
     ce qui permet de placer la recherche sur sa propre ligne. */

  /* Le sélecteur de langue rejoint les boutons de droite : sans order,
     il passait devant le hamburger et son menu sortait de l'écran à gauche */
  .header__actions > .lang-switch,
  .header__actions > .action-btn,
  .header__actions > .mini-cart-wrap {
    order: 3;
  }

  /* --- Recherche pleine largeur --- */
  .search-bar {
    order: 5;
    flex: 1 1 100%;
    padding: 10px 14px;
  }

  .search-bar__input {
    flex: 1;
    width: auto;
    font-size: 16px; /* < 16px : iOS zoome sur le champ au focus */
  }

  .search-results {
    left: 0;
    right: 0;
    width: auto;
  }

  /* --- Code client --- */
  .ccode-header {
    order: 6;
    flex: 1 1 100%;
    justify-content: flex-start;
    gap: 12px;
    font-size: 14px;
  }

  /* --- Panneau de navigation --- */
  .header__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 280;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    max-height: calc(100vh - 130px);
    max-height: calc(100dvh - 130px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bg-surface);
    border-top: 3px solid var(--accent);
    box-shadow: 0 16px 32px rgba(0, 0, 0, .45);
  }

  .header__nav.is-open {
    display: flex;
  }

  .nav-item,
  .nav-item--mega,
  .nav-item--drop {
    width: 100%;
  }

  .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    font-size: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
  }

  .nav-link:active {
    background: var(--bg-hover);
  }

  .nav-arrow {
    margin-left: auto;
    color: var(--accent);
  }

  /* --- "À propos" : sous-liens toujours visibles (pas de survol sur mobile) --- */
  .nav-item--drop .nav-arrow {
    display: none;
  }

  .nav-item--drop > .nav-link {
    padding-bottom: 10px;
    border-bottom: none;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    pointer-events: none;
  }

  .nav-dropdown {
    position: static;
    display: block;
    min-width: 0;
    transform: none;
    background: transparent;
    border-top: none;
    border-radius: 0;
    box-shadow: none;
  }

  .nav-dropdown a {
    padding: 14px 20px 14px 32px;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
    white-space: normal;
  }

  .nav-dropdown a:last-child {
    border-bottom: 1px solid var(--border);
  }

  /* --- Mini-panier --- */
  .mini-cart {
    right: -8px;
  }

  .mini-cart__list {
    max-height: 50vh;
  }

  /* --- Menu catégories : navigation en "tiroir" ---
     Catégories → on touche une catégorie → sous-catégories à la place.
     L'en-tête des sous-catégories sert de bouton retour (voir menu.js). */
  .cat-panel {
    position: static;
    display: none;
    width: 100%;
    max-width: none;
    background: var(--bg-deep);
    border-top: none;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .cat-panel.is-open {
    display: block;
  }

  .cat-panel__main {
    flex-direction: column;
  }

  .cat-col--main,
  .cat-col--sub {
    width: 100%;
  }

  .cat-col--sub {
    display: none;
    border-left: none;
  }

  .cat-panel.has-sub .cat-col--main {
    display: none;
  }

  .cat-panel.has-sub .cat-col--sub {
    display: flex;
    width: 100%;
  }

  .cat-col--sub .cat-panel__head,
  .cat-col--sub .cat-list {
    width: 100%;
  }

  .cat-panel__head {
    min-height: 52px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
  }

  .cat-panel__title {
    font-size: 15px;
    white-space: normal;
  }

  /* Flèche retour devant le titre des sous-catégories */
  .cat-col--sub .cat-panel__head {
    cursor: pointer;
  }

  .cat-col--sub .cat-panel__title::before {
    content: "←";
    margin-right: 10px;
    color: var(--accent);
  }

  .cat-list {
    max-height: none;
    padding: 0;
    overflow: visible;
  }

  .cat-row {
    padding: 14px 20px;
  }

  .cat-row--sub {
    padding-left: 24px;
  }

  /* --- Mega menu --- */
  .mega-menu {
    position: static;
    flex-direction: column;
    gap: 20px;
    padding: 8px 16px 16px;
    border-top: none;
    box-shadow: none;
  }

  .mega-col {
    padding: 0 0 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .mega-col:last-child {
    border-bottom: none;
  }

  /* --- Messages --- */
  #messages {
    width: 90%;
  }

  /* --- Footer --- */
  .footer__top {
    gap: 32px;
    padding: 40px 6%;
  }

  .footer__col {
    flex: 1 1 160px;
  }

  .footer__bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 20px 6%;
  }

  .footer__legal {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }
}


/* =========================================================================
   14c-bis. BOUTON THÈME SUR LA LIGNE DE RECHERCHE (<= 560px)
   La ligne 1 est pleine (client qui voit les prix : ☰ + logo + langue +
   5 boutons) : le bouton thème la faisait passer sur deux lignes jusqu'à
   ~500px. Il se place à droite de la barre de recherche (ligne 2).
   ========================================================================= */

@media (max-width: 560px) {
  .header__actions > .theme-bouton {
    order: 5;
  }

  .search-bar {
    flex-basis: 0;
  }
}


/* =========================================================================
   14d. PETIT MOBILE (<= 480px)
   ========================================================================= */

@media (max-width: 480px) {
  .header {
    gap: 10px;
    padding: 8px 12px 10px;
  }

  .header__logo img {
    height: 34px;
  }

  .action-btn {
    padding: 4px;
  }

  /* Pop-up CGV : boutons empilés, « J'accepte » en haut */
  .cgv-modal__foot {
    flex-direction: column-reverse;
  }

  .footer__top {
    flex-direction: column;
    padding: 32px 20px;
  }

  .footer__col {
    flex: none;
  }

  .footer__bottom {
    padding: 20px;
  }
}


/* =========================================================================
   14e. TRÈS PETIT MOBILE (<= 360px)
   Client connecté : ☰ + logo + langue + 4 boutons (prix, contact, compte,
   panier) tiennent sur la ligne 1 (sinon le panier passait seul sur une
   deuxième ligne à 320px).
   ========================================================================= */

@media (max-width: 360px) {
  .header {
    column-gap: 6px;
  }

  .header__logo img {
    height: 30px;
  }

  /* Boutons d'action plus serrés sur les côtés : place pour "Masquer les prix" */
  .action-btn {
    padding: 4px 2px;
  }
}


/* =========================================================================
   ACCESSIBILITÉ : animations réduites
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
  .page-loader__spinner {
    animation-duration: 2s;
  }

  .cat-list--fade,
  .cart-badge.is-pulse {
    animation: none;
  }

  .mini-cart {
    transform: none;
    transition: opacity .1s, visibility .1s;
  }
}


/* =========================================================================
   15. THÈME CLAIR
   Le thème sombre reste le thème par défaut. Le thème clair s'active avec
   data-theme="light" sur <html>, posé par le serveur au rendu du layout
   (choix du client : bouton de l'en-tête ou page « Mon compte », route
   POST /theme) : pas de flash de thème sombre au chargement.

   Organisation :
   - ici : les tokens globaux du thème clair et les règles communes ;
   - chaque feuille de page a sa section « THÈME CLAIR » en fin de fichier
     (tokens propres à la page + couleurs écrites en dur) ;
   - les surcharges utilisent :where(:root[data-theme="light"]) pour garder
     la spécificité de la règle sombre d'origine : elles passent devant
     parce qu'elles sont placées en fin de fichier.

   L'en-tête et le pied de page restent sombres : le logo est prévu pour un
   fond sombre. Ils reprennent les valeurs sombres des tokens (plus bas).

   Accent du thème clair : anthracite + trait jaune.
   Le jaune foncé (or) en texte sur blanc n'était pas beau : le texte d'accent
   passe en anthracite, et le jaune vif #FED900 sert de marqueur (soulignement
   des liens, barres latérales, aplats des boutons et badges).
   Tokens propres au thème clair (non définis en sombre) :
     --accent-text : anthracite (texte, liens, icônes mis en avant)
     --accent-line : anthracite (bordures actives, contours de focus : 3:1 mini)
     --accent-mark : jaune vif (soulignement des liens, barres d'accent)
   Fonds teintés et halos de focus : rgba(254, 217, 0, …).
   En-tête et pied de page restent sombres avec l'accent jaune (plus bas).

   Contrastes renforcés (palette commune à toutes les feuilles) :
     - fond de page #e4e4e4 : les cartes blanches s'en détachent nettement ;
     - bordures de 1,8:1 (#c2c2c2) à 3:1 (#8f8f8f, champs de saisie) sur blanc ;
     - textes secondaires de 7:1 à 10:1 sur blanc (#575757, #4a4a4a, #404040) ;
     - couleurs d'état (rouge, vert, orange) au moins 4,5:1 sur le fond de
       page, pas seulement sur blanc.
   ========================================================================= */

:root[data-theme="light"] {
  --light:  #1e1e1e;   /* texte principal */

  --bg-page:    #e4e4e4;
  --bg-surface: #ffffff;
  --bg-deep:    #dadada;
  --bg-hover:   #e4e4e4;

  --border:       #c2c2c2;
  --border-light: #adadad;

  --text-muted:  #4a4a4a;
  --text-subtle: #333333;

  --accent-text: #1e1e1e;   /* anthracite */
  --accent-line: #1e1e1e;
  --accent-mark: #FED900;   /* trait jaune */
}

/* En-tête (menus déroulants et mini-panier compris) et pied de page : sombres */
:root[data-theme="light"] .header,
:root[data-theme="light"] .footer {
  --light:        #efefef;
  --bg-page:      #3d3d3d;
  --bg-surface:   #1e1e1e;
  --bg-deep:      #1a1a1a;
  --bg-hover:     #2a2a2a;
  --border:       #2e2e2e;
  --border-light: #5d5d5d;
  --text-muted:   #888888;
  --text-subtle:  #cfcfcf;
  --accent-text:  var(--accent);
  --accent-line:  var(--accent);
  --accent-mark:  var(--accent);
}

/* Texte hérité de <body> (foncé en clair) : remis en clair dans l'en-tête */
:root[data-theme="light"] .header {
  color: var(--light);
}

/* Texte jaune en sombre (code client, <strong>), hors de l'en-tête :
   - lien du code client : couleur d'accent (anthracite) ;
   - <strong> du contenu : texte foncé, mis en avant par la graisse.
   Limité à <main> : le code client de l'en-tête (sombre) reste jaune. */
:where(:root[data-theme="light"]) .ccode-header a {
  color: var(--accent-text);
}

:where(:root[data-theme="light"] main) strong {
  color: #111111;
}

/* Liens d'accent du contenu : anthracite souligné de jaune (trait épais).
   Sans le soulignement, un lien anthracite ressemblerait à du texte.
   Pour un nouveau lien d'accent : ajouter son sélecteur ici.
   Spécificité volontairement plus forte que les règles des pages (qui
   peuvent mettre text-decoration: none) : cette feuille est chargée avant. */
:root[data-theme="light"] :is(
  .cgv-modal__link,
  .cat-page__login a, .cat-page__connexion a, .sidebar__hint a, .filtres__reset,
  .product-buy__login a,
  .error-page__hint a,
  .legal-card__body a,
  .ent-link, .ent-page .rs-depot__link,
  .search-panel__hint a, .about__link, .cat-card__more,
  .delivery-note a,
  .notice a, .notice-print a, .form-page .field__lien,
  .cgv-notice a, .acces-refuse__text a, .retour-aide,
  .suivi__lien
) {
  color: var(--accent-text);
  text-decoration-line: underline;
  text-decoration-color: var(--accent-mark);
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

:root[data-theme="light"] :is(
  .cgv-modal__link,
  .cat-page__login a, .cat-page__connexion a, .sidebar__hint a, .filtres__reset,
  .product-buy__login a,
  .error-page__hint a,
  .legal-card__body a,
  .ent-link, .ent-page .rs-depot__link,
  .search-panel__hint a, .about__link, .cat-card__more,
  .delivery-note a,
  .notice a, .notice-print a, .form-page .field__lien,
  .cgv-notice a, .acces-refuse__text a, .retour-aide,
  .suivi__lien
):hover {
  text-decoration-color: var(--accent-line);
}

/* Icônes des vues dessinées avec stroke="#efefef" / "#FED900" dans le HTML */
:where(:root[data-theme="light"]) main svg[stroke="#efefef"] {
  stroke: #1e1e1e;
}

:where(:root[data-theme="light"]) main svg[stroke="#FED900"] {
  stroke: var(--accent-text);
}

/* Pop-up CGV */
:where(:root[data-theme="light"]) .cgv-modal {
  box-shadow: 0 20px 50px rgba(0, 0, 0, .2);
}

:where(:root[data-theme="light"]) .cgv-modal::backdrop {
  background: rgba(0, 0, 0, .45);
}



/* =========================================================================
   16. PRIX MASQUÉS
   Bouton "Masquer les prix" de l'en-tête : il bascule la classe prix-masques
   sur <html> (script du <head> de layout.html, choix mémorisé dans le
   navigateur). Tous les prix ci-dessous disparaissent, sur toutes les pages.

   Pour masquer un autre prix (page panier, bons de livraison…) :
   lui ajouter la classe "prix" dans le HTML, ou ajouter son sélecteur ici.
   ========================================================================= */

html.prix-masques .prix,

/* Page article : prix + prix carcasse du bloc d'achat, références associées */
html.prix-masques .product-buy__price-main,
html.prix-masques .product-buy__price-list,
html.prix-masques .similar-card__prix,

/* Page d'accueil : top ventes */
html.prix-masques .top-card__prix,

/* Page catégorie : mode détaillé et cartes */
html.prix-masques .vd-achat__prix,
html.prix-masques .product-card__price,

/* Mini-panier de l'en-tête : prix des lignes, total, carcasses */
html.prix-masques .mini-cart__price,
html.prix-masques .mini-cart__unit,
html.prix-masques .mini-cart__carcasse,
html.prix-masques .mini-cart__total,
html.prix-masques .mini-cart__dont {
  display: none !important;
}