/* ============================================================
   BamBam — Shared mobile UI kit (light theme)
   Used by client / restaurant / rider HTML templates.
   Design: white surfaces, teal + yellow accent (🛵), rounded, soft shadows.
   ============================================================ */

:root {
  /* Brand — teal + yellow, echoing the 🛵 emoji (BamBam) */
  --primary: #0FB9A9;
  --primary-dark: #0A9587;
  --primary-soft: #DFF6F3;
  --secondary: #FFC53D;
  --secondary-soft: #FFF3D6;
  --ink: #14211F;
  --ink-2: #566360;
  --ink-3: #93A09D;
  --line: #E8EEEC;
  --bg: #F3F7F6;
  --surface: #FFFFFF;
  --surface-2: #F1F6F5;
  --success: #0FB05C;
  --success-soft: #E2F6EB;
  --warning: #E8A400;
  --warning-soft: #FDF3D9;
  --danger: #E11D2E;
  --danger-soft: #FDE7E9;
  --info: #2563EB;

  /* App accent — overridden per app on <body data-app> */
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(20,17,15,.05);
  --shadow: 0 6px 20px rgba(20,17,15,.08);
  --shadow-lg: 0 14px 40px rgba(20,17,15,.14);

  --ease: cubic-bezier(.22,.61,.36,1);
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Per-app accent themes */
body[data-app="restaurant"] { --accent: #14211F; --accent-soft: #E8EEEC; }
body[data-app="rider"]      { --accent: #0FB9A9; --accent-soft: #DFF6F3; }
body[data-app="client"]     { --accent: #0FB9A9; --accent-soft: #DFF6F3; }

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; width: 100%; overflow-x: hidden; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 13.5px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ---------- Phone shell (screen fills its frame/iframe) ---------- */
.screen {
  position: relative;
  height: 100dvh;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* real device safe-area at top (status area lives in the OS, not the app) */
  padding-top: max(env(safe-area-inset-top), 12px);
}

/* Scroll body */
.view {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}
.view::-webkit-scrollbar { width: 0; }
.pad { padding: 0 20px; }

/* ---------- Top app bar ---------- */
.appbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 20px 14px;
}
.appbar h1 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.appbar .sub { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.iconbtn {
  width: 38px; height: 38px; border-radius: var(--radius-full);
  background: var(--surface); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 16px; cursor: pointer;
  box-shadow: var(--shadow-sm); flex: 0 0 auto; color: var(--ink);
  transition: transform .15s var(--ease);
}
.iconbtn:active { transform: scale(.92); }
.iconbtn.solid { background: var(--accent); color: #fff; border-color: transparent; }
.spacer { flex: 1; }

/* ---------- Logo (playful brand wordmark) ---------- */
:root { --font-brand: 'Baloo 2', 'Plus Jakarta Sans', sans-serif; }
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-brand); font-weight: 800; font-size: 22px; letter-spacing: 0;
  color: var(--ink);
}
.logo .b { color: var(--primary); }
/* 🛵 emoji in a teal squircle (BamBam brand mark) */
.logo .moto { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 11px; background: linear-gradient(135deg, #14CBB9, var(--accent)); box-shadow: 0 3px 8px rgba(15,185,169,.35); }
.logo .moto [data-ic], .logo .moto svg { display: none !important; }
.logo .moto::before { content: "🛵"; font-size: 19px; line-height: 1; }

/* ---------- Search ---------- */
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-full); padding: 13px 18px;
  color: var(--ink-3); font-size: 14px; box-shadow: var(--shadow-sm);
  margin: 0 20px 16px;
}
.search input { border: 0; background: transparent; flex: 1; font: inherit; color: var(--ink); outline: none; }
.search input::placeholder { color: var(--ink-3); }

/* ---------- Section headers ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 20px 10px; }
.section-head h2 { font-size: 14px; font-weight: 800; letter-spacing: -.01em; }
.section-head a { color: var(--accent); font-size: 13px; font-weight: 700; text-decoration: none; }

/* ---------- Category chips ---------- */
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 4px 20px 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-full);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; white-space: nowrap;
  transition: all .18s var(--ease);
}
.chip .emo { font-size: 17px; }
.chip.active { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(15,185,169,.28); }
body[data-app="restaurant"] .chip.active { box-shadow: 0 6px 16px rgba(17,24,39,.25); }

/* Parent categories (big tiles) */
.parents { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; padding: 4px 20px 16px; }
.parent-tile {
  position: relative; border-radius: var(--radius); padding: 16px; min-height: 92px;
  display: flex; flex-direction: column; justify-content: space-between; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: transform .18s var(--ease);
}
.parent-tile:active { transform: scale(.97); }
.parent-tile .p-emo { font-size: 24px; color: var(--accent); }
.parent-tile .p-name { font-weight: 800; font-size: 15px; }
.parent-tile .p-count { font-size: 12px; color: var(--ink-3); font-weight: 600; }

/* ---------- Cards / list ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin: 0 20px 14px; overflow: hidden;
}
.card.flat { box-shadow: none; }

/* Restaurant row card */
.resto {
  display: flex; gap: 14px; padding: 14px; align-items: center; cursor: pointer;
}
.resto .thumb {
  width: 60px; height: 60px; border-radius: 14px; flex: 0 0 auto; object-fit: cover;
  background: linear-gradient(135deg,#FFE3D6,#FFD0BE);
}
.resto .info { flex: 1; min-width: 0; }
.resto .name {
  font-weight: 800; font-size: 15px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.resto .meta {
  font-size: 12px; color: var(--ink-2); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* meta row: one line, never wraps; items separated by dots */
.resto .row2 {
  display: flex; align-items: center; gap: 10px; margin-top: 7px;
  font-size: 12px; color: var(--ink-2); font-weight: 600; white-space: nowrap;
  overflow: hidden;
}
.resto .row2 > span { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.resto .row2 > span + span::before { content: "·"; margin-right: 8px; color: var(--ink-3); font-weight: 700; }
.resto .row2 [data-ic] { font-size: 13px; color: var(--ink-3); }
.resto .row2 .rate { color: var(--warning); }
.resto .row2 .rate [data-ic] { color: var(--warning); }
/* badge sits top-aligned, never crushes the text column */
.resto > .badge { align-self: flex-start; flex: 0 0 auto; margin-top: 2px; }

/* Product card (grid) */
.grid2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; padding: 4px 20px 16px; }
.prod {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); cursor: pointer;
  display: flex; flex-direction: column; transition: transform .18s var(--ease);
}
.prod:active { transform: scale(.97); }
.prod .pimg { aspect-ratio: 1.35/1; background: linear-gradient(135deg,#FFE3D6,#FFCDBB); position: relative; display:grid; place-items:center; font-size:44px; }
.prod .pbody { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.prod .pname { font-weight: 700; font-size: 14px; line-height: 1.25; }
.prod .prow { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.prod .price { font-weight: 800; color: var(--ink); font-size: 15px; }
.prod .price small { font-weight: 700; font-size: 11px; color: var(--ink-3); }
.prod .add {
  width: 30px; height: 30px; border-radius: var(--radius-full); background: var(--accent);
  color: #fff; border: 0; font-size: 18px; display: grid; place-items: center; cursor: pointer;
}
.prod .prate { font-size: 12px; color: var(--warning); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px; border-radius: var(--radius);
  background: var(--accent); color: #fff; border: 0; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 14px; box-shadow: var(--shadow);
  transition: transform .15s var(--ease), filter .15s var(--ease);
}
.btn:active { transform: scale(.98); filter: brightness(.96); }
/* button loading state */
.btn.loading { color: transparent !important; pointer-events: none; position: relative; }
.btn.loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px;
  margin: -9px 0 0 -9px; border: 2.5px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite; }
.btn.ghost.loading::after { border-color: rgba(20,33,31,.3); border-top-color: var(--ink); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.sm { padding: 9px 14px; font-size: 13px; border-radius: 12px; }
.btn.dark { background: var(--ink); }
.btn.success { background: var(--success); }
.btn.block-lg { padding: 18px; border-radius: var(--radius-lg); }

/* Bottom action bar (sticky in-screen) */
.actionbar {
  flex: 0 0 auto; padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255,255,255,0), var(--surface) 22%);
  border-top: 1px solid var(--line);
}

/* ---------- Bottom tab bar ---------- */
.tabbar {
  flex: 0 0 auto; display: flex; justify-content: space-around; align-items: center;
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--ink-3); font-size: 10.5px; font-weight: 700; cursor: pointer;
  padding: 4px 12px; border-radius: 14px; text-decoration: none; transition: color .15s;
}
.tab .ti { font-size: 21px; line-height: 1; }
.tab.active { color: var(--accent); }
.tab.fab {
  width: 56px; height: 56px; border-radius: var(--radius-full); background: var(--accent);
  color: #fff; justify-content: center; margin-top: -22px; box-shadow: 0 10px 24px rgba(15,185,169,.4);
}
.tab.fab .ti { font-size: 26px; }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: var(--radius-full);
  font-size: 11.5px; font-weight: 800; letter-spacing: .01em;
}
.badge.b-new { background: var(--primary-soft); color: var(--primary); }
.badge.b-ok { background: var(--success-soft); color: var(--success); }
.badge.b-wait { background: var(--warning-soft); color: var(--warning); }
.badge.b-off { background: var(--danger-soft); color: var(--danger); }
.badge.b-info { background: #E7EEFE; color: var(--info); }
.badge.b-return { background: #EDE9FE; color: #6D28D9; }

/* ---------- Forms ---------- */
.field { margin: 0 20px 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin: 0 4px 6px; }
.input {
  width: 100%; padding: 13px 15px; border-radius: var(--radius); background: var(--surface);
  border: 1.5px solid var(--line); font: inherit; font-size: 14.5px; color: var(--ink); outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--ink-3); }

/* Phone input with prefix */
.phone-input { display: flex; gap: 10px; margin: 0 20px 12px; }
.phone-input .prefix {
  display: flex; align-items: center; gap: 7px; padding: 13px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1.5px solid var(--line); font-weight: 800; font-size: 14.5px; white-space: nowrap;
}
.phone-input .input { flex: 1; }

/* OTP boxes */
.otp { display: flex; gap: 10px; justify-content: center; margin: 8px 20px 18px; }
.otp .box {
  width: 48px; height: 56px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface);
  display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--ink);
}
.otp .box.filled { border-color: var(--accent); background: var(--accent-soft); }
.otp-hint { text-align: center; color: var(--ink-3); font-size: 13px; margin: -4px 20px 16px; }
.otp-hint b { color: var(--accent); }

/* ---------- Splash ---------- */
.splash {
  height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; text-align: center; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #1FD3C1 0%, #0FB9A9 48%, #0A9587 100%);
}
/* soft yellow glow (echoes the 🛵 headlight/brand) */
.splash::before { content:""; position:absolute; top:-30%; left:50%; transform:translateX(-50%);
  width:420px; height:420px; border-radius:50%; background:radial-gradient(circle, rgba(255,197,61,.35) 0%, transparent 65%);
  animation: haloPulse 3.2s ease-in-out infinite; }
.splash .moto-big { width: 92px; height: 92px; border-radius: 28px; background: rgba(255,255,255,.16);
  backdrop-filter: blur(4px); display: grid; place-items: center; color: #fff; font-size: 48px; position: relative; z-index: 1;
  animation: motoIn 1s var(--ease) both, bob 1.4s ease-in-out .9s infinite; box-shadow: 0 12px 30px rgba(0,0,0,.2); }
.splash .moto-big [data-ic], .splash .moto-big svg { display: none !important; }
.splash .moto-big::before { content: "🛵"; font-size: 52px; line-height: 1; display: inline-block; transform: scaleX(-1); animation: wheelie 1.4s ease-in-out .9s infinite; }
/* speed lines trailing the scooter */
.splash .moto-big::after { content:""; position:absolute; left:-46px; top:50%; width:40px; height:3px; border-radius:2px;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.7)); box-shadow:0 -9px 0 -1px rgba(255,255,255,.5), 0 9px 0 -1px rgba(255,255,255,.5);
  animation: zoom 1.4s ease-in-out 1.2s infinite; }
/* the road the scooter rides on */
.splash .road { position:absolute; bottom:120px; left:0; right:0; height:3px; z-index:0;
  background:repeating-linear-gradient(90deg, rgba(255,255,255,.55) 0 26px, transparent 26px 52px);
  background-size:52px 3px; animation: dash 1s linear infinite; opacity:.6; }
.splash h1 { font-family: var(--font-brand); font-size: 38px; font-weight: 800; letter-spacing: 0; position:relative; z-index:1; animation: fadeUp .7s var(--ease) .25s both; }
.splash p { font-size: 15px; opacity: .92; font-weight: 600; position:relative; z-index:1; animation: fadeUp .7s var(--ease) .4s both; }
.splash .role { margin-top: 6px; font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; opacity: .85; position:relative; z-index:1; animation: fadeUp .7s var(--ease) .5s both; }
.splash .loader { position: absolute; bottom: 60px; width: 40px; height: 40px; border: 3px solid rgba(255,255,255,.3); border-top-color:#fff; border-radius: 50%; animation: spin 1s linear infinite; }
.splash.dark { background: radial-gradient(120% 90% at 50% 0%, #2B3242 0%, #141821 60%, #0B0E14 100%); }

@keyframes motoIn { from { opacity: 0; transform: translateX(-140px) rotate(-12deg) scale(.6);} to { opacity:1; transform: none; } }
@keyframes bob { 0%,100%{ transform: translateY(0) } 50%{ transform: translateY(-8px) } }
@keyframes wheelie { 0%,100%{ transform: scaleX(-1) rotate(0) } 45%{ transform: scaleX(-1) rotate(7deg) } }
@keyframes zoom { 0%{ opacity:0; transform:translateX(0) } 40%{ opacity:1 } 100%{ opacity:0; transform:translateX(-18px) } }
@keyframes dash { to { background-position:-52px 0 } }
@keyframes haloPulse { 0%,100%{ transform:translateX(-50%) scale(1); opacity:.8 } 50%{ transform:translateX(-50%) scale(1.12); opacity:1 } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px);} to { opacity:1; transform:none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Intro slides ---------- */
.intro { height: 100dvh; display: flex; flex-direction: column; background: var(--surface); }
.intro .slide-art { flex: 1; display: grid; place-items: center; font-size: 80px; color: var(--accent); background: var(--accent-soft); }
.intro .slide-art [data-ic] { font-size: 80px; }
.intro .slide-body { padding: 30px 28px 20px; }
.intro .slide-body h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 10px; }
.intro .slide-body p { color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.dots { display: flex; gap: 7px; justify-content: center; margin: 18px 0; }
.dots i { width: 7px; height: 7px; border-radius: 999px; background: var(--line); }
.dots i.on { width: 22px; background: var(--accent); }

/* ---------- Timeline / order tracking ---------- */
.timeline { padding: 6px 24px; }
.tl-step { display: flex; gap: 14px; position: relative; padding-bottom: 22px; }
.tl-step:last-child { padding-bottom: 0; }
.tl-step .dot {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line); color: var(--ink-3); font-size: 13px; z-index: 2;
}
.tl-step::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.tl-step:last-child::before { display: none; }
.tl-step.done .dot { background: var(--success); border-color: var(--success); color: #fff; }
.tl-step.active .dot { background: var(--accent); border-color: var(--accent); color: #fff; animation: pulse 1.6s ease-in-out infinite; }
.tl-step.done::before, .tl-step.active::before { background: var(--success); }
.tl-step .tl-txt .t { font-weight: 700; font-size: 14px; }
.tl-step .tl-txt .s { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.tl-step.pending .tl-txt .t { color: var(--ink-3); font-weight: 600; }
@keyframes pulse { 0%,100%{ box-shadow: 0 0 0 0 rgba(15,185,169,.4);} 50%{ box-shadow: 0 0 0 8px rgba(15,185,169,0);} }

/* ---------- Order summary rows ---------- */
.summary { margin: 4px 20px 14px; }
.summary .r { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; color: var(--ink-2); }
.summary .r b { color: var(--ink); }
.summary .r.total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 14px; font-size: 17px; }
.summary .r.total b { color: var(--accent); font-size: 19px; }

/* ---------- Delivery fee offer slider (legacy chips) ---------- */
.offer { margin: 0 20px 16px; }
.offer .amounts { display: flex; gap: 10px; }
.offer .amt {
  flex: 1; text-align: center; padding: 14px 6px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 800;
}
.offer .amt small { display: block; font-size: 10px; color: var(--ink-3); font-weight: 700; margin-top: 3px; }
.offer .amt.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ---------- Price offer stepper (inDrive-style: you set the price) ---------- */
.price-set { margin: 0 20px 14px; padding: 20px 18px 16px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-align: center; }
.price-set .ps-row { display: flex; align-items: center; justify-content: center; gap: 22px; }
.price-set .ps-btn {
  width: 52px; height: 52px; border-radius: var(--radius-full); flex: 0 0 auto;
  background: var(--surface-2); border: 1.5px solid var(--line); color: var(--ink);
  display: grid; place-items: center; font-size: 22px; cursor: pointer;
  transition: transform .12s var(--ease), background .12s, opacity .12s;
}
.price-set .ps-btn:active { transform: scale(.9); }
.price-set .ps-btn.hot { background: var(--accent); border-color: var(--accent); color: #fff; }
.price-set .ps-btn.blocked { opacity: .4; cursor: not-allowed; }
.price-set .ps-amount { min-width: 128px; }
.price-set .ps-amount .val { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.price-set .ps-amount .val small { font-size: 18px; font-weight: 700; color: var(--ink-2); }
.price-set .ps-amount .cur { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-top: 4px; }
.price-set.shake { animation: shakeX .32s var(--ease); }
@keyframes shakeX { 0%,100%{ transform: translateX(0);} 25%{ transform: translateX(-6px);} 75%{ transform: translateX(6px);} }

/* speed meter: fills as offer rises above min */
.ps-speed { margin-top: 16px; }
.ps-speed .bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.ps-speed .bar i { display: block; height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--secondary), var(--accent)); transition: width .35s var(--ease); }
.ps-speed .lbl { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.ps-speed .lbl b { color: var(--accent); }
.ps-hint { font-size: 12px; color: var(--ink-2); margin-top: 12px; }
.ps-hint.min-hit { color: var(--warning); font-weight: 700; }

/* ---------- Slide to confirm (rider) ---------- */
.slide-confirm {
  position: relative; height: 62px; border-radius: var(--radius-full); background: var(--ink);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; overflow: hidden;
  user-select: none;
}
.slide-confirm.success { background: var(--success); }
.slide-confirm .knob {
  position: absolute; left: 6px; top: 6px; width: 50px; height: 50px; border-radius: 50%; background: #fff;
  color: var(--ink); display: grid; place-items: center; font-size: 22px; box-shadow: var(--shadow);
  animation: nudge 1.8s ease-in-out infinite;
}
@keyframes nudge { 0%,100%{ transform: translateX(0);} 55%{ transform: translateX(8px);} }

/* ---------- Map placeholder ---------- */
.mapbox {
  height: 190px; background:
    linear-gradient(rgba(255,255,255,.6),rgba(255,255,255,.6)),
    repeating-linear-gradient(0deg,#E7EDF2 0 1px,transparent 1px 26px),
    repeating-linear-gradient(90deg,#E7EDF2 0 1px,transparent 1px 26px),
    #EFF3F6;
  position: relative; border-radius: var(--radius); margin: 0 20px 14px; overflow: hidden; border: 1px solid var(--line);
}
.mapbox .route { position: absolute; left: 18%; top: 30%; right: 22%; bottom: 30%;
  border-top: 3px dashed var(--accent); transform: rotate(-8deg); border-radius: 40%; }
.mapbox .pin { position: absolute; font-size: 26px; }
.mapbox .pin.a { left: 14%; top: 22%; }
.mapbox .pin.b { right: 14%; bottom: 20%; }
.mapbox .zone-blob { position: absolute; width: 78px; height: 60px; border-radius: 40% 55% 50% 45%;
  background: rgba(15,185,169,.14); border: 1.5px solid rgba(15,185,169,.5); }

/* ---------- Wallet ---------- */
.wallet-card {
  margin: 0 20px 16px; border-radius: var(--radius-lg); padding: 22px;
  background: linear-gradient(135deg, #1FD3C1, #0A9587); color: #fff; box-shadow: 0 14px 30px rgba(15,185,169,.32);
}
.wallet-card .lbl { font-size: 13px; opacity: .9; font-weight: 700; }
.wallet-card .bal { font-size: 38px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.wallet-card .bal small { font-size: 18px; font-weight: 700; }

.txn { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.txn .ti { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: var(--surface-2); flex: 0 0 auto; }
.txn .info { flex: 1; }
.txn .info .t { font-weight: 700; font-size: 14px; }
.txn .info .d { font-size: 12px; color: var(--ink-3); }
.txn .amt { font-weight: 800; font-size: 15px; }
.txn .amt.plus { color: var(--success); }
.txn .amt.minus { color: var(--danger); }

/* ---------- Tabs (segment) ---------- */
.segment { display: flex; gap: 6px; margin: 0 20px 16px; background: var(--surface-2); padding: 5px; border-radius: var(--radius-full); }
.segment .seg { flex: 1; text-align: center; padding: 10px; border-radius: var(--radius-full); font-weight: 700; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.segment .seg.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Empty/upload states ---------- */
.upload-tile {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center;
  color: var(--ink-3); background: var(--surface); margin: 0 20px 12px;
}
.upload-tile .u-emo { font-size: 34px; }
.upload-tile.done { border-style: solid; border-color: var(--success); color: var(--success); background: var(--success-soft); }

/* helpers */
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.center { text-align: center; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; }
.h-sm { font-size: 15px; font-weight: 800; }

/* ---------- Icons ---------- */
[data-ic] { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
[data-ic] svg { width: 1em; height: 1em; }
.ic-lg { font-size: 22px; }
.iconbtn [data-ic] { font-size: 17px; }
.tab .ti [data-ic] { font-size: 20px; }

/* Neutral image placeholder (replaces food emoji) */
.imgph {
  background: linear-gradient(135deg, #FFE7DC 0%, #FFD3C2 100%);
  display: grid; place-items: center; color: rgba(226,52,0,.55); position: relative;
}
.imgph [data-ic] { font-size: 26px; }
.imgph.sm [data-ic] { font-size: 20px; }
/* placeholder icon scales to its tile: small thumbs vs big heroes */
.thumb.imgph [data-ic], .cimg.imgph [data-ic], .mi.imgph [data-ic],
.dot.imgph [data-ic], .pin.imgph [data-ic] { font-size: 22px; }
.pimg.imgph [data-ic] { font-size: 40px; }
body[data-app="restaurant"] .imgph { background: linear-gradient(135deg,#EDF0F5,#DCE1EA); color: #64748B; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--radius-full);
  font-weight: 700; font-size: 13px; box-shadow: var(--shadow-lg); z-index: 200;
  opacity: 0; transition: all .25s var(--ease); pointer-events: none; max-width: 80%;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Modal + bottom sheet ---------- */
.sheet-overlay {
  position: fixed; inset: 0; background: rgba(20,17,15,.42); z-index: 150;
  display: flex; align-items: flex-end; justify-content: center; opacity: 0;
  transition: opacity .25s var(--ease); backdrop-filter: blur(1px);
}
.sheet-overlay.show { opacity: 1; }
.modal-card {
  background: var(--surface); border-radius: var(--radius-lg); margin: auto; width: calc(100% - 48px);
  max-width: 360px; padding: 24px 22px 20px; transform: scale(.92); transition: transform .25s var(--ease);
  box-shadow: var(--shadow-lg);
}
.sheet-overlay.show .modal-card { transform: scale(1); }
.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.01em; }
.modal-body { color: var(--ink-2); font-size: 14px; line-height: 1.5; margin-bottom: 18px; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.modal-actions .btn { padding: 13px; }

.sheet-card {
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; width: 100%;
  max-width: 440px; padding: 12px 0 calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .28s var(--ease); box-shadow: var(--shadow-lg);
  max-height: 82vh; overflow-y: auto;
}
.sheet-overlay.show .sheet-card { transform: translateY(0); }
.sheet-grip { width: 40px; height: 5px; border-radius: 999px; background: var(--line); margin: 4px auto 14px; }
.sheet-body { }

/* Product option rows (used by Bam.productSheet + product.html) */
.opt { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s var(--ease); }
.opt:last-child { border-bottom: 0; }
.opt.on { background: linear-gradient(120deg, rgba(15,185,169,.06), rgba(255,197,61,.07)); }
.opt b { font-family: var(--font-brand); font-weight: 700; letter-spacing: -.01em; font-size: 14px; }
.opt .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; transition: all .15s var(--ease); }
.opt.on .radio { border-color: var(--accent); background: radial-gradient(circle at center, var(--accent) 0 6px, transparent 7px); box-shadow: 0 0 0 4px rgba(15,185,169,.12); }
.opt .check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); flex: 0 0 auto; display: grid; place-items: center; color: #fff; font-size: 13px; transition: all .15s var(--ease); }
.opt .check [data-ic] { opacity: 0; } .opt.on .check [data-ic] { opacity: 1; }
.opt.on .check { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px rgba(15,185,169,.12); }
.qty { display: flex; align-items: center; gap: 14px; }
.qty button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 18px; font-weight: 700; display: grid; place-items: center; }
.qty button:active { transform: scale(.9); transition: transform .12s var(--ease); }

/* ---------- Address picker rows (sheet) ---------- */
.addr-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 14px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.addr-row.on { border-color: var(--accent); background: var(--accent-soft); }
.addr-row .ar-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; color: var(--accent); flex: 0 0 auto; }
.addr-row.on .ar-ic { background: #fff; }
.addr-row b { font-size: 14px; }
.addr-row .ar-check { color: var(--accent); font-size: 18px; flex: 0 0 auto; }

/* ---------- Toggle switch + checkbox (unified, ACCENT color) ---------- */
/* Supports both conventions: default-ON toggles add `.off`; default-OFF toggles add `.on`. */
.sw { width: 46px; height: 27px; border-radius: 999px; background: var(--accent); position: relative; flex: 0 0 auto; cursor: pointer; transition: background .18s var(--ease); }
.sw::after { content: ""; position: absolute; top: 3px; left: 22px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: left .18s var(--ease); }
.sw.off { background: var(--line); } .sw.off::after { left: 3px; }
/* default-OFF variant: neutral until `.on` is added */
.sw.default-off { background: var(--line); } .sw.default-off::after { left: 3px; }
.sw.default-off.on { background: var(--accent); } .sw.default-off.on::after { left: 22px; }
.chk { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; flex: 0 0 auto; cursor: pointer; transition: all .15s var(--ease); }
.chk [data-ic] { opacity: 0; font-size: 13px; } .chk.on { border-color: var(--accent); background: var(--accent); } .chk.on [data-ic] { opacity: 1; }
input[type="checkbox"].accent, input[type="radio"].accent { accent-color: var(--accent); width: 18px; height: 18px; }

/* Address autocomplete dropdown */
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden; max-height: 220px; overflow-y: auto; }
.ac-item { display: flex; align-items: center; gap: 8px; padding: 11px 14px; font-size: 13px; color: var(--ink);
  border-bottom: 1px solid var(--line); cursor: pointer; }
.ac-item:last-child { border-bottom: 0; }
.ac-item:active { background: var(--surface-2); }
.ac-item [data-ic] { color: var(--accent); font-size: 15px; flex: 0 0 auto; }
/* leaflet container needs an explicit height */
[data-map], .mapbox { position: relative; }

/* Location sheet */
.loc-map { height: 180px; margin: 0 0 8px; }
.loc-map .mapbox { margin: 0 20px; height: 180px; }
.loc-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 4px; }

/* Segmented / filter rows inside sheets */
.sheet-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.sheet-row:last-child { border-bottom: 0; }

/* ---------- Real photos ---------- */
.photo { background-size: cover; background-position: center; background-repeat: no-repeat; background-color: var(--surface-2); }
/* logo badge overlay (like McDelivery) */
.logo-badge {
  position: absolute; left: 14px; bottom: -18px; width: 60px; height: 60px; border-radius: 16px;
  background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; overflow: hidden;
  border: 3px solid #fff;
}
.logo-badge .photo { width: 100%; height: 100%; }
.logo-badge.sm { width: 46px; height: 46px; left: 12px; bottom: 12px; border-radius: 13px; }

/* "Gratuit" delivery pill + struck price */
.free-pill { display: inline-flex; align-items: center; gap: 5px; background: var(--accent); color: #fff;
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; }
.free-pill .strike { text-decoration: line-through; opacity: .7; font-weight: 700; }
.thumbs { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.thumbs [data-ic] { color: var(--success); }

/* promo ribbon on a card image */
.ribbon { position: absolute; left: 0; top: 12px; background: var(--accent); color: #fff;
  padding: 5px 12px 5px 12px; border-radius: 0 999px 999px 0; font-size: 12px; font-weight: 800; box-shadow: var(--shadow-sm); }

/* ---------- Skeleton loading ---------- */
.skel { position: relative; overflow: hidden; background: #E7EEEC; border-radius: 10px; }
.skel::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  transform: translateX(-100%); animation: shimmer 1.3s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skel-line { height: 12px; border-radius: 6px; margin: 6px 0; }
.skel-card { border-radius: var(--radius); }

/* ---------- Fixed centre pin (Uber/Glovo address picker) ---------- */
/* A single pin locked to the map centre; the user moves the map under it. */
/* Center pin: the sharp tip must point straight DOWN to the map centre.
   The head is anchored by its own bottom tip (the stem shadow sits under it),
   so the container is translated up by its full height to put the tip on the
   centre point. */
.map-centerpin { position: absolute; z-index: 450; pointer-events: none;
  inset: 50% auto auto 50% !important;   /* top:50% right:auto bottom:auto left:50% — defeats Leaflet child insets */
  width: 24px !important; height: 32px !important;
  transform: translate(-50%, -100%); transition: transform .18s var(--ease); }
.map-centerpin.lift { transform: translate(-50%, -118%); }
/* Teardrop: round top, sharp bottom tip. border-radius 50% 50% 0 50% makes the
   bottom-RIGHT corner sharp; rotating 45° clockwise swings that sharp corner to
   the bottom-centre, so the tip points exactly down. */
.map-centerpin .cp-head { position: absolute; left: 50%; bottom: 4px; display: block;
  width: 22px; height: 22px; margin-left: -11px; border-radius: 50% 50% 0 50%;
  background: var(--accent); transform: rotate(45deg); transform-origin: center;
  box-shadow: 0 3px 8px rgba(0,0,0,.3); border: 2.5px solid #fff; }
/* Small shadow ellipse right under the tip at the exact centre. */
.map-centerpin .cp-stem { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 10px; height: 5px; border-radius: 50%; background: rgba(20,33,31,.28); filter: blur(1.5px); }

/* ---------- Glovo-style map screen + draggable bottom sheet ---------- */
.map-screen { position: relative; flex: 1; overflow: hidden; }
.map-screen .map-fill { position: absolute; inset: 0; }
.map-screen .map-fill .leaflet-container,
.map-screen .map-fill > div { width: 100%; height: 100%; }
/* floating back/action buttons over the map */
.map-float { position: absolute; z-index: 500; }
.map-float.tl { top: 14px; left: 14px; }
.map-float.tr { top: 14px; right: 14px; }
.map-float .iconbtn { box-shadow: var(--shadow); }
/* the draggable sheet */
.map-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 400;
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -8px 30px rgba(20,33,31,.14);
  transform: translateY(0); transition: transform .28s var(--ease);
  max-height: 82%; display: flex; flex-direction: column;
  touch-action: none;
}
.map-sheet.dragging { transition: none; }
.map-sheet .ms-grip { width: 42px; height: 5px; border-radius: 999px; background: var(--line);
  margin: 9px auto 4px; flex: 0 0 auto; cursor: grab; }
.map-sheet .ms-head { padding: 2px 20px 8px; flex: 0 0 auto; }
.map-sheet .ms-body { overflow-y: auto; padding: 0 0 calc(16px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
/* collapsed state = only the head peeks; expanded = tall */
.map-sheet.collapsed { transform: translateY(calc(100% - var(--peek, 200px))); }

/* page enter — subtle, on every screen's .view */
.view { animation: viewIn .34s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* tactile press on interactive surfaces */
.card, .resto, .prod, .parent-tile, .chip, .tab, .btn, .iconbtn { -webkit-tap-highlight-color: transparent; }

/* fade-in on load */
.fade { animation: fadeUp .5s var(--ease) both; }
.fade.d1 { animation-delay: .06s; } .fade.d2 { animation-delay: .12s; }
.fade.d3 { animation-delay: .18s; } .fade.d4 { animation-delay: .24s; }
