/* =====================================================================
   Myboutiik : socle commun (jetons, typographie, formulaires, boutons)
   Jaune « zem » + indigo : les couleurs de la rue béninoise, une enseigne
   peinte en guise d'identité.
   ===================================================================== */

@font-face {
  font-family: "Anton";
  src: url("/assets/fonts/anton-latin.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/dmsans-latin-var.woff") format("woff");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --jaune: #f5c400;
  --jaune-clair: #fff4c2;
  --jaune-voile: #fffbea;
  --indigo: #1b2a6b;
  --indigo-vif: #2b3f9e;
  --encre: #17204a;
  --gris: #565d80;
  --gris-clair: #8a90ad;
  --trait: #e2e1ee;
  --fond: #f6f6fb;
  --blanc: #ffffff;
  --vert: #0f8a4b;
  --vert-fonce: #0b6b3a;
  --piment: #c81e3a;
  --piment-voile: #fdebee;
  --ok-voile: #e6f5ec;

  --f-affiche: "Anton", "Impact", "Arial Narrow", sans-serif;
  --f-texte: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --t-xs: 0.8125rem;   /* 13 */
  --t-sm: 0.9375rem;   /* 15 */
  --t-md: 1.0625rem;   /* 17 */
  --t-lg: 1.3125rem;   /* 21 */
  --t-xl: 1.625rem;    /* 26 */
  --t-2xl: 2.125rem;   /* 34 */
  --t-3xl: 3rem;       /* 48 */
  --t-4xl: 4.5rem;     /* 72 */

  --r-sm: 0;
  --r-md: 0;
  --r-lg: 0;

  --ombre: 0 1px 2px rgba(23, 32, 74, 0.08), 0 8px 24px -12px rgba(23, 32, 74, 0.25);
  --focus: 0 0 0 3px var(--blanc), 0 0 0 6px var(--indigo-vif);
  --largeur: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-texte);
  font-size: var(--t-md);
  line-height: 1.55;
  color: var(--encre);
  background: var(--blanc);
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--indigo-vif); text-underline-offset: 3px; }
a:hover { color: var(--indigo); }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.15; color: var(--encre); }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 0; }
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { box-shadow: none; }

.affiche {
  font-family: var(--f-affiche);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.02;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--indigo); color: var(--blanc); padding: 10px 14px; border-radius: 0;
}
.skip-link:focus { top: 12px; color: var(--blanc); }

.wrap { width: min(100% - 32px, var(--largeur)); margin-inline: auto; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 48px; padding: 0.7em 1.25em;
  border: 2px solid transparent; border-radius: 0;
  background: var(--indigo); color: var(--blanc);
  font-weight: 700; font-size: var(--t-md); line-height: 1.1; text-decoration: none;
  cursor: pointer; transition: background-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--indigo-vif); color: var(--blanc); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.6; cursor: not-allowed; }
.btn[aria-busy="true"]::after {
  content: ""; width: 1em; height: 1em; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: tourne 0.7s linear infinite;
}
.btn-jaune { background: var(--jaune); color: var(--indigo); }
.btn-jaune:hover { background: #ffd21f; color: var(--indigo); }
.btn-wa { background: var(--vert); color: var(--blanc); }
.btn-wa:hover { background: var(--vert-fonce); color: var(--blanc); }
.btn-contour { background: transparent; color: var(--indigo); border-color: var(--indigo); }
.btn-contour:hover { background: var(--indigo); color: var(--blanc); }
.btn-discret { background: transparent; color: var(--indigo); padding-inline: 0.75em; }
.btn-discret:hover { background: var(--fond); color: var(--indigo); }
.btn-danger { background: var(--piment); }
.btn-danger:hover { background: #a3162e; }
.btn-sm { min-height: 38px; padding: 0.45em 0.85em; font-size: var(--t-sm); border-radius: 0; }
.btn-bloc { width: 100%; }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }

@keyframes tourne { to { transform: rotate(360deg); } }

/* ---------- Formulaires ---------- */
.champ { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-bottom: 18px; }
.champ > label, .champ > .label { font-weight: 700; font-size: var(--t-sm); }
.aide { font-size: var(--t-xs); color: var(--gris); margin: 0; }
.champ .erreur { font-size: var(--t-xs); color: var(--piment); margin: 0; font-weight: 600; }
.saisie, select.saisie, textarea.saisie {
  width: 100%; min-height: 48px; padding: 0.65em 0.85em;
  border: 1.5px solid #cfd0e2; border-radius: 0;
  background: var(--blanc); font-size: 1rem; /* 16px : pas de zoom auto sur iOS */
  transition: border-color 0.15s;
}
textarea.saisie { min-height: 110px; resize: vertical; line-height: 1.5; }
.saisie:hover { border-color: #a9abc8; }
.saisie:focus { outline: none; border-color: var(--indigo-vif); box-shadow: 0 0 0 3px rgba(43, 63, 158, 0.18); }
.saisie[aria-invalid="true"] { border-color: var(--piment); }
.saisie-groupe { display: flex; align-items: stretch; }
.saisie-groupe .prefixe {
  display: flex; align-items: center; padding: 0 0.75em;
  border: 1.5px solid #cfd0e2; border-right: 0; border-radius: 0;
  background: var(--fond); color: var(--gris); font-size: var(--t-sm); white-space: nowrap;
}
.saisie-groupe .saisie { border-radius: 0; min-width: 0; }
.case { display: flex; gap: 10px; align-items: flex-start; font-size: var(--t-sm); cursor: pointer; }
.case input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--indigo); flex: none; }
.grille-2 { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .grille-2 { grid-template-columns: 1fr 1fr; } }

.message {
  padding: 12px 14px; border-radius: 0; font-size: var(--t-sm); margin-bottom: 16px;
  border-left: 4px solid var(--indigo); background: #eef0fa;
}
.message.erreur { border-color: var(--piment); background: var(--piment-voile); color: #7a1023; }
.message.ok { border-color: var(--vert); background: var(--ok-voile); color: #0a4d2a; }
.message.attention { border-color: var(--jaune); background: var(--jaune-voile); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 0; font-size: var(--t-xs); font-weight: 700;
  background: var(--fond); color: var(--gris); white-space: nowrap;
}
.badge.ok { background: var(--ok-voile); color: var(--vert-fonce); }
.badge.attente { background: var(--jaune-clair); color: #6b5200; }
.badge.danger { background: var(--piment-voile); color: #8f1429; }

/* ---------- Boîtes de dialogue ---------- */
dialog.fenetre {
  width: min(100% - 24px, 560px); max-height: min(92vh, 900px);
  padding: 0; border: 0; border-radius: 0;
  box-shadow: 0 30px 80px -20px rgba(23, 32, 74, 0.5);
  color: var(--encre);
}
dialog.fenetre::backdrop { background: rgba(23, 32, 74, 0.55); }
dialog.fenetre[open] { animation: apparait 0.18s ease-out; }
.fenetre-tete {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--trait);
  position: sticky; top: 0; background: var(--blanc); z-index: 1;
}
.fenetre-tete h2 { margin: 0; font-size: var(--t-lg); }
.fenetre-corps { padding: 20px; }
.fenetre-pied {
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px solid var(--trait);
  position: sticky; bottom: 0; background: var(--blanc);
}
.fermer {
  width: 40px; height: 40px; border: 0; border-radius: 0;
  background: var(--fond); cursor: pointer; display: grid; place-items: center; flex: none;
}
.fermer:hover { background: var(--trait); }
@keyframes apparait { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Notifications ---------- */
.toasts {
  position: fixed; z-index: 1000; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: grid; gap: 8px; width: min(100% - 24px, 440px); pointer-events: none;
}
.toast {
  pointer-events: auto; padding: 12px 16px; border-radius: 0;
  background: var(--encre); color: var(--blanc); font-size: var(--t-sm); font-weight: 600;
  box-shadow: var(--ombre); animation: apparait 0.2s ease-out;
}
.toast.erreur { background: var(--piment); }
.toast.ok { background: var(--vert-fonce); }

/* ---------- Divers ---------- */
.chargement {
  display: grid; place-items: center; min-height: 40vh; color: var(--gris); gap: 12px;
}
.chargement::before {
  content: ""; width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--trait); border-top-color: var(--indigo);
  animation: tourne 0.8s linear infinite;
}
.muet { color: var(--gris); }
.petit { font-size: var(--t-sm); }
.tres-petit { font-size: var(--t-xs); }
.centre { text-align: center; }
.pile > * + * { margin-top: 12px; }
.ligne { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.espace { flex: 1; }

.logo-myboutik {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--encre);
  font-family: var(--f-affiche); font-size: 1.6rem; letter-spacing: 0.01em; line-height: 1;
}
.logo-myboutik .pastille { width: 38px; height: 38px; display: block; flex: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 18px; }
.mt-3 { margin-top: 28px; }

/* Boutons radio carrés, cohérents avec le style à angles droits. */
input[type="radio"] {
  -webkit-appearance: none; appearance: none; margin: 0;
  width: 20px; height: 20px; flex: none; cursor: pointer;
  border: 2px solid var(--gris-clair); border-radius: 0; background: var(--blanc);
  display: inline-grid; place-content: center;
}
input[type="radio"]::before {
  content: ""; width: 10px; height: 10px; background: currentColor; transform: scale(0); transition: transform 0.12s;
}
input[type="radio"]:checked { border-color: var(--indigo); color: var(--indigo); }
input[type="radio"]:checked::before { transform: scale(1); }
.page-boutique input[type="radio"]:checked { border-color: var(--theme); color: var(--theme); }
.prix-barre-mini { color: var(--gris); font-weight: 600; margin-right: 8px; font-size: .8em; }
