:root{
  --bg:#f5f1e8; --surface:#ffffff; --ink:#22201c; --muted:#77706690; --muted2:#8a8377;
  --line:#e7e0d2; --accent:#0e93cc; --accent-d:#0a6f9e;
  --vin:#7c2d4a; --biere:#c07a12; --soft:#1f7a86; --ok:#2f7d4f; --ok-d:#256540;
  --warn:#b4520e; --shadow:0 6px 20px rgba(40,30,20,.12);
  --r:16px; --tap:#0000000d;
  font-size:16px;
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html,body{margin:0; height:100%;}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg); color:var(--ink);
  overscroll-behavior:none; -webkit-font-smoothing:antialiased;
}
button{font-family:inherit; cursor:pointer; border:none; background:none; color:inherit;}
.hidden{display:none !important;}

/* ---------- Screens ---------- */
.screen{min-height:100%; display:flex; flex-direction:column;}

/* ---------- Top bar ---------- */
.topbar{
  position:sticky; top:0; z-index:30;
  background:linear-gradient(180deg,var(--accent),var(--accent-d));
  color:#fff; padding:calc(env(safe-area-inset-top) + 10px) 12px 10px;
  display:flex; align-items:center; gap:10px; box-shadow:0 2px 10px rgba(0,0,0,.15);
}
.brand{font-weight:800; font-size:1.05rem; letter-spacing:.2px; display:flex; align-items:center; gap:8px;}
.brand .dot{width:10px;height:10px;border-radius:50%;background:#ffd24a;box-shadow:0 0 0 3px #ffffff30;}
.user-chip{
  margin-left:auto; display:flex; align-items:center; gap:7px;
  background:#ffffff22; border:1px solid #ffffff33; color:#fff;
  padding:7px 11px; border-radius:999px; font-weight:600; font-size:.9rem; max-width:46vw;
}
.user-chip .name{white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.user-chip svg{flex:none;}
.icon-btn{
  width:40px;height:40px;border-radius:12px;background:#ffffff1f;border:1px solid #ffffff26;
  color:#fff; display:grid; place-items:center; flex:none;
}
.icon-btn:active{background:#ffffff33;}

.demo-flag{
  background:#ffd24a; color:#5b3d00; font-weight:700; font-size:.72rem; text-align:center;
  padding:3px 8px; letter-spacing:.3px;
}

/* ---------- Bandeau message (gate non bloquant) ---------- */
.gate-banner{
  background:#fff7dd; color:#6a4a00; border-bottom:1px solid #eadaa5;
  padding:10px 12px; font-size:.86rem; display:flex; align-items:flex-start; gap:10px;
}
.gate-banner .gb-body{flex:1;}
.gate-banner b{display:block; font-size:.9rem;}
.gate-banner a{color:var(--accent-d); font-weight:700;}
.gate-banner .gb-close{width:30px;height:30px;border-radius:9px;background:#00000010; display:grid; place-items:center; flex:none; font-weight:700;}

/* ---------- Product area ---------- */
.products{flex:1; overflow-y:auto; padding:12px 12px 150px; -webkit-overflow-scrolling:touch;}
.cat{margin:2px 0 14px;}
.cat-head{
  display:flex; align-items:center; gap:8px; margin:6px 2px 9px; font-weight:800; font-size:.95rem;
  text-transform:uppercase; letter-spacing:.6px;
}
.cat-head .bar{width:26px;height:5px;border-radius:3px;}
.grid{display:grid; grid-template-columns:repeat(2,1fr); gap:10px;}
.tile{
  position:relative; background:var(--surface); border-radius:var(--r);
  border:1px solid var(--line); box-shadow:0 1px 2px rgba(0,0,0,.04);
  min-height:88px; padding:12px 12px 11px; text-align:left;
  display:flex; flex-direction:column; justify-content:space-between; gap:6px;
  transition:transform .06s ease;
  border-left:6px solid var(--tilecol,#ccc);
}
.tile:active{transform:scale(.97); background:#fbf8f2;}
.tile .pname{font-weight:700; font-size:1rem; line-height:1.2;}
.tile .pprice{font-weight:800; font-size:1.05rem; color:var(--ink);}
.tile .psub{font-size:.72rem; color:var(--muted2); font-weight:600;}
.tile .badge{
  position:absolute; top:-9px; right:-9px; min-width:26px; height:26px; padding:0 6px;
  background:var(--accent); color:#fff; border-radius:999px; font-weight:800; font-size:.85rem;
  display:grid; place-items:center; box-shadow:0 3px 8px rgba(0,0,0,.22); border:2px solid #fff;
}
.free{color:var(--soft);}

/* ---------- Cart bar ---------- */
.cartbar{
  position:fixed; left:0; right:0; bottom:0; z-index:40;
  padding:10px 12px calc(env(safe-area-inset-bottom) + 12px);
  background:linear-gradient(180deg,#ffffffd8,#fffffff2); backdrop-filter:blur(8px);
  border-top:1px solid var(--line); box-shadow:0 -6px 20px rgba(30,20,10,.08);
}
.cartbar-row{display:flex; align-items:center; gap:12px;}
.cart-summary{flex:1; min-width:0;}
.cart-summary .lbl{font-size:.74rem; color:var(--muted2); font-weight:700; text-transform:uppercase; letter-spacing:.4px;}
.cart-summary .amt{font-size:1.5rem; font-weight:800; line-height:1.1;}
.cart-summary .amt.refund{color:var(--warn);}
.btn-pay{
  background:linear-gradient(180deg,var(--ok),var(--ok-d)); color:#fff; font-weight:800;
  padding:15px 20px; border-radius:14px; font-size:1.05rem; box-shadow:var(--shadow);
  display:flex; align-items:center; gap:9px;
}
.btn-pay:disabled{background:#c8c2b6; box-shadow:none;}
.btn-pay:active{transform:translateY(1px);}
.cart-count{
  display:inline-flex; align-items:center; gap:6px; margin-top:4px; font-size:.8rem; color:var(--muted2); font-weight:600;
}
.link-cart{color:var(--accent); font-weight:700; text-decoration:underline;}

/* ---------- Sheet / modal ---------- */
.scrim{position:fixed; inset:0; background:#241d1466; z-index:50; opacity:0; pointer-events:none; transition:opacity .18s;}
.scrim.show{opacity:1; pointer-events:auto;}
.sheet{
  position:fixed; left:0; right:0; bottom:0; z-index:60; background:var(--bg);
  border-radius:22px 22px 0 0; box-shadow:0 -10px 40px rgba(0,0,0,.25);
  transform:translateY(110%); transition:transform .24s cubic-bezier(.2,.8,.2,1);
  max-height:92vh; display:flex; flex-direction:column;
  padding-bottom:calc(env(safe-area-inset-bottom) + 10px);
}
.sheet.show{transform:translateY(0);}
.sheet-grip{width:44px;height:5px;border-radius:3px;background:#0000001f;margin:9px auto 4px;}
.sheet-head{display:flex; align-items:center; padding:6px 16px 10px; gap:10px;}
.sheet-head h2{margin:0; font-size:1.2rem; font-weight:800;}
.sheet-head .close{margin-left:auto; width:36px;height:36px;border-radius:10px;background:#00000010; display:grid; place-items:center;}
.sheet-body{overflow-y:auto; padding:0 16px 8px;}

.cart-line{display:flex; align-items:center; gap:10px; padding:11px 0; border-bottom:1px solid var(--line);}
.cart-line .ci-name{flex:1; min-width:0;}
.cart-line .ci-name b{display:block; font-size:.98rem;}
.cart-line .ci-name span{font-size:.78rem; color:var(--muted2);}
.stepper{display:flex; align-items:center; gap:0; background:#fff; border:1px solid var(--line); border-radius:12px; overflow:hidden;}
.stepper button{width:38px;height:38px;font-size:1.3rem;font-weight:700; display:grid; place-items:center; color:var(--accent);}
.stepper button:active{background:#00000010;}
.stepper .q{min-width:30px; text-align:center; font-weight:800; font-size:1rem;}
.ci-price{width:64px; text-align:right; font-weight:800; font-size:.98rem;}
.ci-remove{width:34px;height:34px;border-radius:9px;background:#00000008; display:grid; place-items:center; color:#b23; flex:none;}
.ci-trash{width:40px;height:40px;border-radius:11px;background:#f6e5e5;color:#b23; display:grid; place-items:center; font-size:1.05rem; flex:none;}
.ci-trash:active{background:#efd3d3;}
.glass-chip{display:inline-flex; align-items:center; gap:6px; margin-top:6px; background:#f6ead6; color:#8a5a12; border:1px solid #e6d3b8; border-radius:999px; padding:6px 11px; font-size:.8rem; font-weight:800;}
.glass-chip:active{background:#efdcbf;}
.cash-manual{width:100%; padding:14px; border:1.5px solid var(--line); border-radius:12px; font-size:1.1rem; text-align:center; margin:6px 0 2px; background:#fff; font-weight:700;}
.cash-manual:focus{outline:none; border-color:var(--ok);}
.cash-manual::placeholder{font-weight:600; color:var(--muted2);}

.consigne-box{background:#fff; border:1px solid var(--line); border-radius:14px; padding:12px 14px; margin:14px 0;}
.consigne-row{display:flex; align-items:center; gap:10px; padding:6px 0;}
.consigne-row .cl{flex:1;}
.consigne-row .cl b{display:block; font-size:.95rem;}
.consigne-row .cl span{font-size:.76rem; color:var(--muted2);}
.consigne-row .val{font-weight:800;}
.hint{font-size:.78rem; color:var(--muted2); line-height:1.35;}

.totalcard{background:#fff; border:2px solid var(--ink); border-radius:16px; padding:14px 16px; margin:8px 0 14px;}
.totalcard .tt-row{display:flex; justify-content:space-between; padding:3px 0; font-size:.9rem; color:#4a453d;}
.totalcard .tt-net{display:flex; justify-content:space-between; align-items:baseline; margin-top:8px; padding-top:10px; border-top:1px dashed #00000022;}
.totalcard .tt-net .l{font-weight:800; font-size:1.05rem;}
.totalcard .tt-net .v{font-weight:900; font-size:1.7rem;}
.totalcard .tt-net .v.refund{color:var(--warn);}

.row-btns{display:flex; gap:10px; padding:4px 0 8px;}
.btn{padding:15px; border-radius:14px; font-weight:800; font-size:1rem; text-align:center;}
.row-btns .btn{flex:1;}
.btn-ghost{background:#00000008; color:#4a453d; border:1px solid var(--line);}
.btn-primary{background:linear-gradient(180deg,var(--ok),var(--ok-d)); color:#fff; box-shadow:var(--shadow);}
.btn-accent{background:linear-gradient(180deg,var(--accent),var(--accent-d)); color:#fff;}
.btn:active{transform:translateY(1px);}
.btn:disabled{opacity:.5;}
.menu-item{text-align:left; display:flex; align-items:center; gap:12px;}

/* ---------- Pay ---------- */
.pay-choice{display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:8px 0 4px;}
.pay-opt{background:#fff; border:1.5px solid var(--line); border-radius:16px; padding:20px 12px; display:flex; flex-direction:column; align-items:center; gap:8px; font-weight:800; font-size:1.05rem;}
.pay-opt .em{font-size:1.9rem;}
.pay-opt.sel{border-color:var(--ok); background:#f0f9f2;}
.pay-target{font-size:1.05rem; text-align:center; margin:6px 0;}
.pay-target b{font-size:2rem; display:block; margin-top:4px;}
.keypad{display:grid; grid-template-columns:repeat(3,1fr); gap:9px; margin:12px 0;}
.keypad button{background:#fff; border:1px solid var(--line); border-radius:12px; height:56px; font-size:1.35rem; font-weight:700;}
.keypad button:active{background:#00000010;}
.cash-display{background:#fff; border:1px solid var(--line); border-radius:14px; padding:12px 14px; margin:6px 0;}
.cash-display .cd-row{display:flex; justify-content:space-between; padding:4px 0; font-size:1rem;}
.cash-display .cd-row.rendu{border-top:1px dashed #00000022; margin-top:6px; padding-top:8px;}
.cash-display .cd-row.rendu b{font-size:1.5rem; color:var(--ok-d);}
.chips{display:flex; flex-wrap:wrap; gap:8px; margin:4px 0 6px;}
.chip{background:#fff; border:1px solid var(--line); border-radius:999px; padding:9px 14px; font-weight:700; font-size:.92rem;}
.chip:active{background:#00000010;}

/* ---------- Login ---------- */
.login{flex:1; display:flex; flex-direction:column; justify-content:flex-start; align-items:center; padding:34px 22px 40px; text-align:center; gap:4px; overflow-y:auto;}
.login .logo{width:64px;height:64px;border-radius:20px;background:linear-gradient(180deg,var(--accent),var(--accent-d)); display:grid; place-items:center; color:#fff; box-shadow:var(--shadow); margin-bottom:8px;}
.brand-logo{width:min(74vw,330px); height:auto; margin:6px 0 2px;}
.login h1{margin:6px 0 0; font-size:1.45rem;}
.login p{margin:2px 0 14px; color:var(--muted2);}
.field{width:100%; max-width:400px;}
.field input{width:100%; padding:15px; font-size:1.1rem; border:1.5px solid var(--line); border-radius:14px; background:#fff; text-align:center;}
.field input:focus{outline:none; border-color:var(--accent);}
.vol-list{display:flex; flex-wrap:wrap; gap:10px; justify-content:center; width:100%; max-width:440px; margin:16px 0 8px;}
.vol{display:flex; align-items:center; gap:9px; background:#fff; border:1px solid var(--line); border-radius:14px; padding:8px 15px 8px 8px; font-weight:700; font-size:1rem;}
.vol:active{background:#fbf3f3; border-color:var(--accent);}
.vol .av{width:34px;height:34px;border-radius:50%; display:grid; place-items:center; color:#fff; font-weight:800; font-size:.9rem; flex:none;}
.vol-empty{color:var(--muted2); font-size:.86rem; margin:10px 0;}
.add-btn{width:100%; max-width:400px; margin:8px 0 0;}
.add-panel{width:100%; max-width:400px; background:#fff; border:1px solid var(--line); border-radius:16px; padding:16px; margin:12px 0 0; box-shadow:var(--shadow);}
.add-panel p{margin:0 0 12px; color:var(--ink); font-size:.92rem;}
.add-panel .init-row{display:flex; align-items:center; gap:10px; justify-content:center;}
.init-input{width:64px; height:56px; text-align:center; font-size:1.6rem; font-weight:800; text-transform:uppercase; border:1.5px solid var(--line); border-radius:12px; background:#fff;}
.init-input:focus{outline:none; border-color:var(--accent);}

/* ---------- Closed / Block pages ---------- */
.closed{flex:1; display:flex; flex-direction:column; justify-content:center; align-items:center; padding:34px 26px; text-align:center; gap:12px;
  background:radial-gradient(120% 80% at 50% 0%, #2bb3e5 0%, #0b86bd 55%, #076a97 100%); color:#fff; min-height:100%;}
.closed .big{font-size:3.4rem;}
.closed h1{margin:6px 0 0; font-size:1.7rem;}
.closed p{margin:0; color:#ffffffcf; font-size:1.05rem; line-height:1.5; max-width:340px;}
.closed .next{margin-top:14px; background:#ffffff1c; border:1px solid #ffffff33; border-radius:14px; padding:14px 18px; font-weight:700;}
.closed .lights{font-size:1.4rem; letter-spacing:6px; opacity:.9;}
.closed-admin{margin-top:26px; color:#ffffff9a; font-size:.85rem; font-weight:600; text-decoration:underline;}
.closed-retry{margin-top:18px; background:#ffffff22; border:1px solid #ffffff44; color:#fff; font-weight:800; padding:13px 26px; border-radius:14px; font-size:1rem;}
.closed .block-link{display:inline-block; margin-top:10px; background:#fff; color:var(--accent-d); font-weight:800; padding:13px 26px; border-radius:14px; text-decoration:none;}

/* ---------- Bandeau d'incitation à installer (mode navigateur uniquement) ---------- */
.install-promo{
  background:#e7f4fb; color:#0a5a80; border-bottom:1px solid #c3e2f2;
  padding:10px 12px; font-size:.84rem; display:flex; align-items:center; gap:10px; line-height:1.35;
}
.install-promo .ip-body{flex:1; cursor:pointer;}
.install-promo .ip-body b{display:block; font-size:.88rem;}
.install-promo .ip-btn{
  flex:none; background:linear-gradient(180deg,var(--accent),var(--accent-d)); color:#fff;
  font-weight:800; font-size:.84rem; padding:9px 14px; border-radius:10px;
}
.install-promo .ip-close{width:30px;height:30px;border-radius:9px;background:#00000010; display:grid; place-items:center; flex:none; font-weight:700;}
.install-card{
  width:100%; max-width:400px; display:flex; align-items:center; gap:12px; text-align:left;
  background:#e7f4fb; border:1px solid #c3e2f2; border-radius:14px; padding:12px 14px; margin:14px 0 0;
  color:#0a5a80; font-size:.85rem; line-height:1.4;
}
.install-card .ic-emoji{font-size:1.5rem; flex:none;}
.install-card .ic-txt b{display:block; font-size:.92rem;}
.install-card:active{background:#d9edf8;}

/* ---------- Install help ---------- */
.install-block{background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px 16px; margin:10px 0;}
.install-block b{font-size:.98rem;}
.install-block .ib-title{display:flex; align-items:center; gap:9px;}
.brw{width:22px; height:22px; flex:none;}
.brw-globe{display:grid; place-items:center; font-size:1.15rem;}
.install-block ol{margin:8px 0 0; padding-left:20px; font-size:.9rem; line-height:1.6; color:#4a453d;}
.ios-share{display:inline-grid; place-items:center; width:22px; height:22px; border:1.5px solid var(--accent); border-radius:6px; color:var(--accent); font-size:.85rem; font-weight:800;}

/* ---------- QR ---------- */
.qr-wrap{background:#fff; border:1px solid var(--line); border-radius:18px; padding:18px; text-align:center; margin:6px 0;}
.qr-box{width:210px;height:210px;margin:0 auto 12px;}
.qr-box svg{width:100%;height:100%;}
.qr-url{font-weight:700; word-break:break-all; font-size:.95rem;}
.state-pill{display:inline-flex; align-items:center; gap:7px; padding:8px 14px; border-radius:999px; font-weight:800; font-size:.9rem;}
.state-open{background:#e8f3ec; color:var(--ok-d);} .state-closed{background:#f6e5e5; color:var(--accent);}

.toast{position:fixed; left:50%; bottom:26px; z-index:90;
  /* masqué : entièrement sous l'écran (100% de sa hauteur + le décalage bottom + marge),
     invisible et non cliquable pour ne jamais gêner les boutons du bas */
  transform:translate(-50%,calc(100% + 40px)); visibility:hidden; pointer-events:none;
  background:var(--ink); color:#fff; padding:14px 20px; border-radius:14px; font-weight:700; box-shadow:var(--shadow);
  display:flex; align-items:center; gap:10px; max-width:88vw;
  transition:transform .28s cubic-bezier(.2,.9,.2,1), visibility 0s linear .28s;}
.toast.show{transform:translate(-50%,0); visibility:visible; pointer-events:auto;
  transition:transform .28s cubic-bezier(.2,.9,.2,1);}
.toast.ok{background:var(--ok-d);}
.toast-act{margin-left:4px; background:#ffffff26; border:1px solid #ffffff40; color:#fff; font-weight:800; padding:8px 14px; border-radius:10px; font-size:.92rem;}
.toast-act:active{background:#ffffff40;}

.kbd-hint{font-size:.74rem; color:var(--muted2); text-align:center; padding:6px 0 2px;}
