/* ===========================================================
   منوی آنلاین رستوران — استایل صفحه عمومی (موبایل‌محور)
   =========================================================== */
@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-style: normal;
    font-display: swap;
}

:root {
    --radius: 18px;
    --catbar-h: 84px;
    --ease: cubic-bezier(.2, .8, .2, 1);
}
.theme-dark {
    --bg: #131110;
    --bg-2: #181513;
    --surface: #1d1a17;
    --surface-2: #27221e;
    --text: #f4ede5;
    --muted: #a3978b;
    --line: rgba(255, 255, 255, .075);
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --leader: rgba(255, 255, 255, .16);
    color-scheme: dark;
}
.theme-light {
    --bg: #f6f2ec;
    --bg-2: #efe9e1;
    --surface: #ffffff;
    --surface-2: #f3ede5;
    --text: #221b15;
    --muted: #7b6f64;
    --line: rgba(40, 25, 10, .08);
    --shadow: 0 10px 28px rgba(60, 40, 20, .09);
    --leader: rgba(40, 25, 10, .18);
    color-scheme: light;
}

html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: "Vazirmatn", Tahoma, system-ui, sans-serif;
    font-feature-settings: "ss01";
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
}
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- HERO ---------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: calc(34px + env(safe-area-inset-top)) 20px 30px;
    text-align: center;
    background:
        radial-gradient(120% 90% at 50% -10%, rgba(var(--brand-rgb), .38), transparent 60%),
        radial-gradient(60% 50% at 100% 100%, rgba(var(--brand-rgb), .14), transparent 70%),
        var(--bg-2);
    border-bottom: 1px solid var(--line);
}
.hero::before {
    /* الگوی ظریف تزئینی */
    content: "";
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(var(--brand-rgb), .22) 1px, transparent 1.2px);
    background-size: 18px 18px;
    mask-image: radial-gradient(70% 70% at 50% 30%, #000 10%, transparent 75%);
    -webkit-mask-image: radial-gradient(70% 70% at 50% 30%, #000 10%, transparent 75%);
    opacity: .55;
    pointer-events: none;
}
.hero.has-cover::before { display: none; }
.hero-bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    transform: scale(1.04);
}
.hero.has-cover::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(10, 8, 6, .35) 0%, rgba(10, 8, 6, .55) 55%, var(--bg) 100%);
}
.hero.has-cover { color: #fff; border-bottom: 0; padding-top: calc(64px + env(safe-area-inset-top)); }
.hero-inner { position: relative; z-index: 2; max-width: 640px; margin: 0 auto; }
.hero-logo {
    width: 96px; height: 96px; margin: 0 auto 14px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .25), 0 0 0 1px rgba(var(--brand-rgb), .6), var(--shadow);
    overflow: hidden;
    animation: pop .6s var(--ease) both;
}
.hero-logo img { width: 100%; height: 100%; object-fit: cover; }
.hero-logo span { font-size: 42px; font-weight: 800; color: var(--brand); line-height: 1; }
.hero-title {
    font-size: clamp(1.6rem, 6.5vw, 2.3rem);
    font-weight: 850; margin: 0; letter-spacing: -.3px;
    animation: rise .6s .05s var(--ease) both;
}
.hero-tagline {
    margin: 6px auto 0; max-width: 460px;
    color: var(--muted); font-size: .95rem;
    animation: rise .6s .1s var(--ease) both;
}
.hero.has-cover .hero-tagline { color: rgba(255, 255, 255, .82); }
.hero-chips {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
    margin-top: 18px;
    animation: rise .6s .15s var(--ease) both;
}
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px;
    font-size: .8rem; font-weight: 500;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(var(--brand-rgb), .08);
    color: inherit; cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background .2s;
}
.hero.has-cover .chip { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .18); }
.chip:active { transform: scale(.97); }
.chip i { color: var(--brand); font-size: .95em; }
.hero.has-cover .chip i { color: #fff; }

/* ---------- CATEGORY BAR ---------- */
.catbar {
    position: sticky; top: 0; z-index: 30;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow .25s;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .theme-dark .catbar { background: rgba(19, 17, 16, .9); }
    .theme-light .catbar { background: rgba(246, 242, 236, .92); }
}
.catbar.is-stuck { box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.catbar-row { display: flex; align-items: center; max-width: 900px; margin: 0 auto; }
.search-toggle {
    flex: 0 0 auto;
    width: 46px; height: 46px; margin: 0 12px 0 4px;
    border-radius: 14px; border: 1px solid var(--line);
    background: var(--surface); color: var(--text);
    display: grid; place-items: center; font-size: 1.05rem;
}
.search-toggle:active { transform: scale(.94); }
.cat-scroll {
    flex: 1; display: flex; gap: 6px;
    overflow-x: auto; overscroll-behavior-x: contain;
    padding: 10px 12px 10px 12px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(to left, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
    mask-image: linear-gradient(to left, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
    flex: 0 0 auto;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    min-width: 66px; padding: 7px 6px 6px;
    border-radius: 16px;
    color: var(--muted);
    scroll-snap-align: center;
    transition: color .25s, background .25s;
}
.cat-ico {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    transition: background .25s var(--ease), color .25s, transform .25s var(--ease), box-shadow .25s;
}
.cat-ico .mi { width: 24px; height: 24px; }
.cat-name { font-size: .72rem; font-weight: 600; white-space: nowrap; max-width: 88px; overflow: hidden; text-overflow: ellipsis; }
.cat-chip.active { color: var(--text); }
.cat-chip.active .cat-ico {
    background: var(--brand); color: var(--on-brand); border-color: transparent;
    box-shadow: 0 6px 16px rgba(var(--brand-rgb), .4);
    transform: translateY(-1px);
}
.mi-img { width: 26px !important; height: 26px !important; object-fit: contain; border-radius: 6px; }

.searchbar {
    display: flex; align-items: center; gap: 10px;
    max-width: 900px; margin: 0 auto; padding: 0 14px 12px;
}
.searchbar[hidden] { display: none; }
.searchbar > i { position: absolute; margin-right: 14px; color: var(--muted); pointer-events: none; }
.searchbar input {
    flex: 1; height: 46px;
    padding: 0 42px 0 14px;
    border-radius: 14px; border: 1px solid var(--line);
    background: var(--surface); color: var(--text);
    font-family: inherit; font-size: 16px; outline: none;
}
.searchbar input:focus { border-color: rgba(var(--brand-rgb), .7); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .18); }
.searchbar button {
    width: 46px; height: 46px; border-radius: 14px;
    border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}

/* ---------- MENU ---------- */
.menu { max-width: 900px; margin: 0 auto; padding: 14px 14px 40px; }
.notice {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 16px; margin: 6px 0 8px;
    border-radius: var(--radius);
    background: rgba(var(--brand-rgb), .1);
    border: 1px dashed rgba(var(--brand-rgb), .45);
    font-size: .9rem; line-height: 1.9;
}
.notice i { color: var(--brand); font-size: 1.2rem; }

.menu-sec { padding-top: 22px; scroll-margin-top: calc(var(--catbar-h) + 10px); }
.sec-head { display: flex; align-items: center; gap: 12px; margin: 4px 4px 14px; }
.sec-ico {
    width: 46px; height: 46px; flex: 0 0 auto;
    display: grid; place-items: center;
    border-radius: 15px;
    color: var(--brand);
    background: rgba(var(--brand-rgb), .12);
    border: 1px solid rgba(var(--brand-rgb), .25);
}
.sec-ico .mi { width: 26px; height: 26px; }
.sec-head h2 { font-size: 1.28rem; font-weight: 800; margin: 0; }
.sec-note { margin: 2px 0 0; color: var(--muted); font-size: .8rem; }
.sec-count {
    margin-right: auto;
    font-size: .74rem; color: var(--muted);
    padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
    white-space: nowrap;
}

.items {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.item {
    display: flex; gap: 14px;
    padding: 16px 16px;
    position: relative;
}
.item + .item { border-top: 1px solid var(--line); }
.item.is-featured { background: linear-gradient(90deg, transparent, rgba(var(--brand-rgb), .07)); }
.item.is-featured::before {
    content: ""; position: absolute; right: 0; top: 14px; bottom: 14px;
    width: 3px; border-radius: 3px 0 0 3px; background: var(--brand);
}
.item-body { flex: 1; min-width: 0; }
.item-top { display: flex; align-items: baseline; gap: 8px; }
.item-name {
    font-size: 1rem; font-weight: 700; line-height: 1.7; margin: 0;
    flex: 0 1 auto;
}
.leader {
    flex: 1 1 18px; min-width: 18px;
    border-bottom: 2px dotted var(--leader);
    transform: translateY(-5px);
}
.item-price {
    flex: 0 0 auto;
    font-weight: 800; font-size: 1.02rem;
    color: var(--brand);
    white-space: nowrap;
}
.item-price .cur { font-size: .68rem; font-weight: 500; color: var(--muted); margin-right: 2px; }
.badge-feat, .badge-off {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .64rem; font-weight: 700;
    padding: 2px 8px; margin-right: 6px;
    border-radius: 999px; vertical-align: middle;
    transform: translateY(-2px);
}
.badge-feat { background: rgba(var(--brand-rgb), .16); color: var(--brand); }
.badge-feat i { font-size: .6rem; }
.badge-off { background: rgba(220, 70, 60, .14); color: #e0685d; }
.item.is-off .item-name, .item.is-off .item-price { opacity: .5; }
.item.is-off .item-price { text-decoration: line-through; }

.item-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.act {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 12px;
    font-size: .78rem; font-weight: 600;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .15s;
}
.act i { color: var(--brand); font-size: .95rem; }
.act .chev { font-size: .7rem; color: var(--muted); transition: transform .3s var(--ease); }
.act:active { transform: scale(.96); }
.act[aria-expanded="true"] { border-color: rgba(var(--brand-rgb), .5); background: rgba(var(--brand-rgb), .1); }
.act[aria-expanded="true"] .chev { transform: rotate(180deg); }

.item-desc {
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows .35s var(--ease);
}
.item-desc > .item-desc-inner { overflow: hidden; color: var(--muted); font-size: .86rem; line-height: 2; }
.item-desc.open { grid-template-rows: 1fr; }
.item-desc.open > .item-desc-inner { padding-top: 10px; }

.item-thumb {
    flex: 0 0 auto; width: 84px; height: 84px;
    padding: 0; border: 0; border-radius: 14px; overflow: hidden;
    background: var(--surface-2);
    cursor: zoom-in;
    align-self: flex-start;
}
.item-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.item-thumb:active img { transform: scale(1.06); }

.no-results, .empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.no-results i { font-size: 2rem; }
.empty-ico { width: 84px; height: 84px; margin: 0 auto 12px; color: var(--brand); }
.empty-ico .mi { width: 84px; height: 84px; }
.empty-state h2 { font-size: 1.2rem; color: var(--text); font-weight: 800; }

.menu-sec.is-hidden, .item.is-hidden { display: none; }

/* ---------- FOOTER ---------- */
.site-footer {
    text-align: center; padding: 32px 20px calc(40px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem;
}
.footer-name { font-weight: 800; color: var(--text); font-size: 1.05rem; margin-bottom: 8px; }
.footer-line { display: inline-flex; gap: 6px; align-items: center; line-height: 1.9; }
.footer-line i { color: var(--brand); }
.footer-note { margin: 10px 0 0; }
.footer-cur { margin: 10px 0 0; font-size: .75rem; opacity: .8; }

.to-top {
    position: fixed; left: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 40;
    width: 46px; height: 46px; border-radius: 15px;
    border: 0; background: var(--brand); color: var(--on-brand);
    box-shadow: 0 8px 22px rgba(var(--brand-rgb), .45);
    opacity: 0; transform: translateY(16px); pointer-events: none;
    transition: opacity .3s, transform .3s var(--ease);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

.toast-lite {
    position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 2000;
    transform: translate(-50%, 20px); opacity: 0;
    background: var(--text); color: var(--bg);
    padding: 10px 18px; border-radius: 12px; font-size: .85rem; font-weight: 600;
    transition: .3s var(--ease); pointer-events: none; white-space: nowrap;
}
.toast-lite.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- ITEM SHEET ---------- */
.sheet .modal-content {
    background: var(--surface); color: var(--text);
    border: 1px solid var(--line); border-radius: 26px; overflow: hidden;
}
.sheet-close {
    position: absolute; top: 12px; left: 12px; z-index: 3;
    width: 38px; height: 38px; border-radius: 50%; border: 0;
    background: rgba(0, 0, 0, .5); color: #fff;
    backdrop-filter: blur(6px);
}
.sheet-img { background: var(--surface-2); aspect-ratio: 4 / 3; }
.sheet-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet-img.is-empty { display: none; }
.sheet-body { padding: 18px 20px 24px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-head h3 { font-size: 1.2rem; font-weight: 800; margin: 0; line-height: 1.7; }
.sheet-price { font-weight: 800; color: var(--brand); white-space: nowrap; font-size: 1.1rem; line-height: 1.9; }
.sheet-price .cur { font-size: .7rem; color: var(--muted); font-weight: 500; }
.sheet-desc { margin-top: 10px; color: var(--muted); line-height: 2.05; font-size: .92rem; }
.sheet-desc:empty { display: none; }
.modal-backdrop.show { opacity: .7; }

/* بر روی موبایل: Bottom Sheet */
@media (max-width: 575.98px) {
    .sheet .modal-dialog {
        margin: 0; min-height: 100%;
        display: flex; align-items: flex-end;
        max-width: none;
    }
    .sheet .modal-content {
        border-radius: 26px 26px 0 0; border-bottom: 0;
        max-height: 92vh; overflow-y: auto;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .sheet.fade .modal-dialog { transform: translateY(100%); transition: transform .38s var(--ease); }
    .sheet.show .modal-dialog { transform: none; }
    .sheet .modal-content::before {
        content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
        width: 42px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .55); z-index: 4;
    }
    .sheet-img.is-empty + .sheet-body { padding-top: 34px; }
    .item-thumb { width: 74px; height: 74px; }
}

@media (min-width: 768px) {
    .menu { padding: 24px 20px 60px; }
    .item { padding: 18px 22px; }
    .item-name { font-size: 1.05rem; }
    .cat-chip { min-width: 80px; }
    .hero { padding-top: 56px; padding-bottom: 44px; }
    .hero-logo { width: 112px; height: 112px; }
}

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Credit ---------- */
.credit {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 22px; padding: 7px 8px 7px 14px;
    border-radius: 999px; border: 1px solid var(--line);
    font-size: .72rem; color: var(--muted);
    transition: border-color .2s, color .2s;
}
.credit:hover { color: var(--text); border-color: rgba(var(--brand-rgb), .45); }
.credit-brand { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--text); }
.credit-mark { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: linear-gradient(135deg, #6d5dfc, #22d3ee); }
.credit-mark svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
