/* =========================================================
   Komande POC - Clean CSS (compatible vieux Chrome Android)
   - Light par défaut + dark auto
   - Barres opaques (pas de blur/transparence)
   - Modales plein écran + masque header/footer quand ouvertes
   ========================================================= */

/* Variables */
:root{
  /* Light (par défaut) */
  --bg:#fff8ee;
  --card:#ffffff;
  --card2:#fff1dc;
  --text:#111827;
  --muted:#374151;
  --line:#f1d9b5;

  --primary:#16a34a;   /* WhatsApp green */
  --primary2:#15803d;

  --danger:#dc2626;
  --radius:18px;
}

/* Dark si supporté par l’appareil/navigateur */
@media (prefers-color-scheme: dark){
  :root{
    --bg:#0b0c10;
    --card:#11131a;
    --card2:#0f1117;
    --text:#e9ecf1;
    --muted:#a7b0c0;
    --line:#222637;

    --primary:#22c55e;
    --primary2:#16a34a;
  }
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a{ color:inherit; text-decoration:none; }

/* ---------------------------------------------------------
   Banner
--------------------------------------------------------- */
.banner{
  margin:10px 12px;
  padding:12px 14px;
  background:linear-gradient(90deg,#fde68a,#fca5a5,#86efac);
  border-radius:16px;
  font-weight:800;
  text-align:center;
}

/* ---------------------------------------------------------
   Topbar / Bottombar (OPAQUES, pas de blur)
--------------------------------------------------------- */
.topbar{
  position:sticky;
  top:0;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 14px;
  background: var(--card);                 /* opaque */
  border-bottom:1px solid var(--line);
  z-index:10;
}

.brand__name{ font-weight:800; font-size:16px; letter-spacing:.2px; }
.brand__meta{ font-size:12px; color:var(--muted); margin-top:2px; }

.container{
  padding:12px 12px 96px;                  /* espace pour la bottombar */
  max-width: 860px;
  margin:0 auto;
}

.bottombar{
  position:fixed;
  left:0; right:0; bottom:0;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  background: var(--card);                 /* opaque */
  border-top:1px solid var(--line);
  z-index:10;
}

.bottombar__left{ display:flex; flex-direction:column; gap:3px; }
.small{ font-size:12px; color:var(--muted); }
.total{ font-size:14px; font-weight:900; }

/* ---------------------------------------------------------
   Hero
--------------------------------------------------------- */
.hero{ margin:8px 0 14px; }

.hero__card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:14px;
}

.hero__title{ font-size:14px; font-weight:800; }
.hero__sub{ font-size:12px; color:var(--muted); margin-top:6px; line-height:1.35; }

/* ---------------------------------------------------------
   Menu
--------------------------------------------------------- */
.menu{ display:flex; flex-direction:column; gap:12px; }

.category{
  background:var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  overflow:hidden;
}

.category__head{
  padding:12px 12px 10px;
  border-bottom:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:10px;
}

.category__title{ font-weight:900; }
.category__hint{ font-size:12px; color:var(--muted); }

.items{ display:flex; flex-direction:column; }

.item{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:12px;
  border-top:1px solid var(--line);
}
.item:first-child{ border-top:none; }

.item__left{ min-width:0; }
.item__name{ font-weight:800; }
.item__desc{ font-size:12px; color:var(--muted); margin-top:4px; line-height:1.35; }
.item__price{ font-weight:900; margin-top:6px; }

.item__right{ display:flex; align-items:center; gap:10px; }

.qty{
  display:flex;
  align-items:center;
  gap:8px;
  background:var(--card2);
  border:1px solid var(--line);
  border-radius:999px;
  padding:6px 8px;
}

.qty button{
  width:34px; height:34px;
  border-radius:999px;
  border:1px solid var(--line);
  background:transparent;
  color:var(--text);
  font-size:18px;
}
.qty button:active{ transform:scale(.92); }
.qty .count{ width:20px; text-align:center; font-weight:900; }

.badge{
  font-size:11px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  color:var(--muted);
}

/* ---------------------------------------------------------
   Buttons
--------------------------------------------------------- */
button{
  cursor:pointer;
  border:none;
  border-radius:12px;
  padding:12px 14px;
  font-weight:900;
}

.primary{
  background:linear-gradient(180deg, var(--primary), var(--primary2));
  color:#fff;
}

.secondary{
  background:transparent;
  border:1px solid var(--line);
  color:var(--text);
}

.ghost{
  background:transparent;
  border:1px solid var(--line);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
}

button:disabled{
  opacity:0.5;
  cursor:not-allowed;
}

/* ---------------------------------------------------------
   Modal (plein écran, lisible vieux Chrome)
--------------------------------------------------------- */
.modal{
  position:fixed;
  inset:0;
  display:none;
  z-index:2000; /* au-dessus de header/footer */
}
.modal[aria-hidden="false"]{ display:block; }

.modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.60);
}

.modal__sheet{
  position:absolute;
  inset:0;                             /* plein écran */
  background:var(--card);              /* opaque */
  display:flex;
  flex-direction:column;
}

.modal__header{
  position:relative;
  padding:12px;
  border-bottom:1px solid var(--line);
}

.modal__title{ font-weight:900; }
.modal__sub{ font-size:12px; color:var(--muted); margin-top:2px; }

.modal__body{
  padding:12px;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:12px;
  background:var(--card);              /* opaque */
}

.modal__footer{
  padding:12px;
  display:flex;
  gap:10px;
  border-top:1px solid var(--line);
  background:var(--card);              /* opaque */
}
.modal__footer button{ flex:1; }

/* Boutons Fermer (infos + panier) */
#btnCloseInfo,
#btnCloseCart{
  position:absolute;
  top:12px;
  right:12px;

  width:100px;
  height:36px;

  display:flex;
  align-items:center;
  justify-content:center;

  background:#fee2e2;
  color:#b91c1c;
  border:1px solid #fecaca;
  border-radius:999px;

  font-size:14px;
  font-weight:900;
  padding:0;
}

#btnCloseInfo:active,
#btnCloseCart:active{
  background:#fecaca;
  transform:scale(.98);
}

/* ---------------------------------------------------------
   Cart lines
--------------------------------------------------------- */
.cartLines{ display:flex; flex-direction:column; gap:10px; }

.cartLine{
  display:flex;
  justify-content:space-between;
  gap:10px;
  background:var(--card2);
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px;
}

.cartLine__name{ font-weight:900; }
.cartLine__meta{ font-size:12px; color:var(--muted); margin-top:3px; }
.cartLine__right{ display:flex; align-items:center; gap:10px; }
.cartLine__price{ font-weight:900; }

/* ---------------------------------------------------------
   Fields
--------------------------------------------------------- */
.field label{ display:block; font-size:12px; color:var(--muted); margin:0 0 6px; }

input, textarea{
  width:100%;
  background:var(--card2);
  border:1px solid var(--line);
  color:var(--text);
  border-radius:12px;
  padding:12px;
  font-size:14px;
  outline:none;
}
textarea{ resize:vertical; }

/* ---------------------------------------------------------
   Segmented buttons (emoji + texte)
--------------------------------------------------------- */
.seg{ display:flex; gap:8px; flex-wrap:wrap; }

.seg__btn{
  flex:1;
  min-width: 140px;
  padding:10px 12px;
  background:transparent;
  border:1px solid var(--line);
  color:var(--text);
  border-radius:999px;
  font-weight:900;

  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;   /* espace emoji/texte */
}

.seg__btn--active{
  border-color: rgba(22,163,74,.55);
  box-shadow: 0 0 0 2px rgba(22,163,74,.15) inset;
}

/* ---------------------------------------------------------
   Option B: masquer header/footer quand une modale est ouverte
--------------------------------------------------------- */
body.modal-open .topbar,
body.modal-open .bottombar{
  display:none !important;
}


/* ===== Fix "panier grisé" : sheet 100% opaque au-dessus du backdrop ===== */
.modal{
  z-index: 2000 !important;
}

.modal__backdrop{
  z-index: 0 !important;
}

.modal__sheet{
  z-index: 1 !important;
  background: var(--card) !important;
  opacity: 1 !important;
  filter: none !important;
}

/* Sécurité : si un parent a une opacité, on évite les effets */
.modal__header,
.modal__body,
.modal__footer{
  background: var(--card) !important;
  opacity: 1 !important;
}


/* Champs en 1 ligne : label à gauche, input à droite */
.field{
  display: flex;
  align-items: center;
  gap: 10px;
}

.field label{
  margin: 0 !important;
  width: 110px;          /* ajuste si besoin */
  flex: 0 0 110px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field textarea{
  flex: 1;
}

/* textarea moins haute pour mobile */
.field textarea{
  min-height: 38px;
}

/* @media (max-width: 360px){ */
  /* .field{ flex-direction: column; align-items: stretch; } */
  /* .field label{ width:auto; flex:auto; } */
/* } */

/* Titre discret au-dessus des champs */
.form-section{
  margin-top: 6px;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

/* Bouton Appeler – visible en light & dark */
.btn-call,
#btnCall,
#btnInfoCall{
  background-color: #2563eb;   /* bleu */
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 10px rgba(37,99,235,.25);
}

/* Dark mode : un peu plus lumineux */
@media (prefers-color-scheme: dark){
  .btn-call,
  #btnCall,
  #btnInfoCall{
    background-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59,130,246,.35);
  }
}

/* Feedback au toucher */
.btn-call:active,
#btnCall:active,
#btnInfoCall:active{
  transform: scale(0.97);
  opacity: 0.95;
}
