/* Ensure the body and parent containers have enough height */
body {
    overflow: visible;
}
button:hover {
    background-color: #dd5903;
}

.catering-menu-container {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

.catering-menu-container .container-fluid {
    width: 80%;
    padding: 50px 20px;
    flex: 1;
}

.content-wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    overflow: visible;
}

/* Cart Popup Toggle Button */
.cart-popup-toggle {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #0D2009;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2em;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.cart-popup-toggle:hover {
    background-color: #1a3c14;
}
.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8em;
}

/* Left Sidebar for Your Selection */
.selection-sidebar {
    flex: 1;
    min-width: 300px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 150px;
    align-self: flex-start;
    margin-top: 40px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.selection-sidebar-close {
    display: none;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5em;
    cursor: pointer;
    color: #333;
    background: none;
    border: none;
}
.selection-sidebar-close:hover {
    color: #000;
}

/* Wrapper for Main Content */
.main-content-wrapper {
    flex: 4;
    min-height: 100vh;
}

.main-content {
    flex: 1;
}

.category-title {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 20px;
    text-transform: uppercase;
    text-align: center;
}

.container-fluid h1 {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 20px;
    text-transform: uppercase;
    text-align: center;
    margin-top: 40px;
}

.menu-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    contain: content;
}

.menu-item-box {
    min-height: 140px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s;
    text-align: left;
}

.menu-item-box:hover {
    transform: translateY(-5px);
}

.menu-item-inner {
    display: flex;
    align-items: stretch;
    gap: 15px;
    position: relative;
    height: 100%;
}

.menu-item-details {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
    padding-bottom: 5px;
}

.menu-item-image {
    flex: 1;
    max-width: 160px;
    min-width: 160px;
    width: 100%;
    min-height: 100%;
}

.menu-item-image img {
    min-height: 100%;
    max-height: 150px;
    width: 100%;
    object-fit: cover;
    border-radius: 0 10px 10px 0;
    loading: lazy;
}

.menu-item-content {
    flex-grow: 1;
}

.menu-item-content h2 {
    font-size: 1.20em;
    font-weight: 600;
    margin: 0;
}

.menu-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dietary-tag {
    background: #007bff;
    color: white;
    font-size: 0.8em;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 5px;
    text-transform: uppercase;
}

.menu-price {
    font-size: 1em;
    font-weight: 600;
    color: #333;
}

.menu-content {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.tray-prices {
    font-size: 0.9em;
    color: #333;
}

.tray-prices p {
    margin: 5px 0;
    font-size: 16px;
}

.tray-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    position: absolute;
    bottom: 10px;
    right: 10px;
}

.select-item {
    width: 60px;
    height: 40px;
    background-color: #000;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 0.85em;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.select-item:hover {
    transform: scale(1.05);
    background-color: #373737;
}

.selected-items {
    text-align: center;
}

.selected-items h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
}

#no-selection-message {
    display: none;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 0;
    text-align: center;
}

.selected-items ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.selected-items li {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    font-size: 16px;
}

.item-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.tray-qty {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 5px;
}

.tray-qty span {
    font-size: 0.9em;
    color: #333;
}

.increase-qty, .decrease-qty {
    background-color: #0D2009;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 30px;
    height: 30px;
    padding: 0;
}

.increase-qty:hover, .decrease-qty:hover {
    background-color: #1a3c14;
}

#proceed-to-form {
    background-color: #0D2009;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
}

#proceed-to-form:hover {
    background-color: #1a3c14;
}

/* Popup styles */
.form-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-popup.active {
    display: flex;
    opacity: 1;
}

.form-popup-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-height: 80vh;
    overflow-y: auto;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5em;
    cursor: pointer;
    color: #333;
}

.close-popup:hover {
    color: #000;
}

.form-container {
    padding: 0;
}

.form-container h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 28px;
}

.form-container p {
    margin-bottom: 20px;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.form-container label {
    display: block;
    margin: 10px 0 5px;
}

.form-container input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.form-container button {
    background-color: #28a745;
    color: white;
    padding: 7px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 10px 5px;
}

.form-container button:hover {
    background-color: #218838;
}

.prev-step {
    background-color: #6c757d;
}

.prev-step:hover {
    background-color: #5a6268;
}

.next-step:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#form-message {
    margin-top: 20px;
    font-weight: bold;
    text-align: center;
}

#confirmation-details {
    margin: 20px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.rts-footer-one {
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .catering-menu-container .container-fluid {
        width: 100%;
    }

    .cart-popup-toggle {
        display: flex;
        visibility: visible;
        opacity: 1;
    }

    .selection-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        max-height: 100vh;
        z-index: 1000;
        background: #f8f9fa;
        transition: left 0.3s ease;
        overflow-y: auto;
        margin-top: 0;
        border-radius: 0;
    }

    .selection-sidebar.active {
        left: 0;
    }

    .selection-sidebar-close {
        display: block;
        width: fit-content;
        padding: 15px;
        line-height: 0.5;
    }

    .main-content-wrapper {
        flex: 1;
        width: 100%;
    }

    .menu-items {
        grid-template-columns: 1fr;
    }

    .menu-item-image {
        max-width: 100%;
        order: 1;
    }

    .menu-item-image img {
        border-radius: 0 0 10px 10px;
        height: 200px;
    }

    .menu-item-details {
        padding: 15px;
        padding-bottom: 5px;
        order: 0;
    }

    .tray-buttons {
        margin-top: 10px;
    }

    .tray-qty {
        align-items: flex-start;
        gap: 12px;
    }
}