/* ==========================================================================
   ATS Community — système de design
   Mobile d'abord. Aucun élément ne doit jamais dépasser de l'écran.
   ========================================================================== */

:root {
  --brand:        #0F766E;
  --brand-600:    #0D9488;
  --brand-700:    #115E59;
  --brand-050:    #ECFDF5;
  --brand-100:    #CCFBF1;

  --accent:       #F59E0B;
  --accent-050:   #FFFBEB;

  --ink:          #0B1220;
  --ink-2:        #26334A;
  --muted:        #5B6676;
  --faint:        #8A94A6;
  --line:         #E4E9F0;
  --line-2:       #EFF3F8;
  --surface:      #FFFFFF;
  --surface-2:    #F9FBFD;
  --bg:           #F4F7FA;

  --success:      #15803D;
  --success-bg:   #ECFDF3;
  --danger:       #DC2626;
  --danger-bg:    #FEF2F2;
  --warn:         #B45309;
  --warn-bg:      #FFFBEB;
  --info:         #1D4ED8;
  --info-bg:      #EFF6FF;

  --r-xs: 8px;
  --r-sm: 12px;
  --r:    16px;
  --r-lg: 22px;
  --r-full: 999px;

  --sh-1: 0 1px 2px rgba(11,18,32,.06), 0 1px 3px rgba(11,18,32,.04);
  --sh-2: 0 4px 12px rgba(11,18,32,.07), 0 2px 4px rgba(11,18,32,.04);
  --sh-3: 0 12px 32px rgba(11,18,32,.12), 0 4px 8px rgba(11,18,32,.05);
  --sh-brand: 0 6px 20px rgba(15,118,110,.28);

  --nav-h: 62px;
  --top-h: 58px;
  --wrap: 1180px;

  --ease: cubic-bezier(.22,.9,.28,1);
  --fast: .18s var(--ease);
  --slow: .34s var(--ease);
}

/* ------------------------------------------------------------------ Reset */

*, *::before, *::after { box-sizing: border-box; }
* { min-width: 0; }

/*
 * Aucune propriété overflow ni height sur <html> et <body> : toute contrainte
 * à cet endroit risque de transformer la racine en conteneur de défilement et
 * de bloquer le défilement de la page entière. Le débordement horizontal est
 * évité à la source (min-width:0 partout, images et tableaux contenus).
 */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg, video, canvas { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-700); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }
p { margin: 0 0 .75em; }
ul, ol { margin: 0; padding-left: 1.1rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

::selection { background: var(--brand-100); color: var(--brand-700); }

:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
  border-radius: 6px;
}

/* --------------------------------------------------------------- Layout */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 16px;
}

.page { padding-block: 18px 28px; }
.page--tight { padding-block: 12px 24px; }

/* Réserve la place de la barre d'onglets mobile + encoche iOS */
.has-tabbar { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); }

.stack   { display: grid; gap: 14px; }
.stack-s { display: grid; gap: 8px; }
.stack-l { display: grid; gap: 22px; }

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.row--between { justify-content: space-between; }
.row--tight { gap: 6px; }
.row--nowrap { flex-wrap: nowrap; }
.spacer { flex: 1 1 auto; }

.grid { display: grid; gap: 12px; align-items: start; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

@media (min-width: 720px) {
  .wrap { padding-inline: 24px; }
  body { font-size: 15.5px; }
  .grid--2\@d { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3\@d { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .grid--4\@l { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
}

/* ------------------------------------------------------------- Typographie */

.h1 { font-size: clamp(22px, 5.2vw, 30px); }
.h2 { font-size: clamp(18px, 4.2vw, 22px); }
.h3 { font-size: 16px; font-weight: 700; }
.lead { font-size: clamp(15px, 3.6vw, 17px); color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.strong { font-weight: 700; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.block { display: block; }

/* Vignette d'article dans les listes de commandes : identifier l'article d'un coup d'oeil. */
.order-thumb {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  overflow: hidden;
  border-radius: 10px;
  background: var(--line-2);
  color: var(--faint);
}
.order-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Cellule d'identification d'une commande : vignette + référence + article. */
.cell-order { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-order__txt { display: grid; min-width: 0; line-height: 1.3; }
/* Les deux lignes se coupent proprement plutôt que de déborder sur la colonne voisine. */
.cell-order__txt > * {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* La colonne « Commande » garde de quoi afficher la référence et l'article. */
.col-order { min-width: 232px; }
.order-thumb__empty { display: flex; align-items: center; justify-content: center; }
.order-thumb__count {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 0 3px;
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  color: #fff;
  background: rgba(17, 24, 39, .82);
  border-radius: 6px 0 0 0;
}

.money { font-variant-numeric: tabular-nums; font-weight: 700; }
.money--gain { color: var(--success); }
.money--cost { color: var(--ink-2); }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
}

/* -------------------------------------------------------------- Surfaces */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--sh-1);
}
.card--flat { box-shadow: none; }
.card--pad-0 { padding: 0; overflow: hidden; }
.card--brand {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-700) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--sh-brand);
}
.card--brand .muted, .card--brand .eyebrow { color: rgba(255,255,255,.78); }

.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 10px;
}

/* ---------------------------------------------------------------- Boutons */

.btn {
  --btn-bg: var(--brand);
  --btn-fg: #fff;
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-full);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 650;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
  transition: transform var(--fast), box-shadow var(--fast), background var(--fast), opacity var(--fast);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover { color: var(--btn-fg); box-shadow: var(--sh-2); }
.btn:active { transform: scale(.975); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

.btn--primary { --btn-bg: var(--brand); box-shadow: var(--sh-brand); }
.btn--primary:hover { --btn-bg: var(--brand-700); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--line); }
.btn--ghost:hover { --btn-bg: var(--surface-2); }
.btn--soft { --btn-bg: var(--brand-050); --btn-fg: var(--brand-700); }
.btn--dark { --btn-bg: var(--ink); }
.btn--danger { --btn-bg: var(--danger); }
.btn--wa { --btn-bg: #25D366; --btn-fg: #06301A; font-weight: 700; }
.btn--wa:hover { --btn-bg: #1FBE5B; }
.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: 8px 14px; font-size: 13.5px; }
.btn--lg { min-height: 54px; padding: 15px 26px; font-size: 16.5px; }
.btn--icon { padding: 0; width: 42px; min-height: 42px; border-radius: var(--r-full); }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-group--fill > .btn { flex: 1 1 140px; }

/* --------------------------------------------------------------- Formulaire */

.field { display: grid; gap: 6px; }
.field > label, .label {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink-2);
}
.label__hint { font-weight: 400; color: var(--faint); }

.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color var(--fast), box-shadow var(--fast);
  appearance: none;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 4px rgba(13,148,136,.13);
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input[readonly] { background: var(--surface-2); color: var(--muted); }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%235B6676' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.input--money { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 17px; }

.input-group { display: flex; align-items: stretch; gap: 0; }
.input-group .input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group__suffix {
  display: grid;
  place-items: center;
  padding-inline: 14px;
  border: 1.5px solid var(--line);
  border-left: 0;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
}

.field__error { color: var(--danger); font-size: 13px; font-weight: 600; }
.field--invalid .input, .field--invalid .select { border-color: var(--danger); }

/* Code personnel : un seul champ, rien qui puisse se vider tout seul. */
.code-field {
  position: relative;
  width: 100%;
  max-width: 260px;
  margin-inline: auto;
}
.code-input {
  width: 100%;
  height: 68px;
  padding: 0 44px 0 10px;
  text-align: center;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: .5em;
  text-indent: .5em;
  font-variant-numeric: tabular-nums;
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  transition: border-color var(--fast), box-shadow var(--fast);
}
.code-input::placeholder { letter-spacing: .35em; font-weight: 600; color: var(--line); }
.code-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(13,148,136,.13);
  outline: none;
}
.code-input::-webkit-outer-spin-button,
.code-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.code-eye {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0; background: transparent;
  color: var(--faint);
  cursor: pointer;
  border-radius: 50%;
}
.code-eye:hover { background: var(--surface-2); color: var(--ink-2); }

/* Barre de paiement collee en bas du tunnel de commande (mobile). */
.paybar {
  position: sticky;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  z-index: 30;
  margin: 14px -16px 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .97);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line);
}
.paybar__in { display: flex; align-items: center; gap: 12px; }
.paybar__in .btn { flex: 0 0 auto; }
.paybar__label { display: block; font-size: 12px; color: var(--muted); }
.paybar__value { display: block; font-size: 19px; font-weight: 800; line-height: 1.2; }

/* Petit indicateur d'attente dans un bouton verrouille. */
.spin {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: tourne .7s linear infinite;
  vertical-align: -2px;
}
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } }

/* Supprime le delai de 300 ms avant qu'un appui ne soit pris en compte. */
button, a, label, .choice__item, input[type="radio"], input[type="checkbox"] {
  touch-action: manipulation;
}

/* Cible tactile confortable sur les choix (livraison, gare, qui paie). */
.choice__item { min-height: 52px; }

/* Encadre d'aide sous un champ : rappelle les prix sans les imposer. */
.hint-box {
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

/* Bouton qui se lit comme un lien (remplir un champ, appliquer une valeur). */
.linklike {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--brand);
  cursor: pointer;
  text-align: right;
}
.linklike:hover { color: var(--brand-700); text-decoration: underline; }

/* Fil d'etapes d'un parcours en plusieurs ecrans */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 6px;
  counter-reset: step;
}
.steps li {
  flex: 1 1 0;
  min-width: 0;
  counter-increment: step;
  padding-top: 8px;
  border-top: 3px solid var(--line);
  font-size: 12px;
  font-weight: 650;
  color: var(--faint);
  text-align: center;
}
.steps li::before { content: counter(step) '. '; }
.steps li.is-active { border-top-color: var(--brand); color: var(--brand-700); }
.steps li.is-done   { border-top-color: var(--success); color: var(--success); }

/* Precision sous un champ de formulaire */
.field__hint { display: block; margin-top: 5px; font-size: 12.5px; color: var(--muted); }

/* Choix en cartes (radio) */
.choice {
  display: grid;
  gap: 8px;
}
.choice__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--fast), background var(--fast), transform var(--fast);
}
.choice__item:active { transform: scale(.99); }
.choice__item input { position: absolute; opacity: 0; pointer-events: none; }
.choice__item:has(input:checked) {
  border-color: var(--brand-600);
  background: var(--brand-050);
  box-shadow: 0 0 0 3px rgba(13,148,136,.10);
}
.choice__dot {
  width: 20px; height: 20px;
  border: 2px solid var(--line);
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid; place-items: center;
  transition: border-color var(--fast);
}
.choice__item:has(input:checked) .choice__dot { border-color: var(--brand); }
.choice__item:has(input:checked) .choice__dot::after {
  content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--brand);
  animation: pop .22s var(--ease);
}
.choice__body { flex: 1 1 auto; min-width: 0; }
.choice__title { font-weight: 650; font-size: 14.5px; }
.choice__meta { font-size: 12.5px; color: var(--muted); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch__track {
  width: 46px; height: 27px; border-radius: var(--r-full);
  background: var(--line); position: relative; transition: background var(--fast);
  flex: 0 0 auto;
}
.switch__track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px; border-radius: 50%; background: #fff;
  box-shadow: var(--sh-1); transition: transform var(--fast);
}
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(19px); }

/* --------------------------------------------------------------- Badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--r-full);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--line-2);
  color: var(--ink-2);
}
.badge__icon { font-size: 12px; }
.badge--brand   { background: var(--brand-050); color: var(--brand-700); }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--danger  { background: var(--danger-bg); color: var(--danger); }
.badge--warn    { background: var(--warn-bg); color: var(--warn); }
.badge--info    { background: var(--info-bg); color: var(--info); }
.badge--accent  { background: var(--accent-050); color: #92400E; }
.badge--dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.badge--live::before { animation: pulse 1.8s infinite; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--fast);
  cursor: pointer;
}
.chip:hover { border-color: var(--brand-600); color: var(--brand-700); }
.chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: var(--sh-brand);
}

/* Rangée de filtres qui défile sans jamais élargir la page */
.chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 16px 6px;
  margin-inline: -16px;
  scroll-snap-type: x proximity;
}
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll > * { scroll-snap-align: start; flex: 0 0 auto; }

/* ------------------------------------------------------------- En-tête app */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__in {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--top-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 16.5px;
  color: var(--ink);
  letter-spacing: -.02em;
}
.brand__mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
  box-shadow: var(--sh-brand);
  flex: 0 0 auto;
}

.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--fast);
  flex: 0 0 auto;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn__dot {
  position: absolute; top: 6px; right: 6px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--surface);
}

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand-050);
  color: var(--brand-700);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  flex: 0 0 auto;
}
.avatar--lg { width: 56px; height: 56px; font-size: 18px; }

/* Navigation bureau */
.topnav { display: none; }
@media (min-width: 860px) {
  .topnav { display: flex; gap: 4px; margin-left: 10px; }
  .topnav a {
    padding: 9px 14px;
    border-radius: var(--r-full);
    font-weight: 600;
    font-size: 14.5px;
    color: var(--muted);
    transition: all var(--fast);
  }
  .topnav a:hover { background: var(--surface-2); color: var(--ink); }
  .topnav a.is-active { background: var(--brand-050); color: var(--brand-700); }
}

/* Barre d'onglets mobile */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 860px) { .tabbar { display: none; } .has-tabbar { padding-bottom: 32px; } }

.tabbar__item {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  height: var(--nav-h);
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 650;
  position: relative;
  transition: color var(--fast);
}
.tabbar__item.is-active { color: var(--brand); }
.tabbar__item.is-active .tabbar__icon { transform: translateY(-2px); }
.tabbar__icon { transition: transform var(--fast); position: relative; }
.tabbar__badge {
  position: absolute; top: -4px; right: -9px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}

/* ------------------------------------------------------------- Annonce */

.announce {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  background: var(--info-bg);
  color: var(--info);
  border-bottom: 1px solid var(--line);
}
.announce--promotion   { background: var(--success-bg); color: var(--success); }
.announce--urgence     { background: var(--danger-bg); color: var(--danger); }
.announce--maintenance { background: var(--warn-bg); color: var(--warn); }
.announce__icon { flex: 0 0 auto; }
.announce__viewport { flex: 1 1 auto; overflow: hidden; }
.announce__track {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
  animation: marquee 26s linear infinite;
  padding-left: 100%;
}
.announce:hover .announce__track { animation-play-state: paused; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* --------------------------------------------------------- Cartes statistiques */

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  box-shadow: var(--sh-1);
  position: relative;
  overflow: hidden;
  transition: transform var(--fast), box-shadow var(--fast);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.stat::after {
  content: '';
  position: absolute; inset: auto -20px -30px auto;
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--brand-050);
  opacity: .55;
}
.stat > * { position: relative; z-index: 1; }
.stat__label { font-size: 12px; font-weight: 650; color: var(--muted); }
.stat__value {
  font-size: clamp(19px, 5vw, 25px);
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.stat__meta { font-size: 12px; color: var(--faint); margin-top: 2px; }
.stat__icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-050); color: var(--brand-700);
  font-size: 16px; margin-bottom: 8px;
}
.stat--gain .stat__value { color: var(--success); }
.stat--gain .stat__icon  { background: var(--success-bg); color: var(--success); }
.stat--gain::after { background: var(--success-bg); }
.stat--warn .stat__icon  { background: var(--warn-bg); color: var(--warn); }
.stat--warn::after { background: var(--warn-bg); }
.stat--info .stat__icon  { background: var(--info-bg); color: var(--info); }
.stat--info::after { background: var(--info-bg); }

/* --------------------------------------------------------------- Produits */

.products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
/* 30 articles par page : 15 rangées de 2 au téléphone, 10 de 3 sur tablette,
   6 rangées de 5 sur grand écran — jamais de rangée à moitié vide. */
@media (min-width: 640px)  { .products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1100px) { .products { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; } }

/* Apparition des cartes du catalogue : elles basculent en relief, en cascade. */
html.js .products .product.on-scroll {
  transform: perspective(800px) rotateX(18deg) translateY(28px) scale(.97);
  transform-origin: 50% 100%;
  transition: opacity .55s var(--ease), transform .65s var(--ease), box-shadow var(--fast);
}
html.js .products .product.on-scroll.is-in { transform: none; }

/* Au survol : un reflet traverse la photo (qui s'avance déjà, voir .product). */
.product__media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}
.product:hover .product__media::after { transform: translateX(120%); transition: transform .8s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html.js .products .product.on-scroll { transform: none; opacity: 1; }
  .product:hover .product__media img { transform: none; }
  .product__media::after { display: none; }
}

.product {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-1);
  transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast);
  color: inherit;
  position: relative;
}
.product:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-3);
  border-color: var(--brand-100);
  color: inherit;
}
.product__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  overflow: hidden;
}
.product__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.product:hover .product__media img { transform: scale(1.06); }
.product__media--empty {
  display: grid; place-items: center;
  color: var(--faint); font-size: 28px;
}
.product__flags {
  position: absolute; top: 8px; left: 8px;
  display: flex; flex-direction: column; gap: 5px;
  max-width: calc(100% - 16px);
}
.product__fav {
  position: absolute; top: 8px; right: 8px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.92);
  box-shadow: var(--sh-1);
  display: grid; place-items: center;
  cursor: pointer;
  font-size: 15px;
  transition: transform var(--fast);
}
.product__fav:active { transform: scale(.88); }
.product__body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 5px; flex: 1 1 auto; }
.product__name {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.7em;
}
.product__price { font-size: 16.5px; font-weight: 800; color: var(--brand-700); font-variant-numeric: tabular-nums; }
.product__loc {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Fiche produit */
.gallery { display: grid; gap: 10px; }
.gallery__main {
  aspect-ratio: 1 / 1;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  position: relative;
}
/* « contain » plutôt que « cover » : une photo 4:3 perdait un quart de sa
   largeur, et l'article était coupé sur les côtés. */
.gallery__main img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.gallery__main::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(11,18,32,.04);
  border-radius: inherit;
}

/* Plein écran : la photo en grand, un appui pour fermer. */
.zoom {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(8, 15, 26, .94);
  cursor: zoom-out;
  animation: fade-in .18s var(--ease);
}
.zoom img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.zoom__fermer {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.14); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.zoom__aide { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom)); color: rgba(255,255,255,.75); font-size: 13px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.gallery__thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.gallery__thumbs::-webkit-scrollbar { display: none; }
.gallery__thumb {
  width: 62px; height: 62px;
  flex: 0 0 auto;
  border-radius: var(--r-xs);
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--surface-2);
  cursor: pointer;
  padding: 0;
  transition: border-color var(--fast);
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb.is-active { border-color: var(--brand); }
.gallery__counter {
  position: absolute; bottom: 10px; right: 10px;
  padding: 3px 10px; border-radius: var(--r-full);
  background: rgba(11,18,32,.65); color: #fff;
  font-size: 12px; font-weight: 600;
}

.price-box {
  background: var(--brand-050);
  border: 1px solid var(--brand-100);
  border-radius: var(--r);
  padding: 14px;
}
.price-box__value { font-size: 26px; font-weight: 800; color: var(--brand-700); letter-spacing: -.02em; }

.margin-live {
  display: flex; align-items: baseline; gap: 8px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--success-bg);
  color: var(--success);
  font-weight: 700;
  transition: background var(--slow);
}
.margin-live.is-negative { background: var(--danger-bg); color: var(--danger); }
.margin-live__value { font-size: 21px; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- Listes */

.list { display: grid; gap: 10px; }

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  transition: transform var(--fast), box-shadow var(--fast);
  color: inherit;
}
a.item:hover { transform: translateY(-2px); box-shadow: var(--sh-2); color: inherit; }
.item__media {
  width: 52px; height: 52px;
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--surface-2);
  flex: 0 0 auto;
  display: grid; place-items: center;
  color: var(--faint);
}
.item__media img { width: 100%; height: 100%; object-fit: cover; }
.item__body { flex: 1 1 auto; min-width: 0; }
.item__title { font-weight: 650; font-size: 14.5px; }
.item__meta { font-size: 12.5px; color: var(--muted); }
.item__side { text-align: right; flex: 0 0 auto; }

/* Ligne de panier */
.cart-line {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
}
.cart-line__media { aspect-ratio: 1; border-radius: var(--r-xs); overflow: hidden; background: var(--surface-2); }
.cart-line__media img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }

.qty {
  display: inline-flex;
  align-items: center;
  /* Ne jamais s'etirer sur la hauteur de la colonne voisine : dans une grille
     a deux colonnes, le champ d'a cote peut etre bien plus haut. */
  align-self: start;
  justify-self: start;
  width: max-content;
  border: 1.5px solid var(--line);
  border-radius: var(--r-full);
  overflow: hidden;
  background: var(--surface);
}
.qty button {
  width: 38px; height: 40px;
  border: 0; background: transparent;
  font-size: 18px; font-weight: 700; color: var(--ink-2);
  cursor: pointer;
  transition: background var(--fast);
}
.qty button:hover { background: var(--surface-2); }
.qty input {
  width: 46px; height: 40px;
  border: 0; text-align: center;
  font-weight: 700; font-variant-numeric: tabular-nums;
  background: transparent;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Récapitulatif */
.summary { display: grid; gap: 9px; }
.summary__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.summary__row--total {
  border-top: 1px dashed var(--line);
  padding-top: 11px;
  font-size: 17px;
  font-weight: 800;
}
.summary__row--gain { color: var(--success); font-weight: 700; }

/* --------------------------------------------------------------- Timeline */

.timeline { display: grid; gap: 0; }
.tl-step {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  position: relative;
  padding-bottom: 18px;
}
.tl-step:last-child { padding-bottom: 0; }
.tl-step::before {
  content: '';
  position: absolute;
  left: 14px; top: 30px; bottom: 0;
  width: 2px;
  background: var(--line);
}
.tl-step:last-child::before { display: none; }
.tl-step__dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--line-2);
  color: var(--faint);
  font-size: 13px;
  border: 2px solid var(--surface);
  z-index: 1;
}
.tl-step.is-done .tl-step__dot { background: var(--brand-050); color: var(--brand-700); }
.tl-step.is-current .tl-step__dot {
  background: var(--brand); color: #fff;
  box-shadow: 0 0 0 4px rgba(13,148,136,.16);
  animation: pulse-ring 2s infinite;
}
.tl-step.is-done::before { background: var(--brand-100); }
.tl-step__title { font-weight: 650; font-size: 14.5px; }
.tl-step.is-current .tl-step__title { color: var(--brand-700); }
.tl-step__meta { font-size: 12.5px; color: var(--muted); }

/* -------------------------------------------------------------- Progression */

.progress {
  height: 10px;
  border-radius: var(--r-full);
  background: var(--line-2);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--brand-600), var(--brand));
  width: 0;
  transition: width 1.1s var(--ease);
  position: relative;
  overflow: hidden;
}
.progress__bar::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.42), transparent);
  animation: shimmer 2.2s infinite;
}
.progress--gain .progress__bar { background: linear-gradient(90deg, #22C55E, var(--success)); }
.progress--accent .progress__bar { background: linear-gradient(90deg, #FBBF24, var(--accent)); }
.progress--done .progress__bar { background: linear-gradient(90deg, #22C55E, #15803D); }

.goal { display: grid; gap: 8px; }
.goal__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.goal__pct { font-weight: 800; font-variant-numeric: tabular-nums; }
.goal__msg {
  font-size: 13.5px;
  color: var(--ink-2);
  background: var(--surface-2);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  padding: 9px 12px;
}

/* ---------------------------------------------------------------- Tableaux */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.table-wrap::-webkit-scrollbar { height: 7px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

table.table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
}
.table th, .table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
  white-space: nowrap;
}
.table th {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--faint);
  background: var(--surface-2);
  position: sticky; top: 0;
}
.table tbody tr { transition: background var(--fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.wrap { white-space: normal; min-width: 180px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- Pagination */

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.pager a, .pager span {
  min-width: 40px; height: 40px;
  padding: 0 12px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 650;
  font-size: 14px;
  color: var(--ink-2);
  transition: all var(--fast);
}
.pager a:hover { border-color: var(--brand-600); color: var(--brand-700); }
.pager .is-current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .is-disabled { opacity: .4; pointer-events: none; }

/* ---------------------------------------------------------------- États */

.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}
.empty__icon {
  width: 66px; height: 66px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid; place-items: center;
  font-size: 28px;
}

.alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 550;
  border: 1px solid transparent;
}
.alert--success { background: var(--success-bg); color: var(--success); border-color: #BBF7D0; }
.alert--danger  { background: var(--danger-bg); color: var(--danger); border-color: #FECACA; }
.alert--warn    { background: var(--warn-bg); color: var(--warn); border-color: #FDE68A; }
.alert--info    { background: var(--info-bg); color: var(--info); border-color: #BFDBFE; }

.toasts {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  z-index: 90;
  display: grid; gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}
@media (min-width: 860px) { .toasts { bottom: 24px; } }
.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--sh-3);
  animation: toast-in .3s var(--ease);
}
.toast--success { background: var(--success); }
.toast--danger { background: var(--danger); }

.skeleton {
  background: linear-gradient(90deg, var(--line-2) 25%, #F7F9FC 37%, var(--line-2) 63%);
  background-size: 400% 100%;
  animation: skeleton 1.4s ease infinite;
  border-radius: var(--r-xs);
}

/* -------------------------------------------------------------- Animations */

@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(13,148,136,.36); }
  70%  { box-shadow: 0 0 0 10px rgba(13,148,136,0); }
  100% { box-shadow: 0 0 0 0 rgba(13,148,136,0); }
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes skeleton { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.reveal { animation: fade-up .42s var(--ease) both; }
.reveal-1 { animation-delay: .04s; }
.reveal-2 { animation-delay: .09s; }
.reveal-3 { animation-delay: .14s; }
.reveal-4 { animation-delay: .19s; }
.reveal-5 { animation-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------- Utilitaires */

.hide { display: none !important; }
@media (max-width: 639px)  { .hide\@m { display: none !important; } }
@media (min-width: 860px)  { .hide\@d { display: none !important; } }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.w-full { width: 100%; }
.sticky-cta {
  position: sticky;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 10px);
  z-index: 30;
}
@media (min-width: 860px) { .sticky-cta { bottom: 18px; } }

/* Bandeau d'environnement : visible uniquement en préproduction. */
.env-flag {
  background: repeating-linear-gradient(45deg, #B45309, #B45309 12px, #92400E 12px, #92400E 24px);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .03em;
  text-align: center;
  padding: 5px 12px;
  position: relative;
  z-index: 60;
}

/* ====================================================== Effets 3D & reveal */

.scene { perspective: 1100px; perspective-origin: 50% 40%; }

.tilt {
  transform-style: preserve-3d;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
  will-change: transform;
}
.tilt:hover { box-shadow: var(--sh-3); }

/* Pile de cartes flottantes du hero */
.stack3d {
  position: relative;
  width: min(320px, 82vw);
  aspect-ratio: 3 / 4;
  margin-inline: auto;
  transform-style: preserve-3d;
  animation: float3d 7s ease-in-out infinite;
}
.stack3d__card {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(3,30,28,.34);
  overflow: hidden;
  transform-style: preserve-3d;
}
.stack3d__card:nth-child(1) { transform: translateZ(-90px) translate(-16%, 9%) rotate(-9deg); opacity: .55; }
.stack3d__card:nth-child(2) { transform: translateZ(-45px) translate(9%, -5%) rotate(6deg); opacity: .8; }
.stack3d__card:nth-child(3) { transform: translateZ(0); }

.stack3d__head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 700; font-size: 13.5px; color: var(--ink);
}
.stack3d__body { padding: 12px 14px; display: grid; gap: 9px; }
.stack3d__row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.stack3d__row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.stack3d__gain {
  margin-top: 2px;
  background: var(--success-bg);
  color: var(--success);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 800;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 15px;
}
.stack3d__bars { display: flex; align-items: flex-end; gap: 6px; height: 62px; margin-top: 4px; }
.stack3d__bars i {
  flex: 1;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #5EEAD4, #0D9488);
  animation: mini-bar 2.6s var(--ease) infinite alternate;
}
.stack3d__bars i:nth-child(1) { height: 40%; animation-delay: 0s; }
.stack3d__bars i:nth-child(2) { height: 66%; animation-delay: .18s; }
.stack3d__bars i:nth-child(3) { height: 48%; animation-delay: .36s; }
.stack3d__bars i:nth-child(4) { height: 86%; animation-delay: .54s; }
.stack3d__bars i:nth-child(5) { height: 58%; animation-delay: .72s; }

@keyframes float3d {
  0%, 100% { transform: rotateX(8deg) rotateY(-12deg) translateY(0); }
  50%      { transform: rotateX(4deg) rotateY(-6deg) translateY(-14px); }
}
@keyframes mini-bar {
  from { transform: scaleY(.72); }
  to   { transform: scaleY(1); }
}

/*
 * Apparition au défilement.
 * Le masquage n'est appliqué que si le JavaScript a pu marquer <html> :
 * sans lui, le contenu reste visible plutôt que de disparaître.
 */
.on-scroll { transition: opacity .6s var(--ease), transform .6s var(--ease); }
html.js .on-scroll { opacity: 0; transform: translateY(22px); }
html.js .on-scroll.is-in { opacity: 1; transform: none; }
.on-scroll[data-delay="1"] { transition-delay: .08s; }
.on-scroll[data-delay="2"] { transition-delay: .16s; }
.on-scroll[data-delay="3"] { transition-delay: .24s; }
.on-scroll[data-delay="4"] { transition-delay: .32s; }
.on-scroll[data-delay="5"] { transition-delay: .40s; }

@media (prefers-reduced-motion: reduce) {
  .on-scroll { opacity: 1; transform: none; }
  .stack3d, .stack3d__bars i { animation: none; }
}

/* ============================================================== Podium */

.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  perspective: 800px;
}
.podium__slot {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 14px 8px 0;
  border-radius: var(--r) var(--r) 0 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  box-shadow: var(--sh-2);
  transform: rotateX(4deg);
  transform-origin: bottom;
  animation: podium-rise .7s var(--ease) both;
}
.podium__slot--1 { animation-delay: .1s; }
.podium__slot--2 { animation-delay: 0s; }
.podium__slot--3 { animation-delay: .2s; }
.podium__slot.is-me { border-color: var(--brand); box-shadow: var(--sh-brand); }

.podium__medal { font-size: 26px; line-height: 1; }
.podium__avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-050); color: var(--brand-700);
  font-weight: 800; font-size: 14px;
}
.podium__name {
  font-size: 13px; font-weight: 700; text-align: center;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.podium__gain { font-size: 14px; font-weight: 800; color: var(--success); font-variant-numeric: tabular-nums; }
.podium__base {
  width: 100%;
  margin-top: 6px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, var(--brand-600), var(--brand-700));
  border-radius: 6px 6px 0 0;
}
.podium__slot--1 .podium__base { height: 74px; }
.podium__slot--2 .podium__base { height: 52px; background: linear-gradient(180deg, #94A3B8, #64748B); }
.podium__slot--3 .podium__base { height: 38px; background: linear-gradient(180deg, #D6A468, #B07C3F); }

@keyframes podium-rise {
  from { transform: rotateX(20deg) translateY(26px); opacity: 0; }
  to   { transform: rotateX(4deg) translateY(0); opacity: 1; }
}

.rank-badge {
  width: 26px; height: 26px; flex: 0 0 auto;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted);
  font-size: 12px; font-weight: 800;
}

/* ================================================= Calculateur de marge */

.calc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  overflow: hidden;
}
.calc__head {
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--brand-700), var(--brand-600));
  color: #fff;
}
.calc__head h3 { font-size: 18px; margin-bottom: 3px; }
.calc__head p { color: rgba(255,255,255,.85); font-size: 13.5px; margin: 0; }
.calc__body { padding: 18px 20px; display: grid; gap: 18px; }
@media (min-width: 860px) { .calc__body { grid-template-columns: minmax(0,1fr) minmax(0,260px); gap: 26px; } }

.calc__field { display: grid; gap: 7px; margin-bottom: 15px; }
.calc__field:last-child { margin-bottom: 0; }
.calc__labels { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.calc__labels span { font-size: 13.5px; font-weight: 650; color: var(--ink-2); }
.calc__labels b { font-size: 17px; font-weight: 800; color: var(--brand-700); font-variant-numeric: tabular-nums; }

.calc__range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--line-2);
  outline: none;
}
.calc__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--brand);
  box-shadow: var(--sh-2);
  cursor: pointer;
  transition: transform var(--fast);
}
.calc__range::-webkit-slider-thumb:active { transform: scale(1.12); }
.calc__range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 3px solid var(--brand);
  box-shadow: var(--sh-2); cursor: pointer;
}

.calc__result {
  background: linear-gradient(160deg, #052E2B, #0F766E);
  border-radius: var(--r);
  padding: 18px;
  color: #fff;
  display: grid;
  gap: 12px;
  align-content: start;
}
.calc__big {
  font-size: clamp(28px, 7vw, 38px);
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.calc__sub { font-size: 12.5px; color: rgba(255,255,255,.78); }
.calc__line {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13.5px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.16);
}
.calc__line b { font-variant-numeric: tabular-nums; }

.calc__split { display: flex; height: 34px; border-radius: 10px; overflow: hidden; box-shadow: var(--sh-1); }
.calc__split i {
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; color: #fff;
  transition: width .5s var(--ease);
  white-space: nowrap; overflow: hidden;
}
.calc__split i:first-child { background: linear-gradient(180deg, #475569, #334155); }
.calc__split i:last-child  { background: linear-gradient(180deg, #22C55E, #15803D); }

/* ============================================================ Page publique */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 88% -10%, rgba(245,158,11,.16), transparent 62%),
    linear-gradient(160deg, #0B3C38 0%, #0F766E 48%, #0D9488 100%);
  color: #fff;
  padding: 44px 0 52px;
}
.hero::after {
  content: '';
  position: absolute; left: -12%; bottom: -58%;
  width: 78%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255,255,255,.09), transparent 65%);
  border-radius: 50%;
}
.hero > * { position: relative; z-index: 1; }
.hero__grid { display: grid; gap: 28px; align-items: center; }
@media (min-width: 960px) {
  .hero { padding: 60px 0 72px; }
  .hero__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 40px; }
}

.hero__title {
  font-size: clamp(28px, 8vw, 50px);
  line-height: 1.08;
  letter-spacing: -.03em;
  font-weight: 800;
  margin-bottom: 14px;
}
.hero__title em { font-style: normal; color: #FCD34D; }
.hero__sub {
  font-size: clamp(15px, 4vw, 19px);
  color: rgba(255,255,255,.9);
  max-width: 56ch;
  margin-bottom: 26px;
}
.hero__cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero__cta .btn--primary { --btn-bg: #FFFFFF; --btn-fg: var(--brand-700); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.hero__cta .btn--primary:hover { --btn-bg: #F0FDFA; }
.hero__cta .btn--ghost { --btn-fg: #fff; --btn-bd: rgba(255,255,255,.45); }
.hero__cta .btn--ghost:hover { --btn-bg: rgba(255,255,255,.12); }

.hero__badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-full);
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  font-size: 12.5px; font-weight: 650;
}

.strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  margin-top: -26px;
  position: relative;
  z-index: 2;
  box-shadow: var(--sh-2);
}
@media (min-width: 720px) { .strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.strip__cell { background: var(--surface); padding: 16px 14px; text-align: center; }
.strip__value {
  font-size: clamp(20px, 5vw, 27px);
  font-weight: 800;
  color: var(--brand-700);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.strip__label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* Schéma du fonctionnement */
.flow {
  display: grid;
  gap: 10px;
  counter-reset: flow;
}
@media (min-width: 900px) {
  .flow { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
}
.flow__node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  transition: transform var(--fast), box-shadow var(--fast);
}
.flow__node:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
@media (min-width: 900px) {
  .flow__node { flex-direction: column; text-align: center; gap: 8px; padding: 18px 12px; }
}
.flow__icon {
  width: 42px; height: 42px; flex: 0 0 auto;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--brand-050); color: var(--brand-700);
  font-size: 19px;
}
.flow__node:nth-child(6) .flow__icon { background: var(--accent-050); color: #92400E; }
.flow__title { font-weight: 700; font-size: 14px; }
.flow__text { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.flow__node::after {
  content: '↓';
  position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%);
  color: var(--brand-100); font-size: 15px; font-weight: 700;
  z-index: 1;
}
.flow__node:last-child::after { display: none; }
@media (min-width: 900px) {
  .flow__node::after { content: '→'; left: auto; right: -13px; bottom: auto; top: 50%; transform: translateY(-50%); }
}

.feature {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  transition: transform var(--fast), box-shadow var(--fast);
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.feature__icon {
  width: 44px; height: 44px; flex: 0 0 auto;
  border-radius: 13px;
  display: grid; place-items: center;
  background: var(--brand-050); color: var(--brand-700);
}
.feature__title { font-weight: 700; font-size: 15px; margin-bottom: 3px; }
.feature__text { font-size: 13.5px; color: var(--muted); line-height: 1.5; }

.quote {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--sh-1);
  display: grid;
  gap: 12px;
}
.quote__stars { color: var(--accent); letter-spacing: 2px; font-size: 13px; }
.quote__text { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.quote__who { display: flex; align-items: center; gap: 10px; }
.quote__name { font-weight: 700; font-size: 14px; }
.quote__role { font-size: 12.5px; color: var(--muted); }

.cta-band {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-600));
  color: #fff;
  border-radius: var(--r-lg);
  padding: 30px 22px;
  text-align: center;
  box-shadow: var(--sh-brand);
}
.cta-band h2 { font-size: clamp(20px, 5vw, 28px); margin-bottom: 8px; }
.cta-band p { color: rgba(255,255,255,.88); max-width: 48ch; margin-inline: auto; }

.site-foot {
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
  margin-top: 34px;
  color: var(--muted);
  font-size: 13.5px;
}

/* Carte d'action mise en avant : l'étape suivante attendue de l'utilisateur. */
.card--action {
  border-color: var(--brand-100);
  background: linear-gradient(180deg, var(--brand-050), var(--surface) 60%);
}

/* ------------------------------- Invitation à installer l'application */

.install {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 90;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.install__card {
  position: relative;
  width: 100%;
  max-width: 420px;
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .22);
  padding: 18px 16px 16px;
  transform: translateY(130%);
  opacity: 0;
  transition: transform .34s var(--ease), opacity .34s var(--ease);
}
.install.is-open .install__card { transform: translateY(0); opacity: 1; }

/* La barre d'onglets occupe déjà le bas de l'écran : on se pose au-dessus. */
body.has-tabbar .install { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px); }
@media (min-width: 860px) { body.has-tabbar .install { padding-bottom: 20px; } }

.install__close {
  position: absolute;
  top: 8px; right: 8px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; background: transparent;
  color: var(--faint);
  cursor: pointer;
  border-radius: 50%;
}
.install__close:hover { background: var(--surface-2); color: var(--ink); }

.install__head { display: flex; gap: 12px; align-items: center; padding-right: 30px; }
.install__icon {
  width: 52px; height: 52px;
  border-radius: 13px;
  box-shadow: var(--sh-1);
  flex: 0 0 auto;
}
.install__title { font-weight: 700; font-size: 16px; }
.install__sub { font-size: 13px; color: var(--muted); line-height: 1.4; }

.install__perks {
  list-style: none;
  margin: 14px 0;
  padding: 0;
  display: grid;
  gap: 7px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.install__perks li { display: flex; gap: 8px; align-items: center; }
.install__perks .ico { color: var(--success); flex: 0 0 auto; }

.install__later {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.install__steps {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 11px;
  font-size: 13.5px;
  line-height: 1.5;
}
.install__steps li { display: flex; gap: 10px; align-items: flex-start; text-align: left; }
.install__steps li > span:last-child { min-width: 0; }
.install__step {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand-050);
  color: var(--brand-700);
  font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}
.install__share { display: inline-block; vertical-align: -3px; color: var(--brand); }

@media (min-width: 860px) {
  .install { justify-content: flex-end; padding: 0 20px 20px; }
}

/* ----------------------------------------------- Confort sur téléphone */

/*
 * Safari iOS zoome sur le champ dès que sa police descend sous 16px, ce qui
 * décale toute la mise en page. On force donc 16px sur les champs tant qu'on
 * est sur un écran tactile étroit ; le rendu bureau garde sa taille d'origine.
 */
@media (max-width: 859px) {
  .input, .select, .textarea, input, select, textarea { font-size: 16px; }

  /* Cible tactile confortable sur les commandes secondaires. */
  .btn--sm { min-height: 42px; }
  .icon-btn { width: 42px; height: 42px; }

  /* Un tableau large reste lisible : bord dégradé signalant qu'il défile. */
  .table-wrap {
    background:
      linear-gradient(to right, var(--surface) 30%, rgba(255,255,255,0)) left / 34px 100% no-repeat local,
      linear-gradient(to left,  var(--surface) 30%, rgba(255,255,255,0)) right / 34px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(15,23,42,.13), transparent) left / 14px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(15,23,42,.13), transparent) right / 14px 100% no-repeat scroll,
      var(--surface);
    overscroll-behavior-x: contain;
  }

  /* Les en-têtes de page empilent leurs actions au lieu de les comprimer. */
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }

  /* Un mot très long (URL, référence) ne doit jamais élargir la page. */
  .wrap, .card, .item__body, .summary__row { overflow-wrap: anywhere; }
}

/* Retour tactile immédiat : pas de halo gris, mais un léger enfoncement. */
@media (hover: none) {
  a, button, .btn, .icon-btn, .chip, .tabbar__item, .product {
    -webkit-tap-highlight-color: transparent;
  }
  .btn:active, .icon-btn:active, .chip:active { transform: scale(.97); }
  .product:active { transform: scale(.985); }
  .product:hover { transform: none; box-shadow: var(--sh-1); border-color: var(--line); }
  .product:hover .product__media img { transform: none; }
}

@media print {
  .topbar, .tabbar, .announce, .no-print, .btn, .install { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* ------------------------------------------------ Bouton WhatsApp flottant */

.wa-fab {
  position: fixed;
  right: 14px;
  /* Au-dessus de la barre d'onglets, jamais par-dessus le contenu :
     .has-tabbar reserve la hauteur correspondante en bas de page. */
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  z-index: 55;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(37, 211, 102, .42);
  transition: transform var(--fast), box-shadow var(--fast);
}
.wa-fab:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(37, 211, 102, .5); }
.wa-fab:active { transform: scale(.94); }
@media (min-width: 860px) { .wa-fab { right: 22px; bottom: 22px; } }

/* Le pouce ne doit jamais tomber sur le bouton au lieu du contenu. */
body.has-fab .has-tabbar,
body.has-fab main.page { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 86px); }
@media (min-width: 860px) {
  body.has-fab main.page { padding-bottom: 96px; }
}

@media print { .wa-fab { display: none !important; } }

/* Sélecteur d'indicatif accolé au champ téléphone. */
.input-group .phone-cc {
  flex: 0 0 auto;
  width: 132px;
  min-height: 48px;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  border-right: 0;
  background-color: var(--surface-2);
  font-size: 14px;
  padding-right: 28px;
  background-position: right 8px center;
}
.input-group .phone-cc + .input { border-radius: 0 var(--r-sm) var(--r-sm) 0; border-left: 0; }
@media (max-width: 380px) { .input-group .phone-cc { width: 104px; font-size: 13px; } }

/* Pastille d'accueil de l'espace livreur. */
.livreur-badge {
  display: inline-grid;
  place-items: center;
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--brand-050);
  color: var(--brand-700);
}

/* Incident signalé par un livreur. */
.incident {
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  border-radius: 9px;
  background: var(--warn-bg);
  font-size: 13.5px;
}
.incident__titre { font-weight: 700; color: var(--warn); }
.incident__note { color: var(--ink-2); overflow-wrap: anywhere; }
.incident__quand { font-size: 11.5px; color: var(--muted); }

/* Demande de livreur en attente d'accord */
.demande{
  border:1px solid var(--line);
  border-left:3px solid var(--warn);
  border-radius:var(--r-md);
  padding:12px;
  margin-bottom:10px;
  background:var(--surface-2, transparent);
}
.demande:last-child{ margin-bottom:0 }

/* Quartier du client : on cherche d'abord, le tarif suit */
.quartier-cherche { position: relative; }
.quartier-cherche > svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.quartier-cherche .input { padding-left: 42px; }

.quartier-liste {
  list-style: none; margin: 6px 0 0; padding: 0;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--surface, #fff);
}
.quartier-liste:empty { display: none; }
.quartier-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; cursor: pointer; min-height: 48px;
}
.quartier-option + .quartier-option { border-top: 1px solid var(--line); }
.quartier-option:hover, .quartier-option:active { background: var(--surface-2); }

.quartier-choisi, .quartier-inconnu {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 8px; padding: 10px 12px; border-radius: 10px; font-size: 14px;
}
.quartier-choisi[hidden], .quartier-inconnu[hidden] { display: none; }
.quartier-choisi { background: var(--success-bg); color: var(--success); font-weight: 600; }
.quartier-inconnu { background: var(--warn-bg, #FFF7E6); color: var(--warn, #B45309); }

.quartier-tous summary { cursor: pointer; color: var(--brand); display: flex; align-items: center; gap: 6px; }
.quartier-tableau {
  margin-top: 8px; max-height: 320px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 12px;
}
.quartier-ligne {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; background: none; border: 0; text-align: left; cursor: pointer;
  font: inherit; color: inherit; min-height: 46px;
}
.quartier-ligne + .quartier-ligne { border-top: 1px solid var(--line); }
.quartier-ligne:hover { background: var(--surface-2); }

/* ------------------------------------------------ Variantes combinées (fiche article) */
.puces-opt { display: flex; flex-wrap: wrap; gap: 8px; }
.puce-opt {
  min-height: 44px; min-width: 56px; padding: 8px 16px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--surface, #fff); color: var(--ink);
  font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer;
  transition: border-color .18s, background-color .18s, color .18s, transform .18s;
}
.puce-opt:hover { border-color: var(--brand-600); }
.puce-opt:active { transform: scale(.97); }
.puce-opt.is-choisi {
  border-color: var(--brand); background: var(--brand); color: #fff;
  box-shadow: 0 4px 14px -6px rgba(15, 118, 110, .6);
}
.puce-opt.is-epuise:not(.is-choisi) {
  color: var(--muted); background: var(--surface-2);
  text-decoration: line-through; text-decoration-thickness: 1.5px;
}
.puce-opt.is-epuise.is-choisi { background: var(--muted); border-color: var(--muted); text-decoration: line-through; }

.choix-combi__etat {
  margin: 4px 0 0; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); color: var(--muted); font-size: 14px;
}
.choix-combi__etat.is-ok { background: var(--success-bg); color: var(--success); font-weight: 600; }
.choix-combi__etat.is-epuise { background: var(--danger-bg); color: var(--danger); font-weight: 600; }

/* ==========================================================================
   Espace livreur — l'argent et le colis se lisent en une seconde, au soleil,
   sur un petit téléphone.
   ========================================================================== */

.lv-course { border-left: 4px solid var(--brand); }

.lv-encaisser {
  display: grid; gap: 2px;
  margin-top: 14px; padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-700) 100%);
  color: #fff;
  box-shadow: var(--sh-brand);
}
.lv-encaisser__lib { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #99F6E4; }
.lv-encaisser__montant { font-size: clamp(1.7rem, 8vw, 2.3rem); font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.lv-encaisser__detail { display: flex; align-items: center; gap: 6px; font-size: 13.5px; line-height: 1.35; color: #D8F3EF; }
.lv-encaisser.is-attention { background: linear-gradient(135deg, #B45309 0%, #92400E 100%); box-shadow: 0 10px 24px -12px rgba(180,83,9,.8); }
.lv-encaisser.is-attention .lv-encaisser__lib { color: #FDE68A; }
.lv-encaisser.is-attention .lv-encaisser__detail { color: #FEF3C7; font-weight: 600; }

.lv-colis { display: grid; gap: 8px; }
.lv-article {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.lv-article__photo {
  flex: none; display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 12px; overflow: hidden;
  background: var(--surface); color: var(--faint); border: 1px solid var(--line);
}
.lv-article__photo img { width: 100%; height: 100%; object-fit: cover; }
.lv-article__corps { flex: 1; min-width: 0; display: grid; gap: 2px; }
.lv-article__corps b { font-size: 14.5px; line-height: 1.25; }
.lv-article__corps span { font-size: 12.5px; color: var(--muted); }
.lv-article__qte { flex: none; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Somme rapportée : les raccourcis et le motif obligatoire quand il manque. */
.lv-recu__rapide { display: flex; flex-wrap: wrap; gap: 6px; }
.lv-puce {
  min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface);
  font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer;
}
.lv-puce:active { transform: scale(.97); }
.lv-manque { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); border: 1px solid #FCD34D; }
.lv-manque[hidden] { display: none; }
.lv-manque b { color: #92400E; font-size: 14.5px; }
.lv-manque .select { min-height: 46px; }

/* Disponibilité du livreur : un interrupteur, tout en haut de sa tournée. */
.lv-dispo {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.lv-dispo.is-oui { background: linear-gradient(135deg, #ECFDF5, #D1FAE5); border-color: #86EFAC; }
.lv-dispo.is-non { background: var(--surface-2); }
.lv-dispo__texte { flex: 1; min-width: 0; display: grid; gap: 2px; }
.lv-dispo__texte b { font-size: 16px; }
.lv-dispo.is-oui .lv-dispo__texte b { color: #166534; }
.lv-dispo__texte span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.lv-bascule {
  flex: none; position: relative;
  width: 64px; height: 36px; padding: 0;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--line); transition: background .22s var(--ease);
}
.lv-dispo.is-oui .lv-bascule { background: var(--success); }
.lv-bascule__rond {
  position: absolute; top: 3px; left: 3px;
  width: 30px; height: 30px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(11,18,32,.25);
  transition: transform .22s var(--ease);
}
.lv-dispo.is-oui .lv-bascule__rond { transform: translateX(28px); }

/* Les réglages du livreur, repliés pour ne pas encombrer la tournée. */
.lv-reglages > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 44px; font-size: 15px; }
.lv-reglages > summary span { color: var(--muted); font-size: 12.5px; }
.lv-reglage { padding-top: 16px; margin-top: 12px; border-top: 1px solid var(--line-2); }
.lv-reglage .h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 4px; }

/* Deux issues pour une course : livrer, ou annuler en justifiant la cause. */
.lv-annuler > summary {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 46px; margin-top: 8px;
  border-radius: 14px; border: 1.5px solid var(--danger-bg);
  background: var(--danger-bg); color: var(--danger);
  font-size: 14.5px; font-weight: 700; cursor: pointer;
}
.lv-annuler[open] > summary { border-color: var(--danger); }

/* ------------------------------------------------ Choix du modele (3D) */
/*
 * Vingt-et-un modeles dans une fiche : une liste qui se deplie, pas une
 * bouillie de puces. Le relief sert a comprendre — la ligne se souleve quand
 * on la touche, les memoires se deploient comme on ouvre un tiroir.
 */
.vsel { perspective: 1200px; }

.vsel__quete {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
.vsel__quete:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent);
}
.vsel__quete svg { flex: none; color: var(--muted); }
.vsel__champ {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: none;
  padding: 13px 0; font: inherit; font-size: 16px; color: var(--text);
}
.vsel__compte { margin: 6px 2px 0; }

.vsel__liste {
  display: grid; gap: 8px;
  margin-top: 10px;
  transform-style: preserve-3d;
}

.vsel__grp {
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform .28s cubic-bezier(.2,.8,.3,1), box-shadow .28s, border-color .2s;
}
.vsel__grp.is-ouvert {
  border-color: var(--brand);
  box-shadow: 0 10px 26px -14px rgba(11,18,32,.45);
  transform: translateZ(18px);
}
.vsel__grp.is-retenu { border-color: var(--brand); }
.vsel__grp.is-vide { opacity: .55; }

.vsel__tete {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 56px;
  padding: 12px 14px;
  border: 0; background: none; cursor: pointer;
  font: inherit; text-align: left; color: var(--text);
}
.vsel__nom { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; }
.vsel__des { font-weight: 700; white-space: nowrap; color: var(--brand); }
.vsel__rupture { color: var(--muted); font-weight: 600; }

.vsel__chev {
  flex: none; width: 10px; height: 10px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); margin-right: 2px;
  transition: transform .28s cubic-bezier(.2,.8,.3,1);
}
.vsel__grp.is-ouvert .vsel__chev { transform: rotate(45deg); }

.vsel__corps {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .3s cubic-bezier(.2,.8,.3,1);
}
.vsel__grp.is-ouvert .vsel__corps { grid-template-rows: 1fr; }
/* min-height:0 : sans lui la rangee fermee garde la hauteur du padding. */
.vsel__corps > * { overflow: hidden; min-height: 0; }

.vsel__cartes {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px; padding: 0 12px;
  perspective: 700px;
}
/* La marge basse n'apparait qu'ouvert : sinon la rangee fermee garde
   sa hauteur, le min-height ne s'appliquant pas au padding. */
.vsel__grp.is-ouvert .vsel__cartes { padding-bottom: 12px; }

.vsel__carte {
  display: grid; gap: 2px;
  padding: 12px 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  cursor: pointer; font: inherit; text-align: left; color: var(--text);
  transform-origin: top center;
  transform: rotateX(-70deg); opacity: 0;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.vsel__grp.is-ouvert .vsel__carte {
  animation: vsel-ouvre .34s cubic-bezier(.2,.9,.3,1) forwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes vsel-ouvre {
  from { transform: rotateX(-70deg); opacity: 0; }
  to   { transform: rotateX(0);      opacity: 1; }
}
.vsel__carte:hover:not(:disabled) { border-color: var(--brand); }
.vsel__carte.is-choisi {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--brand) 60%, transparent);
}
.vsel__carte:disabled { cursor: not-allowed; opacity: .45; }
.vsel__valeur { font-weight: 700; font-size: 15px; }
.vsel__prix   { font-weight: 700; color: var(--brand); }
.vsel__stock  { font-size: 12px; color: var(--muted); }
.vsel__carte.is-epuise .vsel__valeur { text-decoration: line-through; }

.vsel__vide { text-align: center; padding: 14px 0; }

@media (prefers-reduced-motion: reduce) {
  .vsel__grp, .vsel__chev, .vsel__corps { transition: none; }
  .vsel__grp.is-ouvert { transform: none; }
  .vsel__carte { transform: none; opacity: 1; }
  .vsel__grp.is-ouvert .vsel__carte { animation: none; }
}

/* On a commande sans choisir : le selecteur se signale, une fois. */
@keyframes vsel-attire {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.vsel--attire { animation: vsel-attire .45s ease-in-out; }
@media (prefers-reduced-motion: reduce) { .vsel--attire { animation: none; } }

/* La pastille « nouveau » du lien Formation, dans le menu du haut. */
.topnav__nouveau {
  display: inline-block; margin-left: 4px; padding: 1px 6px;
  border-radius: 999px; background: #F97316; color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em; vertical-align: 1px;
}
