/* Savory Snap - Final Responsive Theme */

:root {
    --primary-color: #000000;
    --accent-color: #E23744; 
    --bg-color: #fdfdfd;
    --text-color: #191919;
    --text-secondary: #767676;
    --border-color: #e0e0e0;
    --font-main: 'Manrope', sans-serif;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    background-image: none !important;
    color: var(--text-color);
    font-family: var(--font-main);
    font-weight: 500;
    margin: 0; padding: 0;
    padding-bottom: 100px; 
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- HEADER --- */
.header {
    background-color: var(--bg-color);
    padding: 15px 10px; text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    position: relative; z-index: 100;
    transition: background-color 0.3s ease;
}
.header-logo { display: block; margin: 0 auto 5px auto; width: 100%; max-width: 200px; height: auto; }
.header p { margin: 0; font-size: 0.9rem; color: var(--text-secondary); font-weight: 600; }
#sticky-header { position: sticky; top: 0; z-index: 1000; background: var(--bg-color); transition: background-color 0.3s ease; }

/* --- THEME TOGGLE --- */
#theme-toggle { position: absolute; top: 20px; right: 20px; cursor: pointer; }
.theme-icon { width: 24px; height: 24px; stroke: var(--text-color); transition: stroke 0.3s ease; }
.icon-moon { display: none; }
body.dark-mode .icon-moon { display: block; stroke: white; }
body.dark-mode .icon-sun { display: none; }

/* --- SEARCH BAR --- */
.search-wrapper {
    display: flex; align-items: center; background-color: #EEEEEE;
    border-radius: 50px; padding: 10px 15px; margin: 10px 15px;
    transition: background-color 0.3s ease;
}
.search-icon { width: 18px; height: 18px; stroke: #555; margin-right: 10px; }
#search-bar { width: 100%; border: none; background: transparent; outline: none; font-size: 1rem; color: #000; font-family: var(--font-main); }

/* --- TABS --- */
#tab-navigation {
    display: flex; overflow-x: auto; padding: 0 10px 10px 10px;
    -ms-overflow-style: none; scrollbar-width: none;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}
#tab-navigation::-webkit-scrollbar { display: none; }
.tab-button {
    flex-shrink: 0; padding: 8px 16px; margin-right: 5px;
    border: none; background: #f0f0f0; border-radius: 20px;
    font-size: 0.9rem; font-weight: 700; color: #555; cursor: pointer; transition: all 0.2s;
}
.tab-button.active { background-color: #000; color: #fff; }

/* --- MENU --- */
.menu-container { 
    padding: 0 10px; 
    max-width: 1200px; /* Keeps things sane on huge screens */
    margin: 0 auto; 
}
.menu-category { display: none; }
.menu-category.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.menu-category h2 { font-size: 1.5rem; font-weight: 800; color: var(--text-color); margin: 25px 0 10px 0; border-bottom: 2px solid var(--border-color); padding-bottom: 5px; }
.menu-subcategory h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-secondary); margin: 15px 0 10px 0; }

/* --- ITEM CARDS (MOBILE FIRST LOGIC) --- */
.accordion-item {
    background: var(--bg-color); border-bottom: 1px solid var(--border-color);
    margin: 0; padding: 15px 0; transition: background-color 0.3s ease;
}
.accordion-title { display: flex; justify-content: space-between; align-items: flex-start; cursor: pointer; }
.text-container { flex: 1; padding-right: 10px; }
.title-text { display: block; font-size: 1.05rem; font-weight: 700; color: var(--text-color); margin-bottom: 4px; text-transform: capitalize; }
.price { display: block; font-size: 0.95rem; color: var(--text-secondary); font-weight: 500; }
.item-desc-preview {
    font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    line-height: 1.4; transition: opacity 0.2s;
}
.accordion-item.is-open .item-desc-preview { display: none; }

/* THUMBNAIL (Base State - Small Square) */
.item-thumbnail-wrapper {
    width: 90px; height: 90px; flex-shrink: 0;
    border-radius: 8px; overflow: hidden; background-color: #eee;
    position: relative; transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.item-thumbnail-wrapper video { width: 100%; height: 100%; object-fit: cover; }

/* --- EXPANDED STATE: MOBILE (Phone Default) --- */
.accordion-item.is-open .accordion-title {
    flex-direction: column-reverse; /* Image moves ABOVE text */
}
.accordion-item.is-open .item-thumbnail-wrapper {
    width: 100%; 
    max-width: 350px;
    height: 240px; /* Bigger Hero Height */
    margin: 0 auto 15px auto; /* MARGIN AUTO CENTERS IT ON PHONE */
    border-radius: 12px;
}
.accordion-item.is-open .text-container { width: 100%; text-align: left; }

/* EXPANDED CONTENT */
.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.expanded-details { padding-top: 10px; }
.full-desc { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 15px; }

/* --- DESKTOP / PC OVERRIDES (Big Screen Logic) --- */
@media (min-width: 768px) {
    /* On PC, Keep image on the RIGHT when expanded */
    .accordion-item.is-open .accordion-title {
        flex-direction: row; /* Keep row direction */
    }

    /* Make image bigger, but keep it on the right side */
    .accordion-item.is-open .item-thumbnail-wrapper {
        width: 280px; /* Specific Width for PC */
        height: 180px;
        margin: 0 0 0 20px; /* Reset margins, add left spacing */
    }

    .accordion-item.is-open .text-container {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    /* Center the grid on PC */
    .menu-container { width: 80%; margin: 0 auto; }
}

/* --- FEATURED CAROUSEL --- */
#featured-container { padding: 15px 0 5px 0; background: var(--bg-color); transition: background-color 0.3s ease; }
#featured-container.hidden { display: none; }
#featured-container h2 { font-size: 1.3rem; font-weight: 800; margin: 0 0 10px 15px; color: var(--text-color); }
#featured-carousel { display: flex; overflow-x: auto; padding: 0 15px 15px 15px; -ms-overflow-style: none; scrollbar-width: none; gap: 15px; }
#featured-carousel::-webkit-scrollbar { display: none; }
.featured-card {
    flex: 0 0 160px; border-radius: 12px; overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); background: #fff; 
    position: relative; transition: background-color 0.3s ease;
}
.featured-card .video-wrapper { width: 100%; aspect-ratio: 1 / 1; background: #000; padding: 0; }
.featured-card video { width: 100%; height: 100%; object-fit: cover; }
.featured-info { padding: 10px; text-align: center; }
.featured-title { font-weight: 700; font-size: 0.95rem; margin: 0 0 4px 0; text-transform: capitalize; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.featured-desc { font-size: 0.8rem; color: #666; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 2.4em; }

/* --- BUTTONS --- */
.add-btn {
    background-color: #f0f0f0; color: #000; border: none; border-radius: 30px;
    padding: 6px 18px; font-weight: 700; font-size: 0.85rem; cursor: pointer;
}
.qty-control {
    display: flex; align-items: center; justify-content: space-between;
    background-color: #000; color: white; border-radius: 30px; width: 100px; padding: 4px; margin: 0 auto;
}
.qty-btn { background: none; border: none; color: white; font-size: 1.1rem; width: 25px; cursor: pointer; display:flex; justify-content:center;}
.qty-display { font-weight: 700; font-size: 0.9rem; }

/* --- CART & MODAL --- */
#cart-bar {
    position: fixed; bottom: 20px; left: 5%; width: 90%;
    background-color: var(--accent-color); color: white;
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px; border-radius: 50px;
    box-shadow: 0 10px 25px rgba(226, 55, 68, 0.3); z-index: 2000;
    cursor: pointer; animation: slideUp 0.3s ease-out;
}
#cart-bar.hidden { display: none; }
@keyframes slideUp { from { transform: translateY(100px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); z-index: 3000;
    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: #fff; width: 100%; max-width: 600px;
    border-radius: 20px 20px 0 0; padding: 25px; max-height: 85vh; 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 { text-align: center; position: relative; margin-bottom: 20px; }
.modal-header h2 { margin: 0; color: #000; }
.close-btn { position: absolute; left: 0; top: 50%; transform: translateY(-50%); background: #f0f0f0; border: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }
.modal-item-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; color: #000; }
.qty-badge { background: #f0f0f0; color: #000; font-weight: 700; padding: 4px 8px; border-radius: 4px; margin-right: 10px; font-size: 0.9rem;}
.modal-item-name { flex: 1; font-weight: 600; font-size: 0.95rem; }
.checkout-btn {
    width: 100%; background-color: var(--accent-color); color: white;
    padding: 16px; border: none; border-radius: 50px; font-size: 1.1rem; font-weight: 700; margin-top: 15px; cursor: pointer;
}

/* --- DARK MODE OVERRIDES --- */
body.dark-mode { --bg-color: #121212; --text-color: #ffffff; --text-secondary: #a0a0a0; --border-color: #333; }
body.dark-mode .search-wrapper { background-color: #2a2a2a; }
body.dark-mode #search-bar { color: #fff; }
body.dark-mode .search-icon { stroke: #fff; }
body.dark-mode .tab-button { background-color: #333; color: #ccc; }
body.dark-mode .tab-button.active { background-color: #fff; color: #000; }

body.dark-mode .featured-card { background-color: #222; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
body.dark-mode .featured-title { color: #fff; }
body.dark-mode .featured-desc { color: #bbb; }

body.dark-mode .modal-content { background-color: #1e1e1e; }
body.dark-mode .close-btn { background-color: #333; color: white; }
body.dark-mode .modal-header h2, body.dark-mode .modal-item-row { color: white; }
body.dark-mode .qty-badge { background: #333; color: #fff; }

#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(--bg-color);
    transition: transform 0.8s cubic-bezier(0.86, 0, 0.07, 1);
}
.splash-logo { width: 60%; max-width: 200px; height: auto; }
#splash-screen.hide { transform: translateY(-100%); }