/* ==================== ROOT VARIABLES ==================== */
:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-elevated: #1a2233;
    --bg-card: #151c2e;
    --bg-card-hover: #1e2a3d;
    --bg-surface: #050810;
    --accent: #ff7a18;
    --accent-glow: rgba(255, 122, 24, 0.3);
    --accent-hover: #ff9340;
    --accent-dim: rgba(255, 122, 24, 0.08);
    --accent-soft: rgba(255, 122, 24, 0.12);
    --text-primary: #ffffff;
    --text-secondary: #9aa4c2;
    --text-muted: #5a6a80;
    --border: rgba(255, 255, 255, 0.05);
    --border-strong: rgba(255, 255, 255, 0.1);
    --green: #22c55e;
    --green-bg: rgba(34, 197, 94, 0.1);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.1);
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.25);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.3);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
    --shadow-glow: 0 4px 20px var(--accent-glow);
    --r-xs: 8px;
    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 22px;
    --r-xl: 28px;
    --r-full: 100px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --app-max: 480px;
    --sidebar-w: 260px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --status-pending: #ff9800;
    --status-preparing: #2196f3;
    --status-completed: #4caf50;
    --status-cancelled: #f44336;
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-surface);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100dvh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; }
input { font-family: inherit; border: none; outline: none; }
a { text-decoration: none; color: inherit; }

.place-order-btn.offline-disabled {
    opacity: 0.7;
    cursor: not-allowed;
    filter: grayscale(0.2);
}

/* ==================== APP WRAPPER ==================== */
.app-wrapper {
    display: flex;
    min-height: 100dvh;
    background: var(--bg-primary);
    position: relative;
    transition: background-color 0.3s ease;
}

.main-content {
    flex: 1;
    min-width: 0;
    min-height: 100dvh;
    position: relative;
}

/* ==================== TOP BAR ==================== */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-primary);
    transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease), color 0.3s var(--ease);
}

.top-bar.scrolled {
    background: rgba(10, 14, 24, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 var(--border);
}

.top-bar-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    color: var(--text-primary);
    background: var(--bg-card);
    transition: all 0.2s var(--ease);
    position: relative;
}

.top-bar-btn:active {
    transform: scale(0.92);
    background: var(--bg-card-hover);
}

.top-bar-center {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.restaurant-name {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.restaurant-tagline {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.cart-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    border-radius: 9px;
    animation: badgePop 0.3s var(--spring);
}

@keyframes badgePop {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* ==================== SEARCH BAR ==================== */
.search-sticky {
    position: sticky;
    top: 60px;
    z-index: 98;
    background: var(--bg-primary);
    transition: box-shadow 0.3s var(--ease), padding 0.2s var(--ease);
    padding-top: 4px;
}

.search-sticky.compact {
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
    padding-top: 2px;
}

.search-sticky.compact {
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
}

.search-wrap {
    padding: 0 16px 8px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    padding: 0 16px;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    padding: 11px 10px;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-clear {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: 50%;
    transition: all 0.15s var(--ease);
}

.search-clear:hover { color: var(--text-primary); background: var(--bg-elevated); }

/* ==================== CATEGORY CHIPS ==================== */
.category-chips-nav {
    background: var(--bg-primary);
    padding: 0 0 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-chips-nav::-webkit-scrollbar { display: none; }

.category-chips {
    display: flex;
    gap: 8px;
    padding: 0 16px;
}

.category-chip {
    flex-shrink: 0;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    white-space: nowrap;
    transition: all 0.25s var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.category-chip:active { transform: scale(0.95); }

.category-chip.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

/* ==================== FEATURED SECTION ==================== */
.featured-section {
    margin: 8px 12px 10px;
    padding: 10px;
    border: 1px solid rgba(245, 195, 74, 0.35);
    border-radius: var(--r-md);
    background: linear-gradient(140deg, rgba(245, 195, 74, 0.08), rgba(245, 195, 74, 0.02) 45%, rgba(255, 255, 255, 0.01));
    box-shadow: 0 0 14px rgba(245, 195, 74, 0.1);
}

.featured-section.hidden { display: none; }

.featured-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px;
    border-radius: var(--r-sm);
    color: #f7d98b;
    background: rgba(245, 195, 74, 0.06);
    border: 1px solid rgba(245, 195, 74, 0.18);
    transition: all 0.35s ease;
}

.featured-toggle:hover {
    background: rgba(245, 195, 74, 0.12);
    border-color: rgba(245, 195, 74, 0.28);
}

.featured-toggle-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

.featured-toggle-icon { font-size: 15px; }

.featured-toggle-chevron {
    transition: transform 0.35s ease;
    transform: rotate(0deg);
}

.featured-section.expanded .featured-toggle-chevron {
    transform: rotate(180deg);
}

.featured-content {
    overflow: hidden;
    max-height: 500px;
    opacity: 1;
    transition: max-height 0.35s ease, opacity 0.35s ease;
}

.featured-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.section-label {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
    padding: 0 16px 12px;
    color: var(--text-primary);
}

.featured-scroll {
    display: flex;
    gap: 12px;
    padding: 12px 0 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

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

.featured-card {
    flex-shrink: 0;
    width: 260px;
    scroll-snap-align: start;
    background: var(--bg-card);
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s var(--ease);
}

.featured-card:active { transform: scale(0.97); }

.featured-card-img {
    width: 100%;
    height: 140px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    position: relative;
    overflow: hidden;
}

.featured-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-card-body {
    padding: 12px;
}

.featured-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-card-price {
    font-size: 14px;
    font-weight: 800;
    color: var(--accent);
}

.featured-special-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--r-full);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* ==================== MENU GRID ==================== */
.menu-grid-container {
    padding: 8px 12px 180px;
}

.category-section {
    margin-bottom: 24px;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.category-section.filtered-out {
    opacity: 0;
    height: 0;
    overflow: hidden;
    margin: 0;
    pointer-events: none;
}

.category-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    margin-bottom: 12px;
}

.category-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.2px;
    color: var(--text-primary);
}

.category-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: var(--r-full);
}

.category-body {
    overflow: hidden;
}

.menu-items-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ==================== FOOD CARD ==================== */
.food-card {
    background: var(--bg-card);
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s var(--ease);
    position: relative;
    display: flex;
    flex-direction: column;
}

.food-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.food-card:active {
    transform: scale(0.97) translateY(0);
}

.food-card-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    position: relative;
    overflow: hidden;
}

.food-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--ease);
}

.food-card:hover .food-card-img img {
    transform: scale(1.05);
}

.food-card-veg {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--green);
    border-radius: 3px;
    background: rgba(10, 14, 24, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.food-card-veg::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.food-card-veg.non-veg {
    border-color: var(--red);
}

.food-card-veg.non-veg::after {
    background: var(--red);
    border-radius: 0;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    width: 8px;
    height: 7px;
}

.food-card-special {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--r-full);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.food-card-body {
    padding: 10px 10px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.food-card-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.food-card-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.food-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.food-card-price {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.food-card-price .price-from {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
}

/* ==================== ADD TO CART BUTTON ==================== */
.add-button-container {
    flex-shrink: 0;
}

.add-btn {
    padding: 6px 16px;
    background: var(--accent);
    color: white;
    border-radius: var(--r-xs);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.2s var(--ease);
    box-shadow: var(--shadow-xs);
}

.add-btn:active {
    transform: scale(0.92);
}

@keyframes addPulse {
    0% { box-shadow: 0 0 0 0 var(--accent-glow); }
    70% { box-shadow: 0 0 0 8px rgba(255, 107, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0); }
}

.add-btn.pulsed {
    animation: addPulse 0.5s var(--ease);
}

/* ==================== QUANTITY CONTROLLER ==================== */
.qty-ctrl {
    display: inline-flex;
    align-items: center;
    background: var(--accent);
    border-radius: var(--r-xs);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.qty-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 700;
    transition: background 0.15s var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.qty-btn:active { background: rgba(255,255,255,0.2); }

.qty-val {
    min-width: 22px;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    color: white;
}

.multi-qty-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--accent);
    color: white;
    border-radius: var(--r-xs);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    box-shadow: var(--shadow-xs);
    transition: all 0.2s var(--ease);
}

.multi-qty-badge:active { transform: scale(0.92); }

.multi-qty-count {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.25);
    border-radius: 5px;
    font-size: 10px;
    font-weight: 800;
}

.multi-qty-label { font-size: 11px; font-weight: 600; opacity: 0.9; }

/* ==================== FLOATING CART BAR ==================== */
.floating-cart {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    width: calc(100% - 32px);
    max-width: calc(var(--app-max) - 32px);
    background: var(--accent);
    color: white;
    border-radius: var(--r-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-glow), var(--shadow-lg);
    animation: cartBarSlide 0.35s var(--spring);
}

.floating-cart.hidden { display: none; }

@keyframes cartBarSlide {
    from { transform: translateX(-50%) translateY(80px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.floating-cart-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.floating-cart-count {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border-radius: var(--r-xs);
    font-size: 13px;
    font-weight: 800;
}

.floating-cart-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.floating-cart-items {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.85;
}

.floating-cart-total {
    font-size: 16px;
    font-weight: 800;
}

.floating-cart-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: white;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.18);
    border-radius: var(--r-xs);
    transition: background 0.2s var(--ease);
}

.floating-cart-btn:active { background: rgba(255,255,255,0.3); }

/* ==================== SHEET MODAL (shared) ==================== */
.sheet-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.sheet-modal.hidden { display: none; }

/* Size picker must layer above cart modal */
#sizePicker { z-index: 310; }

/* Cart checkout should feel like a centered dialog with breathing room */
#cartModal {
    align-items: center;
    padding: 24px 16px calc(24px + var(--safe-bottom));
}

.sheet-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.2s var(--ease);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet-content {
    position: relative;
    width: 100%;
    max-width: var(--app-max);
    background: var(--bg-secondary);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding-bottom: calc(16px + var(--safe-bottom));
    animation: sheetUp 0.3s var(--spring);
    overflow: hidden;
}

.sheet-content--tall {
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
}

#cartModal .sheet-content {
    width: min(560px, 100%);
    max-height: calc(100dvh - 48px - var(--safe-bottom));
    border-radius: var(--r-lg);
    padding-bottom: calc(20px + var(--safe-bottom));
}

@keyframes sheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--border-strong);
    border-radius: 2px;
    margin: 10px auto 0;
}

.sheet-header {
    padding: 14px 20px 12px;
}

.sheet-header h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.sheet-body {
    padding: 0 20px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ==================== SIZE PICKER ==================== */
.size-option-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    transition: all 0.2s var(--ease);
}

.size-option-btn:active {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.size-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1.5px solid var(--accent);
    border-radius: var(--r-sm);
}

.size-option-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.size-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.size-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}

/* ==================== CART MODAL ==================== */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
}

.cart-header h2 {
    font-size: 17px;
    font-weight: 800;
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: 50%;
    transition: all 0.15s var(--ease);
}

.icon-btn:active {
    background: var(--bg-card);
    color: var(--text-primary);
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.cart-step {
    transition: all 0.35s ease;
}

.cart-step-active {
    opacity: 1;
    transform: translateY(0);
    max-height: 3000px;
    pointer-events: auto;
}

.cart-step-hidden {
    opacity: 0;
    transform: translateY(14px);
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
}

.cart-items { padding: 0 20px 20px; }

#cartStep2 {
    padding: 0 20px 8px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--r-sm);
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

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

.cart-item-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 1px;
}

.cart-item-size {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1px;
}

.cart-item-price { font-size: 11px; color: var(--text-muted); }

.cart-item-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.cart-item-total {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    text-align: center;
}

.cart-empty.hidden { display: none; }

.cart-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.cart-empty p {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.cart-empty span {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==================== CART FOOTER ==================== */
.cart-footer {
    border-top: 1px solid var(--border);
    padding: 14px 20px calc(16px + var(--safe-bottom));
    background: var(--bg-elevated);
}

.cart-footer.hidden { display: none; }

.cart-footer-step {
    transition: all 0.35s ease;
}

.cart-footer-step-active {
    opacity: 1;
    transform: translateY(0);
    max-height: 1000px;
    pointer-events: auto;
}

.cart-footer-step-hidden {
    opacity: 0;
    transform: translateY(12px);
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
}

.cart-summary { margin-bottom: 14px; }

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}

.summary-row span:first-child {
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-value {
    font-weight: 800;
    color: var(--text-primary);
}

/* ==================== CART DETAILS SECTION ==================== */
.cart-details-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.cart-details-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.1px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-input::placeholder { color: var(--text-muted); }

.form-textarea {
    resize: none;
    font-family: inherit;
    line-height: 1.4;
}

.order-type-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.type-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s var(--ease);
}

.type-pill.active {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent);
}

.place-order-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: white;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 800;
    box-shadow: var(--shadow-glow);
    transition: all 0.2s var(--ease);
}

.place-order-btn:active { transform: scale(0.98); }

.place-order-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cart-step-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 24px;
    padding-bottom: 18px;
}

.primary-action-btn,
.secondary-action-btn {
    width: 100%;
    min-height: 46px;
    padding: 12px;
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s var(--ease);
}

.primary-action-btn {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.secondary-action-btn {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
}

.primary-action-btn:active,
.secondary-action-btn:active {
    transform: scale(0.98);
}

/* ==================== ORDER TRACKER ==================== */
.order-tracker {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 190;
    width: calc(100% - 32px);
    max-width: calc(var(--app-max) - 32px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-lg);
    animation: cartBarSlide 0.35s var(--spring);
}

.order-tracker.hidden { display: none; }

.order-tracker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.order-tracker-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    display: block;
}

.order-tracker-id {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
}

.tracker-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.tracker-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.3;
    transition: opacity 0.3s var(--ease);
}

.tracker-step.active,
.tracker-step.done { opacity: 1; }

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

.tracker-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tracker-step.active .tracker-label { color: var(--accent); }

.tracker-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 4px;
    margin-bottom: 18px;
}

.tracker-step.done + .tracker-line { background: var(--accent); }

.tracker-status-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

/* ==================== LOADING STATE ==================== */
.loading-state {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 500;
    gap: 20px;
}

.loading-state.hidden { display: none; }

.loader-wrap {
    position: relative;
    width: 56px;
    height: 56px;
}

.loader-ring {
    position: absolute;
    inset: 0;
    border: 3px solid var(--bg-card);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.loader-emoji {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
}

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

.loading-state p {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-card);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    max-width: calc(var(--app-max) - 32px);
    animation: toastIn 0.4s var(--spring);
}

.toast.hidden { display: none; }

.toast span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

@keyframes toastIn {
    from { transform: translateX(-50%) translateY(-30px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ==================== SEARCH EMPTY STATE ==================== */
.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.search-empty.hidden { display: none; }

.search-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.search-empty p { font-size: 15px; font-weight: 700; color: var(--text-secondary); margin-bottom: 4px; }
.search-empty span { font-size: 12px; color: var(--text-muted); }

/* ==================== NOT FOUND PAGE ==================== */
.not-found-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 40px 20px;
    text-align: center;
}

.not-found-page.hidden { display: none; }

.not-found-icon { font-size: 56px; margin-bottom: 20px; opacity: 0.4; }

.not-found-page h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.not-found-page p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: -300px;
    bottom: 0;
    height: 100vh;
    z-index: 250;
    transition: left 0.3s var(--ease);
    overflow: hidden;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar { display: none; }
.sidebar.open { left: 0; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 240;
    animation: fadeIn 0.2s var(--ease);
}

.sidebar-overlay.active { display: block; }

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

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo { font-size: 22px; }

.sidebar-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
}

.sidebar-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-xs);
    color: var(--text-muted);
    transition: all 0.15s var(--ease);
}

.sidebar-close:hover { color: var(--text-primary); background: var(--bg-card); }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s var(--ease);
}

.sidebar-user:hover { background: var(--bg-card); }

.sidebar-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 50%;
    color: var(--text-muted);
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-user-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-section-categories {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-categories {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-soft) transparent;
}

.sidebar-categories::-webkit-scrollbar {
    width: 5px;
}

.sidebar-categories::-webkit-scrollbar-track {
    background: var(--bg-surface);
    border-radius: 8px;
    margin: 8px 0;
}

.sidebar-categories::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-soft), var(--border-strong));
    border-radius: 8px;
    transition: background 0.2s;
}

.sidebar-categories::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent), var(--accent-soft));
}

.sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.sidebar-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.sidebar-cat-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-cat-item.active {
    color: var(--accent);
    background: var(--accent-dim);
    border-right: 3px solid var(--accent);
}

.sidebar-cat-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 7px;
    border-radius: var(--r-full);
}

.sidebar-cat-item.active .sidebar-cat-count {
    background: var(--accent-soft);
    color: var(--accent);
}

.sidebar-cat-parent {
    padding: 8px 18px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

.sidebar-section {
    padding: 8px 0;
}

.sidebar-section + .sidebar-section {
    border-top: 1px solid var(--border);
}

.sidebar-section-label {
    padding: 10px 18px 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.sidebar-nav-group {
    padding: 4px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-page-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--r-xs);
    transition: all 0.15s var(--ease);
}

.sidebar-page-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-page-btn.active {
    color: var(--accent);
    background: var(--accent-dim);
}

/* ==================== FILTER SYSTEM ==================== */
.filter-dropdown-wrap {
    padding: 0 16px 8px;
    position: relative;
}

.filter-trigger-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    transition: all 0.2s var(--ease);
    white-space: nowrap;
}

.filter-trigger:active { transform: scale(0.96); }

.filter-trigger.has-filters {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
}

.filter-trigger-arrow {
    font-size: 12px;
    transition: transform 0.2s var(--ease);
}

.filter-trigger.open .filter-trigger-arrow {
    transform: rotate(180deg);
}

.active-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.active-filter-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-dim);
    border-radius: var(--r-full);
    white-space: nowrap;
    animation: pillIn 0.2s var(--spring);
}

@keyframes pillIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.active-filter-pill .remove-filter {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    opacity: 0.6;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.active-filter-pill .remove-filter:hover { opacity: 1; }

.filter-dropdown {
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    padding: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    animation: dropdownSlide 0.2s var(--ease);
}

.filter-dropdown.hidden { display: none; }

@keyframes dropdownSlide {
    from { transform: translateY(-8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.filter-group { margin-bottom: 12px; }
.filter-group:last-child { margin-bottom: 0; }

.filter-group-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.filter-group-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    transition: all 0.2s var(--ease);
    white-space: nowrap;
}

.filter-pill:active { transform: scale(0.95); }

.filter-pill.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.veg-dot { background: var(--green); }
.nonveg-dot { background: var(--red); }

/* ==================== BOTTOM NAVIGATION ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 6px 0 calc(6px + var(--safe-bottom));
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 16px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    transition: color 0.2s var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item.active { color: var(--accent); }

.bottom-nav-item svg { transition: transform 0.2s var(--ease); }
.bottom-nav-item:active svg { transform: scale(0.9); }

/* ==================== PAGE CONTAINER ==================== */
.page { display: none; }
.page.active { display: block; }

.page-header {
    padding: 20px 16px 12px;
}

.page-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}

/* ==================== ORDERS PAGE ==================== */
.orders-tabs {
    display: flex;
    gap: 0;
    padding: 0 16px 12px;
}

.orders-tab {
    flex: 1;
    padding: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.2s var(--ease);
}

.orders-tab:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.orders-tab:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

.orders-tab.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.orders-content { padding: 0 16px 80px; }
.orders-content.hidden { display: none; }

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.order-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.order-card-id {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.order-card-date {
    font-size: 11px;
    color: var(--text-muted);
}

.order-card-items {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-card-total {
    font-size: 14px;
    font-weight: 800;
    color: var(--accent);
}

.order-status-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--r-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-status-badge.pending { background: rgba(255,152,0,0.15); color: var(--status-pending); }
.order-status-badge.preparing { background: rgba(33,150,243,0.15); color: var(--status-preparing); }
.order-status-badge.completed { background: rgba(76,175,80,0.15); color: var(--status-completed); }
.order-status-badge.cancelled { background: rgba(244,67,54,0.15); color: var(--status-cancelled); }
.order-status-badge.ready { background: rgba(76,175,80,0.15); color: var(--status-completed); }

.orders-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 20px;
    text-align: center;
}

.orders-empty.hidden { display: none; }
.orders-empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.orders-empty p { font-size: 15px; font-weight: 700; color: var(--text-secondary); margin-bottom: 4px; }
.orders-empty span { font-size: 12px; color: var(--text-muted); }

/* ==================== ORDER DETAIL MODAL BODY ==================== */
.order-detail-body {
    padding: 0 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.order-detail-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: var(--bg-card);
    border-radius: var(--r-sm);
    margin-bottom: 16px;
}

.order-detail-status .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.status-dot.pending { background: var(--status-pending); }
.status-dot.preparing { background: var(--status-preparing); }
.status-dot.completed { background: var(--status-completed); }
.status-dot.cancelled { background: var(--status-cancelled); }

.order-detail-info {
    flex: 1;
}

.order-detail-info span {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.order-detail-info small {
    font-size: 11px;
    color: var(--text-muted);
}

.order-detail-items {
    margin-bottom: 16px;
}

.order-detail-items h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.order-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.order-detail-item-name { color: var(--text-primary); font-weight: 500; }
.order-detail-item-qty { color: var(--text-muted); }
.order-detail-item-price { color: var(--accent); font-weight: 700; }

.order-detail-total {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 800;
}

.order-detail-total span:last-child { color: var(--accent); }

/* ==================== PROFILE PAGE ==================== */
.profile-login-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 24px;
}

.profile-login-prompt.hidden { display: none; }
.profile-login-icon { font-size: 56px; margin-bottom: 20px; opacity: 0.4; }
.profile-login-prompt h3 { font-size: 18px; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.profile-login-prompt p { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }

.profile-content { padding: 0 16px 80px; }
.profile-content.hidden { display: none; }

.profile-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: 16px;
}

.profile-avatar {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border-radius: 50%;
    color: var(--text-muted);
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

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

.profile-name {
    display: block;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.profile-phone {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

.profile-edit-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-dim);
    border-radius: var(--r-xs);
    transition: all 0.15s var(--ease);
}

.profile-edit-btn:hover { background: var(--accent-soft); }

/* ==================== LOYALTY CARD ==================== */
.loyalty-card {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px;
    margin-bottom: 16px;
}

.loyalty-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

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

.loyalty-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.loyalty-balance {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}

.loyalty-points {
    font-size: 36px;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
}

.loyalty-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.loyalty-info {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==================== PROFILE ACTIONS ==================== */
.profile-section {
    margin-bottom: 16px;
}

.profile-section-title {
    margin: 0 0 10px;
    padding: 0 4px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s var(--ease);
}

.profile-action-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.profile-action-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-action-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.profile-action-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-action-subtitle {
    font-size: 11px;
    line-height: 1.35;
    color: var(--text-muted);
}

.profile-action-btn.danger { color: var(--red); }
.profile-action-btn.danger:hover { background: var(--red-bg); }
.profile-action-btn.danger .profile-action-title { color: var(--red); }

/* ==================== LOGIN MODAL ==================== */
.login-header {
    padding: 20px 20px 8px;
}

.login-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.login-body {
    padding: 12px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.login-submit {
    margin-top: 4px;
}

/* ==================== SHARED BUTTONS ==================== */
.btn-primary {
    padding: 14px 28px;
    background: var(--accent);
    color: white;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 800;
    box-shadow: var(--shadow-glow);
    transition: all 0.2s var(--ease);
    text-align: center;
    width: 100%;
}

.btn-primary:active { transform: scale(0.98); }

/* ==================== ENHANCED ORDER TRACKER ==================== */
.tracker-step.status-pending .tracker-icon { color: var(--status-pending); }
.tracker-step.status-preparing .tracker-icon { color: var(--status-preparing); }
.tracker-step.status-completed .tracker-icon { color: var(--status-completed); }
.tracker-step.status-cancelled .tracker-icon { color: var(--status-cancelled); }

.tracker-step.active.status-pending .tracker-label { color: var(--status-pending); }
.tracker-step.active.status-preparing .tracker-label { color: var(--status-preparing); }
.tracker-step.active.status-completed .tracker-label { color: var(--status-completed); }
.tracker-step.active.status-cancelled .tracker-label { color: var(--status-cancelled); }

/* ==================== DESKTOP RESPONSIVE ==================== */
@media (min-width: 1024px) {
    .sidebar {
        position: sticky;
        top: 0;
        left: 0;
        height: 100dvh;
        z-index: 10;
        transition: none;
    }

    .sidebar-close { display: none; }
    .sidebar-overlay { display: none !important; }
    #sidebarToggle { display: none; }
    .bottom-nav { display: none !important; }

    .menu-items-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .menu-grid-container { padding-bottom: 60px; }

    .food-card:hover {
        border-color: var(--accent-soft);
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }

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

    .floating-cart { max-width: 420px; }
    .sheet-content { max-width: 520px; }
    #cartModal {
        padding: 56px 24px;
    }
    #cartModal .sheet-content {
        max-height: calc(100dvh - 112px);
        padding-bottom: 28px;
    }
    #cartStep2 {
        padding: 0 30px 10px;
    }
    .cart-details-section {
        margin-bottom: 26px;
    }
    .order-tracker { max-width: 420px; }
    .toast { max-width: 400px; }
    .page-header { padding-top: 24px; }
    .search-sticky { top: 0; }

    .filter-dropdown {
        left: 16px;
        right: auto;
        width: 320px;
    }
}

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

@media (max-width: 1023px) {
    .menu-grid-container { padding-bottom: calc(180px + var(--safe-bottom)); }
    .orders-content { padding-bottom: calc(80px + var(--safe-bottom)); }
    .profile-content { padding-bottom: calc(80px + var(--safe-bottom)); }

    #cartModal {
        padding: 28px 16px calc(28px + var(--safe-bottom));
    }
    #cartModal .sheet-content {
        max-height: calc(100dvh - 56px - var(--safe-bottom));
    }
    #cartStep2 {
        padding: 0 20px 6px;
    }
}

/* ==================== HEADING TYPOGRAPHY ==================== */
.restaurant-name,
.page-title,
.section-label,
.category-title,
.sidebar-title,
.cart-header h2,
.login-header h2 {
    font-family: var(--font-heading);
}

/* ==================== THEME SELECTOR MODAL ==================== */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.theme-card {
    position: relative;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s var(--ease);
}

.theme-card:active { transform: scale(0.96); }

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

.theme-card.active {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.theme-preview {
    height: 80px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-radius: var(--r-md) var(--r-md) 0 0;
}

.theme-preview-bar {
    height: 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 6px;
}

.theme-preview-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.theme-preview-cards {
    display: flex;
    gap: 4px;
    flex: 1;
}

.theme-preview-card {
    flex: 1;
    border-radius: 4px;
    border: 1px solid;
}

.theme-preview-accent {
    height: 6px;
    border-radius: 3px;
    margin-top: auto;
}

.theme-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
}

.theme-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-emoji { font-size: 16px; }

.theme-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.theme-desc {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.3;
    padding-left: 24px;
}

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

    #themeModal {
        align-items: center;
    }

    #themeModal .sheet-content {
        border-radius: var(--r-lg);
        max-width: 560px;
        animation: themeScaleIn 0.25s var(--ease);
    }
}

@keyframes themeScaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.theme-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    animation: badgePop 0.3s var(--spring);
}

/* ==================== STATUS GLOW ANIMATIONS ==================== */
@keyframes glowPending {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 152, 0, 0.15), var(--shadow-sm); }
    50% { box-shadow: 0 0 22px rgba(255, 152, 0, 0.3), var(--shadow-sm); }
}

@keyframes glowPreparing {
    0%, 100% { box-shadow: 0 0 14px rgba(255, 122, 24, 0.2), var(--shadow-sm); }
    50% { box-shadow: 0 0 26px rgba(255, 122, 24, 0.4), var(--shadow-sm); }
}

@keyframes glowCompleted {
    0%, 100% { box-shadow: 0 0 12px rgba(76, 175, 80, 0.15), var(--shadow-sm); }
    50% { box-shadow: 0 0 22px rgba(76, 175, 80, 0.35), var(--shadow-sm); }
}

@keyframes glowCancelled {
    0% { box-shadow: 0 0 12px rgba(244, 67, 54, 0.25), var(--shadow-sm); }
    30% { box-shadow: 0 0 20px rgba(244, 67, 54, 0.45), var(--shadow-sm); }
    100% { box-shadow: 0 0 6px rgba(244, 67, 54, 0.08), var(--shadow-sm); }
}

.order-card.glow-pending { animation: glowPending 2s ease-in-out infinite; }
.order-card.glow-preparing { animation: glowPreparing 1.5s ease-in-out infinite; }
.order-card.glow-completed { animation: glowCompleted 2s ease-in-out infinite; }
.order-card.glow-cancelled { animation: glowCancelled 1.5s ease-in-out 1; }

.order-tracker.glow-pending { animation: glowPending 2s ease-in-out infinite; }
.order-tracker.glow-preparing { animation: glowPreparing 1.5s ease-in-out infinite; }
.order-tracker.glow-completed { animation: glowCompleted 2s ease-in-out infinite; }
.order-tracker.glow-cancelled { animation: glowCancelled 1.5s ease-in-out 1; }

/* ==================== TRACKER AUTO-HIDE ==================== */
@keyframes trackerFadeOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

.order-tracker.fade-out {
    animation: trackerFadeOut 0.5s var(--ease) forwards;
    pointer-events: none;
}

.tracker-message {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
    line-height: 1.4;
}

/* ==================== CART SUGGESTIONS ==================== */
.cart-suggestions { padding: 0 20px 16px; }
.cart-suggestions.hidden { display: none; }

.cart-suggestions-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.suggestions-chevron { transition: transform 0.3s var(--ease); }
.cart-suggestions.collapsed .suggestions-chevron { transform: rotate(-90deg); }

.cart-suggestions-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: none;
    transition: max-height 0.3s var(--ease), opacity 0.3s var(--ease);
    max-height: 200px;
    opacity: 1;
}

.cart-suggestions.collapsed .cart-suggestions-scroll {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.cart-suggestions-scroll::-webkit-scrollbar { display: none; }

.suggestion-card {
    flex-shrink: 0;
    width: 140px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.suggestion-card:active { transform: scale(0.97); }

.suggestion-card-img {
    width: 100%;
    height: 80px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    overflow: hidden;
}

.suggestion-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.suggestion-card-body { padding: 8px 10px; }

.suggestion-card-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.suggestion-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.suggestion-card-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
}

.suggestion-add-btn {
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: var(--r-full);
    white-space: nowrap;
    transition: all 0.2s var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.suggestion-add-btn:active {
    transform: scale(0.95);
    background: var(--accent);
    color: #fff;
}

/* ==================== ORDER DETAIL ACTIONS ==================== */
.order-detail-actions {
    padding: 0 20px 20px;
    display: flex;
    gap: 10px;
}

.order-detail-actions:empty { display: none; padding: 0; }

.order-action-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    border-radius: var(--r-sm);
    transition: all 0.2s var(--ease);
    text-align: center;
}

.order-action-btn:active { transform: scale(0.97); }

.order-action-btn.cancel {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.order-action-btn.reorder {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-glow);
}

/* ==================== ORDER DETAIL MESSAGE ==================== */
.order-detail-message {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    padding: 0 0 12px;
}

/* ==================== UTILITY ==================== */
.hidden { display: none !important; }
