/* style_menu.css */
@import url('style_common.css'); /* Import common styles */

/* === Menu Page Specific Styles === */

/* Category Navigation & Search Bar */
#category-nav {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    padding: 10px 15px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
#category-nav ul {
    list-style-type: none;
    margin: 0 0 15px 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px 15px;
}
#category-nav ul li a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #444;
    font-weight: 500;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
#category-nav ul li a:hover {
    background-color: #f0f0f0;
    color: #000;
}

/* Search Container */
.menu-search-container {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}
#menu-search-form {
    display: flex;
    gap: 5px;
}
#menu-search-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
}
#menu-search-form button {
    padding: 10px 15px;
    border: none;
    background-color: #ff6347;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}
#menu-clear-button {
    background-color: #6c757d;
}
.no-results-message {
    margin-top: 10px;
    color: #777;
    font-style: italic;
}

/* Menu Grid */
#menu { padding-top: 20px; }
.category { margin-bottom: 40px; }
.category h2 {
    font-size: 2em;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff6347;
    margin-bottom: 20px;
}

/* --- NEW: Grid layout for menu items --- */
.menu-items-grid {
    display: grid;
    /* This creates a responsive grid. It will be 1 column on narrow screens
       and switch to 2 or more columns when space is available. */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px; /* Controls the space between items */
}

.menu-item {
    background-color: #fff;
    padding: 12px; /* Reduced padding for compactness */
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
    margin-bottom: 0; /* Replaced by grid gap */
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex; /* Helps align content if it wraps */
    flex-direction: column;
}
.menu-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.item-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px; /* Adds space between name and price */
    width: 100%;
}
.item-summary h3 {
    margin: 0;
    font-size: 1.1em; /* Reduced font size */
    color: #333;
    flex-grow: 1;
}
.price-info {
    margin: 0;
    font-size: 1.05em; /* Reduced font size */
    font-weight: bold;
    color: #4CAF50;
    flex-shrink: 0; /* Prevents price from wrapping on smaller item sizes */
}


/* Modal Styles */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000; backdrop-filter: blur(4px);
}
.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}
.close-modal {
    position: absolute; top: 10px; right: 10px;
    background: none; border: none; font-size: 2em;
    cursor: pointer; color: #888;
}
.modal-image-container {
    width: 100%;
    margin-bottom: 15px;
    text-align: center;
}
.item-image {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    border-radius: 8px;
    background-color: #f0f0f0;
    transition: opacity 0.2s ease-in-out;
}
.item-image.clickable {
    cursor: pointer;
}
.image-placeholder {
    width: 100%;
    height: 200px;
    background-color: #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #888;
    border-radius: 8px;
}

/* Modal text and controls */
#modal-name { margin-top: 0; font-size: 1.8em; }
#modal-desc { font-size: 1.05em; color: #555; }
.modal-price-size-container { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 15px; margin: 20px 0; }
#modal-price-info { font-size: 1.4em; }
.size-options { display: flex; gap: 8px; }
.size-toggle { padding: 8px 16px; border: 1px solid #ccc; background-color: #f9f9f9; border-radius: 5px; cursor: pointer; }
.size-toggle.active { background-color: #ff6347; color: white; border-color: #ff6347; }
#modal-toppings-container p { margin: 10px 0 5px; }
#modal-toppings-container strong { color: #333; }
.toggle-toppings { margin-top: 10px; }
.all-toppings { margin-top: 10px; padding: 15px; background-color: #f9f9f9; border-radius: 5px; }
.all-toppings h4 { margin-top: 0; }
.all-toppings ul { padding-left: 20px; margin: 5px 0 0; }
