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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.category-nav {
    background: white;
    padding: 20px 0;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-nav {
    background: white;
    padding: 15px 0;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-btn, .back-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    display: inline-block;
}

.nav-btn:hover, .nav-btn.active, .back-btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

.category-section {
    margin-bottom: 50px;
}

.category-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.category-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* Special styling for individual category pages */
.category-title.large {
    font-size: 2.5rem;
    margin-bottom: 30px;
    padding-bottom: 15px;
}

.category-title.large:after {
    width: 80px;
    height: 4px;
}

.snack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.snack-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.snack-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.snack-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #999;
    position: relative;
    overflow: hidden;
}

.snack-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.snack-image .emoji-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 4rem;
    color: #999;
}

.snack-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="%23ddd"/><circle cx="80" cy="80" r="2" fill="%23ddd"/><circle cx="50" cy="10" r="1" fill="%23ddd"/><circle cx="90" cy="40" r="1" fill="%23ddd"/></svg>');
    opacity: 0.5;
    pointer-events: none;
}

.snack-info {
    padding: 20px;
    text-align: center;
}

.snack-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.snack-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.price-tag {
    display: none;
}

.search-container {
    text-align: center;
    margin-bottom: 30px;
}

.search-box {
    width: 100%;
    max-width: 400px;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.search-box:focus {
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.hidden {
    display: none;
}

footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #764ba2;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.4);
}

.back-to-top:active {
    transform: translateY(-2px);
}

/* Animation for category switching */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: modalFadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
    top: 50%;
    transform: translateY(-50%);
}

.modal-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.modal-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.modal-image .emoji-large {
    font-size: 8rem;
    color: #999;
}

.modal-info {
    padding: 30px;
    text-align: center;
}

.modal-title {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.modal-description {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(220, 38, 38, 0.8);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.close:hover {
    background: rgba(185, 28, 28, 0.9);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.6);
    border-color: rgba(255, 255, 255, 0.5);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    /* from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }
    to { 
        opacity: 1;
        transform: translateY(-50%) scale(1);
    } */
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    h1 {
        font-size: 2rem;
    }

    .category-title {
        font-size: 1.5rem;
    }

    .category-title.large {
        font-size: 2rem;
    }

    .snack-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .nav-buttons {
        gap: 8px;
    }

    .nav-btn, .back-btn {
        padding: 10px 16px;
        font-size: 12px;
    }

    /* Mobile modal adjustments */
    .modal-content {
        margin: 0 auto;
        width: 95%;
        max-width: 400px;
        top: 50%;
        transform: translateY(-50%);
        position: fixed;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .modal-image {
        height: 250px;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-description {
        font-size: 1rem;
    }

    .modal-info {
        padding: 20px;
    }

    /* Mobile back to top button adjustments */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    /* Mobile close button adjustments */
    .close {
        top: 10px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .snack-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .nav-btn, .back-btn {
        padding: 8px 12px;
        font-size: 11px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .category-title.large {
        font-size: 1.8rem;
    }

    /* Mobile back to top button adjustments */
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 16px;
    }

    /* Mobile close button adjustments */
    .close {
        top: 8px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
}
