@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ── Variables ───────────────────────────────────────── */
:root {
  --vert:       #4C9A5B;
  --vert-fonce: #2E5E38;
  --orange:     #F4831F;
  --creme:      #FAF7F0;
  --blanc:      #FFFFFF;
  --text:       #2D2D2D;
  --muted:      #9A9186;
  --border:     #E8E1D6;
  --shadow:     0 2px 14px rgba(0,0,0,.07);
  --shadow-md:  0 6px 28px rgba(0,0,0,.11);
  --radius:     16px;
  --radius-sm:  10px;
  --sans:       'Nunito', 'Segoe UI', system-ui, sans-serif;
}

/* ── Reset & base ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--creme);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
}

/* ── Sticky header (pages intérieures) ───────────────── */
.sticky-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--blanc);
  border-bottom: 1px solid var(--border);
  padding: 13px 16px;
  display: flex; align-items: center; gap: 12px;
}
.sticky-header h1 {
  flex: 1; font-size: 18px; font-weight: 800; color: var(--vert-fonce);
}

.back-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: none; background: var(--creme); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none; font-size: 20px;
  color: var(--text); line-height: 1; transition: background .15s;
}
.back-btn:hover { background: var(--border); }

/* ── Page content ────────────────────────────────────── */
.page-content {
  max-width: 520px; margin: 0 auto;
  padding: 8px 16px 110px;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: block; width: 100%; padding: 16px 24px;
  border: none; border-radius: 50px;
  font-family: var(--sans); font-size: 16px; font-weight: 800;
  cursor: pointer; text-align: center; text-decoration: none;
  transition: opacity .15s, transform .1s; letter-spacing: .2px;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--vert), var(--vert-fonce));
  color: #fff; box-shadow: 0 4px 16px rgba(76,154,91,.28);
}
.btn-primary:hover { opacity: .92; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; box-shadow: none; }

/* ── Section title ───────────────────────────────────── */
.section-title {
  font-size: 15px; font-weight: 800; color: var(--text);
  margin: 22px 0 11px; display: flex; align-items: center; gap: 8px;
}
.section-title::after { content:''; flex:1; height:1px; background:var(--border); }

/* ── Category header ─────────────────────────────────── */
.cat-section { margin-top: 24px; }
.cat-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.cat-icon { font-size: 22px; flex-shrink: 0; }
.cat-header h2 { font-size: 19px; font-weight: 800; color: var(--text); }
.cat-line { flex:1; height:1px; background: var(--border); }

/* ── Dish card (menu + commande) ─────────────────────── */
.plat-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--blanc); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 10px; gap: 12px;
}
.plat-card.indispo { opacity: .48; }
.plat-info { flex:1; min-width:0; }
.plat-nom  { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.plat-desc { font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.plat-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0;
}
.plat-prix { font-size: 17px; font-weight: 900; color: var(--orange); }
.badge-dispo   { font-size: 11px; font-weight: 700; color: var(--vert);  display:flex; align-items:center; gap:4px; }
.badge-indispo { font-size: 11px; font-weight: 700; color: var(--muted); display:flex; align-items:center; gap:4px; }
.badge-dispo::before   { content:''; width:6px; height:6px; border-radius:50%; background:var(--vert);  flex-shrink:0; }
.badge-indispo::before { content:''; width:6px; height:6px; border-radius:50%; background:var(--muted); flex-shrink:0; }

/* ── Quantity controls ───────────────────────────────── */
.qty-control { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.qty-btn {
  width:34px; height:34px; border-radius:50%;
  border: 2px solid var(--border); background: var(--blanc);
  font-size:20px; font-weight:700; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  color: var(--text); transition:all .15s; line-height:1; user-select:none;
}
.qty-btn:hover { border-color: var(--orange); color: var(--orange); }
.qty-btn.active { border-color:var(--vert); background:var(--vert); color:#fff; }
.qty-value { width:26px; text-align:center; font-size:16px; font-weight:900; }

/* ── Form elements ───────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display:block; font-weight:800; font-size:14px; margin-bottom:7px; }
.form-group input {
  width:100%; padding:13px 16px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--sans); font-size:15px;
  background: var(--blanc); color: var(--text); outline:none;
  transition: border-color .15s;
}
.form-group input:focus { border-color: var(--orange); }

/* ── Sticky bottom (commande) ─────────────────────────── */
.sticky-bottom {
  position:fixed; bottom:0; left:0; right:0;
  background: var(--blanc); border-top:1px solid var(--border);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom,0px));
  box-shadow: 0 -4px 20px rgba(0,0,0,.06); z-index:40;
}
.sticky-bottom .inner { max-width:520px; margin:0 auto; }
.total-line {
  display:flex; justify-content:space-between; align-items:baseline; margin-bottom:12px;
}
.total-label { font-size:15px; font-weight:700; }
.total-amount { font-size:28px; font-weight:900; color: var(--vert-fonce); }

/* ── Sticky CTA footer (menu) ────────────────────────── */
.sticky-cta {
  position:fixed; bottom:0; left:0; right:0;
  background: var(--creme); border-top:1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom,0px));
}
.sticky-cta .inner { max-width:520px; margin:0 auto; }

/* ── Success overlay ─────────────────────────────────── */
.overlay {
  display:none; position:fixed; inset:0; z-index:200;
  background:rgba(0,0,0,.5); backdrop-filter:blur(4px);
  align-items:center; justify-content:center; padding:24px;
}
.overlay.show { display:flex; }
.success-card {
  background: var(--blanc); border-radius:24px;
  padding:40px 28px; text-align:center;
  max-width:380px; width:100%;
  box-shadow: 0 24px 60px rgba(0,0,0,.2);
}
.success-icon  { font-size:62px; margin-bottom:10px; }
.success-title { font-size:24px; font-weight:800; color: var(--vert-fonce); margin-bottom:10px; }
.success-msg { font-size:15px; color:var(--muted); line-height:1.6; margin-bottom:28px; }

/* ── Loading ─────────────────────────────────────────── */
.loading { text-align:center; padding:48px 16px; color:var(--muted); font-size:15px; }
.spinner {
  width:36px; height:36px; border-radius:50%;
  border:3px solid var(--border); border-top-color:var(--orange);
  animation:spin .7s linear infinite; margin:0 auto 14px;
}
@keyframes spin { to { transform:rotate(360deg); } }

/* ── Toast ───────────────────────────────────────────── */
.toast {
  position:fixed; bottom:90px; left:50%; transform:translateX(-50%);
  padding:14px 24px; border-radius:50px; font-weight:800; font-size:14px;
  z-index:300; white-space:nowrap;
  box-shadow:0 4px 24px rgba(0,0,0,.2);
}
.toast.error   { background:#C0392B; color:#fff; }
.toast.success { background:var(--vert);  color:#fff; }
