/* Savory Snap - Final Polished Theme */

:root {
    --primary-color: #000000;
    --accent-color: #FF4500;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #191919;
    --text-secondary: #767676;
    --border-color: #e0e0e0;
    --nav-bg: #ffffff;
    --font-main: 'Manrope', sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    font-weight: 600;
    margin: 0; padding: 0;
    padding-bottom: 90px;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- BANNER --- */
.pro-banner {
    height: 280px;
    background-color: #111;
    background-image: url('https://images.unsplash.com/photo-1585937421612-70a008356fbe?q=80&w=1000&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    position: relative;
    border-radius: 0 0 30px 30px;
    overflow: hidden;
}
.banner-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.9));
    padding: 20px; color: white;
    display: flex; flex-direction: column;
}
.banner-header-row {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: auto;
    position: relative; z-index: 100;
}
.banner-logo-center { height: 40px; width: auto; }
.banner-icon-btn {
    width: 40px; height: 40px; background: rgba(255,255,255,0.2);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(5px); cursor: pointer; color: white; border: none;
}

/* STRICT THEME ICON TOGGLE */
.theme-icon { width: 22px; height: 22px; stroke: white; transition: transform 0.3s; }
#theme-toggle .icon-moon { display: none; }
#theme-toggle .icon-sun { display: block; }
body.dark-mode #theme-toggle .icon-moon { display: block; }
body.dark-mode #theme-toggle .icon-sun { display: none; }

.banner-text-content { margin-bottom: 40px; position: relative; z-index: 20; text-align: center; width: 100%; }
.banner-text-content h1 {
    font-size: 1.8rem; font-weight: 800; margin: 0 0 5px 0;
    line-height: 1.2; text-shadow: 0 2px 10px rgba(0,0,0,0.5); color: white;
}
.banner-text-content p { margin: 0; font-size: 1rem; opacity: 0.9; color: white; }

/* --- SEARCH --- */
.search-container-pro { padding: 0 20px; margin-top: -30px; position: relative; z-index: 30; }
.search-wrapper {
    display: flex; align-items: center; background-color: var(--card-bg);
    border-radius: 50px; padding: 15px 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08); transition: background-color 0.3s ease;
}
.search-icon { width: 20px; height: 20px; margin-right: 12px; stroke: var(--accent-color); }
#search-bar { width: 100%; border: none; background: transparent; outline: none; font-size: 1rem; color: var(--text-color); font-family: var(--font-main); font-weight: 600;}

/* --- GRID LAYOUTS --- */
.section-header { padding: 25px 20px 15px 20px; display: flex; justify-content: space-between; align-items: center; }
.section-header h2 { font-size: 1.3rem; font-weight: 800; color: var(--text-color); margin: 0; }

.category-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px 10px; padding: 0 20px 20px 20px; width: 100%;
}
.cat-item { display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; width: 100%; transition: transform 0.2s; padding: 8px 0; }
.cat-item:active { transform: scale(0.95); }
.cat-icon-box {
    width: 60px; height: 60px; background: var(--card-bg); border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; box-shadow: 0 4px 10px rgba(0,0,0,0.05); margin-bottom: 8px;
    border: 2px solid transparent; transition: all 0.3s ease;
}
.cat-name { font-size: 0.8rem; color: var(--text-secondary); font-weight: 700; line-height: 1.2; }
.cat-item.active .cat-icon-box { border-color: var(--accent-color); background: rgba(255, 69, 0, 0.05); color: var(--accent-color); }
.cat-item.active .cat-name { color: var(--accent-color); }

/* --- FEATURED CAROUSEL --- */
#featured-container { padding: 0 0 20px; background: transparent; transition: background-color 0.3s ease; }
#featured-container.hidden { display: none; }
#featured-carousel { display: flex; overflow-x: auto; gap: 15px; padding: 0 20px 25px 20px; -ms-overflow-style: none; scrollbar-width: none; }
#featured-carousel::-webkit-scrollbar { display: none; }
.featured-card {
    flex: 0 0 260px; height: 160px; border-radius: 20px; overflow: hidden; position: relative;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08); transition: transform 0.3s ease; cursor: pointer;
}
.featured-card .video-wrapper { width: 100%; height: 100%; position: absolute; top:0; left:0; z-index: 0;}
.featured-card video { width: 100%; height: 100%; object-fit: cover; }
.featured-info {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 40px 15px 15px; z-index: 1; color: white; text-align: left;
}
.featured-title { color: white; font-size: 1.1rem; margin-bottom: 2px; font-weight: 800; text-transform: capitalize; padding-right: 40px; }
.featured-desc { display: none; }
.featured-badge { position: absolute; top: 12px; left: 12px; background: var(--accent-color); color: white; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 800; z-index: 2; }

/* FEATURED BUTTON POSITION */
.featured-card .dynamic-btn-container {
    position: absolute; bottom: 15px !important; right: 15px !important; z-index: 10;
}
.featured-card .qty-control { height: 34px; padding: 0 10px; }

/* --- MENU GRID --- */
.menu-container { padding: 0 20px; max-width: 1200px; margin: 0 auto; }
.menu-category { display: none; padding-top: 20px; border-top: 1px solid var(--border-color);}
.menu-category.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.menu-category h2 { font-size: 1.4rem; font-weight: 800; color: var(--text-color); margin: 0 0 15px 0; }
.menu-subcategory { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 30px; }
.menu-subcategory h3 { grid-column: 1 / -1; font-size: 1rem; font-weight: 700; color: var(--text-secondary); margin: 10px 0 5px 0; text-transform: uppercase; letter-spacing: 1px;}

.accordion-item {
    background: var(--card-bg); border-radius: 20px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    display: flex; flex-direction: column; position: relative; height: 100%;
    transition: background-color 0.3s ease; cursor: pointer; border: none;
}
.item-thumbnail-wrapper { width: 100%; height: 140px; background: #eee; order: -1; border-radius: 0; }
.item-thumbnail-wrapper video { width: 100%; height: 100%; object-fit: cover; }
.accordion-title { padding: 12px; display: flex; flex-direction: column; flex-grow: 1; }
.title-text {
    font-size: 1rem; font-weight: 800; margin-bottom: 4px; color: var(--text-color);
    line-height: 1.2; text-transform: capitalize; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.item-desc-preview { display: none; }
.price-row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 10px;}
.price { font-size: 1rem; color: var(--text-color); font-weight: 800; }

/* --- BUTTONS --- */
.dynamic-btn-container { z-index: 5; }
.add-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-color); color: #fff; border: none; font-size: 1.3rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(255, 69, 0, 0.3); cursor: pointer; padding: 0; }
.qty-control { background: var(--accent-color); color: white; border-radius: 30px; padding: 4px 8px; display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: bold; width: auto; box-shadow: 0 4px 10px rgba(255, 69, 0, 0.3); }
.qty-btn { background: none; border: none; color: white; font-size: 1.1rem; padding: 0; cursor: pointer; }

/* --- BOTTOM NAV --- */
#bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; background: var(--nav-bg);
    padding: 10px 20px 25px 20px; display: flex; justify-content: space-around; align-items: center;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05); z-index: 4000; border-radius: 25px 25px 0 0;
    transition: background-color 0.3s ease;
}
.nav-item { display: flex; flex-direction: column; align-items: center; color: var(--text-secondary); cursor: pointer; transition: color 0.2s; }
.nav-item svg { width: 24px; height: 24px; margin-bottom: 4px; }
.nav-item span { font-size: 0.75rem; font-weight: 700; }
.nav-item.active { color: var(--accent-color); }
.cart-nav-btn { position: relative; top: -25px; }
.cart-icon-wrapper {
    width: 65px; height: 65px; background: var(--accent-color); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: white;
    box-shadow: 0 10px 20px rgba(255, 69, 0, 0.3); border: 5px solid var(--bg-color);
    transition: transform 0.2s, border-color 0.3s ease;
}
.cart-icon-wrapper svg { width: 28px; height: 28px; margin: 0; display: block; }
#cart-count {
    position: absolute; top: 0; right: 0; background: white; color: var(--accent-color);
    font-size: 0.75rem; font-weight: 800; padding: 4px 8px; border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
#cart-count.hidden { display: none; }

/* --- HIDE FLOATING CART ON MOBILE --- */
#cart-bar { display: none; }

/* --- MINI TRACKER (FIXED: ADDED !IMPORTANT) --- */
#mini-tracker {
    position: fixed; bottom: calc(env(safe-area-inset-bottom, 0px) + 85px); left: 15px; right: 15px;
    background: #333; color: white; padding: 15px 20px; border-radius: 50px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3); z-index: 3999;
    cursor: pointer; animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#mini-tracker.hidden { display: none !important; }
#mini-status-text { font-weight: 700; font-size: 0.95rem; }
#mini-order-num { background: rgba(255,255,255,0.2); padding: 2px 8px; border-radius: 10px; font-size: 0.8rem; margin-left: 8px;}

/* --- MODALS --- */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); z-index: 6000; display: flex; justify-content: center; align-items: flex-end; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.modal.open { opacity: 1; pointer-events: all; }
.modal-content { background-color: var(--card-bg); width: 100%; max-width: 600px; border-radius: 30px 30px 0 0; padding: 30px; max-height: 90vh; overflow-y: auto; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.modal.open .modal-content { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.close-btn { background: var(--bg-color); border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; color: var(--text-color);}
.checkout-btn { width: 100%; background: var(--accent-color); color: white; padding: 18px; border: none; border-radius: 50px; font-size: 1.1rem; font-weight: 800; cursor: pointer; margin-top: 15px; box-shadow: 0 5px 15px rgba(255, 69, 0, 0.3); }
.modal-item-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; color: var(--text-color); }
.qty-badge { background: var(--bg-color); color: var(--text-color); font-weight: 700; padding: 4px 8px; border-radius: 8px; margin-right: 10px; font-size: 0.9rem;}
.modal-item-name { flex: 1; font-weight: 700; font-size: 1rem; text-transform: capitalize; }
.name-input { width: 100%; padding: 15px; margin-bottom: 10px; border: 2px solid var(--border-color); border-radius: 12px; font-size: 1rem; font-family: var(--font-main); background-color: var(--bg-color); color: var(--text-color); font-weight: 600;}
.name-input:focus { border-color: var(--accent-color); outline: none; background-color: var(--card-bg); }

/* Product Modal */
.product-content { padding: 0; border-radius: 24px 24px 0 0; overflow: hidden; }
.close-btn-float { position: absolute; top: 20px; left: 20px; z-index: 10; background: rgba(255,255,255,0.8); backdrop-filter: blur(5px); border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 1.5rem; font-weight: bold; box-shadow: 0 4px 15px rgba(0,0,0,0.1); cursor: pointer; color: #000; }
#p-modal-media { width: 100%; height: 350px; background: #000; position: relative; }
#p-modal-media video { width: 100%; height: 100%; object-fit: cover; }
.p-modal-body { padding: 25px; background: var(--card-bg); }
#p-modal-title { margin: 0 0 5px 0; font-size: 1.8rem; font-weight: 800; color: var(--text-color); text-transform: capitalize; }
#p-modal-price { font-size: 1.3rem; color: var(--accent-color); font-weight: 800; margin-bottom: 15px; display: block; }
#p-modal-desc { font-size: 1rem; line-height: 1.6; color: var(--text-secondary); margin-bottom: 30px; }
.p-modal-footer { position: sticky; bottom: 0; background: var(--card-bg); border-top: 1px solid var(--border-color); padding: 20px; display: flex; justify-content: center; }
.p-modal-footer .add-btn { width: 100%; height: auto; border-radius: 50px; padding: 20px; background: var(--accent-color); font-size: 1.2rem; font-weight: 800; box-shadow: 0 5px 15px rgba(255, 69, 0, 0.3); }
.p-modal-footer .qty-control { width: 100%; justify-content: space-between; padding: 10px 25px; height: 60px; border-radius: 50px;}

/* Tracker/Receipt */
.receipt-box { background: var(--bg-color); border: 2px dashed var(--border-color); border-radius: 20px; padding: 25px; text-align: left; margin-top: 20px; width: 100%; }
.receipt-header { border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 15px; font-weight: 800; color: var(--text-color); display: flex; justify-content: space-between; align-items: center;}
.receipt-item { display: flex; justify-content: space-between; font-size: 0.95rem; margin-bottom: 12px; color: var(--text-secondary); font-weight: 600;}
.receipt-total { border-top: 2px solid var(--text-color); padding-top: 15px; margin-top: 15px; display: flex; justify-content: space-between; font-weight: 800; font-size: 1.2rem; color: var(--text-color); }

/* Info Modal */
.info-content { padding: 30px; }
.info-row { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); }
.info-row:last-child { border-bottom: none; }
.info-icon { width: 50px; height: 50px; background: #f2f2f2; color: var(--accent-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.info-text h3 { margin: 0 0 5px 0; font-size: 1.1rem; color: var(--text-color); }
.info-text p { margin: 0 0 10px 0; font-size: 0.95rem; color: var(--text-secondary); line-height: 1.5; }
.info-link { color: var(--accent-color); font-weight: 700; text-decoration: none; font-size: 0.9rem; }
.social-section h3 { font-size: 1.1rem; margin-bottom: 15px; text-align: center; color: var(--text-color); }
.social-buttons { display: flex; gap: 15px; justify-content: center; }
.social-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 12px; font-weight: 700; text-decoration: none; color: white; transition: opacity 0.2s; }
.social-btn:hover { opacity: 0.9; color: white; }
.social-btn.insta { background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d); }
.social-btn.fb { background: #1877F2; }

/* --- DESKTOP OVERRIDES --- */
@media (min-width: 768px) {
    body { padding-bottom: 0; }
    #bottom-nav { display: none; }
    #cart-bar {
        display: flex;
        position: fixed; bottom: 30px; right: 30px; left: auto; width: auto;
        background: var(--accent-color); color: white; padding: 15px 30px;
        border-radius: 50px; box-shadow: 0 10px 25px rgba(255, 69, 0, 0.4);
        gap: 20px; z-index: 5000; cursor: pointer;
    }
    #cart-bar.hidden { display: none; }

    .pro-banner { height: 350px; border-radius: 0 0 50px 50px; }
    .banner-overlay { padding: 40px; align-items: center; text-align: center;}
    .banner-header-row { width: 100%; max-width: 1000px; }
    .banner-text-content h1 { font-size: 3rem; }
    .search-container-pro { max-width: 600px; margin: -40px auto 0 auto; }
    .search-wrapper { padding: 20px 30px; }
    .category-grid { grid-template-columns: repeat(8, 1fr); max-width: 1000px; margin: 0 auto; }

    .section-header {
        max-width: 1000px; margin: 0 auto; padding: 25px 0 15px 0;
    }

    .menu-container { max-width: 1000px; margin: 0 auto; padding: 0; }
    .menu-subcategory { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .item-thumbnail-wrapper { height: 180px; }
    #featured-carousel { justify-content: center; gap: 30px; padding-bottom: 20px; max-width: 1200px; margin: 0 auto; padding-left: 0; padding-right: 0; }
    .featured-card { flex: 0 0 300px; height: 200px; }
    .modal { align-items: center; }
    .modal-content { border-radius: 30px; max-height: 85vh; max-width: 500px;}
    .close-btn-float { top: 20px; left: 20px; }
}

/* --- DARK MODE --- */
body.dark-mode { --bg-color: #121212; --card-bg: #1E1E1E; --text-color: #fff; --text-secondary: #aaa; --border-color: #333; --nav-bg: #1E1E1E; }
body.dark-mode .search-wrapper, body.dark-mode .cat-icon-box, body.dark-mode .receipt-box { background-color: #2a2a2a; }
body.dark-mode .theme-icon.icon-sun { display: none; }
body.dark-mode .theme-icon.icon-moon { display: block; }
body.dark-mode .banner-icon-btn { background: rgba(0,0,0,0.5); }
body.dark-mode .cart-icon-wrapper { border-color: var(--nav-bg); }
body.dark-mode .banner-logo-center, body.dark-mode .splash-logo { filter: brightness(0) invert(1); }
body.dark-mode .price, body.dark-mode #p-modal-price { color: #ddd; }
body.dark-mode .add-btn { background: white; color: black; }
body.dark-mode .modal-header h2, body.dark-mode .modal-item-row { color: white; }
body.dark-mode .qty-badge { background: #333; color: #fff; }
body.dark-mode .accordion-item { background-color: #1E1E1E; }
body.dark-mode .p-modal-body, body.dark-mode .p-modal-footer { background: #1E1E1E; }
body.dark-mode .info-icon { background: #333; }

/* Splash */
#splash-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999; display: flex; justify-content: center; align-items: center; background-color: var(--accent-color); transition: transform 0.8s cubic-bezier(0.86, 0, 0.07, 1); }
.splash-logo { width: 60%; max-width: 200px; height: auto; filter: brightness(0) invert(1); }
#splash-screen.hide { transform: translateY(-100%); }

/* HIDE FLOATING CART ON MOBILE (Ensure no double cart) */
@media (max-width: 767px) {
    #cart-bar { display: none !important; }
}
