/* ============================================================
   Règles communes à tout le site, chargées en dernier sur chaque page.
   1. Notifications (toasts) en haut de l'écran, compactes, sans bloquer les clics.
   2. Champs à 16px sur écran tactile : iOS ne zoome plus au focus.
   ============================================================ */

/* ── 1. Toasts ────────────────────────────────────────────── */
#toast-container,
.toast-container {
  position: fixed !important;
  top: max(14px, env(safe-area-inset-top)) !important;
  bottom: auto !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  z-index: 100000 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  width: min(440px, calc(100vw - 24px)) !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  pointer-events: none !important;   /* ne bloque jamais le header ni les boutons dessous */
}
#toast-container > *,
.toast-container > .toast,
.toast-container > .acc-toast {
  position: relative !important;
  inset: auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 11px 16px !important;
  border-radius: 12px !important;
  border: 0 !important;
  font-family: "Outfit", system-ui, sans-serif !important;
  font-size: 0.86rem !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  color: #fff !important;
  background: rgba(17,17,17,0.94) !important;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18) !important;
  pointer-events: none !important;
  overflow-wrap: anywhere;
  text-align: left !important;
  opacity: 1 !important;
  transform: none;
  animation: ui-toast-in .32s cubic-bezier(.22,.61,.36,1) both !important;
}
#toast-container > * i,
.toast-container > * i { flex-shrink: 0; font-size: .95rem; }
/* Couleur portée par l'icône : le fond reste sobre */
#toast-container > .success i, #toast-container > .toast-success i { color: #7fd6a0 !important; }
#toast-container > .error i,   #toast-container > .toast-error i   { color: #ff9b8f !important; }
#toast-container > .info i,    #toast-container > .toast-info i    { color: #C9A96E !important; }
#toast-container > .error,     #toast-container > .toast-error     { background: rgba(60,12,10,0.95) !important; }
#toast-container > .exit { animation: ui-toast-out .25s ease forwards !important; }
/* Trois au maximum : les plus anciens disparaissent */
#toast-container > :nth-last-child(n+4) { display: none !important; }
@keyframes ui-toast-in  { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ui-toast-out { to { opacity: 0; transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) {
  #toast-container > *, .toast-container > * { animation: none !important; }
}

/* ── 2. Champs sur mobile : 16px minimum, sinon iOS zoome au focus ── */
@media (max-width: 1024px), (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ── 3. Statuts : une couleur propre à chaque étape (admin et espace client) ── */
:root {
  --st-devis_soumis-bg: #e8f0fe;   --st-devis_soumis-tx: #1e4fa8;
  --st-devis_valide-bg: #eeeafe;   --st-devis_valide-tx: #4b32b8;
  --st-paye-bg: #e3f6ea;           --st-paye-tx: #17693a;
  --st-en_transit-bg: #e1f4f8;     --st-en_transit-tx: #0d6a80;
  --st-recu-bg: #e7edf5;           --st-recu-tx: #34557d;
  --st-en_preparation-bg: #fff2d6; --st-en_preparation-tx: #8a5a00;
  --st-traite-bg: #f4e8fb;         --st-traite-tx: #7a2c99;
  --st-expedie_retour-bg: #fdece0; --st-expedie_retour-tx: #a2490c;
  --st-livre-bg: #1f2a24;          --st-livre-tx: #9ee0b5;
  --st-annule-bg: #ececec;         --st-annule-tx: #555555;
  --st-en_attente-bg: #fdecf3;     --st-en_attente-tx: #9d174d;
  --st-devis_refuse-bg: #fdeae7;   --st-devis_refuse-tx: #a3261b;
}
/* Admin : pastilles pleines */
.status-badge.st-devis_soumis   { background: var(--st-devis_soumis-bg) !important;   color: var(--st-devis_soumis-tx) !important;   border-color: transparent !important; }
.status-badge.st-devis_valide   { background: var(--st-devis_valide-bg) !important;   color: var(--st-devis_valide-tx) !important;   border-color: transparent !important; }
.status-badge.st-paye           { background: var(--st-paye-bg) !important;           color: var(--st-paye-tx) !important;           border-color: transparent !important; }
.status-badge.st-en_transit     { background: var(--st-en_transit-bg) !important;     color: var(--st-en_transit-tx) !important;     border-color: transparent !important; }
.status-badge.st-recu           { background: var(--st-recu-bg) !important;           color: var(--st-recu-tx) !important;           border-color: transparent !important; }
.status-badge.st-en_preparation { background: var(--st-en_preparation-bg) !important; color: var(--st-en_preparation-tx) !important; border-color: transparent !important; }
.status-badge.st-traite         { background: var(--st-traite-bg) !important;         color: var(--st-traite-tx) !important;         border-color: transparent !important; }
.status-badge.st-expedie_retour { background: var(--st-expedie_retour-bg) !important; color: var(--st-expedie_retour-tx) !important; border-color: transparent !important; }
.status-badge.st-livre          { background: var(--st-livre-bg) !important;          color: var(--st-livre-tx) !important;          border-color: transparent !important; }
.status-badge.st-en_attente     { background: var(--st-en_attente-bg) !important;     color: var(--st-en_attente-tx) !important;     border-color: transparent !important; }
.status-badge.st-annule         { background: var(--st-annule-bg) !important;         color: var(--st-annule-tx) !important;         border-color: transparent !important; }
.status-badge.st-devis_refuse   { background: var(--st-devis_refuse-bg) !important;   color: var(--st-devis_refuse-tx) !important;   border-color: transparent !important; }
/* Espace client : la tuile d'icône prend la couleur de l'étape (variables lues par espace-refonte.css) */
.status-badge.status-devis_soumis   { --bg: var(--st-devis_soumis-bg);   --tx: var(--st-devis_soumis-tx); }
.status-badge.status-devis_valide   { --bg: var(--st-devis_valide-bg);   --tx: var(--st-devis_valide-tx); }
.status-badge.status-paye           { --bg: var(--st-paye-bg);           --tx: var(--st-paye-tx); }
.status-badge.status-en_transit     { --bg: var(--st-en_transit-bg);     --tx: var(--st-en_transit-tx); }
.status-badge.status-recu           { --bg: var(--st-recu-bg);           --tx: var(--st-recu-tx); }
.status-badge.status-en_preparation { --bg: var(--st-en_preparation-bg); --tx: var(--st-en_preparation-tx); }
.status-badge.status-traite         { --bg: var(--st-traite-bg);         --tx: var(--st-traite-tx); }
.status-badge.status-expedie_retour { --bg: var(--st-expedie_retour-bg); --tx: var(--st-expedie_retour-tx); }
.status-badge.status-livre          { --bg: var(--st-livre-bg);          --tx: #1f2a24; }
.status-badge.status-en_attente     { --bg: var(--st-en_attente-bg);     --tx: var(--st-en_attente-tx); background: var(--st-en_attente-bg); color: var(--st-en_attente-tx); }
.status-badge.status-annule         { --bg: var(--st-annule-bg);         --tx: var(--st-annule-tx); }
.status-badge.status-devis_refuse   { --bg: var(--st-devis_refuse-bg);   --tx: var(--st-devis_refuse-tx); }

/* ── 4. Liste admin : mode d'envoi en gris comme les autres étiquettes, rond vert si payé ── */
.article-tag.article-tag--expedition {
  color: var(--text-secondary, #555) !important;
  background: var(--gray-100, #f3f3f3) !important;
  border-color: var(--border, #e5e5e5) !important;
  display: inline-flex; align-items: center; gap: 5px;
}
.paid-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22a35a; box-shadow: 0 0 0 2px rgba(34,163,90,0.18); flex-shrink: 0; }

/* Mode d'envoi avec Chronopost : étiquette bleue (les commandes 100 % boutique restent grises) */
.article-tag.article-tag--expedition.article-tag--chrono {
  color: #1e4fa8 !important;
  background: #e8f0fe !important;
  border-color: #bcd0f7 !important;
}
