/* OrderMyDrink customer app. Mobile first, dark by default. Tokens: ../brand/tokens.css */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 16px/1.45 var(--font-body);
  display: flex; flex-direction: column;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
a { color: var(--brand-text); }
.muted { color: var(--text-muted); }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.word { font: 700 20px var(--font-head); letter-spacing: -.3px; }
.word b, h1 b { color: var(--omd-amber); font-weight: 700; }
.loc-chip {
  display: flex; align-items: center; gap: 6px; max-width: 55%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 99px;
  padding: 7px 12px; font-size: 13px; font-weight: 500;
}
.loc-chip svg { color: var(--brand); flex: none; }
.loc-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-chip.unset { border-color: var(--brand); color: var(--brand-text); }
.loc-chip .caret { flex: none; color: var(--text-muted); font-size: 11px; }

/* ---------- layout ---------- */
.view { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 16px 16px 120px; outline: none; }
.foot { text-align: center; font-size: 12px; color: var(--text-muted); padding: 14px 16px 100px; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; line-height: 1.2; }
.hello { font-size: 26px; font-weight: 700; margin: 8px 0 4px; }
.sub { color: var(--text-muted); margin: 0 0 16px; }
.section-title { font: 600 13px var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 24px 0 10px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: var(--radius-sm); padding: 11px 16px; font-weight: 600; font-size: 15px;
  white-space: nowrap; text-decoration: none; min-height: 44px;
}
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.soft { background: var(--surface-2); color: var(--text); }
.btn.big { width: 100%; padding: 15px; font-size: 17px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.wa { background: #1F9D55; color: #fff; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface-2); display: grid; place-items: center; font-size: 20px; line-height: 1; padding: 0;
}
.link-btn { background: none; border: 0; color: var(--brand-text); font: 600 13px var(--font-body); text-transform: none; letter-spacing: 0; padding: 4px 0; }
.back { background: none; border: 0; color: var(--text-muted); padding: 4px 0; margin-bottom: 8px; font-weight: 500; }

/* ---------- search ---------- */
.search { position: relative; }
.search input {
  width: 100%; padding: 15px 16px 15px 46px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); font-size: 17px;
}
.search input::placeholder { color: var(--text-muted); }
.search input:focus { border-color: var(--brand); outline: none; }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--text-muted); font-size: 22px; padding: 6px 10px; }
.hint { font-size: 13px; color: var(--text-muted); margin: 8px 2px 0; }
.results { list-style: none; margin: 10px 0 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.results li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border); }
.results li:first-child { border-top: 0; }
.results .r-name { flex: 1; min-width: 0; }
.results .r-name b { font-weight: 600; display: block; }
.results .r-name small { color: var(--text-muted); font-size: 12px; }
.results .empty { display: block; color: var(--text-muted); padding: 16px; }
.results .r-row { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .12s; }
.results .r-row:hover, .results .r-row:active { background: var(--surface-2, rgba(242,169,59,.08)); }
.results .r-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.results .add { flex: none; pointer-events: none; }
.add { background: var(--brand); color: var(--on-brand); border: 0; border-radius: 99px; padding: 7px 14px; font-weight: 700; font-size: 14px; }
.in-cart { color: var(--ok); font-weight: 600; font-size: 13px; }

/* ---------- cart ---------- */
.cart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.cart-row { display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid var(--border); }
.cart-row:first-child { border-top: 0; }
.del-btn { flex: none; width: 32px; height: 32px; margin-left: -2px; border: 0; border-radius: 50%; background: none; color: var(--text-muted); display: grid; place-items: center; padding: 0; }
.del-btn:hover, .del-btn:active { color: var(--danger, #E5484D); background: rgba(229,72,77,.12); }
.cart-row.flash { animation: rowflash 1.4s ease-out; }
@keyframes rowflash { 0%, 30% { background: rgba(242,169,59,.22); } 100% { background: transparent; } }
.cart-row .c-name { flex: 1; min-width: 0; font-weight: 500; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty span { min-width: 22px; text-align: center; font-weight: 700; }
.empty-cart { text-align: center; padding: 28px 16px; color: var(--text-muted); }
.empty-cart .big-emoji { font-size: 40px; margin-bottom: 6px; }
.chasers { margin-top: 12px; padding: 14px; border-radius: var(--radius); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--brand) 55%, transparent); }
.chasers p { margin: 0 0 10px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--border); background: var(--surface-2); border-radius: 99px; padding: 7px 13px; font-size: 14px; font-weight: 500; }
.chip.added { border-color: var(--ok); color: var(--ok); }

/* ---------- sticky action bar ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.actionbar .inner { max-width: 560px; margin: 0 auto; }

/* ---------- offers ---------- */
.summary { margin-bottom: 14px; }
.summary h2 { font-size: 24px; }
.summary .muted { display: block; font-size: 14px; margin-top: 2px; }
.banner { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 14px; }
.banner.warn { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.banner.info { background: var(--surface); border: 1px solid var(--border); }
.offer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.offer.closed { opacity: .62; }
.offer.best { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.store-name { font: 600 18px var(--font-head); }
.pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.pill.open { background: rgba(47,179,107,.15); color: var(--ok); }
.pill.closed { background: rgba(229,72,77,.15); color: var(--danger); }
.pill.best { background: var(--brand); color: var(--on-brand); }
.pill.test { background: var(--surface-2); color: var(--text-muted); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.meta { color: var(--text-muted); font-size: 14px; margin: 6px 0 12px; }
.price { font: 700 26px var(--font-head); font-variant-numeric: tabular-nums; }
.price-sub { color: var(--text-muted); font-size: 13px; text-align: right; }
.missing { font-size: 13px; color: var(--danger); margin: 10px 0 0; }
.details { margin-top: 10px; }
.details summary { cursor: pointer; color: var(--text-muted); font-size: 14px; list-style: none; }
.details summary::-webkit-details-marker { display: none; }
.details summary::before { content: "▸ "; }
.details[open] summary::before { content: "▾ "; }
.lines { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; }
.lines li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px dashed var(--border); }
.lines li.na { color: var(--text-muted); text-decoration: line-through; }
.offer-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-top: 14px; }

/* ---------- order tracker ---------- */
.code { display: inline-block; font: 800 30px var(--font-head); letter-spacing: 1px; padding: 6px 16px; border-radius: var(--radius-sm); background: var(--brand); color: var(--on-brand); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-top: 14px; }
.steps { list-style: none; padding: 0; margin: 4px 0 0; }
.steps li { position: relative; padding: 0 0 18px 30px; color: var(--text-muted); }
.steps li::before { content: ""; position: absolute; left: 6px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--border); }
.steps li::after { content: ""; position: absolute; left: 12px; top: 20px; bottom: 2px; width: 2px; background: var(--border); }
.steps li:last-child::after { display: none; }
.steps li.done { color: var(--text); }
.steps li.done::before { background: var(--ok); border-color: var(--ok); }
.steps li.now { color: var(--text); font-weight: 600; }
.steps li.now::before { background: var(--brand); border-color: var(--brand); animation: pulse 1.4s infinite; }
.steps li.bad::before { background: var(--danger); border-color: var(--danger); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 25%, transparent); } }
.status-big { font: 700 22px var(--font-head); margin: 14px 0 4px; }
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.recent { list-style: none; padding: 0; margin: 0; }
.recent li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; }
.recent a { text-decoration: none; color: var(--text); flex: 1; min-width: 0; }

/* ---------- bottom sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 88vh; overflow: auto;
  background: var(--surface); border-radius: 20px 20px 0 0; border-top: 1px solid var(--border);
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto;
  animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 4px auto 14px; }
.sheet h2 { font-size: 20px; margin-bottom: 6px; }
.field { display: block; margin: 14px 0; }
.field span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); font-size: 16px;
}
.field input:focus, .field textarea:focus { border-color: var(--brand); outline: none; }
.landmarks { list-style: none; margin: 0; padding: 0; max-height: 40vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.landmarks button { width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--border); padding: 12px 14px; }
.landmarks li:first-child button { border-top: 0; }
.landmarks button.sel { background: color-mix(in srgb, var(--brand) 14%, transparent); }
.landmarks small { color: var(--text-muted); margin-left: 6px; }
.or { text-align: center; color: var(--text-muted); font-size: 13px; margin: 14px 0; }
.lm-filter { width: 100%; margin-bottom: 8px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); font-size: 16px; }
.lm-filter:focus { border-color: var(--brand); outline: none; }
.keep-loc { margin-bottom: 10px; }
.loc-confirm { text-align: center; padding: 6px 0 4px; }
.loc-confirm .pin { font-size: 40px; line-height: 1; }
.loc-confirm p { margin: 8px 0 0; }
.loc-confirm h2 { margin: 2px 0 16px; font-size: 24px; }
.loc-confirm .field { text-align: left; }
.loc-confirm .link-btn { margin-top: 2px; font-size: 15px; padding: 8px 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); z-index: 60;
  background: var(--omd-cream); color: var(--omd-night); padding: 10px 16px; border-radius: 99px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .2s; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- age gate ---------- */
.gate { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; padding: 24px; }
.gate-box { max-width: 380px; text-align: center; }
.gate-box img { margin: 0 auto 10px; }
.gate-box h1 { font-size: 32px; }
.gate-box h2 { font-size: 22px; margin: 30px 0 16px; }
.gate-actions { display: grid; gap: 10px; }
.gate-no { color: var(--danger); font-weight: 600; }

/* skeleton */
.skel { height: 150px; border-radius: var(--radius); margin-bottom: 12px; background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }

@media (min-width: 600px) {
  .hello { font-size: 30px; }
}
