:root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --h1-color: #ffffff;
    --card-bg: #1e1e1e;
    --card-shadow: 0 4px 6px rgba(0,0,0,0.5);
    --img-bg: #2a2a2a;
    --name-color: #ffffff;
    --price-color: #f39c12; /* Slightly brighter orange for dark mode */
    --input-bg: #2a2a2a;
    --input-border: #444;
    --input-text: #fff;
    --btn-bg: #2c3e50;
    --btn-text: #ddd;
    --btn-hover-bg: #e67e22;
    --btn-hover-text: #fff;
    --accent: #e67e22;
    --border-color: #333;
    --modal-bg: rgba(0,0,0,0.7);
    --modal-content-bg: #1e1e1e;
}

[data-theme="light"] {
    --bg-color: #f4f4f9;
    --text-color: #333;
    --h1-color: #333;
    --card-bg: #fff;
    --card-shadow: 0 4px 6px rgba(0,0,0,0.1);
    --img-bg: #eee;
    --name-color: #222;
    --price-color: #e67e22;
    --input-bg: #fff;
    --input-border: #ddd;
    --input-text: #333;
    --btn-bg: #fff;
    --btn-text: #555;
    --btn-hover-bg: #e67e22;
    --btn-hover-text: #fff;
    --accent: #e67e22;
    --border-color: #eee;
    --modal-bg: rgba(0,0,0,0.5);
    --modal-content-bg: #fff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.3s, color 0.3s;
}
h1 {
    color: var(--h1-color);
    margin-bottom: 30px;
}
.menu-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    width: 100%;
    max-width: 1100px;
    align-items: start;
}

@media (min-width: 600px) {
    .menu-container {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 25px;
    }
}

.product-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.2s ease, background-color 0.3s, box-shadow 0.3s;
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure all cards in a row have the same height */
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1.2; /* Square aspect ratio for uniformity */
    object-fit: cover;
    background-color: var(--img-bg);
    display: block;
}

.product-info {
    padding: 15px;
    flex-grow: 1; /* Makes the info section fill the remaining space */
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.product-name {
    font-size: 1.1rem;
    margin: 8px 0;
    color: var(--name-color);
}
.product-price {
    font-size: 1rem;
    color: var(--price-color);
    font-weight: bold;
}

@media (min-width: 600px) {
    .product-name {
        font-size: 1.25rem;
        margin: 10px 0;
    }
    .product-price {
        font-size: 1.1rem;
    }
}
.search-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 30px;
    padding: 0 20px;
    box-sizing: border-box;
}

#search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    text-align: center;
    box-shadow: var(--card-shadow);
}

@media (max-width: 600px) {
    #search-input {
        max-width: 90%;
        padding: 10px 15px;
    }
}
.filter-container {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center;
}
.filter-btn {
    padding: 8px 20px;
    border: none;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    font-weight: 500;
}
.filter-btn:hover {
    background-color: var(--btn-hover-bg);
    color: var(--btn-hover-text);
}
.filter-btn.active {
    background-color: var(--btn-hover-bg);
    color: var(--btn-hover-text);
}

/* Theme Toggle Styles */
.theme-switch-wrapper {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
}

@media (max-width: 600px) {
    .theme-switch-wrapper {
        position: fixed;
        top: auto;
        bottom: 20px;
        right: 20px;
        background: var(--card-bg);
        padding: 10px 15px;
        border-radius: 30px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        border: 1px solid var(--border-color);
    }
    
    .theme-label {
        display: none; /* Hide label on mobile to keep it compact */
    }
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 50px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #e67e22;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.theme-label {
    font-size: 0.8rem;
    font-weight: bold;
}

/* Modal / Lightbox Styles */
.modal {
    display: none; /* Will be set to 'flex' by JavaScript */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    backdrop-filter: blur(8px); /* Slightly more blur for focus */
    justify-content: center;
    align-items: center;
    padding: 10px; /* Minimal padding for small screens */
    box-sizing: border-box;
    cursor: zoom-out;
}

.modal-content {
    margin: auto; /* Extra centering safety */
    display: block;
    max-width: 95%;
    max-height: 95%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0,0,0,0.9);
    cursor: default;
    animation: zoomIn 0.25s ease-out;
    background-color: var(--modal-content-bg);
    padding: 10px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
    z-index: 2001;
}

.close-modal:hover {
    color: var(--accent);
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 600px) {
    .close-modal {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
}