/* اپ سفارش کافه روبی — موبایل‌اول؛ رنگ و فونت همان سایت دپاک (قهوه‌ای روبی) */
@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Variable.woff2") format("woff2-variations"), url("fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --brand: #7a3e1d;
  --brand-strong: #5c2c12;
  --brand-soft: #f6ece4;
  --accent: #c2410c;
  --accent-soft: #fdeee4;
  --ok: #059669;
  --ok-soft: #e7f8f1;
  --err: #b91c1c;
  --err-soft: #fef2f2;
  --ink: #1c1410;
  --muted: #6b5f57;
  --faint: #9a8f87;
  --line: #ece4dc;
  --surface: #ffffff;
  --page: #faf7f3;
  --shadow: 0 1px 2px rgba(40, 20, 10, .05), 0 8px 24px rgba(40, 20, 10, .07);
  --bar: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #e0a47a; --brand-strong: #f0c4a2; --brand-soft: #2c1d14;
    --accent: #f08a4b; --accent-soft: #35200f; --ok: #34d399; --ok-soft: #0f2d23; --err: #f87171; --err-soft: #3a1414;
    --ink: #f2ebe5; --muted: #b5a99f; --faint: #85796f; --line: #33291f; --surface: #1b1612; --page: #120e0b;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: "Vazirmatn", Tahoma, system-ui, sans-serif; line-height: 1.7; color: var(--ink); background: var(--page);
  padding-bottom: env(safe-area-inset-bottom); }
img { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.4; }
p { margin: 0; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

/* ---------- نوار بالا ---------- */
.bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.bar__in { max-width: 1200px; margin: 0 auto; height: var(--bar); padding: 0 12px; display: flex; align-items: center; gap: 8px; }
.bar__brand { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; }
.bar__brand img { width: 38px; height: 38px; flex: none; }
.bar__brand b { display: block; font-size: 17px; font-weight: 900; line-height: 1.3; }
.bar__back { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--ink); }
.bar__back:hover { background: var(--brand-soft); }
.bar__title { font-size: 17px; font-weight: 900; }
.bar__act { margin-inline-start: auto; display: flex; gap: 4px; }
.iconbtn { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--muted); }
.iconbtn:hover { background: var(--brand-soft); color: var(--brand); }
.iconbtn .dot { position: absolute; top: 8px; inset-inline-end: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.status { display: block; font-size: 12px; font-weight: 700; color: var(--faint); line-height: 1.4; }
.status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); margin-inline-end: 5px; vertical-align: 1px; }
.status--open { color: var(--ok); }
.status--open::before { background: var(--ok); }
dd .status { display: inline; }

/* ---------- چیدمان اپ ---------- */
.app { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 0 0 110px; }
.app__menu { min-width: 0; }
.app__cart { display: none; }
@media (min-width: 1000px) {
  .app { grid-template-columns: minmax(0, 1fr) 340px; padding: 16px 16px 40px; }
  .app__cart { display: block; }
  .cartpanel { position: sticky; top: calc(var(--bar) + 16px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
    padding: 18px; box-shadow: var(--shadow); max-height: calc(100vh - var(--bar) - 32px); overflow: auto; }
  .cartpanel h2 { font-size: 17px; font-weight: 900; margin-bottom: 12px; }
  .is-app .cartbar { display: none; }
}

.cover { position: relative; height: 150px; overflow: hidden; color: #fff; background: #2a160b; }
.cover img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30, 14, 6, .15), rgba(30, 14, 6, .85)); }
.cover__t { position: absolute; inset-inline: 16px; bottom: 14px; z-index: 1; }
.cover h1 { font-size: 24px; font-weight: 900; }
.cover p { font-size: 13px; opacity: .9; }
@media (min-width: 1000px) { .cover { border-radius: 22px; height: 180px; } .cover h1 { font-size: 30px; } }

.notice { margin: 12px 16px 0; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; padding: 10px 14px; border-radius: 14px; }
@media (min-width: 1000px) { .notice { margin-inline: 0; } }

/* جستجو و دسته‌ها: زیر نوار بالا می‌چسبند */
.sticky { position: sticky; top: calc(var(--bar) + env(safe-area-inset-top)); z-index: 10; background: var(--page); padding: 12px 16px 0;
  border-bottom: 1px solid var(--line); }
@media (min-width: 1000px) { .sticky { padding-inline: 0; } }
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 0 14px; color: var(--faint); }
.search:focus-within { border-color: var(--brand); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); padding: 11px 0; outline: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search__x { border: 0; background: var(--line); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; line-height: 1; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a { flex: none; display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px; padding-inline-end: 14px; }
.chips img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.chips a.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.cat { padding: 18px 16px 0; scroll-margin-top: calc(var(--bar) + 130px); }
@media (min-width: 1000px) { .cat { padding-inline: 0; } }
.cat h2 { font-size: 19px; font-weight: 900; margin-bottom: 10px; }
.cat h2 small { font-size: 13px; color: var(--faint); font-weight: 600; }

/* ---------- آیتم منو ---------- */
.rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .rows { grid-template-columns: 1fr 1fr; } }
.row { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; transition: border-color .15s, box-shadow .15s; }
.row:hover { box-shadow: var(--shadow); }
.row.in-cart { border-color: var(--accent); }
.row__open { display: flex; gap: 12px; padding: 12px; color: inherit; min-height: 128px; }
.row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row__body > b { font-size: 15.5px; font-weight: 800; line-height: 1.5; }
.row__desc { font-size: 13px; color: var(--muted); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .price { margin-top: auto; }
.row__img { position: relative; flex: none; width: 104px; height: 104px; border-radius: 14px; overflow: hidden; background: var(--brand-soft); }
.row__img img { width: 100%; height: 100%; object-fit: cover; }
.off { position: absolute; top: 6px; inset-inline-start: 6px; background: var(--accent); color: #fff; font-style: normal; font-size: 11.5px; font-weight: 800; padding: 0 7px; border-radius: 999px; }
.tag { font-style: normal; font-size: 10.5px; font-weight: 800; color: var(--accent); background: var(--accent-soft); padding: 0 7px; border-radius: 999px; vertical-align: 2px; }
/* دکمه‌ی افزودن روی گوشه‌ی عکس */
.row__add { position: absolute; bottom: 8px; inset-inline-end: 8px; }
.price { font-size: 15.5px; font-weight: 900; letter-spacing: -.01em; }
.price small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.price del { font-size: 12px; font-weight: 500; color: var(--faint); margin-inline-end: 6px; }
.add { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 12px; background: var(--surface); color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,.18); cursor: pointer; }
.add:active { transform: scale(.92); }
.qty { display: none; align-items: center; background: var(--accent); color: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.qty button { width: 34px; height: 38px; border: 0; background: transparent; color: #fff; font-size: 20px; font-weight: 800; cursor: pointer; line-height: 1; }
.qty output { min-width: 18px; text-align: center; font-weight: 900; }
.in-cart .add { display: none; }
.in-cart .qty { display: inline-flex; }
.is-closed .row__add { display: none; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 50px 16px; color: var(--muted); }
.empty b { color: var(--ink); font-size: 17px; }
.empty .cta { margin-top: 12px; width: auto; padding-inline: 28px; }
.credit { padding: 26px 16px 0; font-size: 12px; color: var(--faint); text-align: center; }
.credit a { color: var(--faint); text-decoration: underline; }

/* ---------- نوار سبد (موبایل) ---------- */
.cartbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  transform: translateY(120%); transition: transform .25s; pointer-events: none; }
.cartbar.open { transform: none; pointer-events: auto; }
.cartbar__btn { width: 100%; max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 12px; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; border-radius: 16px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(194, 65, 12, .35); font-weight: 800; }
.cartbar__n { display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: 9px; background: rgba(255,255,255,.22); }
.cartbar__sum { margin-inline-start: auto; }

/* ---------- برگه‌ی پایین (آیتم و سبد) ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet__bg { position: absolute; inset: 0; background: rgba(20, 10, 5, .5); animation: fade .2s; }
.sheet__panel { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--surface);
  border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: up .25s ease-out; }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet__panel { border-radius: 24px; } }
.sheet__x { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.9); color: #1c1410; display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.sheet__img { aspect-ratio: 4 / 3; background: var(--brand-soft); }
.sheet__img img { width: 100%; height: 100%; object-fit: cover; }
.sheet__c { padding: 18px 18px 20px; display: grid; gap: 8px; }
.sheet__c h2 { font-size: 22px; font-weight: 900; }
.sheet__c .en { color: var(--faint); font-size: 13px; direction: ltr; text-align: right; }
.sheet__c p { color: var(--muted); }
.sheet__c .price { font-size: 20px; }
.sheet__buy { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 14px; }
.stepper button { width: 44px; height: 48px; border: 0; background: transparent; font-size: 22px; font-weight: 800; color: var(--accent); cursor: pointer; }
.stepper output { min-width: 26px; text-align: center; font-weight: 900; font-size: 17px; }
.sheet__cart { padding: 22px 18px 18px; }
.sheet__cart h2 { font-size: 19px; font-weight: 900; margin-bottom: 12px; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- ردیف‌های سبد ---------- */
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lines li { display: flex; align-items: center; gap: 10px; }
.lines img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; }
.lines .t { flex: 1; min-width: 0; }
.lines .t b { display: block; font-size: 14.5px; }
.lines .t small { color: var(--muted); }
.lines .amt { font-weight: 800; white-space: nowrap; }
.lines .qty { display: inline-flex; }
.lines .qty button { width: 30px; height: 34px; font-size: 17px; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 900; font-size: 16px; padding-top: 12px; margin-top: 12px; border-top: 1px dashed var(--line); }
.cartempty { color: var(--faint); text-align: center; padding: 26px 0; font-size: 14px; }

/* ---------- دکمه‌ها ---------- */
.cta { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; border: 0; cursor: pointer; text-decoration: none;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 16px; border-radius: 16px; padding: 14px 18px; margin-top: 14px; }
.cta:only-child, .cta--center, .empty .cta { justify-content: center; }
.cta:disabled { opacity: .5; cursor: not-allowed; }
.cta--ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--line); justify-content: center; }
.sheet__buy .cta { margin: 0; flex: 1; }
.link { display: inline-block; margin-top: 12px; font-weight: 700; font-size: 14px; }

/* ---------- صفحه‌های دیگر (ثبت، پیگیری، …) ---------- */
.page { max-width: 640px; margin: 0 auto; padding: 14px 14px 40px; display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; }
.card h2 { font-size: 16.5px; font-weight: 900; margin-bottom: 10px; }
.alert { border-radius: 14px; padding: 10px 14px; font-weight: 600; font-size: 14px; }
.alert--err { background: var(--err-soft); color: var(--err); }
.hint { color: var(--faint); font-size: 12.5px; margin-top: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.field label { font-weight: 700; font-size: 14px; }
.field input, .field select, .field textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--page); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 10px 14px; width: 100%; }
.field textarea { min-height: 64px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.err { color: var(--err); font-size: 13px; margin: 0; padding: 0; list-style: none; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label { display: flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid var(--line); border-radius: 14px; padding: 11px; cursor: pointer; font-weight: 800; }
.seg label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.seg input { position: absolute; opacity: 0; }

.ticket { text-align: center; }
.ticket h2 { font-size: 21px; margin: 8px 0 4px; }
.ticket p { color: var(--muted); font-size: 14px; }
.ticket__ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 28px; font-weight: 900; }
.ticket__ic--err { background: var(--err-soft); color: var(--err); }
.track { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.track li { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--faint); }
.track i { width: 100%; height: 6px; border-radius: 999px; background: var(--line); }
.track li.on { color: var(--ok); }
.track li.on i { background: var(--ok); }

.orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.orders a { display: flex; align-items: center; gap: 12px; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.orders .n { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); font-weight: 900; flex: none; }
.orders .t { flex: 1; min-width: 0; }
.orders .t b { display: block; }
.orders .t small { color: var(--muted); }
.orders .s { font-size: 12.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--page); color: var(--muted); white-space: nowrap; }
.orders .s--live { background: var(--accent-soft); color: var(--accent); }
.orders .s--done { background: var(--ok-soft); color: var(--ok); }

.about { text-align: center; }
.about__logo { margin: 0 auto 8px; }
.about h2 small { display: block; font-size: 13px; color: var(--faint); font-weight: 600; }
.about p { color: var(--muted); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 700; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: var(--surface);
  font-size: 14px; font-weight: 700; padding: 8px 16px; border-radius: 999px; box-shadow: var(--shadow); animation: fade .2s; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.tablenote { margin: 12px 16px 0; background: var(--ok-soft); color: var(--ok); font-weight: 700; font-size: 14px; padding: 10px 14px; border-radius: 14px; }
@media (min-width: 1000px) { .tablenote { margin-inline: 0; } }
