/* Food Fly Master Production CSS (PC / Tablet / Mobile Optimized) */
:root {
    --brand-yellow: #FEB703;
    --brand-yellow-dark: #EAA700;
    --brand-red: #E21B70;
    --brand-red-dark: #C2135D;
    --brand-black: #0F172A;
    --brand-dark: #1E293B;
    --brand-gray: #64748B;
    --brand-light-gray: #F1F5F9;
    --brand-card-bg: #FFFFFF;
    --brand-radius-sm: 10px;
    --brand-radius-md: 16px;
    --brand-radius-lg: 24px;
    --brand-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --brand-shadow-md: 0 6px 20px rgba(0, 0, 0, 0.06);
    --brand-shadow-lg: 0 12px 35px rgba(0, 0, 0, 0.09);
    --transition-smooth: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    -webkit-overflow-scrolling: touch;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', 'Hind Siliguri', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #F8FAFC;
    color: var(--brand-black);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    touch-action: pan-y;
}

button, a, input, select, textarea {
    touch-action: manipulation;
}

/* Fast Image Skeleton & Zero Jitter */
img {
    background-color: #EEF2F6;
    image-rendering: -webkit-optimize-contrast;
}

/* GPU Accelerated Fixed/Sticky Layers */
.top-header, .cart-drawer, .foodfly-offers-float {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 60fps/120fps Hardware Accelerated Fast Rendering with Off-Screen Virtualization */
.restaurant-card, .deal-card, .service-card, .food-card {
    contain: layout style paint;
    content-visibility: auto;
    contain-intrinsic-size: 240px;
}

/* WhatsApp Support Floating Action Button */
.whatsapp-float {
    position: fixed;
    bottom: 90px;
    right: 18px;
    background: #25D366;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
    z-index: 998;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s;
}
.whatsapp-float:hover {
    transform: translate3d(0, -3px, 0) scale(1.08);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.65);
}
@media (min-width: 641px) {
    .whatsapp-float {
        bottom: 28px;
        right: 28px;
        width: 56px;
        height: 56px;
        font-size: 30px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 12px rgba(226, 27, 112, 0.4); }
    50% { transform: scale(1.04); box-shadow: 0 0 22px rgba(226, 27, 112, 0.7); }
}

@keyframes bounceCart {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.25); }
    70% { transform: scale(0.92); }
}

/* Responsive Main Shell */
.app-container {
    width: 100%;
    margin: 0 auto;
    transition: var(--transition-smooth);
}

/* ===================================================
   DESKTOP & TABLET VIEWPORT (Wide Screen > 1024px)
   =================================================== */
@media (min-width: 1025px) {
    .app-container {
        max-width: 1240px;
        padding: 0 24px;
    }

    body {
        padding-bottom: 40px;
    }

    /* Desktop Navigation Bar */
    .top-header {
        border-radius: var(--brand-radius-lg);
        margin-top: 16px;
        padding: 16px 28px !important;
        box-shadow: var(--brand-shadow-md);
    }

    .search-bar-container {
        max-width: 820px;
        margin: -26px auto 0 auto !important;
    }

    .foodi-hero-emerald {
        border-radius: var(--brand-radius-lg) !important;
        margin-top: 16px;
        padding: 0 0 20px 0 !important;
    }

    .foodi-hero-emerald .hero-video-slider-container {
        max-height: 320px;
        border-radius: var(--brand-radius-lg) var(--brand-radius-lg) 0 0;
    }

    .foodi-hero-emerald .hero-video-slide {
        height: 280px;
    }

    .foodi-services-section, .foodi-deals-section, .foodi-trending-banner-section, .popular-foods-section, .restaurants-section, .foodi-bites-section {
        max-width: 1040px;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Desktop 8-Service Grid */
    .foodi-services-grid {
        grid-template-columns: repeat(8, 1fr) !important;
        gap: 16px !important;
    }

    .foodi-filter-segmented-bar {
        max-width: 480px;
        margin: 16px auto !important;
    }

    .foods-grid-homepage {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 20px !important;
    }

    .service-card {
        padding: 22px 16px !important;
    }

    .service-icon-box {
        width: 64px !important;
        height: 64px !important;
    }

    .service-emoji {
        font-size: 34px !important;
    }

    .service-title {
        font-size: 14.5px !important;
    }

    /* Desktop Restaurants Grid (3 Columns) */
    .restaurants-list {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 24px !important;
    }

    .restaurant-card {
        transition: var(--transition-smooth) !important;
    }

    .restaurant-card:hover {
        transform: translateY(-6px) !important;
        box-shadow: var(--brand-shadow-lg) !important;
    }

    /* Hide Mobile Curved Bottom Nav on Desktop */
    .curved-bottom-nav {
        display: none !important;
    }

    /* Desktop Floating Cart Pill */
    .desktop-cart-trigger {
        display: flex !important;
    }
}

/* ===================================================
   TABLET VIEWPORT (641px - 1024px)
   =================================================== */
@media (min-width: 641px) and (max-width: 1024px) {
    .app-container {
        max-width: 900px;
        padding: 0 20px;
    }

    body {
        padding-bottom: 95px;
    }

    .hero-slide {
        gap: 25px !important;
    }

    .slide-title {
        font-size: 32px !important;
    }

    .slide-image-box {
        width: 220px !important;
        height: 160px !important;
    }

    .service-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 16px !important;
    }

    .restaurants-list {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }

    .restaurant-card:hover {
        transform: translateY(-4px);
    }
}

/* ===================================================
   MOBILE VIEWPORT (< 640px)
   =================================================== */
@media (max-width: 640px) {
    .app-container {
        width: 100%;
        padding: 0;
    }

    body {
        padding-bottom: 90px;
    }

    .desktop-cart-trigger {
        display: none !important;
    }
}

/* Common Interactive Styles */
.deal-card {
    transition: var(--transition-smooth);
}

.deal-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--brand-shadow-md);
}

.offers-glow-badge {
    animation: pulseGlow 2.5s infinite ease-in-out;
}

.add-to-cart-btn {
    transition: var(--transition-smooth);
}

.add-to-cart-btn:hover {
    background: var(--brand-red);
    color: #fff;
    transform: scale(1.06);
}

/* Zero-Flicker Layout Rules (Customer Profile Page) */
@media (max-width: 640px) {
    .profile-desktop-layout {
        display: none !important;
    }
}
@media (min-width: 641px) {
    .profile-mobile-layout {
        display: none !important;
    }
}
