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

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f7f7f7;
    color: #333;
    /* Initial padding for the desktop header height */
    padding-top: 80px; 
    transition: padding-top 0.3s ease; /* Smooth transition for padding change */
}

/* ========================================= */
/* FIXED HEADER STYLES                       */
/* ========================================= */
.menu-header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    z-index: 1000;
    gap: 15px; /* Added gap for better spacing */
}

.back-link {
    text-decoration: none;
    color: #f39c12;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap; /* Prevents wrapping */
}

.view-cart-btn {
    background-color: #f39c12;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
    white-space: nowrap; /* Prevents wrapping */
}

.view-cart-btn:hover {
    background-color: #e67e22;
}

.cart-count {
    background-color: #fff;
    color: #f39c12;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Modern Dropdown Menu */
.menu-nav-dropdown {
    position: relative;
    display: inline-block;
}

#category-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    padding: 10px 40px 10px 15px;
    line-height: 1.5;
    background-color: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#category-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.menu-nav-dropdown::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
}


/* ========================================= */
/* MAIN CONTENT & MENU GRID                  */
/* ========================================= */
.menu-page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.menu-header {
    text-align: center;
    margin-bottom: 40px;
}

.menu-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.menu-header p {
    font-size: 1rem;
    color: #555;
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns */
    gap: 40px;
}

.menu-category {
    margin-bottom: 40px;
}

.menu-category h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0d1bb;
    margin-bottom: 20px;
}

.menu-list-item {
    display: grid;
    grid-template-columns: 65px 1fr auto;
    gap: 15px;
    align-items: center;
    background-color: #fff;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.item-image {
    width: 65px;
    height: 65px;
    border-radius: 6px;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.item-info .price {
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 5px;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background-color: #f9f9f9;
    cursor: pointer;
    font-size: 1.1rem;
}
.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity {
    font-weight: 700;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.add-to-cart-btn {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

#loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #f39c12;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

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

/* ========================================= */
/* CART & PAYMENT MODALS                     */
/* ========================================= */

/* ... (All your existing modal styles are fine and can remain here) ... */
.cart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-modal {
    background-color: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.cart-header h2 {
    font-family: 'Playfair Display', serif;
}

.clear-cart-btn {
    background: none;
    border: none;
    color: #d32f2f;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.8rem;
    margin-right: 15px;
    visibility: hidden;
}

.clear-cart-btn.visible {
    visibility: visible;
}

.close-cart-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
}

.cart-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cart-item-details h4 {
    font-size: 1rem;
    margin-bottom: 3px;
}

.cart-item-details span {
    font-size: 0.9rem;
    color: #555;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #d32f2f;
    cursor: pointer;
    font-size: 0.9rem;
}

.cart-empty-msg {
    text-align: center;
    color: #777;
    padding: 40px 0;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.btn-checkout {
    width: 100%;
    padding: 15px;
    background-color: #f39c12;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}
.btn-checkout:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.payment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    padding: 20px;
}

.payment-modal {
    background-color: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.payment-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.payment-modal-header h3 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
}

.payment-modal-body {
    padding: 30px;
    overflow-y: auto;
}

#payment-message {
    margin-top: 15px;
    text-align: center;
    color: #d32f2f;
}

#submit-payment-btn {
    width: calc(100% - 60px);
    margin: 0 30px 30px 30px;
    flex-shrink: 0;
}

.close-payment-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.2s ease;
}

.close-payment-btn:hover {
    color: #333;
}

.hidden {
    display: none;
}


/* ========================================= */
/* RESPONSIVE STYLES (UPDATED)               */
/* ========================================= */

@media (max-width: 992px) {
    .menu-grid {
        grid-template-columns: 1fr; /* Stack menu to one column */
    }
}

/* NEW: Mobile-friendly header layout */
@media (max-width: 768px) {
    /* Make the header taller to fit two rows */
    .menu-header-fixed {
        flex-wrap: wrap; /* Allow items to wrap to the next line */
        padding: 10px 20px;
        row-gap: 10px; /* Add space between the rows */
    }

    /* IMPORTANT: Increase body padding to prevent content from hiding under the taller header */
    body {
        padding-top: 125px; 
    }

    /* Make the dropdown take up the full width on its own line */
    .menu-nav-dropdown {
        flex-basis: 100%; /* Force this element to take up the full width */
        order: 3; /* Make it appear last, after the link and button */
    }
}