.search-bar {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 48px;
    padding: 28px;
    background: var(--white);
    border-radius: var(--border-radius-large);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.search-bar__fields {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    gap: 40px;
    min-width: 0;
}

.search-bar__field {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

/* Destination wider than Dates / Voyageurs */
.search-bar__fields > .search-bar__field:first-child {
    flex: 1 1 280px;
}

.search-bar__fields > .search-bar__field:not(:first-child) {
    flex: 1 1 180px;
}

/* Dates plus large (pour afficher la plage complète), Voyageurs plus étroit */
.search-bar__fields > .search-bar__field.search-bar__field--dates {
    flex: 1 1 240px;
}

.search-bar__fields > .search-bar__field.search-bar__field--travelers {
    flex: 0 1 160px;
}

.search-bar__label {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    color: var(--dark1);
    font-size: var(--font-size-small);
    font-family: var(--font-helvetica);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-button);
    cursor: default;
}

.search-bar__label-icon {
    flex-shrink: 0;
}

.search-bar__input-wrap {
    width: 100%;
    box-sizing: border-box;
    height: 48px;
    padding: 0 12px;
    background: var(--light3);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.search-bar__input-wrap:hover {
    background: var(--search-input-hover-bg);
}

.search-bar__input-text {
    flex: 1;
    min-width: 0;
    color: var(--gray2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.search-bar__input-text--filled {
    color: var(--dark1, #37241C);
    font-size: var(--font-size-small);
    font-family: var(--font-rubik);
    font-weight: var(--font-weight-regular);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-bar__icon {
    flex-shrink: 0;
    color: var(--main-color);
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.search-bar__divider {
    width: 0;
    align-self: stretch;
    opacity: 0.05;
    border-right: 2px solid var(--search-divider-color);
}

.search-bar__button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--main-color);
    border-radius: var(--border-radius-small);
    color: var(--white);
    font-size: var(--font-size-small);
    font-family: var(--font-helvetica);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-button);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.search-bar__button:hover {
    background: var(--main-color-orange);
    color: var(--white);
    opacity: 1;
    transition: background 0.2s ease, color 0.2s ease;
}

/* ── Shortcuts row (Recherche par numéro / carte) ────────────── */
.search-bar__shortcuts {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    width: 100%;
    flex-basis: 100%;
}

.search-bar__shortcut {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--white);
    font-size: 14px;
    font-family: var(--font-rubik);
    font-weight: 500;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.search-bar__shortcut:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.20);
    border-color: rgba(252, 176, 90, 0.4);
    transform: translateY(-1px);
}

.search-bar__shortcut-icon {
    font-size: 15px;
    color: var(--main-color);
}

@media (max-width: 900px) {
    .search-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        width: 100%;
        border-radius: var(--border-radius-small);
    }

    .search-bar__fields {
        flex-direction: column;
        gap: 8px;
    }

    /* Reset flex-basis so fields don't become tall as heights in column layout */
    .search-bar__fields > .search-bar__field:first-child,
    .search-bar__fields > .search-bar__field:not(:first-child) {
        flex: 0 0 auto;
    }

    .search-bar__divider {
        display: none;
    }

    .search-bar__button {
        width: 100%;
        justify-content: center;
    }

    .search-bar__shortcuts {
        gap: 16px;
        flex-wrap: wrap;
    }

    .search-bar__shortcut {
        font-size: 13px;
    }
}

/* ══════════════════════════════════════
   Destination Picker Dropdown
   ══════════════════════════════════════ */

#destination-picker-panel {
    background: var(--white);
    border-radius: var(--border-radius-large, 24px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
    min-width: 360px;
    max-width: 450px;
}

.destination-picker {
    padding: 16px;
    max-height: 420px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.destination-picker__search {
    position: relative;
    margin-bottom: 12px;
}

.destination-picker__search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray2, #aeaeb2);
    font-size: 14px;
}

.destination-picker__input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid var(--gray2, #aeaeb2);
    border-radius: var(--border-radius-small, 5px);
    font-family: var(--font-rubik, 'Rubik', sans-serif);
    font-size: var(--font-size-small, 16px);
    box-sizing: border-box;
}

.destination-picker__input:focus {
    outline: none;
    border-color: var(--main-color, #faab57);
}

.destination-picker__results {
    overflow-y: auto;
    flex: 1;
    max-height: 340px;
}

.destination-picker__group {
    padding: 10px 12px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gray2, #aeaeb2);
    letter-spacing: 0.5px;
}

.destination-picker__item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--border-radius-small, 5px);
    gap: 8px;
    transition: background 0.15s;
}

.destination-picker__item:hover {
    background: var(--search-input-hover-bg, #efefed);
}

.destination-picker__item-icon {
    color: var(--gray2, #aeaeb2);
    margin-right: 8px;
}

.destination-picker__sublabel {
    font-size: 13px;
    color: var(--gray2, #aeaeb2);
    white-space: nowrap;
}

.destination-picker__empty {
    padding: 24px;
    text-align: center;
    color: var(--gray2, #aeaeb2);
    font-size: 14px;
}

@media (max-width: 900px) {
    #destination-picker-panel {
        min-width: unset;
        max-width: unset;
        box-sizing: border-box;
    }

    .travelers-picker {
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* ══════════════════════════════════════
   Mobile bottom-sheet (≤768px)
   Les 3 panneaux de la barre de recherche (dates, voyageurs, destination)
   glissent depuis le bas de l'écran, backdrop assombri, footer épinglé.
   Desktop inchangé. positionPanel()/autoScroll côté JS sont désactivés < 768.
   ══════════════════════════════════════ */

.search-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    /* Très haut : le panneau est téléporté dans <body> (portal) à l'ouverture,
       donc backdrop et feuille partagent le contexte d'empilement racine. Doit
       passer au-dessus du hero (z-index:10) et du mount flottant (z-index:99999). */
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.search-sheet-backdrop.is-visible {
    opacity: 1;
}

body.sheet-open {
    overflow: hidden;
}

/* Bouton de fermeture (×) injecté en JS dans les feuilles dates/destination.
   Masqué hors mobile (les panneaux ne sont des feuilles que < 768). */
.search-sheet-close {
    display: none;
}

@keyframes search-sheet-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@media (max-width: 768px) {
    /* Le panneau devient une feuille ancrée en bas de la fenêtre.
       !important pour battre le style inline position:absolute des panneaux. */
    #dates-picker-panel,
    #travelers-picker-panel,
    #destination-picker-panel {
        position: fixed !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        max-height: 90vh !important;
        margin: 0 !important;
        z-index: 100001 !important; /* au-dessus du backdrop (portalisé dans <body>) */
        background: var(--light2, #fff);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        animation: search-sheet-slide-up 0.25s ease;
    }

    /* Bande supérieure réservée au bouton × (dates/destination n'ont pas de
       header propre, contrairement au picker voyageurs qui a déjà son ×). */
    #dates-picker-panel,
    #destination-picker-panel {
        padding-top: 44px;
    }

    .search-sheet-close {
        display: flex;
        position: absolute;
        top: 8px;
        right: 12px;
        z-index: 3;
        width: 34px;
        height: 34px;
        align-items: center;
        justify-content: center;
        border: none;
        border-radius: 50%;
        background: var(--light1, #efefed);
        color: var(--dark1, #37241C);
        font-size: 17px;
        cursor: pointer;
    }

    /* Footer (Valider / Appliquer) épinglé en bas pendant que le corps défile. */
    #dates-picker-panel .date-range-picker__footer,
    #travelers-picker-panel .travelers-picker__footer {
        position: sticky;
        bottom: 0;
        background: var(--light2, #fff);
        padding-bottom: env(safe-area-inset-bottom, 8px);
        z-index: 2;
    }

    /* La liste destination remplit la feuille au lieu de sa hauteur bornée desktop. */
    #destination-picker-panel .destination-picker {
        max-height: none;
    }

    #destination-picker-panel .destination-picker__results {
        max-height: none;
    }
}
