:root {
    --mbb-primary: #EE5F37;
    /* Orange from screenshot */
    --mbb-bg: #FFFFFF;
    --mbb-text: #303230;
    --mbb-gray: #F5F5F7;
    /* Light gray for backgrounds */
    --mbb-border-radius: 50px;
    --mbb-shadow: 0 2px 20px 0 #BEBABA;
    --mbb-font: 'Roobert Arabic Bold', 'Inter', sans-serif;
    /* Assumption, standard clean font */
}

.mews-booking-bar-wrapper {
    font-family: var(--mbb-font);
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px 0;
    box-sizing: border-box;
}

/* Desktop Bar Container */
.mbb-bar {
    background: var(--mbb-bg);
    border-radius: var(--mbb-border-radius);
    box-shadow: var(--mbb-shadow);
    display: flex;
    align-items: center;
    padding: 18px 44px 18px 28px;
    width: 100%;
    max-width: calc(100% - 130px);
    max-height: 80px;
    /* Adjust based on needs */
    position: relative;
    gap: 25px;
}

/* Sections (Inputs) */
.mbb-section {
    flex: .66;
    max-width: calc(33.33% - (200px / 3));
    position: relative;
    padding: 10px 0;
    cursor: pointer;
    border-radius: 30px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mbb-section:first-of-type {
    flex: .33;
}

.mbb-section:first-of-type:hover {
    background: var(--mbb-gray);
}

.mbb-section-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-grow: 1;
}

.mbb-icon {
    width: 20px;
    height: 20px;
    color: #666;
    flex-shrink: 0;
}

.mbb-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.mbb-label-arrival,
.mbb-label-departure {
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.mbb-label-title {
    color: #303230;
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 15px;
    letter-spacing: 3%;
}

.mbb-label-value {
    font-size: 18px;
    color: #303230;
    font-family: "Roobert Arabic", sans-serif;
    font-weight: 400;
    line-height: 15px;
    letter-spacing: 3%;
    margin-top: 2px;
    max-width: calc(100% - 25px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mbb-dates-wrapper .mbb-label-value {
    display: flex;
    flex-direction: row;
    align-items: center;
    color: #BEBABA;
}

.mbb-date-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.mbb-date-val {
    font-size: 16px;
    font-weight: 700;
    color: #303230;
}

.mbb-date-sub {
    font-size: 16px;
    font-family: "Roobert Arabic", sans-serif;
    font-weight: 400;
    color: #303230;
}

.mbb-date-arrow {
    display: inline-block;
    width: 18px;
    height: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 18 8'%3E%3Cpath fill='%23000' d='M17.354 4.035a.5.5 0 0 0 0-.707L14.172.146a.5.5 0 1 0-.708.707l2.829 2.829-2.828 2.828a.5.5 0 1 0 .707.707zM0 3.682v.5h17v-1H0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
}

.mbb-chevron {
    width: 24px;
    height: 24px;
    background: #F8F4F4;
    /* Light pinkish bg from screenshot */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #333;
    margin-left: 10px;
}

/* Divider */
.mbb-divider {
    width: 1px;
    height: 41px;
    background: #EBE5DA;
}

/* Button */
/* Button */
.mbb-submit {
    position: relative;
    font-family: var(--button_typography-font-family);
    font-weight: var(--button_typography-font-weight);
    letter-spacing: var(--button_typography-letter-spacing);
    background: var(--mbb-primary);
    border: 2px solid #D44924;
    color: white;
    padding: 11px 23px;
    border-radius: 2px;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 14px;
    transition: transform 0.1s, opacity 0.2s, background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.mbb-submit span {
    position: relative;
    z-index: 1;
}

.mbb-submit::before {
    content: "";
    position: absolute;
    inset: 0;
    /* top/right/bottom/left:0 */
    background: rgba(184, 64, 33, 1);
    /* prend la couleur du texte */
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform .35s ease;
    z-index: 0;
    /* derrière le texte */
}

.mbb-submit:hover {
    border-color: var(--mbb-primary);
}

.mbb-submit:hover::before {
    transform: scaleY(1);
}

/* Dropdowns */
.mbb-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 15px;
    background: #FFF;
    /* Light pinkish bg from dropdown screenshot */
    padding: 20px;
    border-radius: 20px;
    filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.1));
    min-width: 280px;
    display: none;
    z-index: 100;
    animation: mbb-fade-in 0.2s ease-out;
}

.mbb-dropdown-dates {
    min-width: 620px;
    /* To fit 2 months */
}

.mbb-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #FFF;
}

.mbb-dropdown.active {
    display: block;
}

@keyframes mbb-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mbb-dropdown-promo {
    min-width: 250px;
    padding: 20px 25px;
}

.mbb-promo-input {
    width: 100%;
    padding: 17px 19px 16px;
    border: 1px solid #D7D6D6;
    border-radius: 7px;
    font-size: 18px;
    font-family: "Roobert Arabic", sans-serif;
    font-weight: 400;
    line-height: 15px;
    letter-spacing: 3%;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    color: #303230 !important;
    text-transform: uppercase;
}

.mbb-promo-input::placeholder {
    color: #BEBABA;
    text-transform: none;
    font-family: "Roobert Arabic", sans-serif;
    font-weight: 400;
}

.mbb-promo-input:focus {
    border-color: var(--mbb-primary);
}

/* Counter Rows */
.mbb-counter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.mbb-counter-row:last-child {
    margin-bottom: 0;
}

.mbb-counter-label {
    font-weight: 600;
    color: var(--mbb-text);
}

.mbb-counter-controls {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 20px;
    padding: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.mbb-btn-count {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mbb-btn-count:hover {
    color: var(--mbb-primary);
}

.mbb-count-value {
    width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

/* Calendar customization */
/* VanillaCalendar Customization */
.vanilla-calendar {
    width: 100%;
    margin: 0 auto;
    font-family: inherit;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.vanilla-calendar-day__btn,
.vanilla-calendar-week__day,
.vanilla-calendar-month,
.vanilla-calendar-year {
    font-size: 16px !important;
}

.vanilla-calendar-week__day,
.vanilla-calendar-day__btn {
    font-weight: 400 !important;
    font-family: "Roobert Arabic", sans-serif !important;
}

.vanilla-calendar-week__day {
    font-size: 14px !important;
}

.vanilla-calendar-day__btn_weekend:not(.vanilla-calendar-day__btn_disabled),
.vanilla-calendar-week__day_weekend:not(.vanilla-calendar-day__btn_disabled) {
    color: var(--mbb-text) !important;
    font-weight: normal !important;
}

.vanilla-calendar-week__day {
    color: #64748b !important;
}

.vanilla-calendar-day_selected .vanilla-calendar-day__btn {
    background: rgba(234, 98, 62, 1) !important;
    color: white !important;
    border-radius: 50% !important;
}

.vanilla-calendar-day_selected-first .vanilla-calendar-day__btn,
.vanilla-calendar-day_selected-last .vanilla-calendar-day__btn,
.vanilla-calendar:not(:has(.vanilla-calendar-day_selected-first)) .vanilla-calendar-day__btn.vanilla-calendar-day__btn_selected {
    background: rgba(234, 98, 62, 1) !important;
    border-color: rgba(234, 98, 62, 1) !important;
    color: white !important;
    border-radius: 50% !important;
    position: relative;
    box-shadow: none !important;
}

.vanilla-calendar-day_selected-first .vanilla-calendar-day__btn::after,
.vanilla-calendar-day_selected-last .vanilla-calendar-day__btn::after,
.vanilla-calendar:not(:has(.vanilla-calendar-day_selected-first)) .vanilla-calendar-day__btn.vanilla-calendar-day__btn_selected::after {
    content: "";
    position: absolute;
    inset: -3px;
    /* 5px gap + 1px border */
    border: 1px solid rgba(234, 98, 62, 1);
    border-radius: 50%;
    pointer-events: none;
    box-sizing: border-box;
}

.vanilla-calendar-day_selected-first .vanilla-calendar-day__btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 13px;
    width: 20px;
    height: 30px;
    background: #F7C0B2;
    transform: translate(0%, -50%);
    pointer-events: none;
    z-index: -1;
}

.vanilla-calendar-day_selected-last .vanilla-calendar-day__btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 20px;
    height: 30px;
    background: #F7C0B2;
    transform: translate(0%, -50%);
    pointer-events: none;
    z-index: -1;
}

.vanilla-calendar-day_hover-intermediate .vanilla-calendar-day__btn,
.vanilla-calendar-day_selected-intermediate .vanilla-calendar-day__btn {
    background: #F7C0B2 !important;
    color: var(--mbb-text) !important;
    box-shadow: none !important;
    border: none !important;
}

.vanilla-calendar-columns {
    gap: 20px;
}

/* New Dates Wrapper */
.mbb-dates-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.mbb-dates-arrow {
    color: var(--mbb-text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mbb-date-sub {
    color: #303230;
}

.mbb-date-placeholder {
    color: #BEBABA;
    font-weight: 400;
}

/* Mobile Modal Header/Footer hidden on desktop */
.mbb-modal-header-mobile,
.mbb-modal-footer-mobile {
    display: none;
}

/* Mobile View */
.mbb-bar-mobile {
    display: none;
}

.mbb-mobile-bar {
    display: none;
    /* Hidden on desktop */
    width: 100%;
    background: var(--mbb-bg);
    border-radius: 50px;
    box-shadow: var(--mbb-shadow);
    padding: 10px 20px;
    align-items: center;
    justify-content: space-between;
}

.mbb-mobile-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--mbb-text);
    font-weight: 500;
}

.mbb-mobile-value {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mbb-mobile-divider {
    color: #E5E5E5;
    font-size: 10px;
    margin: 0 2px;
}

.mbb-mobile-chevron {
    width: 20px;
    height: 20px;
    background: #F8F4F4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    margin-left: 5px;
}

.mbb-mobile-dropdown-panel {
    display: none;
    background: #FFF5F4;
    border-radius: 20px;
    padding: 20px;
    margin-top: 10px;
    width: 100%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    animation: mbb-fade-in 0.2s ease-out;
}

.mbb-mobile-dropdown-panel.active {
    display: block;
}

.mbb-mobile-submit-container {
    display: none;
    width: 100%;
    margin-top: 15px;
}

.mbb-mobile-submit-container .mbb-submit {
    width: 100%;
    padding: 18px;
    font-size: 14px;
}

/* Dropdown Arrow */
.mbb-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #FFF;
}

/* Active State */
.mbb-section.active .mbb-icon {
    color: var(--mbb-primary);
}


/* Date Format Visibility */
.mbb-date-desktop {
    display: inline;
}

.mbb-date-mobile {
    display: none;
}

.mbb-mobile-inline {
    display: none;
}

@media (max-width: 1320px) and (min-width: 851px) {
    .mbb-bar {
        gap: 12px;
    }
    .mbb-section {
        max-width: calc(33.33% - (180px / 3));
    }
    .mbb-section.mbb-section-dates {
        flex: .9;
    }
}

@media (max-width: 1180px) and (min-width: 851px) {
    .mbb-bar {
        gap: 8px;
        padding: 18px 20px 18px 18px;
    }
    .mbb-section {
        max-width: calc(33.33% - (120px / 3));
    }
    .mbb-section-content {
        gap: 10px;
    }
    .mbb-label-title {
        font-size: 16px;
    }
    .mbb-icon {
        width: 18px;
        height: 18px;
    }
    .mbb-chevron {
        display: none;
    }
    .mbb-date-arrow {
        display: none;
    }
    .mbb-date-val,
    .mbb-date-sub {
        font-size: 14px;
    }
}

/* Mobile View Refactoring */
@media (max-width: 850px) {
    .mews-booking-bar-wrapper {
        padding: 0 21px;
    }

    .mbb-bar {
        display: none !important;
    }

    .mbb-bar-mobile {
        display: flex;
        background: var(--mbb-bg);
        border-radius: 50px;
        box-shadow: var(--mbb-shadow);
        padding: 18px 19px 18px 27px;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        cursor: pointer;
    }

    .mbb-mobile-minimal {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .mbb-mobile-text {
        color: var(--mbb-text);
        font-size: 15px;
        font-weight: 400;
        font-family: "Roobert Arabic", sans-serif;
    }
    
    .mbb-bar-mobile .mbb-icon {
        width: 20px;
        height: 20px;
    }

    .mbb-bar-mobile .mbb-submit {
        border-radius: 30px;
        padding: 12px 20px;
        font-size: 14px;
        font-weight: bold;
        overflow: hidden;
    }

    .mbb-section {
        width: auto;
        padding: 0;
        border-bottom: none;
        border-radius: 20px;
        flex: 0 1 auto;
        /* Allow shrinking */
    }

    .mbb-section:hover,
    .mbb-section.active {
        background: transparent;
    }

    .mbb-divider {
        display: none;
    }

    /* Hide Title Labels on Mobile (Nom d'aventuriers...) */
    .mbb-label-title {
        display: none;
    }

    /* Hide Text parts of values (Adultes, Nuits...) */
    .mbb-text-label {
        display: none;
    }

    .mbb-label-arrival,
    .mbb-label-departure {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .mbb-dates-wrapper {
        gap: 5px;
    }

    .mbb-dates-arrow {
        max-width: 10px;
    }

    .mbb-label-value {
        font-size: 11px;
        color: var(--mbb-text);
        margin-top: 0;
        display: flex;
        gap: 0;
    }

    .mbb-section:first-of-type .mbb-label-value {
        font-size: 14px;
    }

    .mbb-section-dates {
        flex: 1;
        width: 100%;
    }

    .mbb-dates-wrapper:not(:has(.mbb-date-primary)) .mbb-label-title {
        display: block;
        font-size: 11px;
    }

    .vanilla-calendar-day_selected-first .vanilla-calendar-day__btn,
    .vanilla-calendar-day_selected-last .vanilla-calendar-day__btn,
    .vanilla-calendar:not(:has(.vanilla-calendar-day_selected-first)) .vanilla-calendar-day__btn.vanilla-calendar-day__btn_selected {
        max-width: 20px;
    }

    .vanilla-calendar-day_selected-first .vanilla-calendar-day__btn::before {
        left: 81%;
    }

    .vanilla-calendar-day_selected-last .vanilla-calendar-day__btn::before {
        left: -47%;
        width: 68%;
    }

    /* Date formatting toggles */
    .mbb-date-desktop {
        display: none;
    }

    .mbb-dropdown-dates {
        min-width: 0;
    }

    .mbb-date-mobile {
        display: flex;
        flex-direction: column;
        align-items: center;
        line-height: 1;
    }

    .mbb-day {
        font-size: 16px;
        font-weight: 700;
    }

    .mbb-month {
        font-size: 10px;
        text-transform: uppercase;
        margin-top: 2px;
    }

    /* Chevron & Icon tweaks for mobile space */
    .mbb-chevron {
        display: none;
    }

    /* Icon Size 29x29px on mobile */
    .mbb-icon {
        width: 20px;
        height: 20px;
    }

    /* Button */
    .mbb-submit {
        display: block;
        padding: 10px 15px;
        font-size: 12px;
        letter-spacing: 3px;
        border-radius: 100px;
    }

    /* Dropdown adjustments: Absolute position (no overlay) */
    .mbb-dropdown {
        position: absolute;
        top: calc(100% + 20px);
        left: 50%;
        transform: translateX(-50%);
        width: 300px;
        max-width: 90vw;
        z-index: 1000;
        margin-top: 0;
        animation: mbb-fade-in 0.2s ease-out;
        filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.1));
    }

    .mbb-dropdown.mbb-dropdown--adventurers {
        left: -15px;
        transform: translateX(0);
    }

    /* Restore arrow on mobile */
    .mbb-dropdown::before {
        display: block;
        left: 50%;
        transform: translateX(-8px);
    }

    .mbb-dropdown.mbb-dropdown--adventurers::before {
        left: 30px;
    }

    /* Mobile Dates Dropdown Modal (Full Screen) */
    .mbb-dropdown-dates {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-width: none !important;
        max-height: none !important;
        transform: none !important;
        border-radius: 0 !important;
        display: none;
        flex-direction: column;
        padding: 0 !important;
        background: #fff !important;
        z-index: 9999999 !important;
    }

    .mbb-dropdown-dates.active {
        display: flex !important;
    }

    .mbb-dropdown-dates::before {
        display: none !important;
    }

    /* Header */
    .mbb-modal-header-mobile {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 24px 20px;
        position: relative;
        background: #fff;
        z-index: 2;
    }

    .mbb-modal-title {
        font-size: 18px;
        font-weight: 600;
        color: var(--mbb-text);
    }

    .mbb-modal-close {
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        cursor: pointer;
        padding: 10px;
        color: var(--mbb-text);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Calendar Mount Mobile Scroll */
    div[id^="calendar-mount-"] {
        flex: 1;
        overflow-y: auto;
        padding: 0 10px 100px 10px;
        /* Custom scrollbar for better look */
        scrollbar-width: none;
    }

    div[id^="calendar-mount-"]::-webkit-scrollbar {
        display: none;
    }

    /* Make VanillaCalendar responsive vertically on mobile */
    .vanilla-calendar-columns {
        flex-direction: column !important;
        align-items: center;
        width: 100%;
    }

    .vanilla-calendar-column {
        width: 100% !important;
        margin-bottom: 25px;
        min-width: 0;
    }

    .vanilla-calendar {
        height: auto;
    }

    /* Footer */
    .mbb-modal-footer-mobile {
        display: flex;
        flex-direction: column;
        padding: 43px 21px;
        background: #fff;
        box-shadow: 0 4px 34px 10px rgba(0, 0, 0, 0.25);
        position: relative;
        z-index: 2;
        margin-top: auto;
    }

    .mbb-modal-footer-dates-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }

    .mbb-modal-footer-dates {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 15px;
        color: var(--mbb-text);
    }

    .mbb-footer-arr,
    .mbb-footer-dep {
        display: flex;
        flex-direction: column;
    }

    .mbb-footer-date {
        font-weight: 700;
        font-size: 16px;
    }

    .mbb-footer-day {
        font-size: 12px;
        color: #666;
    }

    .mbb-modal-footer-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
    }

    .mbb-btn-reset-dates {
        background: transparent;
        border: none;
        color: var(--mbb-text);
        font-size: 14px;
        text-decoration: underline;
        font-weight: 600;
        cursor: pointer;
        margin-left: auto;
    }

    .mbb-modal-footer-actions .mbb-submit {
        flex: 1;
        padding: 15px;
        font-size: 16px;
        width: 100%;
        text-align: center;
        border-radius: 2px;
    }

    /* Remove Overlay */
    .mbb-dropdown.active::after {
        display: none;
    }
}

@keyframes mbb-fade-in-mobile {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}