/* صبحانه‌سرای ناشتا — استایل رترو دهه ۶۰ (میلادی ۹۰) */
:root {
    --red: #8E1B1B;
    --red-dark: #6E1212;
    --mustard: #E8A93C;
    --mustard-soft: #F2C566;
    --gold: #C9973B;
    --cream: #FBF6EA;
    --paper: #F5EBD7;
    --ink: #3A2A1E;
    --ink-soft: #7A6A55;
    --line: #D8C7A6;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--cream);
    background-image:
        radial-gradient(circle at 20% 10%, rgba(232, 169, 60, 0.08), transparent 40%),
        radial-gradient(circle at 80% 90%, rgba(142, 27, 27, 0.06), transparent 40%),
        repeating-linear-gradient(45deg, transparent 0 10px, rgba(58, 42, 30, 0.015) 10px 11px);
    color: var(--ink);
    line-height: 1.8;
}

.site-frame {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); }

h1, h2, h3, .display { font-family: 'Lalezar', 'Vazirmatn', Tahoma, cursive; font-weight: 400; }

/* ---------- سربرگ: تابلوی کافه ---------- */
.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 0 0.8rem;
}

/* بازسازی وکتوری تابلوی واقعی کافه:
   قاب کرم، گوشه‌های بریده هشت‌ضلعی، ستاره گره‌چینی در چهار گوشه، زمینه قرمز لاکی */
.sign-board {
    display: inline-block;
    font-size: 1rem;
    background: linear-gradient(180deg, #F6EDCF, #EADDB4);
    padding: 0.3em;
    clip-path: polygon(1.15em 0, calc(100% - 1.15em) 0, 100% 1.15em,
        100% calc(100% - 1.15em), calc(100% - 1.15em) 100%, 1.15em 100%,
        0 calc(100% - 1.15em), 0 1.15em);
    filter: drop-shadow(0 0.35em 0.7em rgba(43, 22, 16, 0.45));
    line-height: 1;
    text-decoration: none;
}
.sign-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1em;
    padding: 0.45em 1.6em 0.7em;
    background-color: #8E1B1B;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23F2E8C9'%3E%3Crect x='7' y='7' width='10' height='10'/%3E%3Crect x='7' y='7' width='10' height='10' transform='rotate(45 12 12)'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23F2E8C9'%3E%3Crect x='7' y='7' width='10' height='10'/%3E%3Crect x='7' y='7' width='10' height='10' transform='rotate(45 12 12)'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23F2E8C9'%3E%3Crect x='7' y='7' width='10' height='10'/%3E%3Crect x='7' y='7' width='10' height='10' transform='rotate(45 12 12)'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23F2E8C9'%3E%3Crect x='7' y='7' width='10' height='10'/%3E%3Crect x='7' y='7' width='10' height='10' transform='rotate(45 12 12)'/%3E%3C/g%3E%3C/svg%3E"),
        radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.12), transparent 55%),
        linear-gradient(180deg, #A82834, #97202A 45%, #7E141E);
    background-repeat: no-repeat;
    background-size: 0.85em 0.85em, 0.85em 0.85em, 0.85em 0.85em, 0.85em 0.85em, 100% 100%, 100% 100%;
    background-position: top 0.28em right 0.28em, top 0.28em left 0.28em,
        bottom 0.28em right 0.28em, bottom 0.28em left 0.28em, center, center;
    clip-path: polygon(0.95em 0, calc(100% - 0.95em) 0, 100% 0.95em,
        100% calc(100% - 0.95em), calc(100% - 0.95em) 100%, 0.95em 100%,
        0 calc(100% - 0.95em), 0 0.95em);
    box-shadow: inset 0 0 2.2em rgba(0, 0, 0, 0.3);
}
.sign-pre {
    font-family: 'Noto Nastaliq Urdu', 'Vazirmatn', serif;
    font-size: 0.95em;
    line-height: 2;
    color: #FDFBF2;
    text-shadow:
        -1px 0 0 #55622F, 1px 0 0 #55622F, 0 -1px 0 #55622F, 0 1px 0 #55622F,
        -1px 1px 0 #55622F, 1px -1px 0 #55622F, 0 0.12em 0.05em rgba(0, 0, 0, 0.35);
}
.sign-main {
    font-family: 'Noto Nastaliq Urdu', 'Vazirmatn', serif;
    font-weight: 700;
    font-size: 2em;
    line-height: 1.7;
    color: #F8F1DC;
    text-shadow:
        -1px 0 0 #241610, 1px 0 0 #241610, 0 -1px 0 #241610, 0 1px 0 #241610,
        -0.06em 0.09em 0 #241610, 0 0.14em 0.1em rgba(0, 0, 0, 0.4);
}
.sign-sm { font-size: 0.62rem; }
.sign-lg { font-size: 1.5rem; }
.sign-hours { font-size: 0.78rem; color: var(--ink-soft); text-align: center; display: block; margin-top: 0.4rem; }
.brand-wrap { display: inline-flex; flex-direction: column; align-items: center; }
@media (max-width: 640px) {
    .sign-lg { font-size: 1.05rem; }
}

.main-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.main-nav a {
    background: var(--paper);
    border: 1.5px solid var(--gold);
    border-radius: 999px;
    padding: 0.35rem 1.1rem;
    font-weight: 600;
    box-shadow: 0 2px 0 rgba(58, 42, 30, 0.15);
}
.main-nav a:hover { background: var(--mustard-soft); }
.cart-link { position: relative; }
.cart-badge {
    display: inline-block;
    min-width: 1.4em;
    text-align: center;
    background: var(--red);
    color: #fff;
    border-radius: 999px;
    font-size: 0.78rem;
    padding: 0 0.35em;
    margin-inline-start: 0.35em;
}

.closed-banner {
    background: var(--ink);
    color: var(--mustard-soft);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    text-align: center;
    margin: 0.6rem 0;
}

.flash {
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin: 0.8rem 0;
    border: 1.5px solid;
    text-align: center;
}
.flash-ok { background: #EDF6E8; border-color: #4E7A3A; color: #33551F; }
.flash-error { background: #FBE9E7; border-color: var(--red); color: var(--red-dark); }

/* ---------- هیرو ---------- */
.hero {
    margin: 1.2rem 0 2rem;
    background: linear-gradient(160deg, #F0B94F, var(--mustard) 60%, #D89A2E);
    border: 3px solid var(--red);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(58, 42, 30, 0.22), inset 0 0 0 6px rgba(255, 248, 226, 0.35);
    padding: 2.4rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before, .hero::after {
    content: '✦';
    position: absolute;
    color: rgba(142, 27, 27, 0.25);
    font-size: 3.5rem;
}
.hero::before { top: 0.6rem; right: 1.2rem; }
.hero::after { bottom: 0.6rem; left: 1.2rem; }
.hero h1 {
    margin: 0;
    font-size: 2.6rem;
    color: var(--red-dark);
    text-shadow: 1px 2px 0 rgba(255, 248, 226, 0.6);
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.hero .sign-board { margin-bottom: 0.8rem; }
.hero p { margin: 0.4rem 0 1.2rem; font-size: 1.05rem; color: #5C3D14; }
.btn {
    display: inline-block;
    background: var(--red);
    color: #FFE9B0;
    font-family: 'Lalezar', cursive;
    font-size: 1.15rem;
    border: 2px solid var(--red-dark);
    border-radius: 10px;
    padding: 0.5rem 2rem;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--red-dark);
    transition: transform 0.08s, box-shadow 0.08s;
    white-space: nowrap;
    text-align: center;
}
.btn:hover { color: #fff; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-dark); }
.btn-sm { font-size: 0.95rem; padding: 0.25rem 1.1rem; box-shadow: 0 3px 0 var(--red-dark); }
.btn-ghost {
    background: var(--paper);
    color: var(--red);
    border-color: var(--gold);
    box-shadow: 0 3px 0 var(--gold);
}

/* ---------- منو ---------- */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 2rem 0 1rem;
    color: var(--red-dark);
    font-size: 1.7rem;
}
.section-title::before, .section-title::after {
    content: '';
    flex: 1;
    border-top: 2px dashed var(--gold);
}

.cat-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}
.cat-nav a {
    background: var(--red);
    color: var(--mustard-soft);
    border-radius: 6px;
    padding: 0.25rem 1rem;
    font-family: 'Lalezar', cursive;
    font-size: 1.05rem;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 0.8rem;
}
.menu-card {
    background: var(--paper);
    border: 2px solid var(--gold);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 3px 8px rgba(58, 42, 30, 0.1);
}
/* کارت‌های بدون عکس: بدون بلوک بزرگ خالی — یک نوار باریک تزئینی بالای کارت */
.menu-card.no-img { border-top: 4px solid var(--red); }
.menu-card-img {
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mustard-soft);
    font-size: 2.4rem;
}
.menu-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.menu-card-body { padding: 0.7rem 0.85rem 0.85rem; display: flex; flex-direction: column; flex: 1; gap: 0.15rem; }
.menu-card h3 { margin: 0; font-size: 1.1rem; line-height: 1.4; color: var(--red-dark); }
.menu-card .desc { font-size: 0.8rem; color: var(--ink-soft); margin: 0.1rem 0 0.5rem; flex: 1; }
.menu-card .price-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-top: 1px dashed var(--line);
    padding-top: 0.6rem;
    margin-top: auto;
}
.menu-card .price-row form { width: 100%; }
.menu-card .price-row .btn { width: 100%; }
.price { font-weight: 700; color: var(--ink); text-align: center; white-space: nowrap; }

/* ---------- جدول‌ها و فرم‌ها ---------- */
.card {
    background: var(--paper);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
    margin: 1rem 0;
    box-shadow: 0 4px 12px rgba(58, 42, 30, 0.1);
}

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 0.55rem 0.6rem; text-align: right; border-bottom: 1px dashed var(--line); }
.tbl th { color: var(--red-dark); font-family: 'Lalezar', cursive; font-weight: 400; font-size: 1.05rem; }
.tbl tr:last-child td { border-bottom: 0; }

label { display: block; margin: 0.7rem 0 0.25rem; font-weight: 600; font-size: 0.92rem; }
input[type=text], input[type=tel], input[type=password], input[type=number], textarea, select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--mustard); border-color: var(--gold); }

/* ---------- خطوط سبد خرید ---------- */
.cart-line {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.7rem 0;
    border-bottom: 1px dashed var(--line);
}
.cart-line-info { flex: 1 1 55%; min-width: 130px; }
.cart-line-name { font-weight: 700; color: var(--red-dark); }
.cart-line-unit { font-size: 0.8rem; }
.cart-line-total { font-weight: 700; white-space: nowrap; margin-inline-start: auto; }
.cart-line-del { margin: 0; }
.cart-sumline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.9rem;
    margin-top: 0.3rem;
    font-size: 1.15rem;
    color: var(--red-dark);
    font-weight: 700;
}
.cart-sumline strong { white-space: nowrap; }

.qty-form { display: inline-flex; align-items: center; gap: 0.3rem; }
.qty-btn {
    background: var(--mustard);
    border: 1.5px solid var(--gold);
    border-radius: 6px;
    width: 1.8rem;
    height: 1.8rem;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
}
.qty-btn:hover { background: var(--mustard-soft); }

.radio-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.4rem 0; }
.radio-row label {
    flex: 1;
    min-width: 130px;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    padding: 0.55rem;
    text-align: center;
    cursor: pointer;
    background: #fff;
    margin: 0;
    font-weight: 500;
}
.radio-row input { display: none; }
.radio-row label:has(input:checked) {
    border-color: var(--red);
    background: var(--mustard-soft);
    font-weight: 700;
}

/* ---------- پیگیری سفارش ---------- */
.status-line { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.8rem 0; }
.status-step {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 0.45rem 0.3rem;
    border-radius: 8px;
    background: #fff;
    border: 1.5px dashed var(--line);
    font-size: 0.82rem;
    color: var(--ink-soft);
}
.status-step.done { background: var(--mustard-soft); border-style: solid; border-color: var(--gold); color: var(--ink); font-weight: 700; }
.status-step.current { background: var(--red); border-color: var(--red-dark); color: #FFE9B0; font-weight: 700; }
.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 0.1rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--mustard-soft);
    border: 1px solid var(--gold);
}
.badge.canceled { background: #FBE9E7; border-color: var(--red); color: var(--red-dark); }
.badge.delivered { background: #EDF6E8; border-color: #4E7A3A; color: #33551F; }

/* ---------- پاورقی ---------- */
.site-footer {
    margin-top: 3rem;
    text-align: center;
    border-top: 3px double var(--gold);
    padding-top: 1rem;
    color: var(--ink-soft);
    font-size: 0.9rem;
}
.footer-ornament { color: var(--gold); font-size: 1.1rem; letter-spacing: 6px; }
.footer-name { font-family: 'Noto Nastaliq Urdu', 'Lalezar', serif; font-size: 1.3rem; line-height: 2; color: var(--red-dark); margin: 0.2rem 0; }

@media (max-width: 640px) {
    .site-header { justify-content: center; text-align: center; }
    .hero h1 { font-size: 2rem; }
}

/* ---------- محبوب‌ها ---------- */
.popular-row {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding: 0.2rem 0.2rem 0.8rem;
    scroll-snap-type: x mandatory;
}
.popular-card {
    min-width: 170px;
    max-width: 170px;
    scroll-snap-align: start;
    border-color: var(--red);
    box-shadow: 0 4px 12px rgba(142, 27, 27, 0.18);
}
.popular-card h3 { font-size: 1.05rem; }

.table-chip {
    background: var(--ink);
    color: var(--mustard-soft);
    border-radius: 999px;
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
}

/* ---------- بنر نصب PWA ---------- */
.pwa-banner {
    position: fixed;
    bottom: 0.8rem;
    right: 0.8rem;
    left: 0.8rem;
    max-width: 480px;
    margin-inline: auto;
    background: var(--ink);
    color: var(--cream);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    z-index: 60;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.pwa-banner span { flex: 1; font-size: 0.9rem; }
body.has-pwa-banner { padding-bottom: 5rem; }
.pwa-dismiss {
    background: none;
    border: 0;
    color: var(--cream);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.7;
}

/* ---------- پنل مدیریت ---------- */
.admin-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    background: var(--red);
    border: 2px solid var(--red-dark);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    margin: 1rem 0;
}
.admin-top .brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--mustard-soft); }
.admin-top .brand-label { font-family: 'Lalezar', cursive; font-size: 1.15rem; }
.admin-top .sign-board { filter: drop-shadow(0 0.25em 0.4em rgba(0, 0, 0, 0.35)); }
.admin-nav { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.admin-nav a, .admin-nav button {
    background: var(--red-dark);
    color: #F5D9A0;
    border: 1px solid rgba(255, 233, 176, 0.35);
    border-radius: 6px;
    padding: 0.25rem 0.8rem;
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
}
.admin-nav a:hover, .admin-nav button:hover { background: #5A0E0E; color: #fff; }
.admin-nav a.active { background: var(--mustard); color: var(--red-dark); font-weight: 700; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
    margin: 1rem 0;
}
.stat-tile {
    background: var(--paper);
    border: 2px solid var(--gold);
    border-radius: 10px;
    padding: 0.9rem 0.6rem;
    text-align: center;
}
.stat-tile .num { font-family: 'Lalezar', cursive; font-size: 1.7rem; color: var(--red-dark); display: block; }
.stat-tile .lbl { font-size: 0.85rem; color: var(--ink-soft); }

.filter-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.8rem 0; }
.filter-tabs a {
    border: 1.5px solid var(--gold);
    background: var(--paper);
    border-radius: 999px;
    padding: 0.2rem 0.9rem;
    font-size: 0.88rem;
}
.filter-tabs a.active { background: var(--red); color: var(--mustard-soft); border-color: var(--red-dark); }

details.order-det { margin: 0.2rem 0; }
details.order-det summary { cursor: pointer; color: var(--red); font-size: 0.85rem; }
.inline-form { display: inline-flex; gap: 0.3rem; align-items: center; }
.inline-form select { width: auto; padding: 0.3rem 0.5rem; font-size: 0.85rem; }
.muted { color: var(--ink-soft); font-size: 0.85rem; }
.danger-btn { background: #FBE9E7 !important; color: var(--red-dark) !important; border-color: var(--red) !important; }
.tbl .num-cell { white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
