/* ==========================================================================
   VKA — Feuille de style principale
   Emplacement : frontend/assets/css/vka.css
   Organisation en couches (@layer) : l'ordre des couches décide des priorités,
   pas la spécificité des sélecteurs → pas de conflits entre sections.
   ========================================================================== */

@layer reset, jetons, base, mise-en-page, composants, sections, utilitaires;

/* --------------------------------------------------------------- RESET --- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  img, svg, video { display: block; max-width: 100%; }
  input, button, select, textarea { font: inherit; color: inherit; }
  button { cursor: pointer; background: none; border: 0; }
  a { color: inherit; text-decoration: none; }
  ul, ol { list-style: none; padding: 0; }
  :where(h1, h2, h3, h4) { text-wrap: balance; }
  p { text-wrap: pretty; }
}

/* -------------------------------------------------------------- JETONS --- */
@layer jetons {
  /* Couleur d'accent animable (utilisée par l'anneau WhatsApp) */
  @property --angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
  }

  :root {
    /* Palette — noir d'imprimerie + orange de marque.
       --orange est réécrit par config.js si tu changes la couleur de marque. */
    --encre: #141416;
    --graphite: #1e1e22;
    --acier: #2c2c33;
    --papier: #ffffff;
    --trame: #f3f2ef;
    --ligne: #e5e3de;
    --texte: #19191c;
    --texte-doux: #62626b;
    --orange: #f4641c;
    --orange-fonce: color-mix(in oklab, var(--orange) 82%, black);
    --orange-voile: color-mix(in oklab, var(--orange) 12%, white);
    --whatsapp: #25d366;
    /* Encres CMJN : réservées aux repères d'impression (motif de marque) */
    --cyan: #00a3e0;
    --magenta: #e6007e;
    --jaune: #ffe600;

    /* Typographie */
    --police-titre: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
    --police-texte: "Manrope", "Segoe UI", system-ui, sans-serif;
    --police-script: "Kaushan Script", "Brush Script MT", cursive;

    /* Échelle typographique fluide (ratio ≈ 1,25) */
    --t-xs: clamp(0.72rem, 0.7rem + 0.1vw, 0.78rem);
    --t-s: clamp(0.82rem, 0.8rem + 0.12vw, 0.9rem);
    --t-m: clamp(0.94rem, 0.9rem + 0.2vw, 1.02rem);
    --t-l: clamp(1.12rem, 1.02rem + 0.45vw, 1.3rem);
    --t-xl: clamp(1.4rem, 1.2rem + 0.9vw, 1.85rem);
    --t-2xl: clamp(2rem, 1.4rem + 2.6vw, 3.4rem);

    /* Espacements */
    --e-1: 0.25rem; --e-2: 0.5rem; --e-3: 0.75rem; --e-4: 1rem;
    --e-5: 1.5rem;  --e-6: 2rem;   --e-7: 3rem;    --e-8: 4.5rem;

    /* Rayons : hiérarchie volontaire (petit objet = petit rayon) */
    --r-puce: 6px;
    --r-bouton: 10px;
    --r-carte: 14px;
    --r-panneau: 20px;
    --r-plein: 999px;

    /* Ombres « papier posé sur table » : courtes et directionnelles */
    --ombre-1: 0 1px 2px rgb(20 20 22 / 0.06), 0 2px 6px rgb(20 20 22 / 0.05);
    --ombre-2: 0 2px 4px rgb(20 20 22 / 0.06), 0 12px 28px -8px rgb(20 20 22 / 0.18);
    --ombre-3: 0 30px 80px -20px rgb(0 0 0 / 0.55);

    --largeur-max: 1440px;
    --gouttiere: clamp(1rem, 3vw, 2.5rem);
    --hauteur-entete: 76px;

    --transition: 180ms cubic-bezier(0.2, 0.7, 0.2, 1);
    color-scheme: light;
  }
}

/* ---------------------------------------------------------------- BASE --- */
@layer base {
  html { scroll-behavior: smooth; scroll-padding-top: calc(var(--hauteur-entete) + env(safe-area-inset-top, 0px)); }
  body {
    font-family: var(--police-texte);
    font-size: var(--t-m);
    line-height: 1.55;
    color: var(--texte);
    background: var(--trame);
    min-height: 100dvh;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3, h4 { font-family: var(--police-titre); line-height: 1.1; letter-spacing: -0.02em; }
  :focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 4px; }
  ::selection { background: var(--orange); color: #fff; }
  body:has(dialog[open]) { overflow: hidden; }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 1ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 1ms !important;
      scroll-behavior: auto !important;
    }
  }
}

/* -------------------------------------------------------- MISE EN PAGE --- */
@layer mise-en-page {
  .conteneur {
    width: min(100% - 2 * var(--gouttiere), var(--largeur-max));
    margin-inline: auto;
  }
  .pile > * + * { margin-top: var(--e-4); }

  /* Zone catalogue : filtre latéral + grille de produits */
  .catalogue {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: var(--e-5);
    align-items: start;
  }
  /* Rangée basse : services / réalisations / témoignages */
  .rangee-basse {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: var(--e-5);
    align-items: stretch;
  }

  .rangee-basse > :last-child { grid-column: 1 / -1; }
  @media (max-width: 900px) {
    .catalogue { grid-template-columns: 1fr; }
    .rangee-basse { grid-template-columns: minmax(0, 1fr); }
  }
}

/* ---------------------------------------------------------- COMPOSANTS --- */
@layer composants {
  .icone { width: 1.25em; height: 1.25em; flex: none; }

  /* Boutons */
  .bouton {
    --fond: var(--orange);
    --couleur: #fff;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
    min-height: 48px; padding: 0 1.5em;
    border-radius: var(--r-bouton);
    background: var(--fond); color: var(--couleur);
    font-weight: 700; font-size: var(--t-s); letter-spacing: 0.01em;
    border: 1.5px solid transparent;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    white-space: nowrap;
  }
  .bouton:hover { --fond: var(--orange-fonce); }
  .bouton:active { transform: translateY(1px) scale(0.99); }
  .bouton--contour { --fond: transparent; --couleur: currentColor; border-color: currentColor; }
  .bouton--contour:hover { --fond: color-mix(in oklab, currentColor 10%, transparent); }
  .bouton--whatsapp { --fond: var(--whatsapp); }
  .bouton--whatsapp:hover { --fond: color-mix(in oklab, var(--whatsapp) 85%, black); }
  .bouton--clair { --fond: #fff; --couleur: var(--encre); border-color: var(--ligne); }
  .bouton--clair:hover { --fond: var(--trame); border-color: var(--encre); }
  .bouton--plein { width: 100%; white-space: normal; text-align: center; }
  .bouton--petit { min-height: 36px; padding: 0 1em; font-size: var(--t-xs); }
  .bouton-icone {
    display: grid; place-items: center;
    width: 40px; height: 40px; border-radius: var(--r-bouton);
    color: inherit; transition: background var(--transition), color var(--transition);
    position: relative;
  }
  .bouton-icone:hover { background: color-mix(in oklab, currentColor 8%, transparent); }
  .pastille {
    position: absolute; top: 2px; right: 0;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: var(--r-plein); background: var(--orange); color: #fff;
    font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
    transform: scale(var(--echelle, 1)); transition: transform var(--transition);
  }
  .pastille:empty, .pastille[data-valeur="0"] { --echelle: 0; }

  /* Champ de recherche */
  .recherche {
    display: flex; align-items: center;
    background: var(--papier); border: 1.5px solid var(--ligne);
    border-radius: var(--r-bouton); overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
  }
  .recherche:focus-within { border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-voile); }
  .recherche input {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
    padding: 0.7em 1em; font-size: var(--t-s);
  }
  .recherche button {
    align-self: stretch; padding-inline: 1em;
    background: var(--orange); color: #fff; display: grid; place-items: center;
  }

  /* Titre de section : barre verticale orange = « repère de coupe » de la marque */
  .titre-section { display: grid; gap: 0.15rem; }
  .titre-section h2 {
    font-size: var(--t-xl); font-weight: 800;
    padding-left: 0.7rem; border-left: 4px solid var(--orange);
  }
  .titre-section p { color: var(--texte-doux); font-size: var(--t-s); padding-left: calc(0.7rem + 4px); }
  .titre-section--sombre p { color: #b9b9c2; }

  /* Étoiles */
  .etoiles { display: inline-flex; gap: 2px; color: var(--orange); }
  .etoiles .icone { width: 15px; height: 15px; }
  .etoiles .vide { color: var(--ligne); }

  /* Repères de coupe (angles) — motif d'imprimerie posé sur les visuels */
  .reperes { position: relative; }
  .reperes::before, .reperes::after {
    content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
    border-color: color-mix(in oklab, var(--orange) 70%, transparent); border-style: solid;
    opacity: 0; transition: opacity var(--transition), inset var(--transition);
    z-index: 2;
  }
  .reperes::before { top: 8px; left: 8px; border-width: 1.5px 0 0 1.5px; }
  .reperes::after { bottom: 8px; right: 8px; border-width: 0 1.5px 1.5px 0; }

  /* Barre CMJN : séparateur signature */
  .barre-cmjn {
    height: 4px; border-radius: 2px;
    background: linear-gradient(90deg, var(--cyan) 0 25%, var(--magenta) 25% 50%, var(--jaune) 50% 75%, var(--encre) 75%);
  }

  /* Toast */
  .toasts {
    position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    translate: -50% 0; z-index: 90; display: grid; gap: 8px; pointer-events: none;
  }
  .toast {
    background: var(--encre); color: #fff; padding: 0.8em 1.2em; border-radius: var(--r-bouton);
    font-size: var(--t-s); font-weight: 600; box-shadow: var(--ombre-2);
    display: flex; align-items: center; gap: 0.6em;
    animation: toast-entre 260ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  }
  .toast .icone { color: var(--orange); }
  .toast.sort { animation: toast-sort 200ms ease-in both; }
  @keyframes toast-entre { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
  @keyframes toast-sort { to { opacity: 0; transform: translateY(8px); } }
}

/* ------------------------------------------------------------ SECTIONS --- */
@layer sections {

  /* ===== EN-TÊTE ===== */
  .entete {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in oklab, var(--papier) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition), box-shadow var(--transition);
  }
  .entete.defile { border-color: var(--ligne); box-shadow: 0 6px 24px -18px rgb(0 0 0 / 0.5); }
  .entete__rangee {
    height: var(--hauteur-entete);
    display: flex; align-items: center; gap: var(--e-5);
  }
  .marque { display: flex; align-items: center; gap: 0.7rem; flex: none; }
  .marque__logo { height: 46px; width: auto; max-width: 170px; object-fit: contain; }
  .marque__texte { display: grid; line-height: 1.05; }
  .marque__nom { font-family: var(--police-titre); font-weight: 800; font-size: 1rem; letter-spacing: -0.01em; }
  .marque__slogan { font-size: var(--t-xs); color: var(--texte-doux); }
  .marque[data-logo-present] .marque__texte { display: none; }

  .nav { display: flex; gap: 0.2rem; margin-inline: auto; }
  .nav a {
    position: relative; padding: 0.55rem 0.9rem; font-weight: 600; font-size: var(--t-s);
    border-radius: var(--r-puce); transition: color var(--transition);
  }
  .nav a::after {
    content: ""; position: absolute; left: 0.9rem; right: 0.9rem; bottom: 2px; height: 2.5px;
    background: var(--orange); border-radius: 2px;
    scale: 0 1; transform-origin: left; transition: scale var(--transition);
  }
  .nav a:hover, .nav a[aria-current="page"] { color: var(--orange); }
  .nav a:hover::after, .nav a[aria-current="page"]::after { scale: 1 1; }

  .entete__recherche { width: clamp(220px, 24vw, 340px); }
  .entete__actions { display: flex; gap: 0.2rem; }
  .entete__menu { display: none; }

  /* Barre de progression de lecture (animation liée au défilement) */
  .progression {
    position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
    background: var(--orange); transform-origin: left; scale: 0 1;
  }
  @supports (animation-timeline: scroll()) {
    .progression { animation: progression linear both; animation-timeline: scroll(root); }
    @keyframes progression { to { scale: 1 1; } }
  }

  @media (max-width: 1100px) {
    .nav, .entete__recherche { display: none; }
    .entete__menu { display: grid; }
    .entete__actions { margin-left: auto; }
    .entete.menu-ouvert .nav {
      display: grid; position: absolute; top: 100%; left: 0; right: 0;
      background: var(--papier); padding: var(--e-4) var(--gouttiere) var(--e-5);
      border-bottom: 1px solid var(--ligne); box-shadow: var(--ombre-2);
    }
    .entete.menu-ouvert .entete__recherche {
      display: flex; position: absolute; top: calc(100% + 250px); left: var(--gouttiere); right: var(--gouttiere); width: auto;
    }
  }

  /* ===== HÉROS ===== */
  .heros {
    position: relative; isolation: isolate; overflow: hidden;
    background:
      radial-gradient(60% 80% at 78% 40%, color-mix(in oklab, var(--orange) 34%, transparent), transparent 70%),
      radial-gradient(40% 60% at 10% 100%, rgb(255 255 255 / 0.05), transparent 70%),
      linear-gradient(180deg, #17171a, var(--encre));
    color: #fff;
  }
  .heros__photo { position: absolute; inset: 0; z-index: -1; }
  .heros__photo img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
  .heros__photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--encre) 20%, transparent 75%); }
  /* Trame de points (demi-teinte d'impression) */
  .heros::before {
    content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.35;
    background-image: radial-gradient(rgb(255 255 255 / 0.12) 1px, transparent 1.2px);
    background-size: 14px 14px;
    mask-image: linear-gradient(90deg, transparent, #000 45%, #000 70%, transparent);
  }
  .heros__grille {
    display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
    align-items: center; gap: var(--e-6);
    min-height: clamp(440px, 58vh, 560px);
    padding-block: var(--e-7);
  }
  .heros__accroche {
    display: flex; align-items: center; gap: 0.6rem;
    color: var(--orange); font-weight: 700; font-size: var(--t-s);
  }
  .heros__accroche::before { content: ""; width: 28px; height: 3px; background: var(--orange); border-radius: 2px; }
  .heros h1 { font-size: clamp(2rem, 1.3rem + 2.2vw, 3.05rem); font-weight: 800; margin-top: var(--e-3); max-width: 21ch; line-height: 1.04; }
  .heros h1 .trait { color: var(--orange); }
  .heros__sous-titre { font-weight: 700; font-size: var(--t-l); margin-top: var(--e-4); }
  .heros__texte { color: #c9c9d1; max-width: 52ch; margin-top: var(--e-2); }
  .atouts { display: flex; flex-wrap: wrap; gap: var(--e-4) var(--e-5); margin-top: var(--e-5); }
  .atout { display: flex; align-items: center; gap: 0.6rem; font-size: var(--t-s); line-height: 1.25; }
  .atout .icone { width: 30px; height: 30px; color: var(--orange); }
  .atout + .atout { padding-left: var(--e-5); border-left: 1px solid rgb(255 255 255 / 0.18); }
  .heros__actions { display: flex; flex-wrap: wrap; gap: var(--e-3); margin-top: var(--e-6); }
  .heros__actions .bouton--contour { color: #fff; }

  /* Scène : les supports imprimés « posés » en perspective */
  .scene {
    position: relative; aspect-ratio: 5 / 4; perspective: 1400px;
  }
  .scene__objet {
    position: absolute; filter: drop-shadow(0 26px 30px rgb(0 0 0 / 0.55));
    transform-style: preserve-3d;
  }
  .scene__objet svg { width: 100%; height: auto; }
  .scene__objet--sac { width: 50%; left: 18%; top: -6%; }
  .scene__objet--sac2 { width: 42%; left: 50%; top: -2%; }
  .scene__objet--mug { width: 34%; left: -2%; top: 30%; }
  .scene__objet--flyers { width: 54%; left: 48%; top: 34%; }
  .scene__objet--cartes { width: 64%; left: 10%; top: 40%; }
  .scene__script {
    position: absolute; left: 0; top: 0; rotate: -7deg; z-index: 2;
    font-family: var(--police-script); font-size: clamp(1.4rem, 1rem + 1.4vw, 2.4rem);
    line-height: 1.15; color: #fff; text-shadow: 0 4px 24px rgb(0 0 0 / 0.6);
    background: rgb(20 20 22 / 0.55); padding: 0.4em 0.7em; border-radius: 8px;
    border: 1px solid rgb(255 255 255 / 0.1);
  }
  /* Repère de repérage (cible CMJN) */
  .scene__cible {
    position: absolute; width: 42px; height: 42px; left: 4%; bottom: 6%; opacity: 0.7;
  }

  /* Chorégraphie d'arrivée : un seul moment orchestré à l'ouverture */
  .heros .entree { animation: monte 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
  .scene__objet { animation: pose 900ms cubic-bezier(0.2, 0.9, 0.25, 1.05) both; animation-delay: calc(250ms + var(--i, 0) * 110ms); }
  @keyframes monte { from { opacity: 0; transform: translateY(18px); } }
  @keyframes pose { from { opacity: 0; transform: translateY(-40px) rotateX(35deg) scale(0.92); } }

  @media (max-width: 900px) {
    .heros__grille { grid-template-columns: 1fr; padding-block: var(--e-6); }
    .scene { max-width: 520px; width: 100%; margin-inline: auto; order: -1; }
    .atout + .atout { padding-left: 0; border-left: 0; }
  }

  /* ===== BANDEAU CATÉGORIES ===== */
  .bandeau-categories { background: var(--papier); border-bottom: 1px solid var(--ligne); }
  .bandeau-categories__rangee {
    display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--e-5); align-items: center;
    padding-block: var(--e-5);
  }
  .rail-categories {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(104px, 1fr);
    gap: var(--e-3); overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 4px; scrollbar-width: thin;
  }
  .puce-categorie {
    scroll-snap-align: start;
    display: grid; justify-items: center; align-content: center; gap: 0.55rem;
    min-height: 96px; padding: 0.8rem 0.5rem;
    background: var(--papier); border: 1.5px solid var(--ligne); border-radius: var(--r-carte);
    font-size: var(--t-xs); font-weight: 600; text-align: center; line-height: 1.2;
    transition: border-color var(--transition), transform var(--transition), background var(--transition);
  }
  .puce-categorie .icone { width: 28px; height: 28px; color: var(--encre); transition: color var(--transition); }
  .puce-categorie:hover { border-color: var(--encre); transform: translateY(-2px); }
  .puce-categorie[aria-pressed="true"] { border-color: var(--orange); background: var(--orange-voile); }
  .puce-categorie[aria-pressed="true"] .icone { color: var(--orange); }
  .bandeau-categories .titre-section h2 { font-size: var(--t-l); }
  @media (max-width: 900px) { .bandeau-categories__rangee { grid-template-columns: 1fr; } }

  /* ===== CATALOGUE ===== */
  .zone-catalogue { padding-block: var(--e-6); }
  .filtre {
    position: sticky; top: calc(var(--hauteur-entete) + 16px);
    background: var(--encre); color: #fff; border-radius: var(--r-panneau);
    padding: var(--e-5) var(--e-4); display: grid; gap: var(--e-4);
  }
  .filtre h2 { font-size: var(--t-l); font-weight: 800; }
  .filtre > p { color: #b9b9c2; font-size: var(--t-s); margin-top: -0.6rem; }
  .filtre .recherche { background: var(--acier); border-color: transparent; }
  .filtre .recherche input::placeholder { color: #9a9aa4; }
  .filtre .recherche button { background: transparent; color: #9a9aa4; }
  .filtre__liste { display: grid; gap: 2px; }
  .filtre__liste button {
    width: 100%; display: flex; align-items: center; gap: 0.75rem;
    padding: 0.62rem 0.8rem; border-radius: var(--r-bouton);
    font-size: var(--t-s); font-weight: 600; color: #e7e7ec; text-align: left;
    transition: background var(--transition), color var(--transition);
  }
  .filtre__liste button .compte { margin-left: auto; font-size: var(--t-xs); color: #8c8c96; font-variant-numeric: tabular-nums; }
  .filtre__liste button:hover { background: var(--acier); }
  .filtre__liste button[aria-pressed="true"] { background: var(--orange); color: #fff; }
  .filtre__liste button[aria-pressed="true"] .compte { color: #fff; }
  @media (max-width: 900px) {
    .filtre { position: static; }
    .filtre__liste { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  }

  .vitrine {
    background: var(--papier); border-radius: var(--r-panneau); padding: var(--e-5);
    border: 1px solid var(--ligne);
  }
  .vitrine__tete { display: flex; align-items: end; justify-content: space-between; gap: var(--e-4); flex-wrap: wrap; margin-bottom: var(--e-5); }
  .vitrine__resume { font-size: var(--t-s); color: var(--texte-doux); }
  .vitrine__resume strong { color: var(--texte); }

  .grille-produits {
    container-type: inline-size; container-name: grille;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
    gap: var(--e-4);
  }

  /* Carte produit : structure en sous-grille pour aligner prix et boutons d'une carte à l'autre */
  .carte-produit {
    display: grid; grid-template-rows: subgrid; grid-row: span 4; gap: 0;
    background: var(--papier); border: 1px solid var(--ligne); border-radius: var(--r-carte);
    overflow: hidden; cursor: pointer; position: relative;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    view-transition-name: var(--vt, none);
  }
  .carte-produit:hover { border-color: color-mix(in oklab, var(--encre) 40%, var(--ligne)); box-shadow: var(--ombre-2); transform: translateY(-3px); }
  .carte-produit:hover .reperes::before, .carte-produit:hover .reperes::after { opacity: 1; }
  .carte-produit__visuel {
    aspect-ratio: 4 / 3; background: var(--encre); overflow: hidden; position: relative;
  }
  .carte-produit__visuel > svg, .carte-produit__visuel > img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .carte-produit:hover .carte-produit__visuel > * { transform: scale(1.045); }
  .carte-produit__badge {
    position: absolute; top: 10px; left: 10px; z-index: 3;
    background: var(--orange); color: #fff; font-size: 11px; font-weight: 800;
    padding: 3px 8px; border-radius: var(--r-puce);
  }
  .favori {
    position: absolute; top: 8px; right: 8px; z-index: 3;
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgb(255 255 255 / 0.92); color: var(--encre);
    box-shadow: var(--ombre-1);
    transition: transform var(--transition), color var(--transition);
  }
  .favori .icone { width: 17px; height: 17px; }
  .favori:hover { transform: scale(1.08); }
  .favori[aria-pressed="true"] { color: #e11d48; }
  .favori[aria-pressed="true"] .icone { fill: currentColor; animation: battement 360ms ease; }
  @keyframes battement { 40% { transform: scale(1.3); } }

  .carte-produit__corps { padding: var(--e-3) var(--e-4) 0; }
  .carte-produit__nom { font-family: var(--police-texte); font-size: var(--t-s); font-weight: 700; letter-spacing: 0; line-height: 1.3; }
  .carte-produit__detail { font-size: var(--t-xs); color: var(--texte-doux); }
  .carte-produit__prix { padding: var(--e-1) var(--e-4) 0; align-self: end; color: var(--orange); font-weight: 800; font-size: var(--t-m); font-variant-numeric: tabular-nums; }
  .carte-produit__prix small { font-size: 0.72em; font-weight: 700; color: var(--texte-doux); }
  .carte-produit__actions { display: flex; gap: var(--e-2); padding: var(--e-3) var(--e-4) var(--e-4); }
  .carte-produit__actions .bouton { flex: 1; min-height: 38px; font-size: var(--t-xs); }
  .carte-produit__actions .bouton--contour { color: var(--orange); }
  .ajout-devis {
    width: 42px; min-height: 38px; flex: none; border-radius: var(--r-bouton);
    background: var(--orange); color: #fff; display: grid; place-items: center;
    transition: background var(--transition);
  }
  .ajout-devis:hover { background: var(--orange-fonce); }
  .ajout-devis .icone { width: 18px; height: 18px; }

  @container grille (max-width: 520px) {
    .carte-produit__actions .bouton span { display: none; }
  }

  .vide {
    grid-column: 1 / -1; display: grid; justify-items: center; text-align: center; gap: var(--e-3);
    padding: var(--e-7) var(--e-4); border: 2px dashed var(--ligne); border-radius: var(--r-carte);
  }
  .vide .icone { width: 44px; height: 44px; color: var(--orange); }
  .vide p { color: var(--texte-doux); max-width: 44ch; }

  /* ===== FICHE PRODUIT (boîte de dialogue native) ===== */
  .fiche {
    width: min(1120px, 100% - 24px); max-width: none; max-height: min(92dvh, 900px);
    margin: auto; padding: 0; border: 0; border-radius: var(--r-panneau);
    background: var(--papier); color: var(--texte); box-shadow: var(--ombre-3);
    overflow: hidden;
  }
  .fiche::backdrop { background: rgb(12 12 14 / 0.62); backdrop-filter: blur(6px); }
  .fiche[open] { animation: fiche-ouvre 320ms cubic-bezier(0.2, 0.9, 0.25, 1) both; }
  .fiche[open]::backdrop { animation: fondu 320ms ease both; }
  @keyframes fiche-ouvre { from { opacity: 0; transform: translateY(24px) scale(0.97); } }
  @keyframes fondu { from { opacity: 0; } }

  .fiche__cadre {
    display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    max-height: inherit; overflow: auto; overscroll-behavior: contain;
  }
  .fiche__fermer {
    position: absolute; top: 12px; right: 12px; z-index: 5;
    background: var(--papier); box-shadow: var(--ombre-1); border-radius: 50%;
  }
  .galerie {
    display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: var(--e-3);
    padding: var(--e-5); background: var(--trame);
  }
  .galerie__vignettes { display: grid; align-content: start; gap: var(--e-2); max-height: 520px; overflow-y: auto; padding: 2px; }
  .galerie__vignette {
    aspect-ratio: 1; border-radius: var(--r-bouton); overflow: hidden;
    border: 2px solid transparent; background: var(--encre); opacity: 0.7;
    transition: opacity var(--transition), border-color var(--transition);
  }
  .galerie__vignette > * { width: 100%; height: 100%; object-fit: cover; }
  .galerie__vignette:hover { opacity: 1; }
  .galerie__vignette[aria-current="true"] { border-color: var(--orange); opacity: 1; }
  .galerie__scene {
    position: relative; aspect-ratio: 1; border-radius: var(--r-carte); overflow: hidden;
    background: var(--encre); touch-action: pan-y; cursor: zoom-in;
  }
  .galerie__image { position: absolute; inset: 0; transition: transform 180ms ease-out, opacity 220ms ease; }
  .galerie__image > * { width: 100%; height: 100%; object-fit: cover; }
  .galerie__scene.zoom .galerie__image { transform: scale(1.9); }
  .galerie__scene.change .galerie__image { opacity: 0; }
  .galerie__fleche {
    position: absolute; top: 50%; translate: 0 -50%; z-index: 3;
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
    background: rgb(255 255 255 / 0.9); color: var(--encre); box-shadow: var(--ombre-1);
    opacity: 0; transition: opacity var(--transition);
  }
  .galerie__scene:hover .galerie__fleche, .galerie__fleche:focus-visible { opacity: 1; }
  .galerie__fleche--prec { left: 10px; }
  .galerie__fleche--suiv { right: 10px; }
  .galerie__compteur {
    position: absolute; bottom: 10px; left: 10px; z-index: 3;
    background: rgb(20 20 22 / 0.7); color: #fff; font-size: 12px; font-weight: 700;
    padding: 3px 9px; border-radius: var(--r-plein); font-variant-numeric: tabular-nums;
  }

  /* Filigrane : nom + logo de l'entreprise répétés en diagonale sur les visuels agrandis */
  .filigrane {
    position: absolute; inset: -50%; z-index: 2; pointer-events: none;
    display: flex; flex-wrap: wrap; align-content: center; justify-content: center;
    gap: 70px 90px; rotate: -24deg; opacity: 0.13;
    font-family: var(--police-titre); font-weight: 800; font-size: 20px; color: #fff;
    mix-blend-mode: overlay; user-select: none;
  }
  .filigrane span { white-space: nowrap; }
  .filigrane-coin {
    position: absolute; right: 12px; bottom: 12px; z-index: 3; height: 26px; width: auto;
    opacity: 0.8; pointer-events: none;
  }

  .fiche__infos { padding: var(--e-6) var(--e-6) var(--e-5); display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--e-4); }
  .fiche__categorie { font-size: var(--t-xs); font-weight: 700; color: var(--texte-doux); }
  .fiche__titre { font-size: var(--t-xl); font-weight: 800; }
  .fiche__prix { font-family: var(--police-titre); font-size: var(--t-xl); color: var(--orange); font-weight: 800; font-variant-numeric: tabular-nums; }
  .fiche__prix small { font-size: 0.5em; color: var(--texte-doux); font-weight: 700; }
  .fiche__note { display: flex; align-items: center; gap: 0.5rem; font-size: var(--t-s); color: var(--texte-doux); }
  .fiche__description { color: #3e3e45; }
  .fiche__options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: var(--e-3); }
  .champ { display: grid; gap: 0.35rem; font-size: var(--t-xs); font-weight: 700; }
  .champ select {
    width: 100%; appearance: none; min-height: 44px; padding: 0 2.4rem 0 0.9rem; font-size: var(--t-s); font-weight: 600;
    border: 1.5px solid var(--ligne); border-radius: var(--r-bouton); background: var(--papier)
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23141416' stroke-width='2'%3E%3Cpath d='m2 4 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 0.9rem center;
  }
  .champ select:focus { border-color: var(--orange); outline: 0; box-shadow: 0 0 0 4px var(--orange-voile); }
  .couleurs { display: flex; gap: 0.55rem; flex-wrap: wrap; }
  .couleurs label { position: relative; }
  .couleurs input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
  .couleurs span {
    display: block; width: 28px; height: 28px; border-radius: 50%; background: var(--c);
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.15); outline: 2px solid transparent; outline-offset: 3px;
    transition: outline-color var(--transition);
  }
  .couleurs input:checked + span { outline-color: var(--orange); }
  .couleurs input:focus-visible + span { outline-color: var(--encre); }
  .fiche__boutons { display: grid; gap: var(--e-2); }
  .fiche__garanties {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--e-3);
    padding-top: var(--e-4); border-top: 1px solid var(--ligne);
    font-size: var(--t-xs); color: var(--texte-doux);
  }
  .fiche__garanties div { display: flex; gap: 0.5rem; align-items: start; }
  .fiche__garanties strong { display: block; color: var(--texte); }
  .fiche__garanties .icone { width: 24px; height: 24px; color: var(--encre); }
  .fiche__entete-actions { display: flex; justify-content: space-between; align-items: start; gap: var(--e-3); }

  @media (max-width: 860px) {
    .fiche { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
    .fiche__cadre { grid-template-columns: minmax(0, 1fr); }
    .galerie { grid-template-columns: minmax(0, 1fr); padding: var(--e-4); padding-top: calc(var(--e-4) + env(safe-area-inset-top, 0px)); }
    .galerie__vignettes { grid-auto-flow: column; grid-auto-columns: 64px; order: 2; overflow-x: auto; max-height: none; }
    .galerie__fleche { opacity: 1; }
    .fiche__infos { padding: var(--e-5) var(--e-4) calc(var(--e-6) + env(safe-area-inset-bottom, 0px)); }
    .fiche__garanties { grid-template-columns: 1fr; }
    .fiche__options { grid-template-columns: minmax(0, 1fr); }
    .fiche__fermer { top: calc(12px + env(safe-area-inset-top, 0px)); }
  }

  /* ===== DEVIS (panier) ===== */
  .tiroir {
    margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(440px, 100%); max-width: 100%;
    border: 0; padding: 0; background: var(--papier); box-shadow: var(--ombre-3);
  }
  .tiroir::backdrop { background: rgb(12 12 14 / 0.55); backdrop-filter: blur(4px); }
  .tiroir[open] { animation: tiroir-entre 300ms cubic-bezier(0.2, 0.9, 0.25, 1) both; }
  @keyframes tiroir-entre { from { transform: translateX(100%); } }
  .tiroir__cadre { display: grid; grid-template-rows: auto 1fr auto; height: 100%; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .tiroir__tete { display: flex; align-items: center; justify-content: space-between; padding: var(--e-4) var(--e-5); border-bottom: 1px solid var(--ligne); }
  .tiroir__tete h2 { font-size: var(--t-l); }
  .tiroir__liste { overflow-y: auto; padding: var(--e-3) var(--e-5); display: grid; align-content: start; gap: var(--e-3); }
  .ligne-devis { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--e-3); align-items: center; padding-block: var(--e-2); border-bottom: 1px solid var(--ligne); }
  .ligne-devis__visuel { width: 64px; height: 64px; border-radius: var(--r-bouton); overflow: hidden; background: var(--encre); }
  .ligne-devis__visuel > * { width: 100%; height: 100%; object-fit: cover; }
  .ligne-devis h3 { font-family: var(--police-texte); font-size: var(--t-s); letter-spacing: 0; }
  .ligne-devis p { font-size: var(--t-xs); color: var(--texte-doux); }
  .ligne-devis__prix { font-weight: 800; color: var(--orange); font-size: var(--t-s); }
  .ligne-devis__retirer { color: var(--texte-doux); }
  .ligne-devis__retirer:hover { color: #e11d48; }
  .tiroir__pied { padding: var(--e-4) var(--e-5) var(--e-5); border-top: 1px solid var(--ligne); display: grid; gap: var(--e-2); }
  .tiroir__total { display: flex; justify-content: space-between; font-weight: 800; font-size: var(--t-l); margin-bottom: var(--e-2); }
  .tiroir__total span:last-child { color: var(--orange); }
  .tiroir__note { font-size: var(--t-xs); color: var(--texte-doux); }

  /* ===== RANGÉE BASSE ===== */
  .zone-basse { padding-bottom: var(--e-7); }
  .zone-basse .bloc { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .bloc { background: var(--papier); border: 1px solid var(--ligne); border-radius: var(--r-panneau); padding: var(--e-5); display: grid; align-content: start; gap: var(--e-4); }
  .bloc--sombre { background: var(--encre); color: #fff; border-color: var(--encre); }

  .services { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--e-3); }
  .service {
    display: grid; align-content: start; gap: 0.45rem; padding: var(--e-3);
    border: 1px solid var(--ligne); border-radius: var(--r-carte); background: var(--papier);
    transition: border-color var(--transition), box-shadow var(--transition);
  }
  .service:hover { border-color: var(--orange); box-shadow: var(--ombre-1); }
  .service__icone { width: 36px; height: 36px; border-radius: var(--r-bouton); display: grid; place-items: center; color: #fff; background: var(--c, var(--orange)); }
  .service__icone .icone { width: 20px; height: 20px; }
  .service h3 { font-family: var(--police-texte); font-size: var(--t-s); letter-spacing: 0; }
  .service p { font-size: var(--t-xs); color: var(--texte-doux); line-height: 1.4; }

  .zone-basse .bloc--sombre { grid-template-rows: auto minmax(260px, 1fr) auto; }
  .carrousel { position: relative; min-height: 0; }
  .carrousel__piste {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 46%); height: 100%;
    gap: var(--e-3); overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
    scrollbar-width: none; border-radius: var(--r-carte);
  }
  .carrousel__piste::-webkit-scrollbar { display: none; }
  .realisation {
    scroll-snap-align: start; position: relative; min-height: 240px; border-radius: var(--r-carte);
    overflow: hidden; background: var(--acier);
  }
  .realisation > svg, .realisation > img { width: 100%; height: 100%; object-fit: cover; }
  .realisation figcaption {
    position: absolute; inset: auto 0 0; padding: 2rem 0.8rem 0.6rem; font-size: var(--t-xs); font-weight: 700;
    background: linear-gradient(transparent, rgb(0 0 0 / 0.8));
  }
  .carrousel__fleche {
    position: absolute; top: 50%; translate: 0 -50%; z-index: 2;
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
    background: var(--papier); color: var(--encre); box-shadow: var(--ombre-2);
  }
  .carrousel__fleche--prec { left: -10px; }
  .carrousel__fleche--suiv { right: -10px; }

  .temoignages { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--e-3); }
  .temoignage { border: 1px solid var(--ligne); border-radius: var(--r-carte); padding: var(--e-4); display: grid; gap: var(--e-2); align-content: start; }
  .temoignage__auteur { display: flex; align-items: center; gap: 0.6rem; }
  .avatar {
    width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
    background: var(--encre); color: #fff; font-weight: 800; font-size: 14px;
  }
  .temoignage__auteur strong { display: block; font-size: var(--t-s); }
  .temoignage__auteur span { font-size: var(--t-xs); color: var(--texte-doux); }
  .temoignage__auteur .avatar { color: #fff; font-size: 14px; }
  .temoignage blockquote { font-size: var(--t-s); color: #3e3e45; }

  /* ===== PIED DE PAGE ===== */
  .pied { background: var(--encre); color: #c9c9d1; padding-top: var(--e-7); }
  .pied__grille { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr 0.9fr 1.3fr; gap: var(--e-6); padding-bottom: var(--e-6); }
  .pied h3 { color: #fff; font-family: var(--police-texte); font-size: var(--t-s); letter-spacing: 0; margin-bottom: var(--e-3); }
  .pied a:hover { color: var(--orange); }
  .pied__liens { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 1rem; font-size: var(--t-s); }
  .pied__coord { display: grid; gap: 0.55rem; font-size: var(--t-s); }
  .pied__coord li { display: flex; gap: 0.6rem; align-items: start; }
  .pied__coord .icone { color: var(--orange); width: 18px; height: 18px; margin-top: 2px; }
  .reseaux { display: flex; gap: 0.5rem; flex-wrap: wrap; }
  .reseaux a { width: 38px; height: 38px; border-radius: var(--r-bouton); display: grid; place-items: center; background: var(--acier); color: #fff; transition: background var(--transition); }
  .reseaux a:hover { background: var(--orange); color: #fff; }
  .reseaux .icone { width: 18px; height: 18px; }
  .pied__logo { height: 52px; width: auto; max-width: 190px; object-fit: contain; }
  .pied__logo-plaque { display: inline-flex; background: #fff; padding: 8px 12px; border-radius: var(--r-bouton); }
  .pied__nom { font-family: var(--police-titre); font-weight: 800; font-size: var(--t-l); color: #fff; }
  .pied__slogan { margin-top: var(--e-3); font-size: var(--t-s); }
  .newsletter { display: flex; margin-top: var(--e-2); border-radius: var(--r-bouton); overflow: hidden; background: var(--acier); }
  .newsletter input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0.75em 1em; font-size: var(--t-s); color: #fff; }
  .newsletter input::placeholder { color: #8c8c96; }
  .newsletter button { width: 48px; display: grid; place-items: center; background: var(--orange); color: #fff; }
  .newsletter__titre { color: var(--orange) !important; }
  .pied__bas { border-top: 1px solid var(--acier); padding-block: var(--e-4); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--e-3); font-size: var(--t-xs); }
  .pied__bas nav { display: flex; gap: var(--e-4); flex-wrap: wrap; }
  @media (max-width: 1100px) { .pied__grille { grid-template-columns: 1fr 1fr; } .pied__grille > :first-child { grid-column: 1 / -1; } }
  @media (max-width: 560px) { .pied__grille { grid-template-columns: 1fr; } }

  /* ===== BOUTON WHATSAPP FLOTTANT ===== */
  .wa-flottant {
    position: fixed; z-index: 80;
    right: calc(20px + env(safe-area-inset-right, 0px));
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    display: flex; align-items: center; gap: 0.7rem;
  }
  .wa-flottant__etiquette {
    background: var(--papier); color: var(--encre); font-weight: 700; font-size: var(--t-xs);
    padding: 0.55em 0.9em; border-radius: var(--r-plein); box-shadow: var(--ombre-2);
    border: 1.5px solid var(--whatsapp);
    transition: opacity var(--transition), transform var(--transition);
  }
  .wa-flottant__bouton {
    position: relative; width: 62px; height: 62px; border-radius: 50%;
    display: grid; place-items: center; color: #fff; background: var(--whatsapp);
    box-shadow: 0 10px 28px -6px color-mix(in oklab, var(--whatsapp) 70%, transparent);
    transition: transform var(--transition);
  }
  .wa-flottant__bouton .icone { width: 32px; height: 32px; }
  .wa-flottant:hover .wa-flottant__bouton { transform: scale(1.07); }
  /* Anneau tournant (conic-gradient + @property animée) */
  .wa-flottant__bouton::before {
    content: ""; position: absolute; inset: -5px; border-radius: 50%; z-index: -1;
    background: conic-gradient(from var(--angle), var(--whatsapp), transparent 40%, var(--whatsapp) 70%, transparent);
    animation: tourne 3.2s linear infinite;
  }
  /* Ondulation d'appel à l'attention */
  .wa-flottant__bouton::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--whatsapp);
    animation: onde 2.4s ease-out infinite;
  }
  @keyframes tourne { to { --angle: 360deg; } }
  @keyframes onde { from { opacity: 0.8; transform: scale(1); } to { opacity: 0; transform: scale(1.7); } }
  .wa-flottant.discret .wa-flottant__etiquette { opacity: 0; transform: translateX(10px); pointer-events: none; }
  @media (max-width: 640px) { .wa-flottant__etiquette { display: none; } .wa-flottant__bouton { width: 56px; height: 56px; } }
}

/* ---------------------------------------------------------- UTILITAIRES --- */
@layer utilitaires {
  .visuellement-cache {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .espace-haut { margin-top: var(--e-6); }
  [hidden] { display: none !important; }
}

/* ==========================================================================
   AJOUTS BACK END : commande, comptes clients, application installable
   (même jetons, mêmes rayons, mêmes ombres que le reste du site)
   ========================================================================== */
@layer sections {
  /* ----- En-tête : installer + compte ----- */
  .bouton-installer {
    display: inline-flex; align-items: center; gap: 0.45rem; height: 40px; padding: 0 0.95rem;
    border-radius: var(--r-plein); background: var(--encre); color: #fff;
    font-size: var(--t-xs); font-weight: 800; white-space: nowrap;
    transition: background var(--transition), transform var(--transition);
    animation: apparait 400ms ease both;
  }
  .bouton-installer:hover { background: var(--orange); }
  .bouton-installer .icone { width: 18px; height: 18px; }
  @media (max-width: 520px) { .bouton-installer span { display: none; } .bouton-installer { padding: 0; width: 40px; justify-content: center; } }
  .pastille-compte {
    position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%;
    background: var(--whatsapp); box-shadow: 0 0 0 2px var(--papier);
  }
  @keyframes apparait { from { opacity: 0; transform: scale(0.92); } }

  /* ----- Boutons supplémentaires ----- */
  .bouton--sombre { --fond: var(--encre); }
  .bouton--sombre:hover { --fond: #000; }
  .bouton--danger { --fond: #c81e3c; }
  .bouton--danger:hover { --fond: #a3132d; }
  .bouton--grand { min-height: 56px; font-size: var(--t-m); }
  .lien { color: var(--orange-fonce); font-weight: 700; font-size: var(--t-s); text-decoration: underline; text-underline-offset: 3px; justify-self: center; padding: 0.2rem; }
  .lien:hover { color: var(--orange); }

  /* ----- Tiroirs : corps défilant ----- */
  .tiroir--large { width: min(560px, 100%); }
  .tiroir__corps { overflow-y: auto; overscroll-behavior: contain; padding: var(--e-4) var(--e-5) var(--e-5); }
  .tiroir__cadre:has(.tiroir__corps) { grid-template-rows: auto 1fr auto; }
  @media (max-width: 520px) { .tiroir__corps { padding-inline: var(--e-4); } }

  /* ----- Formulaires ----- */
  .formulaire { display: grid; gap: var(--e-3); }
  .formulaire__intro { color: var(--texte-doux); font-size: var(--t-s); }
  .formulaire__aide { color: var(--texte-doux); font-size: var(--t-xs); text-align: center; }
  .formulaire__ligne { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: var(--e-3); }
  .champ small { font-weight: 600; color: var(--texte-doux); }
  .champ input, .champ textarea {
    width: 100%; min-height: 46px; padding: 0.65rem 0.9rem; font-size: var(--t-s); font-weight: 600;
    border: 1.5px solid var(--ligne); border-radius: var(--r-bouton); background: var(--papier);
    transition: border-color var(--transition), box-shadow var(--transition);
  }
  .champ textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
  .champ input:focus, .champ textarea:focus { border-color: var(--orange); outline: 0; box-shadow: 0 0 0 4px var(--orange-voile); }
  .champ [aria-invalid="true"] { border-color: #c81e3c; box-shadow: 0 0 0 4px rgb(200 30 60 / 0.12); }
  .champ-mdp { position: relative; display: block; }
  .champ-mdp input { padding-right: 3rem; }
  .voir-mdp { position: absolute; right: 4px; top: 50%; translate: 0 -50%; width: 40px; height: 40px; display: grid; place-items: center; color: var(--texte-doux); border-radius: var(--r-bouton); }
  .voir-mdp:hover { color: var(--encre); background: var(--trame); }
  .case { display: flex; gap: 0.6rem; align-items: flex-start; font-size: var(--t-s); line-height: 1.4; cursor: pointer; }
  .case input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--orange); flex: none; }
  .case a { color: var(--orange-fonce); text-decoration: underline; }
  .form-erreur { color: #c81e3c; font-size: var(--t-s); font-weight: 600; min-height: 0; }
  .form-erreur:empty, .form-info:empty { display: none; }
  .form-info { color: #137a3a; font-size: var(--t-s); font-weight: 600; background: #e9f8ef; padding: 0.7rem 0.9rem; border-radius: var(--r-bouton); }
  .separateur { display: flex; align-items: center; gap: var(--e-3); color: var(--texte-doux); font-size: var(--t-xs); margin-top: var(--e-2); }
  .separateur::before, .separateur::after { content: ""; flex: 1; height: 1px; background: var(--ligne); }
  .piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .chargement { color: var(--texte-doux); font-size: var(--t-s); padding: var(--e-5) 0; text-align: center; }
  .roue { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgb(255 255 255 / 0.4); border-top-color: #fff; animation: tourne-roue 700ms linear infinite; }
  @keyframes tourne-roue { to { rotate: 360deg; } }

  /* ----- Finalisation de commande ----- */
  .recap { display: grid; gap: 0; border: 1px solid var(--ligne); border-radius: var(--r-carte); overflow: hidden; }
  .recap li { display: flex; justify-content: space-between; gap: var(--e-3); padding: 0.7rem 0.9rem; font-size: var(--t-s); background: var(--trame); }
  .recap li + li { border-top: 1px solid var(--ligne); }
  .recap li span:first-child { display: grid; }
  .recap small { color: var(--texte-doux); font-size: var(--t-xs); }
  .recap li span:last-child { font-weight: 800; color: var(--orange-fonce); white-space: nowrap; font-variant-numeric: tabular-nums; }
  .canaux { border: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--e-2); }
  .canaux legend { font-size: var(--t-xs); font-weight: 700; margin-bottom: 0.4rem; }
  .canal { position: relative; cursor: pointer; }
  .canal input { position: absolute; opacity: 0; inset: 0; }
  .canal__carte {
    display: flex; gap: 0.6rem; align-items: center; height: 100%; padding: 0.8rem; border-radius: var(--r-carte);
    border: 1.5px solid var(--ligne); background: var(--papier); transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  }
  .canal__carte strong { display: block; font-size: var(--t-s); }
  .canal__carte small { display: block; font-size: var(--t-xs); color: var(--texte-doux); line-height: 1.25; }
  .canal__icone { width: 28px; height: 28px; color: var(--encre); }
  .canal__icone--wa { color: var(--whatsapp); }
  .canal input:checked + .canal__carte { border-color: var(--orange); background: var(--orange-voile); box-shadow: 0 0 0 3px var(--orange-voile); }
  .canal input:focus-visible + .canal__carte { outline: 3px solid var(--orange); outline-offset: 2px; }
  @media (max-width: 380px) { .canaux { grid-template-columns: 1fr; } }
  .commande-compte { display: flex; gap: 0.5rem; align-items: flex-start; font-size: var(--t-xs); color: var(--texte-doux); }
  .commande-compte:empty { display: none; }
  .commande-compte .icone { width: 18px; height: 18px; color: var(--orange); }
  .commande-compte .lien { font-size: var(--t-xs); padding: 0; }
  .secours { display: grid; gap: var(--e-2); padding: var(--e-4); border-radius: var(--r-carte); background: #fff7ed; border: 1.5px solid #fdba74; font-size: var(--t-s); }

  /* ----- Écran de succès ----- */
  .succes { display: grid; gap: var(--e-3); justify-items: center; text-align: center; padding: var(--e-4) 0 var(--e-2); outline: 0; }
  .succes > .bouton, .succes > .lien { width: 100%; }
  .succes > .lien { width: auto; }
  .succes__icone {
    width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
    background: #e9f8ef; color: #16a34a; animation: pop 520ms cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
  }
  .succes__icone .icone { width: 40px; height: 40px; stroke-width: 2.6; animation: pop 420ms 160ms cubic-bezier(0.2, 0.9, 0.3, 1.5) both; }
  @keyframes pop { from { transform: scale(0.4); opacity: 0; } }
  .succes h3 { font-size: var(--t-xl); font-weight: 800; }
  .succes__ref { font-size: var(--t-m); }
  .succes__ref strong { font-family: var(--police-titre); letter-spacing: 0.02em; background: var(--trame); padding: 0.15rem 0.5rem; border-radius: var(--r-puce); }
  .succes__total { color: var(--texte-doux); }
  .succes__etape { background: var(--trame); border-radius: var(--r-carte); padding: var(--e-3) var(--e-4); font-size: var(--t-s); text-align: left; }
  .succes__compte { font-size: var(--t-s); color: var(--texte-doux); }

  /* ----- Mon compte ----- */
  .compte-entete { display: flex; align-items: center; gap: var(--e-3); padding-bottom: var(--e-3); border-bottom: 1px solid var(--ligne); }
  .compte-entete strong { display: block; font-size: var(--t-m); }
  .compte-entete span:not(.avatar) { display: block; font-size: var(--t-xs); color: var(--texte-doux); word-break: break-all; }
  .compte-entete .avatar { background: var(--orange); }
  .onglets { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--trame); border-radius: var(--r-bouton); margin: var(--e-3) 0; }
  .onglets button { padding: 0.6rem; border-radius: 8px; font-size: var(--t-s); font-weight: 700; color: var(--texte-doux); }
  .onglets button[aria-selected="true"] { background: var(--papier); color: var(--encre); box-shadow: var(--ombre-1); }
  .liste-commandes { display: grid; gap: var(--e-3); }
  .cmd { border: 1px solid var(--ligne); border-radius: var(--r-carte); padding: var(--e-3) var(--e-4); display: grid; gap: 0.4rem; animation: apparait 300ms ease both; }
  .cmd header { display: flex; justify-content: space-between; align-items: center; gap: var(--e-2); }
  .cmd header strong { font-family: var(--police-titre); letter-spacing: 0.01em; }
  .cmd__date, .cmd__paiement { font-size: var(--t-xs); color: var(--texte-doux); }
  .cmd__lignes { display: grid; gap: 0.25rem; font-size: var(--t-xs); }
  .cmd__lignes li { display: flex; justify-content: space-between; gap: var(--e-2); }
  .cmd__lignes small { color: var(--texte-doux); }
  .cmd__total { display: flex; justify-content: space-between; font-size: var(--t-s); border-top: 1px dashed var(--ligne); padding-top: 0.4rem; }
  .cmd__total strong { color: var(--orange-fonce); }
  .cmd__actions { display: flex; gap: var(--e-2); flex-wrap: wrap; }
  .statut { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: var(--r-plein); background: var(--trame); color: var(--texte); white-space: nowrap; }
  .statut--nouvelle { background: #fff3e6; color: #b45309; }
  .statut--confirmee { background: #e8f0ff; color: #1d4ed8; }
  .statut--en_production { background: #f3e8ff; color: #7e22ce; }
  .statut--prete { background: #e0f7fa; color: #0e7490; }
  .statut--livree { background: #e9f8ef; color: #15803d; }
  .statut--annulee { background: #f1f1f3; color: #6b6b75; text-decoration: line-through; }
  .compte-pied { display: grid; gap: var(--e-3); margin-top: var(--e-5); padding-top: var(--e-4); border-top: 1px solid var(--ligne); }
  .zone-danger, .zone-mdp { border: 1px solid var(--ligne); border-radius: var(--r-carte); padding: var(--e-3) var(--e-4); }
  .zone-danger summary, .zone-mdp summary { cursor: pointer; font-weight: 700; font-size: var(--t-s); }
  .zone-danger summary { color: #c81e3c; }
  .zone-danger[open], .zone-mdp[open] { display: grid; gap: var(--e-3); }
  .zone-danger p { font-size: var(--t-xs); color: var(--texte-doux); }

  /* ----- Guide d'installation (feuille du bas) ----- */
  .feuille {
    margin: auto auto 0; width: min(520px, 100%); max-width: 100%; max-height: 94dvh; overflow-y: auto; border: 0; padding: 0;
    border-radius: var(--r-panneau) var(--r-panneau) 0 0; background: var(--papier); box-shadow: var(--ombre-3);
  }
  .feuille::backdrop { background: rgb(12 12 14 / 0.55); backdrop-filter: blur(4px); }
  .feuille[open] { animation: feuille-monte 320ms cubic-bezier(0.2, 0.9, 0.25, 1) both; }
  @keyframes feuille-monte { from { transform: translateY(100%); } }
  .feuille__cadre { display: grid; gap: var(--e-3); justify-items: center; text-align: center; padding: var(--e-5) var(--e-5) calc(var(--e-5) + env(safe-area-inset-bottom, 0px)); }
  .feuille__icone { width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--ombre-2); }
  .feuille h2 { font-size: var(--t-l); }
  .feuille__texte { font-size: var(--t-s); color: var(--texte-doux); }
  .etapes { display: grid; gap: var(--e-2); text-align: left; width: 100%; counter-reset: none; }
  .etapes li { display: flex; gap: var(--e-3); align-items: flex-start; background: var(--trame); padding: 0.75rem 0.9rem; border-radius: var(--r-carte); font-size: var(--t-s); }
  .etapes__num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: #fff; font-weight: 800; font-size: 13px; }
  .etapes .icone { display: inline-block; vertical-align: -4px; width: 20px; height: 20px; color: #0a84ff; }
  .etapes__note { font-size: var(--t-xs); color: var(--texte-doux); }
  @media (min-width: 700px) { .feuille { margin: auto; border-radius: var(--r-panneau); } }
  @media (max-height: 760px) {
    .feuille__cadre { gap: var(--e-2); padding-top: var(--e-4); }
    .feuille__icone { width: 48px; height: 48px; }
    .etapes li { padding: 0.55rem 0.75rem; }
  }

  /* ----- Bandeau d'installation (mobile) ----- */
  .banniere-app {
    position: fixed; z-index: 85; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.6rem 0.7rem 0.8rem;
    background: var(--encre); color: #fff; border-radius: var(--r-carte); box-shadow: var(--ombre-3);
    animation: feuille-monte 420ms cubic-bezier(0.2, 0.9, 0.25, 1) both;
  }
  .banniere-app img { border-radius: 10px; flex: none; }
  .banniere-app__texte { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
  .banniere-app__texte strong { font-size: var(--t-s); }
  .banniere-app__texte span { font-size: var(--t-xs); color: #b9b9c2; }
  .banniere-app .bouton-icone { color: #b9b9c2; width: 34px; height: 34px; }
  body:has(.banniere-app:not([hidden])) .wa-flottant { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

  /* ----- Toast avec action (mise à jour) ----- */
  .toasts { pointer-events: none; }
  .toast--action { pointer-events: auto; }
  .toast--action button { margin-left: 0.4rem; background: var(--orange); color: #fff; font-weight: 800; padding: 0.35rem 0.7rem; border-radius: 8px; font-size: var(--t-xs); }

  /* ----- Pages légales ----- */
  .legale { max-width: 780px; padding-block: var(--e-6) var(--e-7); display: grid; gap: var(--e-5); }
  .legale h1 { font-size: var(--t-2xl); font-weight: 800; }
  .legale__maj { color: var(--texte-doux); font-size: var(--t-s); margin-top: calc(-1 * var(--e-4)); }
  .legale section { background: var(--papier); border: 1px solid var(--ligne); border-radius: var(--r-panneau); padding: var(--e-5); display: grid; gap: var(--e-3); }
  .legale h2 { font-size: var(--t-l); padding-left: 0.7rem; border-left: 4px solid var(--orange); }
  .legale ul { display: grid; gap: var(--e-2); padding-left: 1.1rem; list-style: disc; }
  .legale a { color: var(--orange-fonce); text-decoration: underline; }
  .pied--simple { padding-top: 0; }
}

/* Notifications : largeur confortable sur téléphone */
@layer sections {
  .toasts { width: min(520px, calc(100vw - 24px)); justify-items: center; }
  .toast { max-width: 100%; }
}
