/* Menu Page Layout (Flex Container) */
.menu-flex-container {
    display: flex;
    gap: 40px;
    /* Space between menu items and cart */
    align-items: flex-start;
    /* Align top */
}

.menu-left {
    flex: 2;
    /* Takes more space */
    min-width: 60%;
}

.menu-right {
    flex: 1;
    /* Takes less space */
    min-width: 350px;
    /* Minimum width for cart */
    position: sticky;
    /* Keep cart visible when scrolling */
    top: 100px;
    /* Adjust based on header height */
    background-color: var(--light-cream);
    /* Light background for cart */
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: var(--text-color-dark);
    /* Dark text for light background */
}

.menu-right h3 {
    color: var(--primary-brown);
    /* Dark brown for cart heading */
    margin-bottom: 20px;
    font-size: 1.8em;
}

/* Menu Item Add to Cart Controls */
.menu-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Pushes price/controls to bottom */
    position: relative;
    /* For dietary info, if needed */
    padding-bottom: 20px;
    /* Give space for controls */
}

.add-to-cart-controls {
    position: absolute;
    /* Position relative to .menu-item */
    bottom: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--primary-brown);
    border-radius: 25px;
    overflow: hidden;
    height: 45px;
    transition: all 0.3s ease;
}

.add-to-cart-btn {
    background-color: var(--accent-orange);
    color: var(--primary-brown);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    /* Take full width when visible */
    height: 100%;
    justify-content: center;
}

.add-to-cart-btn:hover {
    background-color: #e67e00;
    /* Darker orange */
}

.quantity-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 10px;
    color: var(--text-color-light);
    height: 100%;
}

.quantity-controls.hidden {
    display: none;
}

.quantity-controls button {
    background: transparent;
    border: none;
    color: var(--accent-orange);
    font-size: 1.5em;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.quantity-controls button:hover {
    background-color: var(--accent-orange);
    color: var(--primary-brown);
}

.quantity {
    font-size: 1.2em;
    font-weight: 700;
}

/* Cart Summary */
.cart-items-list {
    min-height: 150px;
    /* Ensure some space for empty cart message */
    max-height: 400px;
    /* Scrollable if many items */
    overflow-y: auto;
    padding-right: 10px;
    /* For scrollbar */
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 15px;
}

.empty-cart-message {
    text-align: center;
    color: #888;
    margin-top: 30px;
}

.empty-cart-icon {
    width: 80px;
    height: auto;
    margin-bottom: 15px;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.95em;
    color: var(--text-color-dark);
}

.cart-item-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-details img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.cart-item-info span {
    font-weight: 600;
}

.cart-item-info .item-quantity-text {
    font-weight: normal;
    color: #666;
    margin-right: 5px;
}

.cart-item-info .item-price-per-unit {
    font-size: 0.9em;
    color: #888;
}

.cart-item-total {
    font-weight: 700;
    color: var(--primary-brown);
}

.remove-item-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.1em;
    cursor: pointer;
    transition: color 0.2s ease;
}

.remove-item-btn:hover {
    color: #dc3545;
    /* Red on hover */
}

.cart-total-section {
    padding-top: 15px;
}

.order-total-text {
    display: flex;
    justify-content: space-between;
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary-brown);
}

.carbon-neutral-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 20px;
}

.carbon-neutral-info i {
    color: #28a745;
    /* Green leaf icon */
}

#confirm-order-btn {
    width: 100%;
    font-size: 1.1em;
    padding: 15px;
}

#confirm-order-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    border-color: #ccc;
    box-shadow: none;
    color: #666;
}

/* Order Confirmation Modal */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: 2000;
    /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    /* Full width */
    height: 100%;
    /* Full height */
    overflow: auto;
    /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.6);
    /* Black w/ opacity */
    display: flex;
    /* Use flex to center content */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--light-cream);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    /* Responsive width */
    max-width: 500px;
    /* Max width */
    position: relative;
    color: var(--text-color-dark);
    text-align: center;
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
}

.confirmation-header {
    margin-bottom: 30px;
}

.confirmation-icon {
    font-size: 4em;
    color: #28a745;
    /* Green checkmark */
    margin-bottom: 15px;
}

.modal-content h2 {
    color: var(--primary-brown);
    font-size: 2.5em;
    margin-bottom: 10px;
}

.modal-content p {
    color: #666;
    font-size: 1.1em;
}

.confirmed-order-items {
    background-color: rgba(0, 0, 0, 0.05);
    /* Light background for items */
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    max-height: 250px;
    overflow-y: auto;
}

.confirmed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1em;
    color: var(--text-color-dark);
}

.confirmed-item:last-child {
    margin-bottom: 0;
}

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

.confirmed-item-details img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 5px;
}

.confirmed-item-info span {
    font-weight: 600;
}

.confirmed-item-info .item-quantity-text {
    font-weight: normal;
    color: #666;
    margin-right: 5px;
}

.order-total-modal {
    display: flex;
    justify-content: space-between;
    font-size: 1.4em;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 30px;
    color: var(--primary-brown);
}

#start-new-order-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
}

/* Responsive adjustments for menu page */
@media (max-width: 992px) {
    .menu-flex-container {
        flex-direction: column;
        gap: 60px;
        /* More space when stacked */
    }

    .menu-left,
    .menu-right {
        min-width: unset;
        /* Remove min-width */
        width: 100%;
        /* Take full width */
        position: static;
        /* Remove sticky behavior */
        top: unset;
    }

    .menu-right {
        margin-top: 40px;
        /* Space from menu items above */
    }

    .modal-content {
        width: 95%;
        /* Adjust modal width for smaller screens */
        padding: 30px 20px;
    }

    .confirmation-icon {
        font-size: 3em;
    }

    .modal-content h2 {
        font-size: 2em;
    }

    .modal-content p {
        font-size: 1em;
    }
}

@media (max-width: 768px) {
    .menu-categories ul {
        flex-direction: column;
        align-items: center;
    }

    .menu-categories button {
        width: 100%;
    }
}