@charset "UTF-8";
:root {
  --bg: #0b0a09;
  --bg-2: #15130f;
  --card: #1b1814;
  --line: #2b2721;
  --text: #f6f1e7;
  --muted: #a69e90;
  --green: #7dc243;
  --green-d: #2e8b3e;
  --orange: #f7941d;
  --orange-d: #e9582a;
  --pink: #e8506e;
  --gold: #f6b026;
  --radius: 22px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Outfit', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
body { min-height: 100dvh; overflow-x: hidden; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: var(--text); }
[hidden] { display: none !important; }

/* =================== SPLASH : animation du logo =================== */
#splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: radial-gradient(60% 50% at 50% 45%, #1a140e 0%, var(--bg) 70%);
  transition: opacity .7s ease, transform .9s cubic-bezier(.7, 0, .2, 1);
}
#splash.out { opacity: 0; transform: translateY(-6%) scale(1.04); pointer-events: none; }
.logo-stage { position: relative; width: min(86vw, 520px); aspect-ratio: 1070 / 715; }
.logo-stage img { position: absolute; display: block; user-select: none; }
.lg-word { left: 0; top: 34.27%; width: 100%; opacity: 0; transform: scale(.55); filter: blur(10px);
  animation: wordIn 1s cubic-bezier(.2, 1.4, .4, 1) .15s forwards; }
.lg-pan { left: 41.12%; top: 0; width: 40.19%; opacity: 0; transform: translateY(-120%) rotate(-18deg);
  transform-origin: 50% 80%;
  animation: panDrop .9s cubic-bezier(.3, 1.6, .5, 1) .85s forwards, panFlick 1.6s ease-in-out 1.9s infinite; }
.lg-tagline { position: absolute; left: .93%; top: 90.2%; width: 99.07%; }
.lg-line { display: none; }
.lg-tag { position: relative !important; width: 100%; clip-path: inset(0 100% 0 0);
  animation: wipe .9s cubic-bezier(.6, 0, .2, 1) 1.65s forwards; }
.sparks { position: absolute; left: 61%; top: 22%; }
.sparks i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); opacity: 0;
  box-shadow: 0 0 10px var(--orange); animation: spark 1.4s ease-out infinite; }
.sparks i:nth-child(1) { animation-delay: 1.7s; --x: -40px; }
.sparks i:nth-child(2) { animation-delay: 1.95s; --x: 30px; }
.sparks i:nth-child(3) { animation-delay: 2.2s; --x: -10px; }
.sparks i:nth-child(4) { animation-delay: 2.4s; --x: 45px; }
.sparks i:nth-child(5) { animation-delay: 2.65s; --x: -30px; }
.sparks i:nth-child(6) { animation-delay: 2.9s; --x: 12px; }
.skip { position: absolute; bottom: max(28px, env(safe-area-inset-bottom)); right: 22px; color: var(--muted); font-size: 14px; padding: 8px 12px; }
@keyframes wordIn { to { opacity: 1; transform: none; filter: none; } }
@keyframes panDrop { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes panFlick { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-3deg) translateY(-2%); } }
@keyframes wipe { to { clip-path: inset(0 0 0 0); } }
@keyframes spark { 0% { opacity: 0; transform: translate(0, 0) scale(1); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), -90px) scale(.2); } }

/* =================== APP =================== */
#app { max-width: 560px; margin: 0 auto; padding: 0 16px 120px; animation: appIn .8s ease both; }
@keyframes appIn { from { opacity: 0; transform: translateY(18px); } }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; background: linear-gradient(var(--bg) 70%, transparent); }
.top-logo { height: 46px; }
.cart-btn { position: relative; width: 46px; height: 46px; border-radius: 50%; background: var(--card); display: grid; place-items: center; border: 1px solid var(--line); }
.badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--orange); color: #1b0f00;
  font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; transform: scale(0); transition: transform .3s cubic-bezier(.3, 1.8, .5, 1); }
.badge.on { transform: scale(1); }
.badge.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.5); } }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 14px; white-space: nowrap; transition: .25s; }
.chip[data-cat] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: pan-x; }
.chips.sorting { scroll-behavior: auto; }
.chips.sorting .chip:not(.dragging) { transition: transform .2s, background .25s; }
.chip.dragging { position: relative; z-index: 3; transition: none; transform-origin: center; box-shadow: 0 8px 22px #000a, 0 0 0 2px var(--gold); color: var(--text); cursor: grabbing; }
.chip.on { background: var(--green); color: #0e1a06; border-color: var(--green); font-weight: 600; }

/* ---------- Vitrine + transition entre plats ---------- */
.showcase { position: relative; }
.stage { position: relative; height: 470px; perspective: 1200px; }
.dish {
  position: absolute; inset: 0; border-radius: 28px; overflow: hidden; padding: 22px;
  background: radial-gradient(120% 70% at 50% 0%, var(--tint, #2a1f12) 0%, var(--card) 62%);
  border: 1px solid var(--line); display: flex; flex-direction: column;
}
.plate { position: relative; height: 210px; display: grid; place-items: center; }
.plate::before { content: ''; position: absolute; width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, #f6efe2 0 52%, #ded3c0 53% 60%, #f3ebdc 61% 68%, transparent 69%);
  box-shadow: 0 30px 50px -20px #000a; }
.plate .food { position: relative; font-size: 104px; line-height: 1; filter: drop-shadow(0 14px 12px #0007); }
.plate img.food { width: 170px; height: 170px; object-fit: cover; border-radius: 50%; }
.steam { position: absolute; top: 4px; left: 50%; display: flex; gap: 16px; transform: translateX(-50%); }
.steam i { width: 8px; height: 46px; border-radius: 8px; background: linear-gradient(transparent, #fff5); filter: blur(4px); opacity: 0; animation: steam 2.6s ease-in-out infinite; }
.steam i:nth-child(2) { animation-delay: .6s; } .steam i:nth-child(3) { animation-delay: 1.2s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(20px) scaleY(.6); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-30px) scaleY(1.2) skewX(12deg); } }
.dish-meta { margin-top: 8px; }
.tagrow { display: flex; gap: 6px; min-height: 22px; }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #f7941d22; color: var(--orange); font-weight: 600; }
.dish h3 { font-family: var(--serif); font-weight: 800; font-size: 30px; margin: 8px 0 6px; letter-spacing: -.01em; line-height: 1.05; }
.dish p { color: var(--muted); margin: 0; font-size: 15px; line-height: 1.45; min-height: 44px; }
.dish-buy { margin-top: auto; display: flex; align-items: center; gap: 12px; }
.price { font-family: var(--serif); font-size: 28px; font-weight: 800; color: var(--green); margin-right: auto; }
.price small { font-family: var(--sans); font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.qty { display: flex; align-items: center; background: #0006; border-radius: 999px; border: 1px solid var(--line); }
.qty button { width: 38px; height: 38px; font-size: 20px; }
.qty span { min-width: 22px; text-align: center; font-weight: 600; }
.add { height: 48px; padding: 0 20px; border-radius: 999px; font-weight: 700; color: #102006;
  background: linear-gradient(135deg, #9bd85b, var(--green) 50%, var(--green-d)); box-shadow: 0 10px 24px -10px var(--green); }
.add:active { transform: scale(.96); }

/* Animations de transition : sortie / entrée */
.dish.enter-next { animation: enterNext .75s cubic-bezier(.2, .9, .25, 1) both; }
.dish.enter-prev { animation: enterPrev .75s cubic-bezier(.2, .9, .25, 1) both; }
.dish.leave-next { animation: leaveNext .55s cubic-bezier(.6, 0, .8, .4) both; }
.dish.leave-prev { animation: leavePrev .55s cubic-bezier(.6, 0, .8, .4) both; }
.dish.enter-next .food, .dish.enter-prev .food { animation: plateSpin .9s cubic-bezier(.2, 1.3, .4, 1) both; }
.dish.enter-next .dish-meta > *, .dish.enter-prev .dish-meta > * { animation: rise .6s ease both; }
.dish-meta > :nth-child(2) { animation-delay: .12s !important; }
.dish-meta > :nth-child(3) { animation-delay: .2s !important; }
@keyframes enterNext { from { opacity: 0; transform: translateX(60%) rotateY(-28deg) scale(.85); filter: blur(6px); } }
@keyframes enterPrev { from { opacity: 0; transform: translateX(-60%) rotateY(28deg) scale(.85); filter: blur(6px); } }
@keyframes leaveNext { to { opacity: 0; transform: translateX(-55%) rotateY(24deg) scale(.82); filter: blur(6px); } }
@keyframes leavePrev { to { opacity: 0; transform: translateX(55%) rotateY(-24deg) scale(.82); filter: blur(6px); } }
@keyframes plateSpin { from { transform: rotate(-200deg) scale(.2); opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.flame-wipe { position: absolute; inset: 0; z-index: 3; pointer-events: none; display: grid; place-items: center; }
.flame-wipe img { width: 120px; animation: flamePass .8s ease both; }
@keyframes flamePass { 0% { opacity: 0; transform: scale(.4) translateY(30px); } 40% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.6) translateY(-40px); } }

.nav { position: absolute; top: 105px; z-index: 4; width: 42px; height: 42px; border-radius: 50%; background: #000a; border: 1px solid var(--line); font-size: 26px; line-height: 1; backdrop-filter: blur(6px); }
.prev { left: 8px; } .next { right: 8px; }
.dots { display: flex; justify-content: center; gap: 6px; margin: 14px 0 6px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line); transition: .35s; }
.dots i.on { width: 22px; background: var(--orange); }

.grid-wrap h2 { font-family: var(--serif); font-size: 22px; margin: 26px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 4px; transition: transform .2s; }
.tile:active { transform: scale(.97); }
.tile .e { font-size: 34px; }
.tile b { font-weight: 600; font-size: 14px; line-height: 1.2; }
.tile span { color: var(--green); font-weight: 600; font-size: 14px; }

.float-cart { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  width: min(calc(100% - 32px), 528px); height: 58px; border-radius: 999px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  background: linear-gradient(135deg, var(--orange), var(--orange-d)); color: #1d0b00; font-weight: 600; box-shadow: 0 16px 30px -12px var(--orange-d);
  animation: popUp .5s cubic-bezier(.3, 1.6, .5, 1); }
.float-cart b { font-family: var(--serif); font-size: 18px; }
@keyframes popUp { from { transform: translate(-50%, 120%); } }
.fab-ai { position: fixed; right: 16px; bottom: 90px; z-index: 19; display: flex; align-items: center; gap: 6px; padding: 10px 14px 10px 10px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line); box-shadow: 0 10px 30px #0008; font-size: 14px; }
.fab-ai span { font-size: 20px; }

/* =================== Panneau commande =================== */
.sheet-backdrop { position: fixed; inset: 0; background: #000a; z-index: 40; animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--bg-2); border-radius: 26px 26px 0 0; border: 1px solid var(--line); transform: translateY(105%); transition: transform .5s cubic-bezier(.2, .9, .2, 1); }
.sheet.open { transform: none; }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 10px auto 6px; }
.steps { display: flex; gap: 4px; padding: 6px 16px 10px; }
.steps span { flex: 1; font-size: 11px; color: var(--muted); text-align: center; padding-top: 8px; border-top: 3px solid var(--line); transition: .3s; }
.steps span.on { color: var(--text); border-color: var(--green); }
.steps span.done { border-color: var(--green-d); }
.sheet-body { overflow-y: auto; padding: 4px 16px 16px; flex: 1; }
.sheet-body > .pane { animation: paneIn .45s cubic-bezier(.2, .9, .3, 1); }
@keyframes paneIn { from { opacity: 0; transform: translateX(30px); } }
.sheet-foot { padding: 12px 16px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.sheet h3 { font-family: var(--serif); font-size: 24px; margin: 6px 0 14px; }
.sheet h4 { margin: 18px 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line .e { font-size: 28px; }
.line .n { flex: 1; } .line .n b { display: block; font-weight: 600; } .line .n small { color: var(--muted); }
.totals { margin-top: 14px; display: grid; gap: 6px; }
.totals div { display: flex; justify-content: space-between; color: var(--muted); }
.totals .grand { color: var(--text); font-size: 20px; font-weight: 700; padding-top: 8px; border-top: 1px dashed var(--line); }
.totals .grand span:last-child { color: var(--green); font-family: var(--serif); }
.btn { flex: 1; height: 54px; border-radius: 16px; font-weight: 700; font-size: 16px; color: #102006; background: linear-gradient(135deg, #9bd85b, var(--green) 55%, var(--green-d)); }
.btn:disabled { filter: grayscale(1) brightness(.6); }
.btn.ghost { flex: none; width: 54px; background: var(--card); color: var(--text); border: 1px solid var(--line); }
.choices { display: grid; gap: 10px; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choice { position: relative; text-align: left; padding: 14px; border-radius: 16px; background: var(--card); border: 1.5px solid var(--line); transition: .2s; display: flex; gap: 12px; align-items: center; }
.choice .ic { font-size: 26px; }
.choice b { display: block; font-weight: 600; }
.choice small { color: var(--muted); font-size: 13px; }
.choice.off { opacity: .45; cursor: not-allowed; filter: grayscale(1); border-style: dashed; }
.map-link { display: inline-block; margin-top: 8px; color: var(--green); font-weight: 600; }
.choice.on { border-color: var(--green); background: #7dc24314; }
.choice.on::after { content: '\2713'; position: absolute; right: 12px; top: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #0e1a06; font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; padding: 13px 14px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); outline: none; transition: border-color .2s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); }
.field textarea { resize: vertical; min-height: 70px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.map { width: 100%; height: 170px; border: 0; border-radius: 14px; margin-top: 8px; background: var(--card); }
.gps-status { font-size: 14px; color: var(--muted); margin-top: 8px; }
.gps-status.ok { color: var(--green); }
.pay-logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.success { text-align: center; padding: 20px 0 10px; }
.check { width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 50%; background: var(--green); display: grid; place-items: center; animation: popIn .6s cubic-bezier(.3, 1.8, .5, 1); }
.check svg { width: 50px; stroke: #0e1a06; stroke-width: 4; fill: none; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .5s .35s forwards; }
@keyframes popIn { from { transform: scale(0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success h3 { margin-bottom: 4px; }
.success .oid { font-family: var(--serif); font-size: 30px; color: var(--orange); }
.success p { color: var(--muted); }
.wa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 22px; border-radius: 16px; background: #25d366; color: #052e14; font-weight: 700; text-decoration: none; margin-top: 10px; }
.timeline { text-align: left; margin: 18px auto 0; max-width: 320px; }
.timeline div { display: flex; gap: 10px; align-items: center; padding: 6px 0; color: var(--muted); }
.timeline div.on { color: var(--text); }
.timeline i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); }
.timeline div.on i { background: var(--green); border-color: var(--green); box-shadow: 0 0 0 4px #7dc24333; }

/* =================== Chat IA =================== */
.chat { position: fixed; inset: auto 0 0 0; z-index: 50; max-width: 560px; margin: 0 auto; height: min(78dvh, 640px); display: flex; flex-direction: column;
  background: #0f1a12; border-radius: 24px 24px 0 0; border: 1px solid #22382a; transform: translateY(105%); transition: transform .45s cubic-bezier(.2, .9, .2, 1);
  background-image: radial-gradient(#ffffff08 1px, transparent 1px); background-size: 18px 18px; }
.chat.open { transform: none; }
.chat header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #13261a; border-radius: 24px 24px 0 0; }
.chat header img { width: 40px; height: 40px; border-radius: 50%; }
.chat header div { flex: 1; } .chat header small { display: block; color: #9fc3a8; font-size: 12px; }
.chat header button { font-size: 18px; padding: 6px; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 15px; line-height: 1.4; white-space: pre-wrap; animation: rise .3s ease; }
.msg.bot { background: #1f2c24; border-top-left-radius: 4px; }
.msg.me { align-self: flex-end; background: #1d5e35; border-top-right-radius: 4px; }
.msg.typing { color: #9fc3a8; }
.chat-quick { display: flex; gap: 6px; overflow-x: auto; padding: 0 14px 8px; scrollbar-width: none; }
.chat-quick button { flex: none; font-size: 13px; padding: 7px 12px; border-radius: 999px; border: 1px solid #2f4d39; color: #cfe6d5; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px max(12px, env(safe-area-inset-bottom)); }
.chat-form input { flex: 1; height: 46px; border-radius: 999px; padding: 0 16px; border: 1px solid #2f4d39; background: #13201a; outline: none; }
.chat-form button { width: 46px; height: 46px; border-radius: 50%; background: #25d366; color: #052e14; font-size: 18px; }

.toast { position: fixed; left: 50%; top: 18px; z-index: 90; transform: translate(-50%, -150%); padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.toast.on { transform: translate(-50%, 0); }
.fly { position: fixed; z-index: 95; font-size: 40px; pointer-events: none; transition: transform .7s cubic-bezier(.5, -0.3, .7, 1), opacity .7s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 380px) { .stage { height: 450px; } .dish h3 { font-size: 26px; } }

/* =================== Médias, épuisé, bannière =================== */
.plate .food-media { width: 176px; height: 176px; object-fit: cover; border-radius: 50%; border: 6px solid #f3ebdc; background: #000; }
.plate .food-icon { width: 120px; height: 120px; object-fit: contain; }
.icon-img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; }
.line .icon-img { width: 30px; height: 30px; }
.dish.is-off .plate { filter: grayscale(.85) brightness(.75); }
.soldout { position: absolute; top: 18px; left: 18px; z-index: 2; padding: 5px 12px; border-radius: 999px; background: #ef5a5a; color: #fff; font-weight: 700; font-size: 13px; }
.add:disabled { filter: grayscale(1) brightness(.6); box-shadow: none; }
.tile.is-off { opacity: .55; }
.tile { position: relative; }
.empty-cat { display: grid; place-items: center; align-content: center; gap: 16px; text-align: center; }
.banner { position: relative; margin: 0 0 14px; border-radius: 22px; overflow: hidden; aspect-ratio: 16 / 7; background: var(--card); border: 1px solid var(--line); animation: appIn .6s ease both; }
.banner img, .banner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-txt { position: absolute; inset: auto 0 0 0; padding: 30px 16px 12px; background: linear-gradient(transparent, #000c); display: grid; gap: 2px; }
.banner-txt b { font-family: var(--serif); font-size: 22px; line-height: 1.1; }
.banner-txt span { color: #e9e2d4; font-size: 14px; }

/* =================== Éléments visibles en mode admin =================== */
body.is-admin #app { padding-top: 52px; }
body.is-admin .top { top: 52px; }
.edit-fab { position: absolute; top: 14px; right: 14px; z-index: 5; padding: 8px 12px; border-radius: 999px; background: var(--gold); color: #241700; font-weight: 700; font-size: 13px; box-shadow: 0 6px 18px #0008; }
.tile-edit { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); font-size: 14px; cursor: pointer; }
.tile-add { border: 1.5px dashed var(--gold); color: var(--gold); justify-content: center; align-items: center; text-align: center; min-height: 110px; }
.tile-add .e { font-size: 30px; }
.tile-add span { color: var(--muted); }
.chip-add { border: 1.5px dashed var(--gold); color: var(--gold); background: transparent; }
body.is-admin .toast { top: 62px; }

/* =================== Toute la carte : sections par catégorie =================== */
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
.cat-sec { display: grid; gap: 12px; }
.cat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.cat-emo { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: 24px; border-radius: 14px; background: color-mix(in srgb, var(--orange) 16%, var(--card)); }
.cat-t { flex: 1; min-width: 0; }
.cat-t h3 { margin: 0; font-family: var(--serif); font-size: 21px; line-height: 1.1; }
.cat-t small { color: var(--muted); font-size: 13px; }
.cat-jump { flex: none; color: var(--green); font-weight: 600; font-size: 14px; padding: 8px 4px; }
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-height: 60px; }
.cat-empty { grid-column: 1 / -1; margin: 0; padding: 16px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 16px; font-size: 14px; }
.tile-ic { display: block; }
.tile-txt { display: grid; gap: 3px; min-width: 0; }
.tile-txt .tile-price { color: var(--green); font-weight: 600; font-size: 14px; }
.tile.is-off .tile-price { color: var(--muted); }
/* Plat en tête : pleine largeur, icône en grand */
.tile.lead { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 16px; padding: 14px 16px;
  background: radial-gradient(120% 140% at 0% 50%, color-mix(in srgb, var(--orange) 18%, var(--card)), var(--card) 70%); border-color: color-mix(in srgb, var(--orange) 40%, var(--line)); }
.tile.lead .tile-ic { width: 84px; height: 84px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle, #f6efe2 0 56%, #ded3c0 57% 64%, transparent 65%); }
.tile.lead .tile-ic .e { font-size: 50px; }
.tile.lead .tile-ic .icon-img { width: 58px; height: 58px; }
.tile.lead b { font-family: var(--serif); font-size: 19px; }
.tile.lead em { font-style: normal; color: var(--muted); font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .lead-tag { color: var(--orange); font-weight: 700; font-size: 11px; }
/* Glisser-déposer */
.tile .drag-h { position: absolute; top: 6px; left: 6px; z-index: 2; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: #000a; border: 1px solid var(--line); font-size: 18px; color: var(--gold); cursor: grab; touch-action: none; user-select: none; }
.tile.lead .drag-h { top: auto; bottom: 10px; left: auto; right: 10px; }
body.is-admin .tile:not(.lead):not(.tile-add) .tile-ic { margin-top: 26px; }
.tile.ph { border: 2px dashed var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.tile.ghost { position: fixed; z-index: 80; pointer-events: none; margin: 0; box-shadow: 0 24px 50px #000c; border-color: var(--gold); opacity: .95; }
body.dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
body.dragging .cat-grid { outline: 1px dashed color-mix(in srgb, var(--gold) 35%, transparent); outline-offset: 4px; border-radius: 12px; }
body.is-admin .tile { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* =================== Zone de commande en bas à droite de chaque plat (Toute la carte) ===================
   Vide : un « + » blanc dans un cercle blanc. Avec quantité : la bordure s'élargit et entoure
   poubelle · ×N · +. Poubelle = retire le plat, la zone redevient un simple cercle. */
.tile:not(.lead) { padding-bottom: 56px; }
.tile.lead { padding-bottom: 58px; }
.tile .qctl { position: absolute; right: 10px; bottom: 10px; z-index: 2; height: 38px; min-width: 38px; display: flex; align-items: center; justify-content: flex-end;
  border: 1.5px solid #fff; border-radius: 999px; color: #fff; transition: padding .3s ease, background .3s; }
.tile .qctl.has { padding-left: 4px; background: #ffffff10; }
.tile .ic-plus, .tile .ic-del { width: 35px; height: 35px; flex: none; display: grid; place-items: center; cursor: pointer; border-radius: 50%; transition: transform .15s, opacity .2s; }
.tile .ic-plus svg, .tile .ic-del svg { display: block; filter: drop-shadow(0 1px 2px #0009); }
.tile .ic-plus:active, .tile .ic-del:active { transform: scale(.82); }
.tile .ic-plus:focus-visible, .tile .ic-del:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }
.tile .ic-plus.pop { animation: plusPop .4s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes plusPop { 40% { transform: scale(1.3) rotate(90deg); } }
.tile .ic-del, .tile .ic-n { max-width: 0; opacity: 0; overflow: hidden; pointer-events: none; transition: max-width .3s ease, opacity .25s ease; }
.tile .qctl.has .ic-del { max-width: 35px; opacity: .9; pointer-events: auto; }
.tile .qctl.has .ic-n { max-width: 48px; opacity: 1; }
.tile .ic-n { position: static; display: block; font-style: normal; font-weight: 600; font-size: 14px; color: #fff; white-space: nowrap; text-align: center; }
body.is-admin .tile.lead .drag-h { right: auto; left: 10px; bottom: 10px; top: auto; transform: none; }
.tile .qctl .ic-plus, .tile .qctl .ic-del { color: #fff; }
/* Centrage exact du « + » dans le cercle (état vide) */
.tile .qctl { box-sizing: border-box; padding: 0; }
.tile .qctl:not(.has) { width: 40px; height: 40px; justify-content: center; }
.tile .qctl:not(.has) .ic-n, .tile .qctl:not(.has) .ic-del { display: none; }
.tile .qctl:not(.has) .ic-plus { width: 37px; height: 37px; }
.tile .qctl.has { height: 40px; padding-left: 4px; }
.tile .qctl.has .ic-n { padding: 0 2px; }
/* Plat en tête de vitrine : la photo remplit entièrement le cercle */
.tile.lead .tile-ic { overflow: hidden; }
.tile.lead .tile-ic.filled { background: #f6efe2; box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 45%, transparent), 0 10px 22px -10px #000; }
.tile.lead .tile-ic .lead-media { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
/* Panier : accompagnements en supplément (étiquettes texte) */
.sups { display: flex; flex-wrap: wrap; gap: 8px; }
.sup { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-size: 14px; font-weight: 500; transition: border-color .2s, background .2s, transform .15s; }
.sup:active { transform: scale(.95); }
.sup small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sup .sup-plus { color: var(--green); font-weight: 700; }
.sup b { color: var(--orange); font-size: 13px; }
.sup.on { border-color: var(--green); background: color-mix(in srgb, var(--green) 12%, var(--card)); }
.toast { width: max-content; max-width: calc(100vw - 32px); }
.sup-group + .sup-group { margin-top: 12px; }
.sup-for { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
/* Panier : proposition de boissons (après le 1er « Continuer ») */
.drinks { margin-top: 6px; padding: 4px 14px 16px; border-radius: 18px; border: 1.5px solid color-mix(in srgb, var(--orange) 45%, var(--line));
  background: color-mix(in srgb, var(--orange) 7%, var(--card)); animation: drinksIn .5s cubic-bezier(.2, .9, .3, 1); }
.drinks h4 { color: var(--text); text-transform: none; letter-spacing: 0; font-size: 16px; font-weight: 600; margin: 14px 0 10px; }
@keyframes drinksIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.sup .sup-ic { font-size: 18px; line-height: 1; }
.sup img.sup-ic { width: 20px; height: 20px; object-fit: contain; }
/* =================== Horaires, livraison, contact =================== */
.hours { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 14px; padding: 10px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.h-pill { font-weight: 700; font-size: 12px; padding: 3px 9px; border-radius: 999px; }
.h-pill.open { color: #0e1a06; background: var(--green); }
.h-pill.closed { color: #fff; background: #c2413b; }
.h-line { white-space: nowrap; }
.h-tel { color: var(--text); font-weight: 600; text-decoration: none; }
.closed-note { display: grid; gap: 4px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #c2413b1f; border: 1px solid #c2413b66; font-size: 14px; }
.closed-note span { color: var(--muted); }
.closed-note a, .contact-line a { color: var(--green); font-weight: 600; }
.contact-line { font-size: 14px; }
/* Toute la carte : prix en blanc, graisse réduite */
.tile .tile-txt .tile-price { color: #fff; font-weight: 400; }
.tile.is-off .tile-txt .tile-price { color: var(--muted); }
/* Icône-photo dans la grille « Toute la carte » : vignette carrée bien visible */
.tile:not(.lead) .tile-ic .icon-img { width: 64px; height: 64px; object-fit: cover; border-radius: 14px; background: #0006; }
.line .icon-img { object-fit: cover; border-radius: 8px; }
/* Message si l'appli ne démarre pas (au lieu du logo figé) */
.boot-fail { max-width: 340px; padding: 20px; margin: 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); text-align: center; display: grid; gap: 10px; }
.boot-fail p { margin: 0; color: var(--muted); font-size: 14px; }
.boot-fail pre { margin: 0; max-height: 140px; overflow: auto; text-align: left; white-space: pre-wrap; font-size: 11px; color: var(--muted); background: #0008; padding: 8px; border-radius: 8px; }
.boot-fail button { height: 46px; border-radius: 12px; background: var(--green); color: #102006; font-weight: 700; }

/* Lien « Installer l'application » (bandeau horaires) */
.h-dl { color: var(--green); text-decoration: none; font-weight: 500; }

/* =====================================================================
   RESPONSIVE — téléphone (base) · petit téléphone · tablette · ordinateur
   ===================================================================== */
img, video { max-width: 100%; }
.dish-buy { flex-wrap: wrap; row-gap: 10px; }
.dish h3 { overflow-wrap: anywhere; }

/* Petits téléphones (iPhone SE 1re génération, Android d'entrée de gamme) */
@media (max-width: 360px) {
  #app { padding: 0 12px 120px; }
  .dish { padding: 18px 16px; }
  .dish h3 { font-size: 24px; }
  .price { font-size: 24px; }
  .qty button { width: 34px; height: 34px; }
  .add { height: 44px; padding: 0 14px; }
  .plate::before { width: 170px; height: 170px; }
  .plate .food-media, .plate img.food { width: 152px; height: 152px; }
  .tile.lead { gap: 12px; padding-left: 12px; padding-right: 12px; }
  .tile.lead .tile-ic { width: 68px; height: 68px; }
  .tile.lead b { font-size: 17px; }
  .hours { padding: 10px 12px; }
  .fab-ai b { display: none; }
  .fab-ai { padding: 10px; }
  .choices.two, .row2 { grid-template-columns: 1fr; }
}

/* Téléphone à l'horizontale : vitrine moins haute */
@media (orientation: landscape) and (max-height: 520px) {
  .stage { height: 400px; }
  .plate { height: 170px; }
  .plate::before { width: 160px; height: 160px; }
  .plate .food-media, .plate img.food { width: 142px; height: 142px; }
  .nav { top: 85px; }
  .sheet, .chat { max-height: 96dvh; }
}

/* Tablettes */
@media (min-width: 720px) {
  #app { max-width: 760px; padding: 0 24px 120px; }
  .top-logo { height: 54px; }
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-wrap h2 { font-size: 26px; }
  .sheet, .chat { max-width: 640px; }
  .float-cart { width: min(calc(100% - 48px), 560px); }
}

/* Ordinateurs et grandes tablettes à l'horizontale : vitrine à gauche (fixe), carte complète à droite */
@media (min-width: 1024px) {
  #app {
    max-width: 1240px; padding: 0 32px 110px;
    display: grid; grid-template-columns: minmax(400px, 460px) minmax(0, 1fr); column-gap: 36px;
    align-items: start;
  }
  #app > .top, #app > .hours, #app > .banner { grid-column: 1 / -1; }
  #app > .chips { grid-column: 1; grid-row: 4; }
  #app > .showcase { grid-column: 1; grid-row: 5; position: sticky; top: 84px; }
  #app > .grid-wrap { grid-column: 2; grid-row: 4 / span 3; }
  .grid-wrap h2 { margin-top: 4px; }
  .chips { flex-wrap: wrap; overflow: visible; }
  .banner { aspect-ratio: 16 / 5; }
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile { cursor: pointer; transition: transform .2s, border-color .2s; }
  .tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
  .chip:hover:not(.on) { color: var(--text); border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
  /* Panier : panneau latéral à droite au lieu d'un tiroir du bas */
  .sheet { left: auto; right: 0; top: 0; bottom: 0; width: 480px; max-width: 100vw; max-height: none; margin: 0;
    border-radius: 26px 0 0 26px; transform: translateX(105%); }
  .sheet.open { transform: none; }
  .sheet-grip { display: none; }
  .sheet .steps { padding-top: 22px; }
  /* Assistant : fenêtre flottante en bas à droite */
  .chat { left: auto; right: 24px; bottom: 24px; width: 400px; max-width: calc(100vw - 48px); height: min(640px, calc(100dvh - 48px));
    border-radius: 24px; transform: translateY(calc(100% + 40px)); }
  .chat.open { transform: none; }
  .fab-ai { right: 24px; bottom: 24px; }
  .float-cart { left: auto; right: 160px; transform: none; width: 380px; animation: none; }
}

/* Grands écrans */
@media (min-width: 1400px) {
  #app { max-width: 1360px; grid-template-columns: 480px minmax(0, 1fr); }
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
