/* PlanB — en attendant la DA : une couleur d'accent et des émojis, faciles à remplacer. */
:root {
  --accent: #ff4d2e;
  --accent-fonce: #e03a1c;
  --accent-doux: #fff0ec;
  --encre: #111214;
  --gris: #6b7280;
  --gris-clair: #9ca3af;
  --fond: #ffffff;
  --doux: #f4f4f5;
  --ligne: #e7e7ea;
  --vert: #16a34a;
  --ombre: 0 10px 30px rgba(17, 18, 20, .12);
  --rayon: 16px;
  --fond-page: #f2f3f5;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fond-page);
  color: var(--encre);
  font: 15px/1.4 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }
.sous { color: var(--gris); font-size: 13px; font-weight: 400; }
.ajout-plus { display: inline-block; margin-top: 10px; color: var(--accent-fonce); font-weight: 600; font-size: 14px; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input { font: inherit; }
h1, h2, h3, p { margin: 0; }

/* ---- Cadre de l'app : plein écran sur téléphone, colonne centrée sur ordinateur ---- */
.appli {
  position: relative;
  width: 100%; max-width: 480px; height: 100vh; height: 100dvh;
  margin: 0 auto;
  background: var(--fond);
  overflow: hidden;
  display: flex; flex-direction: column;
}
@media (min-width: 520px) {
  .appli { box-shadow: 0 0 0 1px var(--ligne), 0 30px 80px rgba(17, 18, 20, .08); }
}
.ecran { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 96px; scrollbar-width: none; }
.ecran::-webkit-scrollbar { display: none; }

/* ---- Barre d'onglets ---- */
.onglets {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px calc(14px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--ligne);
}
.onglet { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--gris-clair); padding: 4px 0; }
.onglet svg { width: 24px; height: 24px; }
.onglet.actif { color: var(--encre); font-weight: 600; }

/* ---- Accueil ---- */
.entete { padding: calc(20px + env(safe-area-inset-top)) 20px 8px; }
.adresse { display: flex; align-items: center; gap: 4px; color: var(--gris); font-size: 13px; margin-top: 2px; max-width: 100%; }
.adresse span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lieu { display: flex; align-items: center; gap: 12px; }
.lieu .emo { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-doux); display: grid; place-items: center; font-size: 20px; flex: none; }
.lieu .texte { flex: 1; min-width: 0; }
.lieu .texte strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lien { color: var(--accent-fonce); font-weight: 600; font-size: 14px; }
.livrer { font-size: 12px; color: var(--gris); }
.situation-btn { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 17px; margin-top: 2px; }
.situation-btn .chevron { color: var(--accent); }
.recherche {
  margin: 12px 20px 4px; display: flex; align-items: center; gap: 10px;
  background: var(--doux); border-radius: 999px; padding: 12px 16px;
}
.recherche input { border: 0; background: none; outline: none; flex: 1; min-width: 0; }
.recherche svg { width: 18px; height: 18px; color: var(--gris); flex: none; }

.categories { display: flex; gap: 14px; overflow-x: auto; padding: 14px 20px 6px; scrollbar-width: none; }
.categories::-webkit-scrollbar { display: none; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--gris); flex: none; }
.cat .bulle { width: 58px; height: 58px; border-radius: 18px; background: var(--doux); display: grid; place-items: center; font-size: 28px; transition: transform .15s; }
.cat.actif { color: var(--encre); font-weight: 600; }
.cat.actif .bulle { background: var(--accent-doux); box-shadow: inset 0 0 0 2px var(--accent); }
.cat:active .bulle { transform: scale(.94); }

.promo {
  margin: 14px 20px; padding: 18px; border-radius: 20px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--accent), #ff8a3d);
}
.promo h3 { font-size: 20px; letter-spacing: -.02em; max-width: 72%; position: relative; z-index: 1; }
.promo p { opacity: .9; margin-top: 4px; font-size: 13px; max-width: 68%; position: relative; z-index: 1; }
.promo .code { display: inline-block; margin-top: 10px; background: #fff; color: var(--accent-fonce); font-weight: 800; border-radius: 8px; padding: 4px 10px; letter-spacing: .08em; font-size: 13px; }
.promo .deco { position: absolute; right: -4px; bottom: -12px; font-size: 80px; transform: rotate(-12deg); }

.section-titre { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 20px 10px; }
.section-titre h2 { font-size: 19px; letter-spacing: -.02em; }
.section-titre span { font-size: 13px; color: var(--gris); }

.carrousel { display: flex; gap: 12px; overflow-x: auto; padding: 0 20px 4px; scroll-padding: 0 20px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carrousel::-webkit-scrollbar { display: none; }
.carrousel .carte { width: 260px; flex: none; scroll-snap-align: start; }

.liste { display: grid; gap: 18px; padding: 0 20px; }
.carte { text-align: left; display: block; width: 100%; }
.carte .visuel {
  height: 132px; border-radius: var(--rayon); display: grid; place-items: center; font-size: 64px; position: relative; overflow: hidden;
}
.carte .visuel::after { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 80% at 30% 20%, rgba(255,255,255,.25), transparent 60%); }
.carte .badge { position: absolute; left: 10px; top: 10px; z-index: 1; background: #fff; border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 700; }
.carte .delai { position: absolute; right: 10px; bottom: 10px; z-index: 1; background: #fff; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 700; }
.carte .infos { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.carte h3 { font-size: 16px; }
.carte .meta { color: var(--gris); font-size: 13px; }
.note { background: var(--doux); border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; height: fit-content; white-space: nowrap; }

.vide { text-align: center; color: var(--gris); padding: 40px 20px; }
.vide .gros { font-size: 48px; margin-bottom: 8px; }

/* ---- Prestataire ---- */
.hero { height: 210px; display: grid; place-items: center; font-size: 96px; position: relative; color: #fff; }
.retour {
  position: absolute; left: 16px; top: calc(16px + env(safe-area-inset-top)); width: 40px; height: 40px; border-radius: 50%;
  background: #fff; color: var(--encre); display: grid; place-items: center; box-shadow: var(--ombre); z-index: 2;
}
.retour svg { width: 20px; height: 20px; }
.fiche { padding: 18px 20px 4px; }
.fiche h1 { font-size: 26px; letter-spacing: -.03em; }
.fiche .slogan { color: var(--gris); margin-top: 4px; }
.pastilles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pastilles span { background: var(--doux); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }

.plat { display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--ligne); }
.plat .texte { flex: 1; }
.plat h3 { font-size: 15px; }
.plat .desc { color: var(--gris); font-size: 13px; margin: 4px 0 6px; }
.plat .prix { font-weight: 600; }
.populaire { color: var(--accent-fonce); font-size: 12px; font-weight: 700; }
.plat .vignette { width: 92px; height: 92px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 40px; position: relative; }
.ajouter {
  position: absolute; right: -6px; bottom: -6px; width: 34px; height: 34px; border-radius: 50%;
  background: #fff; box-shadow: var(--ombre); font-size: 22px; font-weight: 500; display: grid; place-items: center;
}
.stepper {
  position: absolute; right: -6px; bottom: -6px; display: flex; align-items: center; gap: 4px;
  background: var(--encre); color: #fff; border-radius: 999px; padding: 4px; box-shadow: var(--ombre);
}
.stepper button { width: 26px; height: 26px; border-radius: 50%; font-size: 18px; color: #fff; display: grid; place-items: center; }
.stepper span { min-width: 16px; text-align: center; font-weight: 700; font-size: 14px; }

.barre-panier {
  position: absolute; left: 16px; right: 16px; bottom: 88px; z-index: 15;
  background: var(--encre); color: #fff; border-radius: 16px; padding: 15px 18px;
  display: flex; justify-content: space-between; align-items: center; font-weight: 600;
  box-shadow: 0 12px 30px rgba(0,0,0,.25); animation: monte .25s ease-out;
}
.barre-panier .nb { background: var(--accent); border-radius: 8px; padding: 2px 8px; margin-right: 8px; }
@keyframes monte { from { transform: translateY(20px); opacity: 0; } }

/* ---- Panier ---- */
.barre-titre { display: flex; align-items: center; gap: 12px; padding: calc(16px + env(safe-area-inset-top)) 20px 16px; position: sticky; top: 0; background: #fff; z-index: 5; border-bottom: 1px solid var(--ligne); }
.barre-titre .retour { position: static; box-shadow: none; background: var(--doux); }
.barre-titre h1 { font-size: 18px; }
.bloc { padding: 18px 20px; border-bottom: 8px solid var(--doux); }
.bloc h2 { font-size: 16px; margin-bottom: 12px; }
.ligne-panier { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.ligne-panier .nom { flex: 1; font-weight: 600; }
.ligne-panier .stepper { position: static; background: var(--doux); color: var(--encre); box-shadow: none; }
.ligne-panier .stepper button { color: var(--encre); }

.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce { border: 1.5px solid var(--ligne); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; }
.puce.actif { border-color: var(--encre); background: var(--encre); color: #fff; }

.option { display: flex; align-items: center; gap: 12px; }
.option .texte { flex: 1; }
.option .sous { color: var(--gris); font-size: 13px; }
.interrupteur { width: 50px; height: 30px; border-radius: 999px; background: var(--ligne); position: relative; transition: background .2s; flex: none; }
.interrupteur::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.interrupteur.actif { background: var(--vert); }
.interrupteur.actif::after { transform: translateX(20px); }

.code-promo { display: flex; gap: 8px; }
.code-promo input { flex: 1; min-width: 0; border: 1.5px solid var(--ligne); border-radius: 12px; padding: 10px 12px; text-transform: uppercase; outline: none; }
.code-promo input:focus { border-color: var(--encre); }
.code-promo button { background: var(--doux); border-radius: 12px; padding: 0 16px; font-weight: 600; }
.ok { color: var(--vert); font-size: 13px; font-weight: 600; margin-top: 8px; }

.paiement { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; text-align: left; }
.paiement .icone { width: 42px; height: 30px; border-radius: 6px; background: var(--doux); display: grid; place-items: center; font-size: 18px; }
.paiement .texte { flex: 1; font-weight: 600; }
.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ligne); }
.radio.actif { border: 7px solid var(--encre); }

.recap div { display: flex; justify-content: space-between; padding: 4px 0; color: var(--gris); }
.recap .remise { color: var(--vert); }
.recap .total { color: var(--encre); font-weight: 800; font-size: 18px; padding-top: 10px; }

.bouton-principal {
  display: block; width: calc(100% - 40px); margin: 20px; padding: 17px; border-radius: 14px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; text-align: center;
  box-shadow: 0 8px 20px rgba(255, 77, 46, .35);
}
.bouton-principal:active { transform: scale(.98); background: var(--accent-fonce); }
.bouton-secondaire { display: block; width: calc(100% - 40px); margin: 0 20px; padding: 15px; border-radius: 14px; background: var(--doux); font-weight: 600; }

/* ---- Suivi ---- */
/* La carte isole ses calques : ils ne passent pas devant les onglets. */
.carte-suivi { position: relative; height: 54vh; height: 54dvh; min-height: 320px; background: #eef0f3; isolation: isolate; z-index: 0; }
.carte-suivi #carte { position: absolute; inset: 0; }
.carte-suivi .retour { z-index: 1000; top: calc(16px + env(safe-area-inset-top)); }
.maplibregl-map { font-family: inherit; }
/* Mention OpenStreetMap obligatoire : gardée, mais au-dessus du panneau qui recouvre le bas. */
.maplibregl-ctrl-bottom-right { bottom: 30px; }
.maplibregl-ctrl-attrib { font-size: 10px; }
.pin-vehicule {
  width: 42px; height: 42px; border-radius: 50%; background: #fff; display: grid; place-items: center;
  font-size: 22px; box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
.pin-dest {
  position: relative; width: 44px; height: 44px; border-radius: 50%; background: #fff;
  border: 3px solid var(--accent); display: grid; place-items: center; font-size: 19px;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.pin-dest::before {
  content: ""; position: absolute; inset: -14px; border-radius: 50%; background: var(--accent);
  opacity: 0; z-index: -1; animation: onde 2s ease-out infinite;
}
@keyframes onde { from { transform: scale(.5); opacity: .35; } to { transform: scale(1.3); opacity: 0; } }
.pin-base { width: 14px; height: 14px; border-radius: 4px; background: var(--encre); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.panneau {
  position: relative; z-index: 1; margin-top: -28px; background: #fff; border-radius: 26px 26px 0 0;
  padding: 22px 20px 8px; box-shadow: 0 -8px 24px rgba(0,0,0,.06);
}
.panneau .poignee { width: 40px; height: 5px; border-radius: 3px; background: var(--ligne); margin: -10px auto 14px; }
.eta { font-size: 13px; color: var(--gris); font-weight: 600; }
.statut { font-size: 24px; font-weight: 800; letter-spacing: -.03em; margin: 2px 0 4px; }
.statut-detail { color: var(--gris); min-height: 40px; }
.progression { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 16px 0 8px; }
.progression span { height: 5px; border-radius: 3px; background: var(--ligne); overflow: hidden; position: relative; }
.progression span.fait { background: var(--encre); }
.progression span.encours::after { content: ""; position: absolute; inset: 0; background: var(--accent); animation: charge 1.4s ease-in-out infinite; }
@keyframes charge { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.livreur { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-top: 1px solid var(--ligne); margin-top: 12px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; color: #fff; }
.livreur .texte { flex: 1; }
.livreur .sous { color: var(--gris); font-size: 13px; }
.rond { width: 42px; height: 42px; border-radius: 50%; background: var(--doux); display: grid; place-items: center; }
.rond svg { width: 20px; height: 20px; }

.etapes { list-style: none; padding: 0; margin: 4px 0 0; }
.etapes li { display: flex; gap: 12px; align-items: center; padding: 7px 0; color: var(--gris-clair); }
.etapes li .point { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ligne); display: grid; place-items: center; font-size: 12px; flex: none; }
.etapes li.fait { color: var(--encre); }
.etapes li.fait .point { background: var(--encre); border-color: var(--encre); color: #fff; }
.etapes li.encours { color: var(--encre); font-weight: 700; }
.etapes li.encours .point { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-doux); }

.fin { text-align: center; padding: 8px 0 4px; animation: monte .4s ease-out; }
.fin .gros { font-size: 64px; }
.etoiles { display: flex; justify-content: center; gap: 6px; margin: 14px 0 6px; }
.etoiles button { font-size: 32px; filter: grayscale(1); opacity: .4; transition: transform .15s; }
.etoiles button.actif { filter: none; opacity: 1; transform: scale(1.1); }

/* ---- Commandes / compte ---- */
.page-titre { font-size: 30px; letter-spacing: -.03em; padding: calc(24px + env(safe-area-inset-top)) 20px 12px; }
.commande { display: flex; align-items: center; gap: 14px; padding: 14px 20px; width: 100%; text-align: left; border-bottom: 1px solid var(--ligne); }
.commande .vignette { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-size: 28px; flex: none; }
.commande .texte { flex: 1; }
.commande .sous { color: var(--gris); font-size: 13px; }
.profil { display: flex; align-items: center; gap: 14px; padding: 0 20px 16px; }
.profil .avatar { width: 64px; height: 64px; font-size: 32px; background: var(--accent); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 20px; }
.stats div { background: var(--doux); border-radius: var(--rayon); padding: 16px; }
.stats strong { display: block; font-size: 24px; letter-spacing: -.03em; }
.stats span { color: var(--gris); font-size: 13px; }
.fidelite { margin: 16px 20px; padding: 18px; border-radius: 20px; background: linear-gradient(120deg, #1f2937, #4b5563); color: #fff; }
.fidelite .jauge { height: 8px; background: rgba(255,255,255,.2); border-radius: 4px; margin-top: 12px; overflow: hidden; }
.fidelite .jauge span { display: block; height: 100%; background: linear-gradient(90deg, #fbbf24, #f59e0b); border-radius: 4px; }
.menu-compte button { display: flex; justify-content: space-between; width: 100%; padding: 16px 20px; border-bottom: 1px solid var(--ligne); font-weight: 500; }

/* ---- Feuille, chargement, toast ---- */
.voile { position: absolute; inset: 0; background: rgba(0,0,0,.4); z-index: 30; display: flex; align-items: flex-end; animation: fondu .2s; }
@keyframes fondu { from { opacity: 0; } }
.feuille { background: #fff; width: 100%; border-radius: 24px 24px 0 0; padding: 10px 0 28px; animation: monte .25s ease-out; }
.feuille h2 { padding: 10px 20px 8px; font-size: 18px; }
.feuille .choix { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 20px; text-align: left; font-weight: 500; }
.feuille .choix .emo { width: 40px; height: 40px; border-radius: 12px; background: var(--doux); display: grid; place-items: center; font-size: 20px; }
.feuille .choix .texte { flex: 1; }

.chargement { position: absolute; inset: 0; z-index: 40; background: rgba(255,255,255,.96); display: grid; place-items: center; text-align: center; animation: fondu .2s; }
.chargement .spinner { width: 54px; height: 54px; border-radius: 50%; border: 5px solid var(--doux); border-top-color: var(--accent); animation: tourne .8s linear infinite; margin: 0 auto 18px; }
.chargement p { color: var(--gris); margin-top: 4px; }
@keyframes tourne { to { transform: rotate(360deg); } }

#toast {
  position: absolute; left: 50%; top: calc(18px + env(safe-area-inset-top)); z-index: 50;
  transform: translate(-50%, calc(-100% - 40px)); visibility: hidden;
  background: var(--encre); color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 14px;
  width: max-content; max-width: calc(100% - 32px); box-shadow: var(--ombre); transition: transform .3s ease, visibility .3s;
}
#toast.visible { transform: translate(-50%, 0); visibility: visible; }
