/* ═══════════════════════════════════════════════════
   منو ساز — Restaurant Menu Design System
   ═══════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #f7f3ee;
    --bg-card: #ffffff;
    --text: #1a1614;
    --text-muted: #6b5e58;
    --border: rgba(26,22,20,.08);
    --shadow: 0 2px 16px rgba(26,22,20,.06);
    --shadow-lg: 0 8px 32px rgba(26,22,20,.1);
    --radius: 16px;
    --radius-sm: 10px;
    --max-w: 680px;
    --nav-h: 108px;
}

.menu-body {
    font-family: var(--font-family, 'Vazirmatn', Tahoma, sans-serif);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
}
.menu-body.mode-dark {
    --bg: #141210;
    --bg-card: #1f1b18;
    --text: #f5f0eb;
    --text-muted: #a89890;
    --border: rgba(255,255,255,.08);
    --shadow: 0 2px 16px rgba(0,0,0,.25);
}

.menu-app { max-width: var(--max-w); margin: 0 auto; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

/* ─── Hero ─── */
.menu-hero {
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    align-items: flex-end;
}
.menu-hero[data-solid="1"] { background: linear-gradient(145deg, var(--primary-dark), var(--primary)); }
.hero-bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    transform: scale(1.02);
}
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.72) 100%);
}
.hero-inner {
    position: relative; z-index: 1;
    width: 100%;
    padding: 32px 20px 22px;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-brand {
    text-align: center;
    margin-bottom: 0;
    width: 100%;
}
.hero-brand--compact { margin-bottom: 0; }
.hero-logo {
    width: auto !important; height: auto !important;
    max-height: var(--logo-max-height, 56px);
    max-width: min(180px, 70vw);
    object-fit: contain;
    margin: 0 auto 10px;
    border: none !important; box-shadow: none !important;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.2));
}
.hero-tagline {
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1.55;
    letter-spacing: .02em;
    opacity: .88;
    margin: 10px auto 0;
    max-width: min(300px, 85vw);
    text-shadow: 0 1px 6px rgba(0,0,0,.25);
}
.hero-brand--compact .hero-tagline { margin-top: 8px; }
.hero-title {
    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(0,0,0,.25);
    margin-top: 12px;
}
.hero-title--solo { margin-top: 4px; }
.hero-subtitle {
    font-size: .75rem;
    font-weight: 500;
    opacity: .75;
    margin-top: 4px;
    letter-spacing: .15em;
    text-transform: uppercase;
}

/* Hero panel — contact */
.hero-panel {
    width: 100%;
    max-width: min(100%, 560px);
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-info {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.hero-info-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 0;
    font-size: .75rem;
    font-weight: 600;
    color: rgba(255,255,255,.92);
    text-decoration: none;
    transition: opacity .15s;
    text-align: center;
    line-height: 1.4;
}
.hero-info-item + .hero-info-item {
    border-top: none;
}
.hero-info-row {
    display: flex;
    width: 100%;
    gap: 12px;
    justify-content: center;
}
.hero-info-row .hero-info-item {
    flex: 0 1 auto;
    min-width: 0;
}
.hero-info-row .hero-info-item + .hero-info-item {
    border-top: none;
    box-shadow: none;
    padding-inline-end: 10px;
}
.hero-info-row--inline {
    flex-wrap: nowrap;
    gap: 0;
    justify-content: center;
    overflow: hidden;
}
.hero-info-row--inline .hero-info-item {
    flex: 0 1 auto;
    min-width: 0;
    padding: 4px 10px;
    white-space: nowrap;
}
.hero-info-row--inline .hero-info-item:last-child {
    padding-inline-end: 0;
}
.hero-info-row--inline .hero-info-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 28vw;
}
a.hero-info-item:hover { opacity: .85; color: #fff; }
.hero-info-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: .85;
}
.hero-info-item span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-social {
    position: absolute;
    left: 14px;
    top: 28px;
    transform: none;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.16);
    color: #fff;
    text-decoration: none;
    transition: background .2s, transform .2s, border-color .2s;
}
.social-btn svg { width: 20px; height: 20px; }
.social-btn:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,.2);
    color: #fff;
}
.social-btn--wa:hover { background: rgba(37,211,102,.35); border-color: rgba(37,211,102,.5); }
.social-btn--ig:hover { background: rgba(225,48,108,.3); border-color: rgba(225,48,108,.45); }
.social-btn--tg:hover { background: rgba(38,165,228,.35); border-color: rgba(38,165,228,.5); }

/* ─── Toolbar (nav + search) ─── */
.menu-toolbar {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px 12px;
}
.menu-nav {
    display: flex; gap: 6px;
    overflow-x: auto; padding-bottom: 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.menu-nav::-webkit-scrollbar { display: none; }
.nav-chip {
    flex-shrink: 0;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: .8125rem; font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all .2s;
    white-space: nowrap;
}
.nav-chip:hover, .nav-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 35%, transparent);
}

.toolbar-search { position: relative; }
.search-icon {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--text-muted); pointer-events: none;
}
.menu-search {
    width: 100%; padding: 11px 42px 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    font-family: inherit; font-size: .875rem;
    transition: border-color .2s, box-shadow .2s;
}
.menu-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.menu-search::placeholder { color: var(--text-muted); opacity: .7; }

/* ─── Main content ─── */
.menu-main { padding: 8px 16px 24px; }

.menu-section {
    scroll-margin-top: var(--nav-h);
    margin-bottom: 8px;
}
.menu-section + .menu-section { margin-top: 12px; }

.section-head {
    display: flex; align-items: center; gap: 12px;
    margin: 28px 0 16px;
}
.section-line {
    flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.section-title {
    font-size: .9375rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--primary);
    white-space: nowrap;
}

/* ─── Dish cards ─── */
.dish-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    align-items: stretch;
}
@media (min-width: 640px) {
    .dish-list { gap: 14px; }
}

.dish-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow .25s, transform .25s;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.dish-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.dish-card.hidden { display: none !important; }

/* Photo card — image on top, info + button below */
.dish-card--photo .dish-media {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--primary-soft);
    flex-shrink: 0;
}
.dish-card--photo .dish-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.dish-card--photo:hover .dish-media img { transform: scale(1.03); }

.dish-card--photo .dish-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 14px 16px 16px;
    min-width: 0;
    min-height: 0;
    height: 100%;
}

.dish-body { padding: 14px 16px; display: flex; flex-direction: column; min-width: 0; }

.dish-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}
.dish-name {
    font-size: .9375rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -.02em;
    color: var(--text);
}
.dish-card--photo .dish-name { font-size: 1rem; }

.dish-price {
    font-size: .8125rem;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    background: var(--primary-soft);
    padding: 4px 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.dish-desc {
    font-size: .8125rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 4px;
}

/* Classic dotted menu line for variants */
.dish-options { list-style: none; margin: 6px 0 2px; }
.dish-options li {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: .8125rem;
    padding: 3px 0;
}
.opt-name { flex-shrink: 0; color: var(--text); font-weight: 500; }
.opt-dots {
    flex: 1;
    border-bottom: 1px dotted color-mix(in srgb, var(--text-muted) 40%, transparent);
    min-width: 12px;
    margin: 0 4px;
    height: .6em;
}
.opt-price { flex-shrink: 0; font-weight: 700; color: var(--primary); font-size: .8125rem; }

.dish-addons { margin-top: 6px; font-size: .75rem; color: var(--text-muted); }
.addons-label { font-weight: 700; color: var(--text); font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; }
.addon-list { list-style: none; margin-top: 4px; }
.addon-list li { display: flex; justify-content: space-between; padding: 2px 0; gap: 8px; }

.dish-actions {
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
    padding-top: 12px;
}
.dish-card--photo .dish-actions { margin-top: auto; }

.dish-order {
    width: 100%;
    padding: 11px 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-family: inherit;
    font-size: .8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s, transform .15s;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 30%, transparent);
}
.dish-order[hidden] { display: none; }
.dish-order:hover { opacity: .92; transform: scale(1.01); }
.dish-order:active { transform: scale(.99); }

.dish-qty {
    display: flex;
    align-items: center;
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--primary);
    background: var(--bg-card);
}
.dish-qty[hidden] { display: none; }
.dish-qty-btn {
    flex: 0 0 44px;
    height: 42px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: opacity .15s;
}
.dish-qty-btn:hover { opacity: .88; }
.dish-qty-value {
    flex: 1;
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
    user-select: none;
}

/* Text-only dishes (no photo) */
.dish-card--text {
    display: flex;
    flex-direction: column;
}
.dish-card--text .dish-body {
    flex: 1;
    padding: 14px 14px;
}
.dish-card--text .dish-head {
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
}
.dish-card--text .dish-name { font-size: .9375rem; }
.dish-card--text .dish-price { background: none; padding: 0; font-size: .875rem; }
.dish-card--text .dish-actions { margin-top: auto; padding-top: 10px; }

.empty-menu {
    text-align: center; padding: 48px 24px;
    color: var(--text-muted); font-size: .9375rem;
}

/* ─── Footer ─── */
.menu-footer {
    text-align: center; padding: 32px 16px 16px;
    color: var(--text-muted); font-size: .75rem;
}
.footer-line {
    width: 40px; height: 2px;
    background: var(--primary);
    margin: 0 auto 12px;
    border-radius: 1px;
    opacity: .5;
}

/* ─── Cart bar (full width) ─── */
.cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom);
}
.cart-bar-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border: none;
    border-radius: 0;
    background: var(--primary);
    color: #fff;
    font-family: inherit;
    font-size: .9375rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 -4px 24px color-mix(in srgb, var(--primary) 35%, transparent);
    transition: opacity .15s, background .15s;
}
.cart-bar-btn:hover { opacity: .95; }
.cart-bar-icon { width: 22px; height: 22px; flex-shrink: 0; }
.cart-bar-label { flex: 1; text-align: center; }
.cart-bar-count {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    margin-inline-start: auto;
    background: rgba(255,255,255,.22);
    border-radius: 999px;
    font-size: .8125rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cart-bar-count.empty { display: none; }

/* ─── Cart drawer & modal ─── */
.cart-overlay, .order-modal-overlay {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(0,0,0,.45);
    opacity: 0; visibility: hidden;
    transition: opacity .25s, visibility .25s;
}
.cart-overlay.open, .order-modal-overlay.open { opacity: 1; visibility: visible; }
.checkout-modal-overlay {
    position: fixed; inset: 0; z-index: 320;
    background: rgba(0,0,0,.45);
    opacity: 0; visibility: hidden;
    transition: opacity .25s, visibility .25s;
}
.checkout-modal-overlay.open { opacity: 1; visibility: visible; }

.cart-drawer, .order-modal {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 310;
    background: var(--bg-card);
    border-radius: 20px 20px 0 0;
    max-height: 88vh;
    display: flex; flex-direction: column;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.32,.72,0,1);
    max-width: var(--max-w); margin: 0 auto;
}
.cart-drawer.open, .order-modal.open { transform: translateY(0); }
.checkout-modal {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 330;
    background: var(--bg-card);
    border-radius: 20px 20px 0 0;
    max-height: 88vh;
    display: flex; flex-direction: column;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.32,.72,0,1);
    max-width: var(--max-w); margin: 0 auto;
}
.checkout-modal.open { transform: translateY(0); }

.cart-drawer-header, .order-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.cart-drawer-header h2, .order-modal-header h3 {
    font-size: 1rem; font-weight: 800; margin: 0;
}
.cart-close, .order-modal-close {
    background: none; border: none; font-size: 1.5rem;
    cursor: pointer; color: var(--text-muted); line-height: 1; padding: 4px;
}

.cart-items { flex: 1; overflow-y: auto; padding: 12px 20px; }
.cart-empty { text-align: center; color: var(--text-muted); padding: 32px 0; font-size: .875rem; }
.cart-item {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px; padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.cart-item-name { font-weight: 700; font-size: .875rem; }
.cart-item-meta { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.cart-item-price { font-weight: 800; color: var(--primary); font-size: .8125rem; white-space: nowrap; }
.cart-item-remove { background: none; border: none; color: #e11d48; cursor: pointer; font-size: 1.125rem; opacity: .7; }

.cart-footer, .order-modal-footer {
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
}
.cart-total-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: .9375rem; font-weight: 600; }
.btn-checkout, .btn-add-cart {
    width: 100%; padding: 14px; border: none;
    border-radius: var(--radius-sm);
    background: var(--primary); color: #fff;
    font-family: inherit; font-size: .9375rem; font-weight: 700;
    cursor: pointer;
}
.btn-checkout:disabled { opacity: .35; cursor: not-allowed; }

.order-modal-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.order-modal-footer { display: flex; gap: 12px; align-items: center; }
.btn-add-cart { flex: 1; }
.modal-qty { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.qty-btn {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg);
    font-size: 1.125rem; cursor: pointer; color: var(--text);
}

.modal-section { margin-bottom: 16px; }
.modal-section label { display: block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 8px; }
.modal-options { display: flex; flex-direction: column; gap: 6px; }
.modal-option {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer; font-size: .875rem;
    transition: border-color .15s, background .15s;
}
.modal-option.selected { border-color: var(--primary); background: var(--primary-soft); }
.modal-option input { accent-color: var(--primary); margin-left: 8px; }
.modal-check { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; font-size: .875rem; }
.modal-check input { accent-color: var(--primary); width: 17px; height: 17px; }

.checkout-form { display: flex; flex-direction: column; gap: 14px; }
.checkout-field label {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.checkout-field input[type="text"],
.checkout-field input[type="tel"],
.checkout-field textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .875rem;
    background: var(--bg);
    color: var(--text);
}
.checkout-field input:focus,
.checkout-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.checkout-type { display: flex; gap: 10px; }
.checkout-type-opt {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: .875rem;
    font-weight: 600;
}
.checkout-type-opt:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}
.checkout-type-opt input { accent-color: var(--primary); }
.checkout-address-wrap[hidden] { display: none !important; }
.checkout-error {
    color: #e11d48;
    font-size: .8125rem;
    margin: 0;
}
.checkout-error[hidden] { display: none !important; }
.checkout-modal-footer { padding-top: 12px; }
.btn-checkout--submit { width: 100%; }
.btn-checkout--submit:disabled { opacity: .6; cursor: wait; }
