/* ═══════════════════════════════════════════════════════
   style.css — Foodito v2.0 | Mobile-First Design
   ═══════════════════════════════════════════════════════ */

/* ── Reset & Base ──────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    direction: rtl;
    background: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

/* ── CSS Variables ─────────────────────────────────────── */
:root {
    --primary: #ef4444;
    --primary-dark: #dc2626;
    --primary-light: #fef2f2;
    --secondary: #f97316;
    --accent: #8b5cf6;

    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-nav: #ffffff;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    --bg-input: #f1f5f9;
    --bg-muted: #f1f5f9;

    --text-main: #0f172a;
    --text-sub: #475569;
    --text-muted: #94a3b8;

    --border-1: #e2e8f0;
    --border-2: #cbd5e1;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.14);
    --shadow-primary: 0 4px 20px rgba(239, 68, 68, 0.30);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --transition: 0.25s ease;
    --nav-height: 60px;
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-nav: #1e293b;
    --bg-input: #334155;
    --bg-muted: #1e293b;

    --text-main: #f1f5f9;
    --text-sub: #94a3b8;
    --text-muted: #64748b;

    --border-1: #334155;
    --border-2: #475569;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ── Utility ───────────────────────────────────────────── */
.hidden {
    display: none !important;
}

/* ══════════════════════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════════════════════ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border-1);
    box-shadow: var(--shadow-sm);
    height: var(--nav-height);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* لوگو */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* دکمه‌های راست */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
}

/* دکمه تم */
.btn-icon {
    width: 38px;
    height: 38px;
    border: none;
    background: var(--bg-muted);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-icon:hover {
    transform: scale(1.1);
}

/* دکمه سبد */
.cart-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
}

.cart-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.cart-icon {
    font-size: 18px;
}

.cart-count {
    background: white;
    color: var(--primary);
    border-radius: var(--radius-full);
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-total-header {
    font-size: 0.75rem;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* نمایش فقط آیکون در موبایل کوچک */
@media (max-width: 400px) {
    .cart-total-header {
        display: none;
    }

    .logo-text {
        display: none;
    }

    .cart-btn {
        padding: 8px 10px;
        gap: 4px;
    }
}

/* منوی کاربر */
.user-menu-wrap {
    position: relative;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-muted);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text-main);
    transition: var(--transition);
    max-width: 130px;
}

.user-avatar-btn span:first-child {
    font-size: 22px;
    flex-shrink: 0;
}

.header-username {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70px;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    overflow: hidden;
    z-index: 200;
}

.user-dropdown a,
.user-dropdown button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text-main);
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: background 0.15s;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: var(--bg-muted);
}

.user-dropdown .logout {
    color: var(--primary);
}

/* دکمه ورود */
.btn-login-header {
    padding: 8px 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-login-header:hover {
    background: var(--primary-dark);
}

/* ══════════════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════════════ */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1e0a3c 0%, #2d1b69 35%, #1a1a2e 70%, #16213e 100%);
    padding: 48px 16px 36px;
    text-align: center;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 0.78rem;
    color: #e2e8f0;
    margin-bottom: 16px;
}

.hero-title {
    font-size: clamp(1.8rem, 7vw, 3rem);
    font-weight: 900;
    color: white;
    line-height: 1.3;
    margin-bottom: 12px;
}

.hero-title .highlight {
    background: linear-gradient(135deg, #f97316, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: clamp(0.85rem, 3vw, 1rem);
    color: #94a3b8;
    margin-bottom: 24px;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(239, 68, 68, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* آمار هیرو */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-top: 28px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.stat-item {
    flex: 1;
    padding: 14px 10px;
    text-align: center;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-child {
    border-left: none;
}

.stat-num {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    font-weight: 900;
    color: white;
    display: block;
}

.stat-label {
    font-size: clamp(0.65rem, 2vw, 0.75rem);
    color: #94a3b8;
    margin-top: 2px;
    display: block;
}

/* ذرات پس‌زمینه */
#particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    bottom: -50px;
    animation: floatUp linear infinite;
    opacity: 0.15;
    user-select: none;
}

@keyframes floatUp {
    from {
        transform: translateY(0) rotate(0deg);
        opacity: 0.15;
    }

    to {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════════════════════ */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 12px 100px;
}

/* ── Toolbar: Search + Sort ──────────────────────────────── */
.menu-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    align-items: center;
}

.search-wrap {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    pointer-events: none;
}

#search-input {
    width: 100%;
    padding: 10px 38px 10px 36px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-1);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
    direction: rtl;
}

#search-input:focus {
    border-color: var(--primary);
}

.search-clear {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    padding: 2px;
}

.sort-select {
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-1);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--text-main);
    outline: none;
    cursor: pointer;
    direction: rtl;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Categories ─────────────────────────────────────────── */
.categories-section {
    margin-bottom: 14px;
}

.categories-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-1);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
}

.category-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

/* ── Menu Header ────────────────────────────────────────── */
.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.menu-title {
    font-size: clamp(1rem, 4vw, 1.2rem);
    font-weight: 800;
    color: var(--text-main);
}

.menu-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ── Menu Grid ──────────────────────────────────────────── */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (min-width: 900px) {
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1100px) {
    .menu-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }
}

/* ── Menu Card ──────────────────────────────────────────── */
.menu-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s, box-shadow 0.22s;
    animation: fadeUp 0.4s ease both;
}

.menu-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.menu-card.unavailable {
    opacity: 0.55;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تصویر کارت */
.card-image {
    position: relative;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

@media (min-width: 480px) {
    .card-image {
        height: 130px;
        font-size: 3.5rem;
    }
}

.cat-pizza {
    background: linear-gradient(135deg, #fff7ed, #fed7aa);
}

.cat-burger {
    background: linear-gradient(135deg, #fffbeb, #fde68a);
}

.cat-sushi {
    background: linear-gradient(135deg, #f0fdf4, #bbf7d0);
}

.cat-salad {
    background: linear-gradient(135deg, #f0fdf4, #86efac);
}

.cat-drink {
    background: linear-gradient(135deg, #eff6ff, #bfdbfe);
}

.cat-dessert {
    background: linear-gradient(135deg, #fdf4ff, #e9d5ff);
}

.cat-default {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

/* بدج‌های کارت */
.card-badges {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.badge {
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 0.62rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-popular {
    background: #fef9c3;
    color: #92400e;
}

.badge-new {
    background: #dcfce7;
    color: #166534;
}

.badge-sold-out {
    background: #fee2e2;
    color: #991b1b;
}

/* بدنه کارت */
.card-body {
    padding: 10px 10px 6px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-title {
    font-size: clamp(0.78rem, 2.5vw, 0.9rem);
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-rating {
    font-size: 0.7rem;
    color: var(--text-sub);
}

/* فوتر کارت */
.card-footer {
    padding: 8px 10px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-1);
    gap: 6px;
    flex-wrap: wrap;
}

.card-price {
    font-size: clamp(0.78rem, 2.5vw, 0.92rem);
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.price-unit {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-muted);
}

.btn-add {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-add:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* کنترل تعداد */
.qty-control {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-muted);
    border-radius: var(--radius-full);
    padding: 4px 8px;
    flex-shrink: 0;
}

.qty-control button {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: var(--transition);
    flex-shrink: 0;
}

.qty-control button:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.qty-control span {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-main);
    min-width: 18px;
    text-align: center;
}

/* ── Skeleton ───────────────────────────────────────────── */
.skeleton {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-1);
    overflow: hidden;
}

.skeleton-img {
    height: 110px;
    background: linear-gradient(90deg, var(--bg-muted) 25%, var(--border-1) 50%, var(--bg-muted) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

.skeleton-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--bg-muted) 25%, var(--border-1) 50%, var(--bg-muted) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.price {
    width: 40%;
}

@keyframes shimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

/* ── Empty State ────────────────────────────────────────── */
.empty-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-sub);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

/* ══════════════════════════════════════════════════════════
   CART DRAWER
══════════════════════════════════════════════════════════ */
.cart-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: min(380px, 100vw);
    height: 100vh;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    z-index: 400;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.cart-drawer.open {
    transform: translateX(0);
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-1);
    flex-shrink: 0;
}

.cart-header h2 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

.cart-close {
    width: 34px;
    height: 34px;
    background: var(--bg-muted);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.cart-close:hover {
    background: #fee2e2;
    color: var(--primary);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.empty-cart-icon {
    font-size: 3.5rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-muted);
    border-radius: var(--radius-md);
    padding: 10px;
}

.ci-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.ci-info {
    flex: 1;
    min-width: 0;
}

.ci-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ci-price {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.cart-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border-1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.cart-totals {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-sub);
}

.total-final {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    padding-top: 8px;
    border-top: 1px solid var(--border-1);
}

.free-badge {
    background: #dcfce7;
    color: #166534;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
}

.min-order-warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.8rem;
    color: #92400e;
    text-align: center;
}

.full-width {
    width: 100%;
}

.pulse-btn {
    animation: pulseBtn 2s infinite;
}

@keyframes pulseBtn {

    0%,
    100% {
        box-shadow: var(--shadow-primary);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.15);
    }
}

/* ── Overlay ────────────────────────────────────────────── */
.overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.overlay.show {
    opacity: 1;
    pointer-events: all;
}

/* ══════════════════════════════════════════════════════════
   AUTH OVERLAY
══════════════════════════════════════════════════════════ */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.auth-box {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.auth-close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 32px;
    height: 32px;
    background: var(--bg-muted);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 8px;
}

.auth-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
}

.auth-sub {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 22px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-1);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
    direction: ltr;
    text-align: center;
}

.form-group input:focus {
    border-color: var(--primary);
}

.field-error {
    font-size: 0.78rem;
    color: #ef4444;
    margin-top: 5px;
    min-height: 18px;
}

/* OTP */
.otp-hint {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-sub);
    margin-bottom: 16px;
}

.otp-hint strong {
    color: var(--primary);
}

.otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    direction: ltr;
    margin-bottom: 16px;
}

.otp-digit {
    width: 44px;
    height: 52px;
    text-align: center;
    background: var(--bg-input);
    border: 2px solid var(--border-1);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.otp-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.otp-digit.filled {
    border-color: #22c55e;
    background: #f0fdf4;
}

@media (max-width: 380px) {
    .otp-inputs {
        gap: 5px;
    }

    .otp-digit {
        width: 38px;
        height: 46px;
        font-size: 1.1rem;
    }
}

.otp-timer {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.timer-count {
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
}

.btn-resend {
    display: block;
    width: 100%;
    padding: 10px;
    background: none;
    border: 1.5px dashed var(--border-2);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--primary);
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    margin-bottom: 10px;
}

.btn-resend:hover {
    background: var(--primary-light);
}

.btn-change-phone {
    display: block;
    width: 100%;
    padding: 10px;
    background: none;
    border: 1.5px solid var(--border-1);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--text-sub);
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.btn-change-phone:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Simulator Box ──────────────────────────────────────── */
.simulator-box {
    margin-top: 16px;
    background: #fffbeb;
    border: 2px dashed #f59e0b;
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
}

[data-theme="dark"] .simulator-box {
    background: #292524;
    border-color: #d97706;
}

.simulator-box .sim-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 6px;
}

[data-theme="dark"] .simulator-box .sim-title {
    color: #fbbf24;
}

.sim-code-box {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    background: white;
    border: 1.5px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 8px 14px;
    margin: 6px 0;
}

[data-theme="dark"] .sim-code-box {
    background: #1c1917;
    border-color: #78350f;
}

.sim-code-display {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: var(--primary);
    direction: ltr;
    font-variant-numeric: tabular-nums;
}

.btn-autofill {
    display: block;
    width: 100%;
    padding: 9px;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: var(--transition);
}

.btn-autofill:hover {
    background: #d97706;
}

/* ══════════════════════════════════════════════════════════
   ORDER MODAL
══════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 600;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

@media (min-width: 640px) {
    .modal-overlay {
        align-items: center;
        padding: 16px;
    }
}

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px 20px 32px;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

@media (min-width: 640px) {
    .modal-box {
        border-radius: var(--radius-xl);
        padding: 28px 24px;
        max-height: 85vh;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 800;
}

.modal-close {
    width: 34px;
    height: 34px;
    background: var(--bg-muted);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-form label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 5px;
}

.modal-form input,
.modal-form textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-1);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
    direction: rtl;
}

.modal-form input:focus,
.modal-form textarea:focus {
    border-color: var(--primary);
}

.modal-form textarea {
    resize: vertical;
    min-height: 72px;
}

.order-summary-box {
    background: var(--bg-muted);
    border-radius: var(--radius-md);
    padding: 12px;
    max-height: 140px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-sub);
}

/* ══════════════════════════════════════════════════════════
   SUCCESS PAGE
══════════════════════════════════════════════════════════ */
.success-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 40px 20px;
    text-align: center;
    gap: 16px;
}

.success-anim {
    font-size: 4rem;
    animation: successBounce 0.6s ease;
}

@keyframes successBounce {
    0% {
        transform: scale(0);
    }

    60% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.success-title {
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    font-weight: 900;
    color: var(--text-main);
}

.success-sub {
    font-size: 0.9rem;
    color: var(--text-sub);
}

.success-order-id {
    background: var(--bg-muted);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
}

/* ══════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════ */
#toast-container {
    position: fixed;
    bottom: 80px;
    left: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
}

.toast {
    background: #1e293b;
    color: white;
    padding: 11px 20px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    pointer-events: all;
    max-width: 340px;
    text-align: center;
    width: fit-content;
}

.toast.success {
    background: #166534;
}

.toast.error {
    background: #991b1b;
}

.toast.info {
    background: #1e40af;
}

.toast.out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(14px);
    }
}

/* ══════════════════════════════════════════════════════════
   FLY TO CART
══════════════════════════════════════════════════════════ */
#fly-item {
    position: fixed;
    pointer-events: none;
    font-size: 1.6rem;
    z-index: 9000;
    display: block;
}

/* ══════════════════════════════════════════════════════════
   SHAKE ANIMATION
══════════════════════════════════════════════════════════ */
.shake {
    animation: shakeAnim 0.4s ease;
}

@keyframes shakeAnim {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE TWEAKS
══════════════════════════════════════════════════════════ */

/* موبایل کوچک: فاصله کارت‌ها */
@media (max-width: 360px) {
    .menu-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .card-body {
        padding: 8px 8px 4px;
    }

    .card-footer {
        padding: 6px 8px 8px;
    }

    .card-image {
        height: 90px;
        font-size: 2.5rem;
    }

    .main-content {
        padding: 12px 8px 90px;
    }
}

/* تبلت */
@media (min-width: 640px) and (max-width: 899px) {
    .main-content {
        padding: 20px 16px 100px;
    }
}

/* دسکتاپ */
@media (min-width: 1200px) {
    .main-content {
        padding: 28px 24px 80px;
    }
}