/* ============================================================
   LIBERTY — Design system v1 (§23 du plan de construction)
   Mobile-first, léger (3G), prêt pour l'empaquetage WebView.
   ============================================================ */

:root {
    /* ------------------------------------------------------------------
       Palette Liberty v2 — « marché cosmique »
       DOMINANTE  : bleu clair            (--liberty / --azur)
       SECONDAIRE : orange cosmique       (--orange)
       ACCENTS    : or brillant (--or) + violet (--aqua / --violet)
       Les noms de variables historiques sont conservés (compatibilité
       totale des gabarits) ; seules leurs VALEURS changent.
       ------------------------------------------------------------------ */
    --encre:        #0A2540;   /* bleu nuit : barres, titres           */
    --liberty:      #1E90E8;   /* bleu clair : actions primaires        */
    --liberty-vif:  #48B0FF;   /* survol / dégradés                    */
    --or:           #FFC531;   /* or brillant : appels à l'action       */
    --or-doux:      #FFDE7C;   /* pastille active du dock              */
    --papier:       #F4F8FD;   /* fond général clair, légèrement bleuté */
    --carte:        #FFFFFF;
    --trait:        #DDE6F0;
    --texte:        #1E2A38;
    --texte-doux:   #5A6B7B;

    /* Couleurs secondaires nommées (nouveautés v2) */
    --orange:       #FF6B2C;   /* orange cosmique : couleur secondaire  */
    --orange-vif:   #FF8A45;
    --violet:       #7B5CFF;   /* violet : accents & lueurs             */
    --violet-doux:  #A98CFF;

    /* Accents VIFS & futuristes (icônes, dégradés, lueurs) */
    --aqua:         #7B5CFF;   /* alias historique -> violet            */
    --aqua-clair:   #A98CFF;
    --azur:         #2BB8FF;   /* bleu lumineux                        */
    /* Dégradé signature : bleu -> violet (boutons, FAB, icônes, avatars) */
    --degrade-vif:  linear-gradient(135deg, var(--liberty) 0%, var(--aqua) 100%);
    /* Dégradé chaud : or brillant -> orange cosmique (CTA « or ») */
    --degrade-or:   linear-gradient(135deg, var(--or) 0%, var(--orange) 100%);

    /* Lueurs (bordures « brillantes », discrètes) */
    --lueur-liberty: 0 0 0 1px rgba(123,92,255,.35), 0 8px 26px rgba(30,144,232,.22);
    --lueur-or:      0 6px 20px rgba(255,197,49,.32);
    --lueur-aqua:    0 0 18px rgba(123,92,255,.45);

    --rayon: 20px;
    --rayon-sm: 13px;
    --ombre: 0 1px 2px rgba(10,37,64,.05), 0 10px 30px rgba(10,37,64,.06);
    --ombre-haute: 0 16px 40px rgba(10,37,64,.16);
    --duree: .2s;
    --dock-h: 64px;

    --font-corps: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-titre: "Sora", var(--font-corps);
}

/* ---------- Base ---------- */
body {
    background:
        radial-gradient(1200px 460px at 88% -8%, rgba(123,92,255,.07), transparent 60%),
        radial-gradient(900px 380px at -5% 6%, rgba(43,184,255,.06), transparent 55%),
        var(--papier);
    background-attachment: fixed;
    color: var(--texte);
    font-family: var(--font-corps);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, .marque {
    font-family: var(--font-titre);
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--encre);
}
h1 { letter-spacing: -.03em; }
.prix, .montant { font-variant-numeric: tabular-nums; font-family: var(--font-titre); }
a { color: var(--liberty); }
::selection { background: var(--aqua-clair); color: var(--encre); }

/* Espace réservé au dock sur mobile (+ encoche iPhone) */
.avec-dock { padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 12px); }
@media (min-width: 992px) { .avec-dock { padding-bottom: 0; } }

/* ---------- Barre haute ---------- */
.barre-haute {
    background: linear-gradient(120deg, #08203A 0%, var(--encre) 55%, #123f34 100%);
    padding-top: max(.55rem, env(safe-area-inset-top));
    padding-bottom: .55rem;
    border-bottom: 1px solid rgba(123,92,255,.18);
    box-shadow: 0 1px 0 rgba(123,92,255,.25), 0 6px 24px rgba(0,0,0,.14);
}
.barre-haute .nav-link { color: rgba(255,255,255,.82); border-radius: 999px; transition: color var(--duree), background var(--duree); }
.barre-haute .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.marque { color: #fff !important; font-size: 1.25rem; }
/* Logo « Liberty Hub » (phénix + texte blanc) dans la barre haute sombre. */
.marque-logo { height: 34px; width: auto; display: block; }
.marque-icone {
    display: grid; place-items: center;
    width: 34px; height: 34px; border-radius: 11px;
    background: var(--degrade-vif);
    color: #fff; font-size: 1.05rem;
    box-shadow: var(--lueur-aqua);
}
.pastille-utilisateur {
    display: grid; place-items: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--liberty-vif); color: #fff;
    font-weight: 700; font-size: .9rem;
    padding: 0; border: none; cursor: pointer; line-height: 1;
}
/* Avatar utilisé comme toggle de menu : pas de flèche Bootstrap. */
.pastille-utilisateur.dropdown-toggle::after,
button.pastille-utilisateur::after { display: none; }

/* Barre haute — ajustements petits écrans : marque plus compacte, cloche et
   panier plus grands (plus lisibles et plus faciles à toucher au pouce). */
@media (max-width: 991.98px) {
    .barre-haute .marque { font-size: 1.05rem; gap: .35rem !important; }
    .barre-haute .marque-logo { height: 29px; }
    .barre-haute .marque-icone {
        width: 28px; height: 28px; font-size: .9rem; border-radius: 9px;
    }
    .barre-haute .lien-cloche i,
    .barre-haute .lien-panier i { font-size: 1.55rem; line-height: 1; }
    .barre-haute .lien-cloche,
    .barre-haute .lien-panier { display: inline-flex; align-items: center; }
}

/* ---------- Boutons ---------- */
.btn { border-radius: 999px; font-weight: 600; letter-spacing: .005em;
    transition: transform var(--duree), box-shadow var(--duree), filter var(--duree), background var(--duree); }
.btn:active { transform: scale(.97); }
.btn-or {
    background: var(--degrade-or); border: none; color: var(--encre); font-weight: 700;
    box-shadow: 0 4px 14px rgba(255,197,49,.24);
}
.btn-or:hover { color: var(--encre); box-shadow: var(--lueur-or); filter: brightness(1.04); }
.btn-liberty {
    background: var(--degrade-vif); border: none; color: #fff; font-weight: 600;
    box-shadow: 0 4px 14px rgba(30,144,232,.22);
}
.btn-liberty:hover { color: #fff; box-shadow: var(--lueur-liberty); filter: brightness(1.05); }
.btn-contour-clair {
    border: 1px solid rgba(255,255,255,.4); color: #fff; background: transparent;
}
.btn-contour-clair:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-contour {
    border: 1.5px solid var(--liberty); color: var(--liberty); background: transparent; font-weight: 600;
}
.btn-contour:hover { background: var(--liberty); color: #fff; box-shadow: var(--lueur-liberty); }
.btn-primary { background: var(--degrade-vif); border: none; }
.btn-primary:hover, .btn-primary:focus { box-shadow: var(--lueur-liberty); filter: brightness(1.05); }

/* ---------- Cartes ---------- */
.card {
    border: 1px solid var(--trait); border-radius: var(--rayon);
    box-shadow: var(--ombre); background: var(--carte);
    transition: transform var(--duree), box-shadow var(--duree), border-color var(--duree);
}
.carte-lien { transition: transform var(--duree), box-shadow var(--duree), border-color var(--duree); }
@media (hover: hover) {
    /* Bordure légèrement « brillante » aqua au survol */
    .carte-lien:hover,
    .carte-boutique:hover,
    .carte-produit--publique:hover {
        transform: translateY(-3px);
        border-color: rgba(123,92,255,.55);
        box-shadow: var(--ombre-haute), var(--lueur-aqua);
    }
}
.carte-produit img { aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--rayon-sm); }

/* ---------- Formulaires ---------- */
.form-control, .form-select {
    border-radius: var(--rayon-sm);
    border-color: var(--trait);
    padding: .65rem .9rem;
    transition: border-color var(--duree), box-shadow var(--duree);
}
.form-control:focus, .form-select:focus {
    border-color: var(--aqua);
    box-shadow: 0 0 0 .18rem rgba(123,92,255,.18), var(--lueur-aqua);
}

/* ---------- Héros (accueil) : signature « ciel cosmique » ---------- */
.heros {
    position: relative; overflow: hidden;
    /* Bleu nuit -> bleu clair, avec une pointe de violet en profondeur */
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(123,92,255,.55) 0%, transparent 55%),
        linear-gradient(140deg, var(--encre) 0%, var(--liberty) 68%, var(--liberty-vif) 100%);
    color: #fff;
    border-radius: 0 0 28px 28px;
}
.heros h1 { color: #fff; }
/* Trame géométrique très discrète (tissage lumineux) */
.heros::before {
    content: ""; position: absolute; inset: 0; opacity: .07; pointer-events: none;
    background-image:
        repeating-linear-gradient(45deg,  #fff 0 2px, transparent 2px 26px),
        repeating-linear-gradient(-45deg, #fff 0 2px, transparent 2px 26px);
}
.heros .sous-titre { color: rgba(255,255,255,.82); max-width: 560px; }
/* Double halo cosmique : violet en haut-droite, orange en bas-gauche */
.heros::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(320px 320px at calc(100% + 40px) -60px, rgba(123,92,255,.42), transparent 70%),
        radial-gradient(300px 300px at -40px calc(100% + 40px), rgba(255,107,44,.30), transparent 68%);
    filter: blur(6px);
}

/* ---------- Étapes de confiance (processus réel : 1→4) ---------- */
.etape { border-left: 3px solid var(--or); padding-left: 1rem; }
.etape .numero {
    font-family: "Sora", sans-serif; font-weight: 700;
    color: var(--or); font-size: .85rem; letter-spacing: .12em;
}
.icone-atout {
    display: grid; place-items: center;
    width: 54px; height: 54px; border-radius: 16px; margin-inline: auto;
    background: linear-gradient(135deg, rgba(123,92,255,.16), rgba(30,144,232,.12));
    color: var(--liberty); font-size: 1.4rem;
    border: 1px solid rgba(123,92,255,.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 6px 18px rgba(30,144,232,.12);
}

/* ---------- Badges de statut (base commune, Phase 4) ---------- */
.badge-statut { font-size: .72rem; letter-spacing: .04em; border-radius: 999px; padding: .35em .8em; }

/* ---------- Dock mobile ---------- */
.dock {
    position: fixed; left: 12px; right: 12px;
    bottom: calc(env(safe-area-inset-bottom) + 10px);
    height: var(--dock-h); z-index: 1030;
    display: flex; justify-content: space-around; align-items: stretch;
    background: rgba(255,255,255,.86);
    backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border: 1px solid rgba(123,92,255,.22);
    border-radius: 24px;
    box-shadow: var(--ombre-haute), 0 0 0 1px rgba(255,255,255,.5) inset, 0 -2px 24px rgba(123,92,255,.12);
}
/* --- Onglets du dock : icônes seules au repos, nom révélé quand actif ---
   Contrainte de charte (skill liberty-design §4) : ce comportement est LA
   règle de toutes les barres de navigation mobiles du projet.
   Optimisation : transform/opacity uniquement (GPU), scintillement BREF
   (2 cycles, jamais d'animation infinie), reduced-motion respecté. */
.dock-item {
    position: relative;
    flex: 1; min-width: 44px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-decoration: none;
    color: var(--texte-doux); font-weight: 600;
    border-radius: 18px; margin: 6px 2px;
    transition: color var(--duree), background var(--duree),
                transform .22s cubic-bezier(.34, 1.4, .64, 1), opacity var(--duree);
}
.dock-item i { font-size: 1.35rem; line-height: 1; transition: transform var(--duree); }

/* Libellé : replié par défaut (icônes sans nom), révélé sous l'icône actif */
.dock-item span {
    font-size: .62rem; line-height: 1;
    max-height: 0; opacity: 0;
    transform: translateY(4px);
    overflow: hidden;
    transition: max-height .22s ease, opacity .18s ease .05s,
                transform .22s ease, margin-top .22s ease;
}

.dock-item:active { transform: scale(.92); }

/* Onglet ACTIF : nom visible, pastille or->orange, icône soulevée, halo chaud */
.dock-item.actif {
    color: var(--encre);
    background: linear-gradient(135deg, var(--or-doux) 0%, var(--or) 100%);
    box-shadow: 0 6px 16px rgba(255,150,40,.35);
    transform: scale(1.06);
}
.dock-item.actif span {
    max-height: 14px; opacity: 1; transform: translateY(0); margin-top: 2px;
}
.dock-item.actif i { transform: translateY(-1px); }

/* Les AUTRES reculent quand un onglet est actif (navigateurs avec :has ;
   sans :has, ils restent simplement à l'état de repos : dégradation propre) */
.dock:has(.actif) .dock-item:not(.actif) {
    transform: scale(.86);
    opacity: .55;
}
.dock:has(.actif) .dock-item:not(.actif):active { transform: scale(.8); }

/* Scintillement doré BREF autour de l'onglet qui vient d'être activé :
   pseudo-élément anime uniquement transform + opacity (GPU). */
.dock-item::after {
    content: "";
    position: absolute; inset: -4px;
    border-radius: 22px;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(closest-side,
                rgba(255, 197, 49, .45), rgba(255, 197, 49, 0) 72%);
}
.dock-item.actif::after {
    animation: dock-scintille .55s ease-out 2;
}
@keyframes dock-scintille {
    0%   { opacity: 0;   transform: scale(.7); }
    45%  { opacity: .9;  transform: scale(1.12); }
    100% { opacity: 0;   transform: scale(1.3); }
}

/* Accessibilité : sans animations, les états restent parfaitement lisibles */
@media (prefers-reduced-motion: reduce) {
    .dock-item, .dock-item span, .dock-item i { transition: none; }
    .dock-item.actif::after { animation: none; }
    .dock:has(.actif) .dock-item:not(.actif) { transform: none; opacity: .6; }
    .dock-item.actif { transform: none; }
}

/* ---------- Pied de page ---------- */
.pied { background: var(--encre); color: rgba(255,255,255,.85); }
.texte-or { color: var(--or-doux); }

/* ---------- Alertes ---------- */
.alert { border-radius: var(--rayon-sm); border: none; box-shadow: var(--ombre); }

/* ---------- Animations d'entrée, sobres et courtes ---------- */
@keyframes apparait {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
.apparait   { animation: apparait .45s ease both; }
.apparait-2 { animation: apparait .45s ease .08s both; }
.apparait-3 { animation: apparait .45s ease .16s both; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Liens des documents legaux (pied de page, toutes tailles d'ecran) */
.liens-legaux a {
    color: rgba(255, 255, 255, .65);
    text-decoration: none;
}
.liens-legaux a:hover { color: var(--or, #E7B84B); text-decoration: underline; }
/* Sur mobile, laisser la place au dock fixe en bas */
@media (max-width: 991.98px) {
    .pied { padding-bottom: 6rem !important; }
}

/* ============ Lot 2B — Mes boutiques & assistant ============ */

/* Puce forfait (tableau de bord grossiste) */
.puce-forfait {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--carte); border: 1px solid var(--trait);
    border-radius: 999px; padding: .25rem .75rem;
    font-size: .82rem; color: var(--texte-doux);
}
.puce-forfait i { color: var(--or); }

/* Cartes boutique */
.carte-boutique { transition: transform var(--duree), box-shadow var(--duree); }
.carte-boutique:hover { transform: translateY(-2px); box-shadow: var(--ombre-haute); }
.logo-boutique {
    width: 52px; height: 52px; border-radius: 14px; object-fit: cover;
    flex: 0 0 auto;
}
.logo-boutique--grand { width: 72px; height: 72px; border-radius: 18px; }
.logo-boutique--initiale {
    display: grid; place-items: center; font-family: "Sora", sans-serif;
    font-weight: 700; font-size: 1.3rem; color: #fff;
    background: linear-gradient(135deg, var(--liberty), var(--liberty-vif));
}
.badge-doux { background: var(--papier); color: var(--texte-doux); border: 1px solid var(--trait); }
/* Sert à la fois pour un <img> (espace grossiste) et un <div> à
   background-image (vitrine publique) : les propriétés background sont
   sans effet sur un <img>, celles d'objet sans effet sur un <div>. */
.banniere-boutique {
    width: 100%; height: 160px; object-fit: cover;
    background-size: cover; background-position: center;
    background-repeat: no-repeat; background-color: var(--papier);
}
.texte-ok { color: var(--liberty-vif); }

/* Rapport de vérification affiché au revendeur (§7.1.9) */
.rapport-controle { border: 1px solid transparent; }
.rapport-controle--ok { background: #DFF3E4; border-color: #B8E3C4; }
.rapport-controle--ko { background: #FBE0DD; border-color: #F3C2BC; }

/* Boutons-icônes d'accès rapide sur les cartes produit (couleur du site) */
.carte-produit-lien { display: block; color: inherit; }
.carte-produit-actions {
    display: flex; gap: .5rem; justify-content: center;
    padding: .25rem .5rem .5rem;
}
.btn-icone {
    width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--degrade-vif); color: #fff; border: 1px solid rgba(123,92,255,.4);
    font-size: 1.1rem; cursor: pointer; text-decoration: none;
    box-shadow: 0 4px 12px rgba(30,144,232,.22);
    transition: box-shadow var(--duree), transform .12s, filter var(--duree), background var(--duree), color var(--duree);
}
.btn-icone:hover { color: #fff; box-shadow: var(--lueur-aqua), 0 6px 16px rgba(30,144,232,.28); filter: brightness(1.06); transform: translateY(-1px); }
.btn-icone:active { transform: scale(.94); }
.btn-icone--contour {
    background: #fff; color: var(--liberty); border-color: rgba(30,144,232,.35); box-shadow: none;
}
.btn-icone--contour:hover { background: var(--degrade-vif); color: #fff; border-color: rgba(123,92,255,.4); }
.btn-icone:disabled, .btn-icone[disabled] {
    opacity: .4; cursor: not-allowed; background: #fff; color: var(--texte-doux);
    border-color: var(--trait); box-shadow: none; filter: none; transform: none;
}

/* Sélecteur de quantité +/- côte à côte (panier), épuré, couleur du site */
.pas-quantite {
    display: inline-flex; align-items: center;
    border: 1.5px solid var(--liberty); border-radius: 999px; overflow: hidden;
}
.pas-quantite form { display: inline-flex; margin: 0; }
.pas-btn {
    width: 34px; height: 34px; border: 0; background: transparent;
    color: var(--liberty); font-size: 1rem; line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.pas-btn:hover { background: rgba(30, 144, 232, .1); }
.pas-btn:active { background: rgba(30, 144, 232, .2); }
.pas-valeur {
    min-width: 2.2ch; text-align: center; font-weight: 700;
    color: var(--encre); padding: 0 .2rem;
}

/* Bulle flottante de confirmation d'ajout au panier (légère, bleu ciel).
   Flotte au-dessus du dock sur mobile ; en bas de l'écran sur grand écran. */
.bulle-panier {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 12px);
    z-index: 1040; pointer-events: none;
    width: max-content; max-width: 92vw;
    display: none;
}
.bulle-panier--visible { display: block; }
@media (min-width: 992px) {
    .bulle-panier { bottom: 24px; }         /* pas de dock sur grand écran */
}
.bulle-message {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .55rem 1rem; border-radius: 999px;
    background: rgba(135, 206, 235, .82);   /* bleu ciel, légèrement transparent */
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    color: #0A3A52; font-weight: 600; font-size: .92rem;
    border: 1px solid rgba(255, 255, 255, .5);
    box-shadow: 0 6px 20px rgba(10, 58, 82, .18);
    animation: bulleEntre .25s cubic-bezier(.2, .8, .3, 1) both;
}
.bulle-message .bi { font-size: 1.1rem; }
.bulle-message--ko {
    background: rgba(224, 72, 59, .85); color: #fff;
    border-color: rgba(255, 255, 255, .35);
}
.bulle-message--sortie { animation: bulleSort .3s ease forwards; }
@keyframes bulleEntre {
    from { opacity: 0; transform: translateY(10px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes bulleSort {
    to { opacity: 0; transform: translateY(10px) scale(.98); }
}
@media (prefers-reduced-motion: reduce) {
    .bulle-message, .bulle-message--sortie { animation-duration: .01ms; }
}

/* Notation par étoiles (avis à la clôture) */
.notation { display: inline-flex; }
.notation input { display: none; }
.notation label {
    color: #d5d5d5; font-size: 1.55rem; cursor: pointer; padding: 0 .06rem;
    transition: color .1s, transform .1s;
}
.notation label:hover, .notation label:hover ~ label,
.notation input:checked ~ label { color: var(--or); }
.notation label:hover { transform: scale(1.12); }

/* Choix de l'opérateur Mobile Money (§10) */
.choix-operateur { cursor: pointer; }
.choix-operateur span { transition: border-color .15s, background .15s; }
.choix-operateur input:checked + span {
    border-color: var(--or) !important; background: #FBF7EC; font-weight: 600;
}
.choix-operateur input:focus-visible + span { outline: 2px solid var(--or); }
.icone-atout--ko { background: #FBE0DD; color: #B02A18; }
.min-w-0 { min-width: 0; }

/* Fil des etapes de l'assistant (signature) */
.assistant-fil {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem;
}
.assistant-fil li {
    border-left: 3px solid var(--trait);
    padding: .15rem 0 .15rem .75rem;
    color: var(--texte-doux); font-size: .9rem;
    transition: border-color var(--duree), color var(--duree);
}
.assistant-fil li .numero { display: block; }
.assistant-fil li.active { border-color: var(--or); color: var(--texte); }
.assistant-fil li.faite  { border-color: var(--liberty-vif); }
.assistant-fil li.faite .numero { color: var(--liberty-vif); }

/* Carte de position */
.carte-position {
    height: 320px; border-radius: var(--rayon); overflow: hidden;
    border: 1px solid var(--trait); background: var(--papier);
}
@media (max-width: 575.98px) { .carte-position { height: 260px; } }

/* Recap etape 3 */
.recap-assistant dd { font-weight: 600; }

/* ============ Lot 2C — Produits ============ */
.vignette-produit {
    width: 56px; height: 56px; border-radius: 12px; object-fit: cover;
    flex: 0 0 auto; background: var(--papier); border: 1px solid var(--trait);
}
.vignette-produit--vide { display: grid; place-items: center; color: var(--texte-doux); }
.carte-produit--masquee { opacity: .6; }
.carte-fiche { border-left: 3px solid var(--or); }
.pastille-couleur {
    --pastille: #ccc;
    width: 14px; height: 14px; border-radius: 50%;
    display: inline-block; background: var(--pastille);
    border: 1px solid rgba(0,0,0,.15);
}
.pastille-couleur--epuisee { opacity: .35; }
.ligne-couleur .form-check { min-width: 24px; }

/* ---------- Marketplace publique (Phase 3) ---------- */
.etoiles { color: var(--or); white-space: nowrap; font-size: .9em; }
.etoiles-nb { color: var(--texte-doux); margin-left: .15rem; }

.carte-produit--publique { overflow: hidden; transition: transform var(--duree), box-shadow var(--duree); }
.carte-produit--publique:hover { transform: translateY(-2px); box-shadow: var(--ombre-haute); }
.carte-produit--publique img { width: 100%; }
.carte-produit-sans-photo {
    aspect-ratio: 1 / 1; display: grid; place-items: center;
    background: var(--papier); color: var(--texte-doux); font-size: 1.8rem;
}

/* Carrousel anime des cartes : jusqu'a 3 images stockees en fondu enchaine.
   100 % CSS (aucun JS) : chaque image est decalee d'un « slot » de temps. */
.carte-carrousel {
    position: relative; aspect-ratio: 1 / 1; overflow: hidden;
    border-radius: var(--rayon-sm); background: var(--papier);
}
.carte-carrousel-img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 0;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    animation-delay: calc(var(--i) * var(--slot) * -1);
}
.carte-carrousel--2 { --slot: 5s; }
.carte-carrousel--2 .carte-carrousel-img { animation-duration: 10s; }
.carte-carrousel--3 { --slot: 5s; }
.carte-carrousel--3 .carte-carrousel-img { animation-duration: 15s; }
/* 2 images : chacune visible ~1/2 du cycle, fondu sur les 10 % de bascule. */
.carte-carrousel--2 .carte-carrousel-img { animation-name: carte-fondu-2; }
@keyframes carte-fondu-2 {
    0%, 40%  { opacity: 1; }
    50%, 90% { opacity: 0; }
    100%     { opacity: 1; }
}
/* 3 images : chacune visible ~1/3 du cycle. */
.carte-carrousel--3 .carte-carrousel-img { animation-name: carte-fondu-3; }
@keyframes carte-fondu-3 {
    0%, 26%  { opacity: 1; }
    33%, 93% { opacity: 0; }
    100%     { opacity: 1; }
}
/* Accessibilite : pas d'animation → on fige la 1re image. */
@media (prefers-reduced-motion: reduce) {
    .carte-carrousel-img { animation: none; opacity: 0; }
    .carte-carrousel-img:first-child { opacity: 1; }
}
.carte-produit-nom {
    color: var(--texte); font-weight: 600; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; min-height: 2.5em;
}
.carte-produit-gros { color: var(--liberty-vif); }

/* Barre de recherche signature : pleine largeur, meme hauteur que les
   filtres (.form-select), LUEUR VERDATRE qui scintille et respire. */
.barre-recherche {
    display: flex; align-items: center; gap: .5rem;
    width: 100%;
    /* meme hauteur rendue que .form-select (padding .65rem + bordures) */
    min-height: calc(1.5em + 1.3rem + 2px);
    position: relative; z-index: 0;
    background: var(--carte); border: 1px solid var(--trait);
    border-radius: 999px; padding: .25rem .45rem .25rem 1rem;
    box-shadow: var(--ombre);
}
.barre-recherche::after {
    content: ""; position: absolute; inset: -3px; border-radius: 999px;
    z-index: -1;
    /* deux couches : un eclat qui balaie + une lueur verte constante */
    background:
        linear-gradient(100deg,
            rgba(30, 144, 232, 0)     12%,
            rgba(30, 144, 232, .50)   38%,
            rgba(123, 92, 255, .95) 50%,
            rgba(30, 144, 232, .50)   62%,
            rgba(30, 144, 232, 0)     88%),
        rgba(30, 144, 232, .30);
    background-size: 220% 100%, 100% 100%;
    filter: blur(5px);
    animation: scintille-vert 2.8s linear infinite,
               souffle-vert 2.8s ease-in-out infinite;
}
.barre-recherche:focus-within { border-color: var(--liberty); }
.barre-recherche:focus-within::after { filter: blur(7px); }
@keyframes scintille-vert {
    from { background-position: 190% 0, 0 0; }
    to   { background-position: -90% 0, 0 0; }
}
@keyframes souffle-vert {
    0%, 100% { opacity: .6; }
    50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .barre-recherche::after {
        animation: none;
        background: rgba(30, 144, 232, .30);
        opacity: 1;
    }
}
.barre-recherche input {
    border: 0; outline: 0; background: transparent; flex: 1 1 auto;
    min-width: 0; font-size: 1rem; color: var(--texte);
}
.barre-recherche .btn { border-radius: 999px; }

/* Pastilles de catégories (accueil + filtres) */
.puce-categorie {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .4rem .85rem; border-radius: 999px;
    background: var(--carte); border: 1px solid var(--trait);
    color: var(--texte); text-decoration: none; font-size: .9rem;
    transition: border-color var(--duree), background var(--duree);
}
.puce-categorie:hover, .puce-categorie.active {
    border-color: rgba(123,92,255,.6); background: rgba(123,92,255,.08); color: var(--encre);
    box-shadow: var(--lueur-aqua);
}
/* Icône en dégradé vif (glyphe Bootstrap Icons coloré via background-clip) */
.puce-categorie .bi {
    background: var(--degrade-vif);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}

/* Indicateur HTMX : visible pendant la requête seulement */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }

/* Galerie de la fiche produit */
.galerie-principale {
    aspect-ratio: 1 / 1; border-radius: var(--rayon); overflow: hidden;
    border: 1px solid var(--trait);
    background: repeating-conic-gradient(#EDECE6 0% 25%, #FFFFFF 0% 50%) 0 0/18px 18px;
    display: flex; align-items: center; justify-content: center;
}
.galerie-principale img { width: 100%; height: 100%; object-fit: contain; }
.galerie-vignettes { display: flex; gap: .5rem; margin-top: .5rem; }
.galerie-vignettes button {
    width: 64px; height: 64px; border-radius: var(--rayon-sm);
    border: 2px solid var(--trait); overflow: hidden; padding: 0;
    background: var(--carte); flex: 0 0 auto;
}
.galerie-vignettes button.active { border-color: var(--or); }
.galerie-vignettes img { width: 100%; height: 100%; object-fit: cover; }


/* ---------- Accueil : rangées horizontales + carrousel (Phase 3) ---------- */
/* Défilement gauche→droite, aligné au doigt (scroll-snap), léger en 3G. */
.rangee-scroll {
    display: flex; gap: .6rem;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding: .25rem .25rem .75rem;
    margin: 0 -.25rem;
    scrollbar-width: thin;
}
.rangee-scroll::-webkit-scrollbar { height: 6px; }
.rangee-scroll::-webkit-scrollbar-thumb {
    background: var(--trait); border-radius: 999px;
}
.rangee-item {
    flex: 0 0 46%; max-width: 46%;
    scroll-snap-align: start;
}
@media (min-width: 576px) { .rangee-item { flex-basis: 31%; max-width: 31%; } }
@media (min-width: 768px) { .rangee-item { flex-basis: 23%; max-width: 23%; } }
@media (min-width: 992px) { .rangee-item { flex-basis: 18%; max-width: 18%; } }
.rangee-item .carte-produit--publique { height: 100%; }

.sentinelle-accueil { min-height: 40px; }

/* Carrousel d'annonces */
.carrousel-annonces { border-radius: var(--rayon); overflow: hidden;
    box-shadow: var(--ombre); }
.carrousel-annonces .carousel-item img {
    width: 100%; height: 220px; object-fit: cover; display: block;
}
@media (min-width: 768px) { .carrousel-annonces .carousel-item img { height: 320px; } }
.carrousel-legende {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 1.25rem 1rem .9rem; color: #fff; text-align: left;
    background: linear-gradient(to top,
        rgba(10, 37, 64, .88) 0%, rgba(10, 37, 64, .45) 55%, transparent 100%);
}
.carrousel-legende h3 { color: #fff; font-family: "Sora", sans-serif; }

/* ---------- Chips de catégories (onboarding revendeur) ---------- */
.chip-categorie {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .35rem .5rem .35rem .85rem; border-radius: 999px;
    background: #FFF8E6; border: 1px solid var(--or);
    color: var(--encre); font-size: .9rem; font-weight: 600;
}
.chip-categorie .chip-x {
    border: 0; background: transparent; color: var(--texte-doux);
    font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0 .1rem;
}
.chip-categorie .chip-x:hover { color: #dc3545; }

/* ---------- Badge panier (Phase 4) ---------- */
.lien-panier { color: #fff; }
.badge-panier-slot { position: absolute; top: 2px; right: 0; }
.badge-panier-pastille {
    display: inline-block; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; background: var(--or); color: var(--encre);
    font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center;
}

/* ---------- Cloche de notifications (badge poll HTMX) ---------- */
.lien-cloche { color: #fff; }
.badge-notif-slot { position: absolute; top: 0; right: -2px; }
.badge-notif-pastille {
    display: inline-block; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; background: #E0483B; color: #fff;
    font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center;
}
.icone-notif {
    flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(123,92,255,.18), rgba(43,184,255,.14));
    color: var(--liberty); font-size: 1.15rem;
    border: 1px solid rgba(123,92,255,.25);
}
.notif-non-lue { background: #FBF7EC; }
.point-non-lu {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: #E0483B; flex: 0 0 auto;
}

/* ---------- Badges de statut de commande (couleurs stables, §5/§13.4) ---------- */
.badge-statut {
    display: inline-block; padding: .2rem .55rem; border-radius: 999px;
    font-size: .78rem; font-weight: 600; white-space: nowrap;
    border: 1px solid transparent;
}
.statut-SOUMISE            { background: #EAF1FB; color: #1B4B8A; }
.statut-EN_PREPARATION     { background: #FFF3D6; color: #8A5A00; }
.statut-APPRETEE           { background: #FDECC8; color: #8A4B00; }
.statut-EN_VERIFICATION    { background: #E7E2F7; color: #4B3A8A; }
.statut-CONFORME           { background: #DFF3E4; color: #1E7A45; }
.statut-NON_CONFORME       { background: #FBE0DD; color: #B02A18; }
.statut-MARCHANDISE_PAYEE  { background: #DDF0EC; color: #1E90E8; }
.statut-EXPEDIEE           { background: #E1EEF5; color: #1B5E7A; }
.statut-EXPEDITION_PAYEE   { background: #DDF0EC; color: #1E90E8; }
.statut-EN_LIVRAISON_FINALE{ background: #E1EEF5; color: #1B5E7A; }
.statut-LIVREE             { background: #DFF3E4; color: #1E7A45; }
.statut-CLOTUREE           { background: #E7E5DF; color: #4A4A44; }
.statut-ANNULEE            { background: #EDEDED; color: #777; }
.statut-LITIGE             { background: #FBE0DD; color: #B02A18; }

/* ---------- Messagerie (Phase 9) ---------- */
/* Bouton flottant (FAB) */
.fab-messagerie {
    position: fixed; right: 16px;
    bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 16px);
    z-index: 1035; width: 58px; height: 58px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--degrade-vif); color: #fff; font-size: 1.5rem;
    text-decoration: none;
    border: 1px solid rgba(123,92,255,.5);
    box-shadow: 0 8px 24px rgba(30,144,232,.35), var(--lueur-aqua);
    transition: transform var(--duree), box-shadow var(--duree), filter var(--duree);
}
.fab-messagerie:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.06); }
.fab-messagerie:active { transform: scale(.94); }
@media (min-width: 992px) { .fab-messagerie { bottom: 24px; right: 24px; } }
.fab-badge-slot { position: absolute; top: -2px; right: -2px; }

/* Bouton flottant du CONTRÔLEUR (service client) — au-dessus de celui des
   messages, sur petit écran : accès direct aux commandes à traiter. */
.fab-controleur {
    position: fixed; right: 16px;
    bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 16px + 70px);
    z-index: 1035; width: 58px; height: 58px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--degrade-or, linear-gradient(135deg, #FFC531, #FF6B2C));
    color: #0A2540; font-size: 1.45rem; text-decoration: none;
    border: 1px solid rgba(255,197,49,.55);
    box-shadow: 0 8px 24px rgba(120,90,0,.30);
    transition: transform var(--duree), filter var(--duree);
}
.fab-controleur:hover { color: #0A2540; transform: translateY(-2px); filter: brightness(1.05); }
.fab-controleur:active { transform: scale(.94); }
.fab-badge {
    display: inline-block; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 999px; background: #E0483B; color: #fff;
    font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center;
    border: 2px solid var(--papier);
}

/* --- Boîte de réception : liste de discussions façon WhatsApp ------------ */
.conv-liste {
    background: var(--carte); border-radius: var(--rayon-sm);
    overflow: hidden; box-shadow: var(--ombre);
}
.conv-ligne {
    display: flex; align-items: center; gap: .75rem;
    padding: .65rem .85rem; text-decoration: none; color: inherit;
    border-bottom: 1px solid var(--trait);
    transition: background var(--duree);
}
.conv-ligne:last-child { border-bottom: 0; }
.conv-ligne:hover { background: var(--papier); }
.conv-avatar {
    width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%;
    background: var(--degrade-vif); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
}
.conv-corps { flex: 1 1 auto; min-width: 0; }
.conv-tete, .conv-bas { display: flex; align-items: center; gap: .5rem; }
.conv-bas { margin-top: 1px; }
.conv-nom {
    flex: 1 1 auto; min-width: 0;
    font-weight: 600; font-size: .97rem; color: var(--texte);
}
.conv-heure { flex: 0 0 auto; font-size: .72rem; color: var(--texte-doux); }
.conv-apercu {
    flex: 1 1 auto; min-width: 0;
    font-size: .85rem; color: var(--texte-doux);
}
.conv-coche { color: var(--azur); margin-right: .2rem; }
.conv-badge {
    flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: 999px; background: var(--liberty); color: #fff;
    font-size: .7rem; font-weight: 700; line-height: 20px; text-align: center;
}
/* Discussion non lue : nom en gras et heure colorée, comme WhatsApp */
.conv-ligne.non-lue .conv-nom { font-weight: 700; color: var(--encre); }
.conv-ligne.non-lue .conv-heure { color: var(--liberty); font-weight: 700; }

/* ============================================================
   MESSAGERIE — mécanique visuelle façon WhatsApp, couleurs Liberty
   (queues de bulle, heure dans la bulle, fond à motif fixe,
    séparateurs de date, groupement par séries)

   Pour basculer sur le vert WhatsApp, seules ces variables changent :
       --chat-fond: #ECE5DD ; --chat-bulle-moi: #D9FDD3 ;
   ============================================================ */
.chat-plein {
    --chat-fond:        #E9EEF4;   /* toile du fil (sous le motif)        */
    --chat-bulle-moi:   #D7E9FB;   /* mes bulles : bleu Liberty très clair */
    --chat-bulle-autre: #FFFFFF;   /* bulles reçues                        */
    --chat-meta:        #64748B;   /* heure, coches, texte secondaire      */
    --chat-composeur:   #EEF2F7;   /* barre de saisie                      */
    --chat-rayon:       8px;       /* rayon des bulles (WhatsApp : 7,5px)  */
    --chat-relief:      0 1px .5px rgba(10, 37, 64, .13);

    /* Hauteur DÉFINIE, surtout pas min-height : un conteneur flex sans hauteur
       définie grandit avec son contenu, donc .chat-fil ne déborde jamais et son
       overflow-y:auto reste inerte (c'est le document qui défilerait). Il faut
       une hauteur ferme ici pour que le fil devienne la zone défilante. */
    height: 100vh; height: 100dvh;
    overflow: hidden;              /* le document ne défile pas : le fil, lui, oui */
    display: flex; flex-direction: column;
    background: var(--chat-fond);
}
.chat-barre {
    position: sticky; top: 0; z-index: 6;
    display: flex; align-items: center; gap: .55rem;
    padding: max(.45rem, env(safe-area-inset-top)) .8rem .45rem;
    background: linear-gradient(120deg, #08203A 0%, var(--encre) 60%, #123f34 100%);
    color: #fff;
    box-shadow: 0 1px 0 rgba(123,92,255,.25), 0 4px 18px rgba(0,0,0,.16);
}
.chat-retour { color: #fff; font-size: 1.3rem; line-height: 1; text-decoration: none; flex: 0 0 auto; }
.chat-retour:hover { color: var(--aqua-clair); }
.chat-avatar {
    width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%;
    background: var(--degrade-vif); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.chat-identite { min-width: 0; flex: 1 1 auto; line-height: 1.2; }
.chat-titre { font-family: var(--font-titre); font-weight: 700; font-size: 1rem; }
/* « en train d'écrire… » : sous-titre de l'en-tête, comme WhatsApp. */
.chat-sous-titre {
    display: flex; align-items: center; gap: 4px;
    font-size: .74rem; color: var(--aqua-clair);
}
.chat-sous-titre[hidden] { display: none; }
.chat-sous-titre .point-frappe { width: 5px; height: 5px; background: var(--aqua-clair); }
.chat-banniere {
    background: #FFF4D4; color: #7a5600;
    border-bottom: 1px solid rgba(255,197,49,.4);
    font-size: .72rem; font-weight: 600; text-align: center;
    padding: .28rem .8rem;
}
/* Corps : porte le fond à motif (FIXE, il ne défile pas avec les messages) et
   ancre le bouton « descendre en bas ». Le fil défile par-dessus. */
.chat-corps {
    position: relative;
    flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column;
    background-color: var(--chat-fond);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%230A2540' stroke-opacity='.055' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 40h28v26a4 4 0 0 1-4 4H22a4 4 0 0 1-4-4z'/%3E%3Cpath d='M26 40v-6a6 6 0 0 1 12 0v6'/%3E%3Cpath d='M118 20h22l18 18-22 22-18-18z'/%3E%3Ccircle cx='130' cy='32' r='3'/%3E%3Cpath d='M156 60h6l5 18h20l4-12h-27'/%3E%3Ccircle cx='171' cy='85' r='2.5'/%3E%3Ccircle cx='184' cy='85' r='2.5'/%3E%3Ccircle cx='58' cy='112' r='14'/%3E%3Ccircle cx='58' cy='112' r='6'/%3E%3Cpath d='M140 104h34a5 5 0 0 1 5 5v18a5 5 0 0 1-5 5h-21l-9 8v-8h-4a5 5 0 0 1-5-5v-18a5 5 0 0 1 5-5z'/%3E%3Cpath d='M30 156l4 9 10 1-7 7 2 10-9-5-9 5 2-10-7-7 10-1z'/%3E%3Cpath d='M96 160h36v26H96z'/%3E%3Cpath d='M96 168h36M114 160v8'/%3E%3C/g%3E%3C/svg%3E");
}
.chat-fil {
    /* min-height:0 : sans lui, un élément flex refuse de rétrécir sous la
       taille de son contenu et déborderait au lieu de défiler. */
    flex: 1 1 auto; min-height: 0; overflow-y: auto; background: transparent;
    display: flex; flex-direction: column; gap: 2px;
    padding: .5rem .6rem .75rem; scroll-behavior: smooth;
}
.chat-pied {
    position: sticky; bottom: 0; z-index: 4;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--chat-composeur);
    border-top: 1px solid rgba(10,37,64,.07);
}

/* Séparateur de date : pastille centrée, collante en haut du fil. */
.chat-jour {
    align-self: center; position: sticky; top: 2px; z-index: 2;
    margin: 10px 0 4px;
}
.chat-jour span {
    display: inline-block; padding: 5px 12px; border-radius: 7px;
    background: rgba(255,255,255,.95); color: var(--chat-meta);
    font-size: .69rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; box-shadow: var(--chat-relief);
}

/* --- Bulles ------------------------------------------------------------- */
/* Le padding latéral loge la queue : elle déborde de la bulle, jamais de .msg
   (sinon overflow-x du fil). */
.msg {
    position: relative; touch-action: pan-y;
    display: flex; flex-direction: column; max-width: 78%;
}
.msg--moi   { align-self: flex-end;   align-items: flex-end;   padding-right: 9px; }
.msg--autre { align-self: flex-start; align-items: flex-start; padding-left: 9px; }
.msg.debut-serie { margin-top: 10px; }
.msg-bulle {
    position: relative; max-width: 100%;
    padding: 6px 9px 8px; border-radius: var(--chat-rayon);
    font-size: .95rem; line-height: 1.35; word-break: break-word;
    box-shadow: var(--chat-relief);
}
.msg--moi   .msg-bulle { background: var(--chat-bulle-moi);   color: var(--texte); }
.msg--autre .msg-bulle { background: var(--chat-bulle-autre); color: var(--texte); }
/* Queue : seulement sur le premier message d'une série (comme WhatsApp). */
.msg.debut-serie .msg-bulle::before {
    content: ''; position: absolute; top: 0; width: 9px; height: 13px;
}
.msg--moi.debut-serie .msg-bulle { border-top-right-radius: 0; }
.msg--moi.debut-serie .msg-bulle::before {
    right: -9px; background: var(--chat-bulle-moi);
    clip-path: polygon(0 0, 0 100%, 100% 0);
}
.msg--autre.debut-serie .msg-bulle { border-top-left-radius: 0; }
.msg--autre.debut-serie .msg-bulle::before {
    left: -9px; background: var(--chat-bulle-autre);
    clip-path: polygon(100% 0, 100% 100%, 0 0);
}

/* Heure + coches DANS la bulle, en bas à droite. `.msg-espace` réserve la
   place sur la dernière ligne de texte ; si elle est pleine, il bascule seul
   sur une ligne neuve et le méta s'y loge — exactement comme WhatsApp. */
.msg-meta {
    position: absolute; right: 8px; bottom: 5px;
    display: flex; align-items: center; gap: 3px;
    font-size: .68rem; line-height: 1; white-space: nowrap;
    color: var(--chat-meta); pointer-events: none;
}
.msg-espace { display: inline-block; width: 46px; height: 1px; }
.msg--moi .msg-espace { width: 62px; }
.msg-coche { font-size: .78rem; }
.msg-lu { color: var(--azur); }              /* accusé de lecture (double coche bleue) */
.msg-filtre { color: #E0483B; }

/* Indicateur « en train d'écrire » : trois points qui pulsent */
.msg-frappe { display: inline-flex; gap: 4px; align-items: center; padding: .55rem .8rem; }
.point-frappe {
    width: 7px; height: 7px; border-radius: 50%; background: var(--texte-doux);
    display: inline-block; animation: frappe 1.1s infinite ease-in-out both;
}
.point-frappe:nth-child(2) { animation-delay: .18s; }
.point-frappe:nth-child(3) { animation-delay: .36s; }
@keyframes frappe {
    0%, 80%, 100% { transform: scale(.6); opacity: .4; }
    40%           { transform: scale(1);  opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .point-frappe { animation: none; } }
.msg-systeme {
    align-self: center; text-align: center; max-width: 85%;
    background: #FFF4D4; color: #7a5600;
    border-radius: 7px; padding: 6px 12px;
    font-size: .75rem; margin: 8px 0 2px;
    box-shadow: var(--chat-relief);
}
/* Carte d'offre de négociation (§8.4) — propre à Liberty : on garde l'or, on
   aligne juste le rayon et le relief sur les bulles. */
.carte-offre {
    position: relative;
    background: #fff; border: 1.5px solid var(--or);
    border-radius: var(--chat-rayon); padding: .6rem .8rem 1.35rem;
    min-width: 210px; max-width: 100%;
    box-shadow: var(--chat-relief);
}
.msg--moi .carte-offre { border-color: rgba(123,92,255,.6); }
.offre-entete {
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: var(--texte-doux);
    display: flex; align-items: center; gap: .35rem;
}
.offre-entete .bi { color: var(--or); }
.offre-statut { margin-left: auto; }
.offre-produit { font-weight: 600; margin-top: .25rem; }
.offre-prix { font-family: var(--font-titre); font-size: 1.15rem; font-weight: 700; color: var(--encre); }
.offre-prix .small { font-size: .7rem; color: var(--texte-doux); font-weight: 400; }
.offre-actions { display: flex; gap: .4rem; margin-top: .5rem; }
.offre-actions form { margin: 0; }
.btn-contre-offre {
    display: inline-flex; align-items: center; gap: .3rem;
    background: none; border: 1px solid var(--or); color: var(--encre);
    border-radius: 999px; font-weight: 600;
}
.btn-contre-offre:hover { background: rgba(255,197,49,.12); }
.statut-offre-ACCEPTEE { border-color: #1E7A45; }
.statut-offre-ACCEPTEE .offre-statut { color: #1E7A45; }
.statut-offre-REFUSEE, .statut-offre-EXPIREE { opacity: .7; border-color: var(--trait); }

/* Vignette du produit dans la carte d'offre */
.offre-produit { display: flex; align-items: center; gap: .5rem; }
.offre-photo {
    width: 42px; height: 42px; border-radius: 8px; object-fit: cover;
    flex: 0 0 auto; border: 1px solid var(--trait); background: #fff;
}

/* Produit épinglé au-dessus du composeur (préparer une offre de prix) */
.produit-epingle {
    display: flex; align-items: center; gap: .6rem;
    background: rgba(255,197,49,.10); border: 1px solid rgba(255,197,49,.35);
    border-radius: 12px; padding: .4rem .5rem; margin-bottom: .5rem;
}
.produit-epingle-photo {
    width: 46px; height: 46px; border-radius: 8px; object-fit: cover;
    flex: 0 0 auto; border: 1px solid var(--trait); background: #fff;
}
.produit-epingle-info { min-width: 0; flex: 1 1 auto; }
.produit-epingle-nom { font-weight: 600; font-size: .92rem; }
.produit-epingle-prix { font-size: .78rem; color: var(--texte-doux); }
.produit-epingle-fermer {
    color: var(--texte-doux); flex: 0 0 auto; padding: .25rem .45rem;
    text-decoration: none; font-size: .85rem;
}

/* --- Swipe-to-reply façon WhatsApp --------------------------------------- */
/* pan-y : on laisse le scroll vertical au navigateur, on gère l'horizontal. */
.msg { position: relative; touch-action: pan-y; }
.msg-swipe-icone {
    position: absolute; top: 50%; transform: translateY(-50%);
    color: var(--or); font-size: 1.05rem; opacity: 0;
    transition: opacity .12s ease; pointer-events: none; z-index: 0;
}
.msg--autre .msg-swipe-icone { left: -26px; }
.msg--moi   .msg-swipe-icone { right: -26px; }
.msg.repondre-arme .msg-swipe-icone { opacity: 1; }

/* Message cité façon WhatsApp : encart DANS la bulle, barre colorée à gauche.
   Cliquable → saut vers la source. */
.msg-reponse-a {
    display: block; max-width: 100%; overflow: hidden;
    text-decoration: none; cursor: pointer;
    background: rgba(10,37,64,.06); border-left: 4px solid var(--liberty);
    border-radius: 4px; padding: 4px 8px; margin-bottom: 4px;
    font-size: .8rem; line-height: 1.3;
    transition: filter .15s ease;
}
.msg--moi .msg-reponse-a { border-left-color: var(--aqua); background: rgba(10,37,64,.07); }
.msg-reponse-a:hover { filter: brightness(.96); }
.msg-reponse-a-auteur {
    display: block; font-weight: 700; font-size: .78rem;
    color: var(--liberty); margin-bottom: 1px;
}
.msg--moi .msg-reponse-a-auteur { color: var(--aqua); }
.msg-reponse-a-texte { display: block; color: var(--chat-meta); }

/* Surbrillance du message source quand on clique sa citation */
@keyframes flash-msg {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,197,49,0); }
    25%      { box-shadow: 0 0 0 3px rgba(255,197,49,.6); }
}
.msg-surligne .msg-bulle,
.msg-surligne .carte-offre { animation: flash-msg 1.5s ease; }
@media (prefers-reduced-motion: reduce) {
    .msg-surligne .msg-bulle, .msg-surligne .carte-offre { animation: none; }
}

/* Bannière de réponse au-dessus du composeur */
.reponse-apercu {
    display: flex; align-items: center; gap: .5rem;
    background: #fff; border-left: 4px solid var(--liberty);
    border-radius: 8px 8px 0 0; padding: .4rem .55rem; margin-bottom: 2px;
    box-shadow: var(--chat-relief);
}
.reponse-apercu[hidden] { display: none; }
.reponse-apercu > .bi-reply-fill { color: var(--liberty); flex: 0 0 auto; }
.reponse-apercu-corps { min-width: 0; flex: 1 1 auto; }
.reponse-apercu-auteur { font-weight: 700; font-size: .8rem; color: var(--liberty); }
.reponse-apercu-texte { font-size: .78rem; color: var(--chat-meta); }
.reponse-apercu-fermer {
    background: none; border: 0; color: var(--chat-meta);
    flex: 0 0 auto; padding: .2rem .4rem; font-size: .85rem;
}

/* Bouton « Filtres » repliable de la recherche : chevron qui pivote */
.chevron-filtres { transition: transform .2s ease; }
.bouton-filtres:not(.collapsed) .chevron-filtres { transform: rotate(180deg); }

/* --- Composeur façon WhatsApp -------------------------------------------
   Pilule blanche (texte + trombone) puis, à droite, UN bouton rond qui bascule
   entre micro (champ vide) et envoi (dès qu'on tape). */
.barre-saisie { display: flex; align-items: flex-end; gap: 6px; margin: 0; }
.saisie-pilule {
    flex: 1 1 auto; min-width: 0;
    display: flex; align-items: flex-end; gap: 2px;
    background: #fff; border-radius: 22px; padding: 3px 4px 3px 14px;
    box-shadow: var(--chat-relief);
}
.saisie-champ {
    flex: 1 1 auto; min-width: 0; width: 100%;
    border: 0; outline: 0; resize: none; background: transparent;
    font: inherit; font-size: .95rem; line-height: 1.4;
    color: var(--texte); padding: 9px 0;
    max-height: 120px; overflow-y: auto;
}
.saisie-champ::placeholder { color: var(--chat-meta); opacity: 1; }

/* Trombone : plat, DANS la pilule */
.btn-media {
    width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%;
    border: 0; background: transparent; color: var(--chat-meta);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.2rem; cursor: pointer; margin: 0 0 2px;
    transition: background var(--duree), color var(--duree);
}
.btn-media:hover { background: rgba(30,144,232,.10); color: var(--liberty); }

/* Bouton rond d'action : micro OU envoi, jamais les deux (voir le JS) */
.btn-action {
    width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%;
    border: 0; background: var(--degrade-vif); color: #fff; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.15rem; cursor: pointer;
    box-shadow: 0 2px 8px rgba(30,144,232,.35);
    transition: transform var(--duree), filter var(--duree);
}
.btn-action[hidden] { display: none; }     /* bat le display:inline-flex */
.btn-action:hover { filter: brightness(1.06); }
.btn-action:active { transform: scale(.92); }
.btn-action.enregistre {
    background: #E0483B; box-shadow: none; animation: pulse-rec 1s infinite;
}
@keyframes pulse-rec { 0%,100% { box-shadow: 0 0 0 0 rgba(224,72,59,.5); } 50% { box-shadow: 0 0 0 6px rgba(224,72,59,0); } }
.etat-micro { font-size: .78rem; color: #E0483B; font-weight: 600; text-align: center; min-height: 1rem; }

/* Bouton « descendre en bas » : apparaît dès qu'on remonte dans le fil */
.btn-bas {
    position: absolute; right: 12px; bottom: 12px; z-index: 5;
    width: 42px; height: 42px; border-radius: 50%;
    border: 0; background: #fff; color: var(--chat-meta);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.2rem; cursor: pointer;
    box-shadow: 0 2px 10px rgba(10,37,64,.22);
    opacity: 0; transform: translateY(8px); pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.btn-bas.visible { opacity: 1; transform: none; pointer-events: auto; }
.btn-bas-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
    background: var(--liberty); color: #fff;
    font-size: .67rem; font-weight: 700; line-height: 19px;
}
.btn-bas-badge[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .btn-bas { transition: none; } }

/* Contenus image / audio dans les bulles */
.msg-image {
    max-width: 240px; max-height: 280px; border-radius: 5px;
    display: block; cursor: pointer;
}
.msg-image:hover { filter: brightness(.95); }
/* Photo : la bulle se réduit au cadre, l'heure passe en surimpression sur un
   voile dégradé (comme WhatsApp). */
.msg-bulle--photo { padding: 3px; }
.msg-bulle--photo::after {
    content: ''; position: absolute; left: 3px; right: 3px; bottom: 3px;
    height: 34px; border-radius: 0 0 5px 5px; pointer-events: none;
    background: linear-gradient(transparent, rgba(0,0,0,.45));
}
.msg-bulle--photo .msg-meta { right: 10px; bottom: 8px; z-index: 1; color: #fff; }
.msg-bulle--photo .msg-lu { color: #fff; }
.msg-bulle--audio { padding: 6px 8px 22px; }
.msg-audio { max-width: 232px; width: 100%; height: 38px; display: block; }
.msg-duree { position: absolute; left: 10px; bottom: 6px; font-size: .68rem; color: var(--chat-meta); }

/* Popup photo (lightbox) */
.modal-image-contenu { background: transparent; border: 0; align-items: center; }
.modal-image-photo {
    max-width: 100%; max-height: 82vh; border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.modal-image-fermer {
    position: absolute; top: -6px; right: -6px; z-index: 2;
    background-color: rgba(0,0,0,.55); border-radius: 50%; padding: .5rem;
    opacity: 1;
}

/* Signalement : hors de la bulle (l'intérieur est réservé à l'heure), au bord
   côté opposé. Discret au doigt, révélé au survol sur ordinateur. */
.btn-signaler {
    position: absolute; top: 50%; right: -28px; transform: translateY(-50%);
    border: 0; background: transparent; color: var(--chat-meta);
    font-size: .8rem; padding: 4px; cursor: pointer; line-height: 1;
    opacity: 0; transition: opacity .15s ease;
}
.msg--autre:hover .btn-signaler,
.btn-signaler:focus-visible { opacity: .75; }
.btn-signaler:hover { color: #E0483B; opacity: 1; }
@media (hover: none) { .msg--autre .btn-signaler { opacity: .35; } }

/* Entonnoir du tableau de bord staff */
.entonnoir-barre { height: 8px; border-radius: 999px; background: var(--papier); overflow: hidden; }
.entonnoir-barre span {
    display: block; height: 100%;
    background: var(--degrade-vif); border-radius: 999px;
    transition: width .4s ease;
}

/* ---------- Réseau social des grossistes (§25) ---------- */
.post-carte { border: 1px solid var(--trait); }
.post-media { width: 100%; border-radius: 12px; object-fit: cover; max-height: 360px; }
video.post-media { object-fit: contain; background: #000; }
.post-produit {
    background: var(--papier); border: 1px solid var(--trait);
    border-radius: 14px; padding: .5rem .65rem;
}
.post-produit:hover { border-color: rgba(123,92,255,.5); }
.post-actions .btn-social {
    border: 0; background: transparent; color: var(--texte-doux);
    font-weight: 600; font-size: .95rem; cursor: pointer; padding: .25rem .3rem;
    text-decoration: none; display: inline-flex; align-items: center; gap: .35rem;
    border-radius: 999px; transition: color var(--duree), background var(--duree), transform .1s;
}
.post-actions .btn-social .bi { font-size: 1.2rem; }
.post-actions .btn-social:hover { color: var(--liberty); background: rgba(30,144,232,.06); }
.post-actions .btn-social:active { transform: scale(.9); }

/* Cœur « J'aime » : dégradé vif + animation pop au clic */
.post-actions .btn-social.aime { color: #FF3D68; }
.post-actions .btn-social.aime .bi {
    background: linear-gradient(135deg, #FF6A9C 0%, #FF2D55 55%, #E0102F 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    filter: drop-shadow(0 2px 6px rgba(255,45,85,.45));
    animation: coeur-pop .45s cubic-bezier(.2,.8,.3,1.4);
}
.post-actions .btn-social.aime:hover { color: #FF2D55; background: rgba(255,45,85,.08); }
@keyframes coeur-pop {
    0%   { transform: scale(.4) rotate(-12deg); }
    45%  { transform: scale(1.35) rotate(6deg); }
    70%  { transform: scale(.9); }
    100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .post-actions .btn-social.aime .bi { animation: none; } }

/* Commentaires en bulles (popup) */
.commentaires-bulles { display: flex; flex-direction: column; gap: .45rem; }
.commentaire-bulle {
    align-self: flex-start; max-width: 88%;
    background: var(--papier); border: 1px solid var(--trait);
    border-radius: 16px; border-bottom-left-radius: 5px;
    padding: .45rem .75rem;
}
.commentaire-bulle--moi {
    align-self: flex-end; background: rgba(123,92,255,.12);
    border-color: rgba(123,92,255,.35);
    border-bottom-left-radius: 16px; border-bottom-right-radius: 5px;
}
.commentaire-auteur { font-weight: 700; font-size: .74rem; color: var(--liberty); }
.commentaire-texte { font-size: .9rem; line-height: 1.35; word-break: break-word; }
.barre-commentaire { display: flex; gap: .5rem; align-items: center; }
.barre-commentaire .form-control { border-radius: 999px; }
.barre-commentaire .btn { border-radius: 50%; width: 42px; height: 42px; flex: 0 0 auto; padding: 0; }

/* ---------- Fil immersif style TikTok (page dédiée, sans dock) ---------- */
body.tiktok { margin: 0; background: #000; overflow: hidden; }
.tk-retour {
    position: fixed; top: calc(.6rem + env(safe-area-inset-top)); left: 12px;
    z-index: 20; width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center; color: #fff; font-size: 1.35rem;
    background: rgba(0,0,0,.35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    text-decoration: none;
}
.tk-feed {
    height: 100dvh; overflow-y: scroll; scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tk-feed::-webkit-scrollbar { display: none; }
.tk-post {
    position: relative; height: 100dvh; scroll-snap-align: start;
    overflow: hidden; background: #000;
}
.tk-media { position: absolute; inset: 0; }
.tk-media img, .tk-media video { width: 100%; height: 100%; object-fit: cover; }
.tk-overlay {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,.8) 0%, rgba(0,0,0,.2) 38%, transparent 62%);
}

/* Rail d'actions vertical à droite */
.tk-rail {
    position: absolute; right: 10px; bottom: 150px; z-index: 5;
    display: flex; flex-direction: column; align-items: center; gap: 1.1rem;
    pointer-events: auto;
}
.tk-rail form { margin: 0; }
.tk-action {
    background: none; border: 0; color: #fff; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: .72rem; font-weight: 700; text-decoration: none;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.6));
}
.tk-action .bi { font-size: 2rem; line-height: 1; transition: transform .1s; }
.tk-action:hover { color: #fff; }
.tk-action:active .bi { transform: scale(.85); }
.tk-action.aime .bi {
    color: #FF2D55;
    animation: coeur-pop .45s cubic-bezier(.2,.8,.3,1.4);
}
.tk-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; }
.tk-avatar--initiale {
    display: grid; place-items: center; font-family: var(--font-titre);
    font-weight: 700; color: #fff; background: var(--degrade-vif);
}

/* Bas : boutique + texte + article mis en valeur */
.tk-bas {
    position: absolute; left: 0; right: 72px; bottom: 0; z-index: 5;
    pointer-events: auto; color: #fff;
    padding: 1rem 1rem calc(1.1rem + env(safe-area-inset-bottom));
}
.tk-boutique { color: #fff; text-decoration: none; font-size: 1rem; }
.tk-boutique .bi { color: var(--aqua-clair); }
.tk-texte { margin: .4rem 0; font-size: .92rem; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tk-produit {
    display: flex; align-items: center; gap: .5rem; margin-top: .5rem;
    background: rgba(255,255,255,.16); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.28); border-radius: 16px; padding: .45rem;
}
.tk-produit-lien { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: #fff; flex: 1 1 auto; min-width: 0; }
.tk-produit-lien img { width: 50px; height: 50px; border-radius: 11px; object-fit: cover; flex: 0 0 auto; }
.tk-prix { font-family: var(--font-titre); font-weight: 700; color: var(--or-doux); }
.tk-panier { border-radius: 999px; font-weight: 700; flex: 0 0 auto; white-space: nowrap; }
.tk-vide { height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; color: #fff; text-align: center; padding: 1rem; }
.tk-vide .bi { font-size: 3rem; opacity: .6; }

/* Barre de stories */
.stories-bar { display: flex; gap: .8rem; overflow-x: auto; padding: .25rem 0 .5rem; }
.story-item { flex: 0 0 auto; width: 64px; text-align: center; text-decoration: none; }
.story-cercle {
    width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
    overflow: hidden; padding: 3px; margin: 0 auto;
    background: var(--degrade-vif);
}
.story-cercle img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid #fff; }
.story-cercle .logo-boutique--initiale { width: 100%; height: 100%; border-radius: 50%; }
.story-nom { display: block; font-size: .68rem; color: var(--texte-doux); margin-top: 2px; }

/* Timeline verticale de la commande */
.timeline { list-style: none; padding-left: 0; margin: 0; }
.timeline li { position: relative; padding-left: 1.5rem; padding-bottom: 1rem; }
.timeline li::before {
    content: ""; position: absolute; left: 3px; top: 4px;
    width: 10px; height: 10px; border-radius: 50%; background: var(--or);
}
.timeline li::after {
    content: ""; position: absolute; left: 7px; top: 14px; bottom: 0;
    width: 2px; background: var(--trait);
}
.timeline li:last-child::after { display: none; }
