/* General Styles */
.menu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
    box-sizing: border-box;
    background-color: #e3e3e3;
    line-height: 1.6;
    font-family: 'Arial', sans-serif;
    border-radius: 10px;
}

/* Filters Container */
.menu-filters {
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border-radius: 8px;
}

/* Toggle Buttons */
.filter-toggle-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-toggle {
    padding: 10px 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    font-size: 0.9em;
    color: #000;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    border-radius: 5px;
}

.filter-toggle:hover {
    background-color: #f8f8f8;
}

.filter-toggle.active {
    background-color: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
}

/* Filter Content Sections */
.filter-content {
    display: none;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    border-radius: 5px;
}

.filter-content.active {
    display: block;
}

/* Branch and Category Buttons */
.branch-buttons,
.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.branch-button,
.category-button {
    padding: 10px 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    font-size: 0.9em;
    color: #000;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    border-radius: 5px;
}

.branch-button:hover,
.category-button:hover {
    background-color: #f8f8f8;
    border-color: #ccc;
    color:#000;
}

.branch-button.active,
.category-button.active {
    background-color: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
}

/* Filter Groups (Allergens and Dietary Options) */
.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #000;
}

.filter-group input[type="checkbox"] {
    margin-right: 10px;
    vertical-align: middle;
}

.filter-group input[type="checkbox"]+label {
    font-weight: 400;
    color: #555;
    display: inline;
}

/* Menu Grid */
.menu-grid {
    break-inside: avoid;
    column-count: 3;
    column-gap: 20px;
    width: 100%;
}

.menu-item {
    display: block;
    width: 100%;
    background-color: #fff;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    break-inside: avoid;
    box-sizing: border-box;
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.menu-item.filtered {
    opacity: 0.3;
}

.menu-item.featured-item {
    border: 2px solid #ff6b6b;
    /* Example styling for featured items */
    background-color: #fff5f5;
}

.menu-item .thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
}

.menu-item h2 {
    margin: 10px 0;
    font-size: 1.5em;
    color: #000;
}

.menu-item .content {
    font-size: 1em;
    color: #555;
    margin-bottom: 10px;
}

.menu-item .price {
    font-size: 1.2em;
    font-weight: 600;
    color: #000;
    margin: 10px 0;
}

.menu-item .allergens {
    font-size: 0.9em;
    color: #777;
    margin: 5px 0;
}

/* Category Header */
#menu-category-header {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

#menu-category-header .category-name {
    margin: 0 0 10px;
    font-size: 1.8em;
    color: #000;
}

#menu-category-header .category-description {
    margin: 0;
    font-size: 1em;
    color: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .menu-container {
        padding: 20px;
        /* Reduced padding for smaller screens */
    }

    .menu-grid {
        flex-direction: column;
        gap: 20px;
    }

    .filter-toggle-buttons {
        flex-direction: column;
    }

    .branch-buttons,
    .category-buttons {
        flex-direction: column;
    }

    .branch-button,
    .category-button {
        width: 100%;
        /* Full width for better touch targets */
    }

    .menu-item {
        width:100%;
        box-sizing: border-box;
    }

    .menu-item .thumbnail img {
        height: 150px;
        /* Reduced height for smaller screens */
    }

    .menu-item h2 {
        font-size: 1.3em;
    }

    #menu-category-header .category-name {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .menu-container {
        padding: 10px;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

    .menu-filters {
        padding: 15px;
    }

    .filter-toggle {
        font-size: 0.85em;
        padding: 8px 15px;
    }

    .menu-item {
        padding: 15px;
    }

    .menu-item h2 {
        font-size: 1.2em;
    }

    .menu-item .price {
        font-size: 1.1em;
    }

    .menu-item .allergens {
        font-size: 0.85em;
    }

    #menu-category-header {
        padding: 15px;
    }

    #menu-category-header .category-name {
        font-size: 1.4em;
    }

    #menu-category-header .category-description {
        font-size: 0.9em;
    }
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    /* Semi-transparent gray */
    z-index: 999;
    /* Below spinner but above content */
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    /* Light gray border */
    border-top: 4px solid #ff6b6b;
    /* Matches your theme color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
    /* Above overlay */
}

/* Category Section */
.category-section {
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border-radius: 8px;
}

.category-section h3 {
    margin: 0 0 15px;
    font-size: 1.5em;
    color: #000;
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top:0px;
}

.category-button {
    padding: 10px 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    font-size: 0.9em;
    color: #000;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    border-radius: 5px;
}

.category-button:hover {
    background-color: #f8f8f8;
    border-color: #ccc;
    color: #000;
}

.category-button.active {
    background-color: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .category-buttons {
        flex-direction: column;
    }

    .category-button {
        width: 100%;
    }
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}