/* REPLACE the entire contents of: style.css */

/* --- CORE LAYOUT & TYPOGRAPHY --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    padding-bottom: 150px;
    background-color: #f8f9fa;
}

body.modal-open {
    overflow: hidden;
}

#main-header {
    border-bottom: 1px solid #dee2e6;
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-content {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- THIS IS THE FIX (Mobile-First Layout) --- */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
}

/* --- THIS IS THE FIX (Desktop Grid Override) --- */
@media (min-width: 1000px) {
    .main-content {
        display: grid;
        grid-template-columns: 300px 1fr 380px;
    }
    #left-sidebar { grid-column: 1 / 2; }
    #catalog-area { grid-column: 2 / 3; }
    #right-sidebar { grid-column: 3 / 4; }
}

#right-sidebar, #left-sidebar {
    position: relative;
}

#event-plan-panel {
    position: sticky;
    top: 85px; /* Height of main header + padding */
}

/* --- SIDEBARS & PANELS --- */
#right-sidebar h3, #left-sidebar h3 {
    margin-top: 0;
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
}

#filter-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    border: 1px solid #ccc;
    padding: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    padding: 8px;
    border: 1px solid #ccc;
    cursor: pointer;
    background: none;
}

.filter-btn.active {
    border: 2px solid blue;
}

#cart-items-container {
    flex-grow: 1;
}

#cart-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #ccc;
}

#cart-footer .total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- FAVORITES CAROUSEL --- */
#favorites-section {
    position: relative;
}

#favorites-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
    scroll-behavior: smooth;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}
.carousel-nav.left { left: -20px; }
.carousel-nav.right { right: -20px; }

.favorite-item {
    position: relative;
    flex: 0 0 100px;
    height: 100px;
    border: 1px solid #ccc;
    background-size: cover;
    background-position: center;
}

/* --- CATALOG CARDS (Simplified) --- */
#catalog-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.event-card {
    display: flex;
    flex-direction: column;
    height: auto;
    border: 1px solid #e0e0e0;
    background-color: #ffffff;
    overflow: hidden;
}

.event-card-image-container {
    height: 200px;
    width: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.event-card-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.event-card-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.2em;
}

.event-card-content p.description {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.5;
    flex-grow: 1;
}

.card-footer {
    padding: 12px 16px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.actions-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.quantity-selector {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.card-footer .price {
    font-weight: bold;
    font-size: 1.2em;
    line-height: 1.2;
}

.card-footer .price .pricing-type {
    display: block;
    font-size: 0.7em;
    font-weight: normal;
}

/* --- MODALS (Functional Layout) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content, .checkout-modal-content, .itinerary-content, .presentation-content {
    pointer-events: auto;
    background: #ffffff;
    padding: 20px;
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    z-index: 1010;
}

.modal-content {
    display: flex;
    flex-direction: row;
    width: 90%;
    max-width: 1000px;
    height: 90vh;
    max-height: 650px;
    padding: 0;
}

.modal-main-column {
    flex: 6;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #ccc;
}

.modal-sidebar-column {
    flex: 4;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#modal-main-image {
    flex-grow: 1;
    background-size: cover;
    background-position: center;
}

#modal-thumbnail-strip {
    flex-shrink: 0;
    padding: 10px;
    border-top: 1px solid #ccc;
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.thumbnail-img {
    width: 80px;
    height: 60px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border: 2px solid transparent;
}

.thumbnail-img.active {
    border-color: blue;
}

/* --- CHAT WIDGET (Layout) --- */
#chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

#chat-window {
    width: 350px;
    height: 500px;
    border: 1px solid #ccc;
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 1000;
    visibility: hidden;
}

#chat-widget-container.chat-open #chat-window {
    visibility: visible;
}

#messages-container {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#message-form {
    border-top: 1px solid #ccc;
    padding: 10px;
    display: flex;
    gap: 10px;
}

#message-input {
    flex-grow: 1;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}
.message-wrapper.sent { align-self: flex-end; }
.message-wrapper.received { align-self: flex-start; }

/* --- Utility --- */
.hidden {
    display: none;
}

/* --- MOBILE & RESPONSIVE STYLES --- */

#mobile-summary-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #343a40;
    color: white;
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    z-index: 998;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease;
}
#mobile-summary-bar.available { background-color: #28a745; }
#mobile-summary-bar.partial { background-color: #fd7e14; }
#mobile-summary-bar.unavailable { background-color: #dc3545; }

#mobile-bar-info {
    display: flex;
    flex-direction: column;
    font-size: 0.9em;
}

#mobile-bar-total-cost {
    font-weight: bold;
    font-size: 1.1em;
}

#mobile-view-plan-btn, #mobile-show-filters-btn {
    padding: 10px 20px;
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    border-radius: 5px;
    cursor: pointer;
}

#mobile-show-filters-btn {
    display: none;
    margin-bottom: 20px;
    width: 100%;
    background-color: #6c757d;
    border: none;
}

/* Main Media Query for Mobile Overrides */
@media (max-width: 999px) {
    /* --- THIS IS THE FIX --- */
    /* This rule is no longer needed here because mobile-first is the default */
    /*
    .main-content {
        display: flex;
        flex-direction: column;
    }
    */

    #left-sidebar, #right-sidebar {
        max-width: 100%;
        transition: max-height 0.4s ease-out, opacity 0.3s ease, margin 0.4s ease, padding 0.4s ease;
        overflow: hidden;
        max-height: 2000px;
        opacity: 1;
    }
    
    #left-sidebar.collapsed, #right-sidebar.collapsed {
        max-height: 0;
        opacity: 0;
        margin: 0;
        padding-top: 0;
        padding-bottom: 0;
    }

    #mobile-summary-bar, #mobile-show-filters-btn {
        display: flex;
    }

    #mobile-show-filters-btn {
        position: sticky;
        top: 75px;
        z-index: 999;
    }
    
    .presentation-body {
        display: flex;
        flex-direction: column;
    }

    .presentation-nav-arrow {
        background: rgba(0,0,0,0.4);
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    #mobile-summary-bar {
        transform: translateY(100%);
        transition: transform 0.3s ease-in-out;
    }
    
    body.mobile-bar-active #mobile-summary-bar {
        transform: translateY(0);
    }
    
    body.mobile-bar-active #chat-widget-container {
        bottom: 75px;
        transition: bottom 0.3s ease-in-out;
    }
}
@media (max-width: 999px) {
    #mobile-filter-trigger {
        display: flex;
        width: 100%;
        position: sticky;
        top: 75px;
        z-index: 998;
        background-color: #6c757d;
        color: white;
        padding: 15px;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        justify-content: space-between;
        align-items: center;
        font-size: 1em;
        font-weight: bold;
        margin-bottom: 15px;
    }

    .caret {
        transition: transform 0.3s ease;
    }

    .collapsed .caret {
        transform: rotate(-90deg);
    }
}

@media (max-width: 999px) {
    .presentation-body {
        display: flex;
        flex-direction: column;
    }

    .presentation-nav-arrow {
        background: rgba(0,0,0,0.4);
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

#plan-filter-btn {
    background-color: #f0f8ff;
    font-weight: bold;
}

#plan-filter-btn.active {
    background-color: #cce5ff;
    border-color: #007bff;
}

#catalog-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
    display: none;
}

.event-type-card .event-card-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;
}

.event-date-display {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-align: center;
    padding: 10px;
    min-width: 70px;
}

.event-date-display .month {
    display: block;
    font-size: 0.8em;
    font-weight: bold;
    color: #dc3545;
}

.event-date-display .day {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: #343a40;
    line-height: 1.1;
}

.event-details {
    flex-grow: 1;
}

.event-details h3 {
    margin-top: 0;
}

.collage-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: 200px;
}

.collage-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.grouping-card .card-footer {
    justify-content: center;
}

/* ADD THIS to the end of your style.css file */

@media (max-width: 768px) {
    /* --- Detail Modal Mobile Layout --- */
    .modal-content {
        flex-direction: column;
        height: 95vh;
        width: 95vw;
        max-height: none;
    }

    .modal-main-column {
        flex: 1; /* Allow it to shrink and grow */
        min-height: 250px; /* Ensure it doesn't collapse */
        border-right: none;
        border-bottom: 1px solid #eee;
    }

    .modal-sidebar-column {
        flex: 1; /* Allow it to shrink and grow */
        padding: 20px;
    }

    #modal-thumbnail-strip {
        padding: 8px;
    }

    .thumbnail-img {
        width: 65px;
        height: 50px;
    }
}

/* ADD THIS to the end of your style.css file */

.sso-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #aaa;
    font-size: 0.8em;
    text-transform: uppercase;
}
.sso-divider::before, .sso-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #eee;
}
.sso-divider:not(:empty-्_)::before {
    margin-right: .5em;
}
.sso-divider:not(:empty-्_)::after {
    margin-left: .5em;
}

.sso-btn {
    width: 100%;
    padding: 12px;
    font-size: 1em;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid #ccc;
    background-color: #fff;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.sso-btn:hover {
    background-color: #f8f8f8;
}
