:root {
    --primary: #D32F2F;
    --primary-dark: #B71C1C;
    --secondary: #FF5722;
    --accent: #2DC653;
    --success: #2DC653;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --text: #333;
    --font-main: 'Poppins', sans-serif;
    --font-display: 'Fredoka One', cursive;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px; /* Offset for fixed header */
    overflow-x: hidden; /* Prevent horizontal scroll */
}

body {
    font-family: var(--font-main);
    background-color: var(--light-gray);
    color: var(--text);
    padding-top: 70px; /* Header height */
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo h1 {
    font-family: var(--font-display);
    color: var(--primary);
    font-size: 1.5rem; /* Reduced size to prevent overlap */
    transition: transform 0.3s;
    margin: 0;
    white-space: nowrap;
}

.logo img {
    vertical-align: middle;
}

.logo h1:hover {
    transform: scale(1.05);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    transition: transform 0.2s;
    padding: 10px; /* Bigger touch area */
}

.mobile-menu-btn:active {
    transform: scale(0.9);
}

/* Navigation Base */
.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: 0.3s;
    position: relative;
    padding: 5px 0;
    font-size: 1rem;
}

.main-nav a:hover {
    color: var(--primary);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: 0.3s;
}

.main-nav a:hover::after {
    width: 100%;
}

/* Desktop */
@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none;
    }

    /* Flex Layout for Desktop */
    .header-content .container {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
    }
    
    .logo {
        flex: 0 0 auto;
        margin-right: 40px;
    }

    .main-nav {
        flex: 1;
        display: flex;
        justify-content: flex-start; /* Align menu to left near logo, or center */
    }
    
    .header-actions {
        flex: 0 0 auto;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    /* Grid Layout for Mobile Header */
    .header-content .container {
        display: grid !important;
        grid-template-columns: 50px 1fr 50px; /* Menu - Logo - Cart */
        align-items: center;
        justify-items: center;
    }

    .logo {
        justify-self: center;
        width: 100%;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .mobile-menu-btn {
        justify-self: start;
    }
    
    .header-actions {
        justify-self: end;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--white);
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        border-top: 1px solid #eee;
        padding: 0;
        z-index: 999;
    }
    
    .main-nav.open {
        display: block;
        animation: slideDown 0.3s ease-out;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }
    
    .main-nav li {
        border-bottom: 1px solid #f0f0f0;
    }
    
    .main-nav a {
        display: block;
        padding: 15px 20px;
        width: 100%;
    }
    
    .main-nav a::after {
        display: none; /* No underline on mobile */
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cart-btn {
    position: relative;
    color: var(--primary);
    font-size: 1.5rem;
    text-decoration: none;
    transition: transform 0.2s;
}

.cart-btn:hover {
    transform: scale(1.1);
}

#cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #212121;
    color: var(--white);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 50%;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    animation: bounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 140px 0 80px 0;
    text-align: center;
    border-radius: 0 0 50px 50px;
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 10%, transparent 10.5%);
    background-size: 20px 20px;
    animation: moveBackground 20s linear infinite;
    opacity: 0.5;
}

@keyframes moveBackground {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hero h2 {
    font-family: var(--font-display);
    font-size: 2.8rem;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.95;
    max-width: 800px;
    margin: 0 auto 30px;
    position: relative;
    z-index: 1;
}

.btn-hero {
    background: #212121;
    color: var(--white);
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1;
    border: 2px solid transparent;
}

.btn-hero:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    background: transparent;
    border-color: #212121;
}

/* Categories */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.cat-btn {
    background: var(--white);
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.cat-btn.active, .cat-btn:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

/* Store Closed Styles */
body.store-closed #store-status-banner-open {
    display: none;
}

body.store-closed .product-card {
    position: relative;
    pointer-events: none; /* Disable clicks */
    opacity: 0.7;
    filter: grayscale(100%);
}

body.store-closed .product-card::after {
    content: '\f023'; /* FontAwesome Padlock Icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: #555;
    z-index: 10;
    text-shadow: 0 0 10px rgba(255,255,255,0.8);
}

/* Also disable the "Add" button visually */
body.store-closed .btn-add, .btn-add.disabled {
    background: #d32f2f !important;
    cursor: not-allowed;
    opacity: 0.8;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    animation: fadeIn 0.6s ease-out;
    animation-fill-mode: both;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.product-img {
    height: 220px;
    width: 100%;
    object-fit: cover;
    background-color: #eee;
    transition: transform 0.5s;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-info {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
    z-index: 1;
}

.product-info h3 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-weight: 700;
}

.product-desc {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 20px;
    flex: 1;
    line-height: 1.5;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.price {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary);
}

.old-price {
    font-size: 0.9rem;
    text-decoration: line-through;
    color: #999;
    margin-right: 8px;
}

.btn-add {
    background: var(--primary);
    color: var(--white);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-add:hover {
    background: var(--accent);
    transform: rotate(90deg);
}

/* Footer */
.main-footer {
    background: var(--primary-dark);
    color: var(--white);
    padding: 40px 0;
    text-align: center;
    margin-top: 50px;
    border-top: 5px solid var(--primary);
}

/* Social Links */
.social-links {
    display: flex;
    gap: 15px;
    justify-content: center; /* Center social links */
    margin-top: 15px;
}
.social-links a {
    color: var(--white);
    font-size: 1.5rem;
    transition: 0.3s;
    text-decoration: none;
    border: none;
    outline: none;
}
.social-links a:hover {
    color: var(--primary);
    transform: translateY(-3px);
}

/* Cart Modal */
.cart-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 100%;
    height: 100%;
    background: var(--white);
    box-shadow: -5px 0 25px rgba(0,0,0,0.2);
    z-index: 2000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    transform: translateX(100%); /* Hide completely off-screen */
    visibility: hidden; /* Prevent interactions/visual artifacts when closed */
}

.cart-modal.open {
    transform: translateX(0); /* Slide in */
    visibility: visible;
}

/* Cart Responsive Fixes */
.cart-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.cart-header {
    padding: 25px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cart-header h3 { font-size: 1.4rem; font-weight: 700; }

.cart-header button {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.8rem;
    cursor: pointer;
    transition: 0.3s;
}
.cart-header button:hover { transform: rotate(90deg); }

.cart-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

/* Ensure cart footer is always visible and fixed at bottom */
.cart-footer {
    background: #fff;
    border-top: 1px solid #eee;
    padding: 15px;
    flex-shrink: 0; /* Prevent shrinking */
    z-index: 10;
}

@media (max-width: 480px) {
    .cart-modal {
        width: 100%;
        height: 100%; /* Full screen on mobile */
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        right: -100%; /* Slide from right */
        transform: none;
    }
    
    .cart-modal.open {
        right: 0;
    }

    .cart-section h4 {
        font-size: 1rem;
    }
}

/* Fix for desktop high screens */
@media (min-width: 1024px) {
    .cart-modal {
        width: 450px; /* Slightly wider on desktop but not full screen */
    }
}

.cart-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: 0.2s;
    animation: fadeIn 0.4s ease-out;
}
.cart-item:hover { transform: translateY(-2px); }

.cart-item-info h4 {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 5px;
}

.cart-item-price {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: bold;
}

.cart-item-remove {
    color: #ff4444;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
    padding: 5px;
}
.cart-item-remove:hover { transform: scale(1.2); }

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--primary-dark);
}

.btn-checkout {
    width: 100%;
    padding: 18px;
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(45, 198, 83, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(45, 198, 83, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(45, 198, 83, 0); }
    100% { box-shadow: 0 0 0 0 rgba(45, 198, 83, 0); }
}

.btn-checkout:hover {
    background: #25a244;
    transform: translateY(-2px);
    animation: none;
}

.empty-cart {
    text-align: center;
    color: #999;
    margin-top: 50px;
    font-size: 1.2rem;
}

/* Modal Product */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    backdrop-filter: blur(5px);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: 0.3s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-overlay.open .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    transition: 0.2s;
}
.close-modal:hover { color: #333; transform: rotate(90deg); }

/* Form Controls */
.form-control {
    border: 2px solid #eee;
    border-radius: 8px;
    transition: 0.3s;
}
.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

/* WhatsApp Float */
.float-wa {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #212121;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: 0.3s;
    text-decoration: none !important;
    border: none !important;
}

.float-wa:hover {
    transform: scale(1.1);
    color: white;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    top: 90px;
    right: 20px;
    background: white;
    border-left: 5px solid #333;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    padding: 15px 20px;
    border-radius: 4px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    animation: slideInToast 0.5s ease-out;
    transition: opacity 0.5s;
}

.notification-toast.hide {
    opacity: 0;
}

.notification-toast.info { border-left-color: #2196F3; }
.notification-toast.success { border-left-color: #4CAF50; }
.notification-toast.warning { border-left-color: #FF9800; }
.notification-toast.error { border-left-color: #F44336; }

.notification-toast .notif-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.notification-toast i { font-size: 1.2rem; }
.notification-toast.info i { color: #2196F3; }
.notification-toast.success i { color: #4CAF50; }
.notification-toast.warning i { color: #FF9800; }
.notification-toast.error i { color: #F44336; }

.notification-toast button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
    margin-left: 10px;
}

@keyframes slideInToast {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
