/* ===== VARIABLES & THEME ===== */
:root {
    /* Brand Colors - Modern Food Palette */
    --primary: #FF6B35;       /* KhajaPath Orange */
    --primary-dark: #E85D2A;
    --primary-light: #FFF0EB;
    
    /* Neutrals */
    --bg-body: #F9FAFB;       /* Light Gray Background */
    --bg-surface: #FFFFFF;
    --text-main: #1F2937;     /* Soft Black */
    --text-muted: #6B7280;
    --border: #E5E7EB;
    
    /* Accents */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    
    /* UI Elements */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-float: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-top: 0;
}

h1, h2, h3, h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--text-main);
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
[x-cloak] { display: none !important; }

/* ===== UTILITIES ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.section-spacer { padding: 2rem 0; }
.text-center { text-align: center; }
.hidden { display: none !important; }

.transition { transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform; }
.ease-out { transition-timing-function: cubic-bezier(0, 0, 0.2, 1); }
.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }

/* ===== BRANDED PAGE LOADER ===== */
.page-loader {
    position: fixed;
    inset: 0;
    background: white; /* Brand Orange */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* 1. Icon Animation */
.brand-icon-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
}

.icon-circle {
    width: 80px;
    height: 80px;
    background: rgb(251, 250, 250);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 2.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    animation: bounceIcon 2s infinite ease-in-out;
    z-index: 2;
}

.icon-shadow {
    position: absolute;
    bottom: -10px;
    width: 60px;
    height: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 50%;
    animation: shadowPulse 2s infinite ease-in-out;
    z-index: 1;
}

/* 2. Text Animation (Wave) */
.brand-loader-text {
    color: rgb(244, 114, 0);
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin: 0;
}

.brand-loader-text span {
    display: inline-block;
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInUpText 0.5s forwards;
}

/* Stagger delays for each letter */
.brand-loader-text span:nth-child(1) { animation-delay: 0.1s; }
.brand-loader-text span:nth-child(2) { animation-delay: 0.15s; }
.brand-loader-text span:nth-child(3) { animation-delay: 0.2s; }
.brand-loader-text span:nth-child(4) { animation-delay: 0.25s; }
.brand-loader-text span:nth-child(5) { animation-delay: 0.3s; }
.brand-loader-text span:nth-child(6) { animation-delay: 0.35s; }
.brand-loader-text span:nth-child(7) { animation-delay: 0.4s; }
.brand-loader-text span:nth-child(8) { animation-delay: 0.45s; }
.brand-loader-text span:nth-child(9) { animation-delay: 0.5s; }

/* 3. Dots Animation */
.loader-dots {
    display: flex;
    gap: 8px;
    margin-top: 0.5rem;
}

.loader-dots .dot {
    width: 8px;
    height: 8px;
    background: rgb(244, 114, 0);
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out both;
}

.loader-dots .dot:nth-child(1) { animation-delay: -0.32s; }
.loader-dots .dot:nth-child(2) { animation-delay: -0.16s; }

/* Animations Keyframes */
@keyframes bounceIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes shadowPulse {
    0%, 100% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(0.7); opacity: 0.1; }
}

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

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0); opacity: 0; }
    40% { transform: scale(1); opacity: 1; }
}

/* ===== HEADER & NAVIGATION ===== */
.header {
    background: var(--bg-surface); height: 70px;
    position: sticky; top: 0; z-index: 100;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.nav-container { height: 100%; }
.nav-content { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.logo-link { display: flex; align-items: center; gap: 0.75rem; font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.logo-text { color: var(--text-main); font-size: 1.25rem; }

.desktop-nav { display: flex; gap: 2rem; align-items: center; }
.nav-link { font-weight: 500; color: var(--text-muted); transition: var(--transition); padding: 0.5rem 0; }
.nav-link:hover { color: var(--primary); }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.nav-icon-btn {
    width: 40px; height: 40px; border-radius: 50%; border: none; background: transparent;
    color: var(--text-main); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition); position: relative; font-size: 1.1rem;
}
.nav-icon-btn:hover { background: var(--bg-body); color: var(--primary); }
.cart-badge {
    position: absolute; top: -2px; right: -2px; background: var(--primary); color: white;
    font-size: 0.7rem; font-weight: 700; width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg-surface);
}

.mobile-menu-btn {
    display: none; background: transparent; border: none; font-size: 1.5rem; color: var(--text-main);
    padding: 0.5rem; cursor: pointer; z-index: 101; width: 44px; height: 44px;
    align-items: center; justify-content: center;
}

.mobile-menu {
    position: fixed; top: 0; left: 0; bottom: 0; width: 280px; background: var(--bg-surface);
    z-index: 150; box-shadow: 4px 0 15px rgba(0,0,0,0.1); padding-top: 80px;
    display: flex; flex-direction: column;
}
.mobile-menu-content { padding: 1rem 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; overflow-y: auto; }
.mobile-nav-link {
    padding: 0.75rem 1rem; border-radius: var(--radius-sm); color: var(--text-main); font-weight: 500;
    display: flex; align-items: center; gap: 1rem; transition: var(--transition);
}
.mobile-nav-link:hover { background: var(--bg-body); color: var(--primary); }
.mobile-menu-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 140; backdrop-filter: blur(2px); }

/* User Menu */
.user-menu { position: relative; }
.user-btn {
    display: flex; align-items: center; gap: 0.5rem; background: var(--bg-body); border: none;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem; border-radius: 50px; cursor: pointer;
}
.user-avatar {
    width: 32px; height: 32px; background: var(--primary-light); color: var(--primary);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.user-dropdown {
    position: absolute; top: 120%; right: 0; background: var(--bg-surface);
    border-radius: var(--radius-md); box-shadow: var(--shadow-float); width: 200px; padding: 0.5rem; border: 1px solid var(--border);
}
.dropdown-item {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem;
    border-radius: var(--radius-sm); font-size: 0.9rem; color: var(--text-main);
}
.dropdown-item:hover { background: var(--bg-body); color: var(--primary); }

/* Auth Buttons */
.auth-buttons { display: flex; gap: 0.75rem; }
.btn-primary {
    padding: 0.5rem 1.25rem; border-radius: 50px; font-weight: 600; font-size: 0.9rem;
    cursor: pointer; transition: var(--transition); border: 1px solid transparent;
    background: var(--primary); color: white;
}
.btn-secondary {
    padding: 0.5rem 1.25rem; border-radius: 50px; font-weight: 600; font-size: 0.9rem;
    cursor: pointer; transition: var(--transition); background: transparent;
    color: var(--text-main); border: 1px solid var(--border);
}

/* ===== LIST PAGE ===== */
.page-header { margin-bottom: 2rem; }
.filter-sticky-wrapper { position: sticky; top: 70px; z-index: 90; background: var(--bg-body); padding: 1rem 0; margin-bottom: 1.5rem; }
.filter-bar { display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.category-pills-wrapper { overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
.category-pills-wrapper::-webkit-scrollbar { display: none; }
.category-pills { display: flex; gap: 0.75rem; }
.pill-btn {
    background: var(--bg-surface); border: 1px solid var(--border); padding: 0.5rem 1.25rem;
    border-radius: 50px; font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
    white-space: nowrap; cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 0.5rem;
}
.pill-btn.active, .pill-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.sort-wrapper {
    display: flex; align-items: center; gap: 0.5rem; background: var(--bg-surface);
    padding: 0.5rem 1rem; border-radius: var(--radius-md); border: 1px solid var(--border);
}
.sort-select-clean { border: none; outline: none; background: transparent; font-size: 0.9rem; cursor: pointer; }

.restaurants-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; }
.restaurant-card-modern {
    background: var(--bg-surface); border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow-sm); transition: var(--transition); display: flex; flex-direction: column;
    height: 100%; border: 1px solid transparent;
}
.restaurant-card-modern:hover { transform: translateY(-5px); box-shadow: var(--shadow-float); border-color: var(--primary-light); }
.card-image-wrapper { position: relative; padding-top: 60%; background: var(--bg-body); }
.card-image-wrapper img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.card-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 5px; }
.badge { padding: 4px 10px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: white; }
.badge-success { background: var(--success); }
.badge-closed { background: var(--danger); }
.rating-bubble {
    position: absolute; bottom: 10px; right: 10px; background: var(--bg-surface); padding: 4px 10px;
    border-radius: 20px; font-size: 0.8rem; font-weight: 600; box-shadow: var(--shadow-sm);
    display: flex; align-items: center; gap: 4px;
}
.rating-bubble i { color: var(--warning); }
.card-details { padding: 1.25rem; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; }
.res-name { font-size: 1.1rem; margin: 0; line-height: 1.3; }
.res-category { font-size: 0.8rem; color: var(--primary-dark); background: var(--primary-light); padding: 2px 8px; border-radius: 4px; }
.card-meta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text-muted); margin-top: 0.5rem; }

/* ===== MENU PAGE - IMMERSIVE HERO ===== */
.restaurant-hero-immersive {
    position: relative;
    height: 400px; /* Taller hero on desktop */
    width: 100%;
    overflow: hidden;
    color: white;
    background: #1a1a1a;
}

.hero-bg-image {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    transition: transform 0.5s ease;
}

/* Gradient to make text readable */
.hero-gradient-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0.9) 100%);
    z-index: 1;
}

.hero-inner-content {
    position: relative; height: 100%; z-index: 2;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding-bottom: 2rem;
}

.hero-text-content { max-width: 800px; }

/* Hero Components */
.hero-top-badges { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.badge-pill {
    padding: 0.25rem 0.75rem; border-radius: 50px; font-size: 0.75rem; font-weight: 600;
    backdrop-filter: blur(10px); background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.1);
}
.badge-pill.category { text-transform: uppercase; letter-spacing: 0.5px; }
.badge-pill.status-open { background: var(--success); color: white; border: none; }
.badge-pill.status-closed { background: var(--danger); color: white; border: none; }

.hero-main-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.hero-title {
    font-size: 2.75rem; font-weight: 700; line-height: 1.1; margin: 0; color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-actions { display: flex; gap: 0.75rem; }
.btn-glass {
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(5px); color: white; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s ease; font-size: 1.1rem;
}
.btn-glass:hover { background: white; color: var(--primary); }

.hero-meta-row { display: flex; align-items: center; gap: 1rem; font-size: 1rem; color: rgba(255,255,255,0.9); margin-bottom: 0.75rem; }
.meta-item { display: flex; align-items: center; gap: 0.5rem; }
.meta-divider { width: 4px; height: 4px; background: rgba(255,255,255,0.5); border-radius: 50%; }

.hero-desc {
    font-size: 0.95rem; color: rgba(255,255,255,0.7); max-width: 600px;
    line-height: 1.5; margin: 0;
}

/* ===== MENU CONTENT (Grid & Sticky Nav) ===== */
.menu-container { padding-top: 1rem; }

.sticky-menu-nav {
    position: sticky; top: 70px; z-index: 80;
    background: var(--bg-body); padding: 1rem 0;
    border-bottom: 1px solid var(--border); margin-bottom: 1.5rem;
}
.menu-search-compact { position: relative; margin-bottom: 1rem; }
.menu-search-compact i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.menu-search-compact input {
    width: 100%; padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--bg-surface); font-size: 0.95rem;
}
.scroll-nav { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
.nav-pill {
    background: transparent; border: none; font-weight: 600; color: var(--text-muted); padding: 0.5rem 0;
    border-bottom: 3px solid transparent; white-space: nowrap; cursor: pointer; transition: var(--transition);
}
.nav-pill.active { color: var(--primary); border-bottom-color: var(--primary); }

.food-grid-modern { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 1.5rem; }
.dish-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 1rem;
    display: flex; justify-content: space-between; gap: 1rem;
    transition: var(--transition);
}
.dish-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.dish-info { flex: 1; display: flex; flex-direction: column; }
.dish-header { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.25rem; }
.diet-icon { font-size: 0.7rem; padding: 1px 3px; border: 1px solid; border-radius: 2px; }
.diet-icon.veg { color: var(--success); border-color: var(--success); }
.diet-icon.non-veg { color: var(--danger); border-color: var(--danger); }
.dish-name { font-size: 1rem; line-height: 1.2; margin: 0; }
.dish-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; margin-bottom: auto; }
.dish-price-row { margin-top: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.price { font-weight: 600; color: var(--text-main); }
.spicy-tag { color: var(--danger); font-size: 0.8rem; }
.dish-image-action { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; width: 110px; flex-shrink: 0; position: relative; }
.img-box { width: 110px; height: 100px; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-body); }
.img-box img { width: 100%; height: 100%; object-fit: cover; }
.img-box .placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); font-size: 1.5rem; }
.add-btn-container { margin-top: -15px; z-index: 2; }
.btn-add-modern {
    background: var(--bg-surface); color: var(--primary);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    padding: 6px 16px; border-radius: 4px; font-weight: 700;
    font-size: 0.85rem; cursor: pointer; text-transform: uppercase;
    transition: var(--transition); display: flex; align-items: center; gap: 5px;
}
.btn-add-modern:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== MEDIA QUERIES ===== */
@media (max-width: 992px) {
    .desktop-nav, .auth-buttons, .user-menu { display: none; }
    .mobile-menu-btn { display: flex; }
    
    .filter-bar { flex-direction: column; align-items: flex-start; }
    .category-pills-wrapper { width: 100%; }
    .sort-wrapper { width: 100%; justify-content: space-between; }
    .restaurants-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .card-image-wrapper { padding-top: 50%; }

    /* Mobile Hero */
    .restaurant-hero-immersive { height: 300px; }
    .hero-title { font-size: 1.8rem; }
    .hero-meta-row { flex-wrap: wrap; gap: 0.5rem; }
    .meta-divider { display: none; }
    .meta-item { background: rgba(0,0,0,0.4); padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; }
    .hero-desc { display: none; /* Hide desc on mobile to save space */ }
    
    .food-grid-modern { grid-template-columns: 1fr; gap: 1rem; }
    .dish-card { padding: 0; border: none; border-bottom: 1px solid var(--border); border-radius: 0; padding-bottom: 1rem; }
    .dish-card:hover { border-color: var(--border); box-shadow: none; }
    .img-box { width: 100px; height: 90px; border-radius: 8px; }
    .dish-image-action { width: 100px; }
}

/* Animation */
.animate-fade-up { animation: fadeUp 0.6s ease-out; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

