@import url('https://fonts.googleapis.com/css2?family=Mulish:wght@400;600;700;800&display=swap');

:root {
    --primary: #ff4757;
    --dark: #2f3542;
    --gray: #747d8c;
    --light: #f1f2f6;
    --card-shadow: 0 4px 15px rgba(0,0,0,0.05);
    --glass-bg: rgba(255, 255, 255, 0.95);
}

/* --- BASE LAYOUT (Fixes Footer Gap) --- */
body {
    font-family: 'Mulish', sans-serif;
    background-color: #fcfcfc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 60px; /* Space for Fixed Header */
}

/* Push footer to bottom */
footer { margin-top: auto; }

/* 1. APP HEADER */
.app-header {
    background: white;
    padding: 15px 0;
    border-bottom: 1px solid #f1f2f6;
}
.greeting { font-size: 1.4rem; font-weight: 800; color: var(--dark); margin: 0; }
.sub-text { font-size: 0.9rem; color: var(--gray); }

/* 2. STICKY NAV BAR */
.sticky-bar {
    position: sticky;
    top: 56px; /* Below the main navbar */
    z-index: 990;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

/* Search Input */
.search-input {
    background: var(--light); border: 1px solid transparent; border-radius: 50px;
    padding: 10px 20px 10px 45px; width: 100%; font-size: 0.9rem; transition: 0.2s;
}
.search-input:focus { background: white; border-color: #dfe4ea; outline: none; box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.1); }
.search-icon { position: absolute; left: 25px; top: 11px; color: #a4b0be; }

/* Category Scroll */
.cat-scroll {
    display: flex; overflow-x: auto; gap: 8px; padding: 5px 0;
    scrollbar-width: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }

.cat-chip {
    white-space: nowrap; padding: 8px 18px; border-radius: 50px;
    background: white; color: var(--gray); font-size: 0.85rem; font-weight: 700;
    border: 1px solid #e1e1e1; transition: 0.2s; cursor: pointer;
}
.cat-chip.active {
    background: var(--dark); color: white; border-color: var(--dark);
    box-shadow: 0 4px 10px rgba(47, 53, 66, 0.2);
}

/* 3. MENU CONTAINER */
.menu-container {
    padding-bottom: 100px; /* Space for Mobile Floating Cart */
}

.cat-title {
    font-weight: 800; font-size: 1.2rem; color: var(--dark);
    margin-top: 30px; margin-bottom: 15px;
    padding-left: 10px; border-left: 4px solid var(--primary);
}

/* ITEM CARD */
.item-card {
    background: white; border-radius: 16px; padding: 15px;
    margin-bottom: 15px; display: flex; gap: 15px;
    box-shadow: var(--card-shadow); border: 1px solid #fff;
    transition: transform 0.2s;
}
/* Mobile Active State */
.item-card:active { transform: scale(0.98); }

.item-info { flex: 1; display: flex; flex-direction: column; }
.item-name { font-weight: 700; font-size: 1rem; color: var(--dark); margin-bottom: 4px; line-height: 1.3; }
.item-price { font-weight: 700; font-size: 0.95rem; color: #535c68; margin-bottom: 6px; }
.item-desc { font-size: 0.8rem; color: #95a5a6; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Food Type Icons */
.type-icon { width: 14px; height: 14px; border: 1px solid; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 5px; }
.type-dot { width: 6px; height: 6px; border-radius: 50%; }
.veg { border-color: #2ecc71; } .veg .type-dot { background: #2ecc71; }
.nonveg { border-color: #e74c3c; } .nonveg .type-dot { background: #e74c3c; }
.egg { border-color: #f1c40f; } .egg .type-dot { background: #f1c40f; }

/* Image & Add Button */
.item-img-box { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.item-img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }

/* The Add Button Logic */
.add-btn-wrapper {
    position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
    width: 90px; height: 34px; background: white; border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 1px solid #f1f2f6;
    display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer;
}
.btn-text { color: #1ba672; font-weight: 800; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }

.qty-control { display: none; width: 100%; height: 100%; justify-content: space-between; align-items: center; background: white; }
.qty-btn { width: 30px; height: 100%; display: flex; align-items: center; justify-content: center; color: #1ba672; font-weight: 800; font-size: 1.2rem; }
.qty-btn:active { background: #f0fff4; }

/* 4. FLOATING CART (Mobile) */
.floating-cart {
    position: fixed; bottom: 80px; /* Above Bottom Nav */ left: 15px; right: 15px;
    background: #60b246; color: white;
    border-radius: 12px; padding: 14px 20px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 10px 25px rgba(96, 178, 70, 0.4);
    z-index: 1000; cursor: pointer;
    transform: translateY(150%); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.floating-cart.visible { transform: translateY(0); }

/* --- DESKTOP OPTIMIZATIONS --- */
@media (min-width: 992px) {
    /* Remove mobile padding */
    .menu-container { padding-bottom: 40px; }
    
    /* 3-Column Grid */
    .menu-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 25px;
    }
    
    .item-card { height: 160px; margin-bottom: 0; }
    
    /* Hide Mobile Elements */
    .floating-cart { display: none; } 
    
    /* Adjust Sticky Header for Desktop Navbar */
    .sticky-bar { top: 70px; }
}