/* ========================================
   NOS DESTINATIONS — RECHERCHE DE STATION
   Chargé avec js/destinations-map-v2.js
======================================== */

.fv-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ----------------------------------------
   1. CHAMP DE RECHERCHE
---------------------------------------- */
.fv-search { position: relative; }

.fv-search-icon {
    position: absolute;
    left: 18px; top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: #555;
    pointer-events: none;
}

.destinations-airbnb-layout .fv-search .fv-search-input {
    box-sizing: border-box;
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 0 52px 0 50px !important;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 50px !important;
    background: #fff !important;
    color: #222 !important;
    font-family: 'Nunito', sans-serif !important;
    font-size: 16px !important; /* 16px mini : évite le zoom automatique sur iOS */
    font-weight: 600;
    line-height: normal;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.destinations-airbnb-layout .fv-search .fv-search-input::placeholder { color: #767676; opacity: 1; font-weight: 500; }
.destinations-airbnb-layout .fv-search.has-value .fv-search-input { border-color: #80BA27 !important; }
.destinations-airbnb-layout .fv-search .fv-search-input:focus {
    border-color: #80BA27 !important;
    box-shadow: 0 0 0 4px rgba(128, 186, 39, 0.15) !important;
}

.destinations-airbnb-layout .fv-search .fv-search-clear {
    position: absolute;
    right: 4px; top: 50%;
    transform: translateY(-50%);
    width: 44px; height: 44px;
    min-width: 0;
    padding: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: #555 !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.destinations-airbnb-layout .fv-search .fv-search-clear[hidden] { display: none !important; }
.destinations-airbnb-layout .fv-search .fv-search-clear:hover,
.destinations-airbnb-layout .fv-search .fv-search-clear:focus-visible { background: #f2f2f2 !important; color: #222 !important; }

.destinations-airbnb-layout .fv-count {
    margin: 12px 8px 0;
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: #555;
}

/* Lettres trouvées dans les cards */
.destinations-airbnb-layout mark.fv-hit {
    padding: 0;
    border-radius: 3px;
    background: #e3f1cc;
    color: #2d5200;
}

/* ----------------------------------------
   2. DESKTOP — EN-TÊTE COLLANT DE LA LISTE
---------------------------------------- */
.fv-v2 .fv-list-head {
    position: sticky;
    top: 0;
    z-index: 5;
    margin-bottom: 12px;
    padding-bottom: 12px;
    background: #fff;
    box-shadow: 0 -20px 0 0 #fff; /* masque les cards qui défilent dans le padding du panneau */
}

/* ----------------------------------------
   3. AUCUN RÉSULTAT
---------------------------------------- */
.destinations-airbnb-layout .fv-no-results { padding: 48px 16px; }
.destinations-airbnb-layout .fv-no-results-title { margin: 0 0 6px; font-size: 16px; font-weight: 800; color: #222; }
.destinations-airbnb-layout .fv-no-results-text { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: #555; }
.destinations-airbnb-layout .fv-no-results-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.destinations-airbnb-layout .fv-btn-outline,
.destinations-airbnb-layout .fv-btn-outline:focus {
    padding: 12px 22px !important;
    border: 1.5px solid #80BA27 !important;
    border-radius: 50px !important;
    background: #fff !important;
    color: #2d5200 !important;
    font-family: 'Nunito', sans-serif !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.2;
    cursor: pointer;
}
.destinations-airbnb-layout .fv-btn-outline:hover { background: #f7fdf0 !important; }

/* ----------------------------------------
   4. BOUTON FLOTTANT LISTE / CARTE (mobile)
---------------------------------------- */
.fv-view-toggle { display: none; }

/* ----------------------------------------
   5. MOBILE
---------------------------------------- */
@media (max-width: 768px) {

    /* Bloc collant : recherche + filtres + compteur, en pleine largeur d'écran
       (calc(50vw - 50%) = marge latérale du conteneur Elementor) */
    .fv-v2 .flocon-filters-bar {
        display: block !important;
        position: sticky !important;
        top: 0;
        z-index: 1000;
        margin: 0 calc(50% - 50vw) !important;
        padding: 12px calc(50vw - 50%) 0 !important;
        background: #fff !important;
        box-shadow: 0 10px 12px -12px rgba(0, 0, 0, 0.35);
    }

    /* Filtres sur une ligne qui défile horizontalement */
    .fv-v2 .filters-bar-inner {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        margin: 10px calc(50% - 50vw) 0 !important;
        padding: 0 calc(50vw - 50%) 2px !important;
        overflow-x: auto;
        overflow-y: hidden;
        border: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .fv-v2 .filters-bar-inner::-webkit-scrollbar { display: none; }
    .fv-v2 .filter-label-group { display: none !important; }
    .fv-v2 .filters-bar-inner .filter-group,
    .fv-v2 .filter-group:has(.custom-dropdown),
    .fv-v2 .filter-niveaux {
        flex: 0 0 auto !important;
        width: auto !important;
    }
    .fv-v2 .filter-group .custom-dropdown { width: auto !important; }
    .fv-v2 .filter-group .dropdown-trigger {
        width: auto !important;
        min-width: 0 !important;
        height: 44px;
        padding: 0 16px !important;
        white-space: nowrap;
    }
    .fv-v2 .niveau-btn {
        flex: 0 0 auto !important;
        height: 44px;
        padding: 0 14px !important;
    }
    .fv-v2 .reset-filters-btn {
        flex: 0 0 auto;
        width: auto !important;
        height: 44px;
        padding: 0 16px !important;
    }

    /* Menus déroulants en panneau bas d'écran (sinon coupés par le défilement horizontal) */
    .fv-v2 .dropdown-menu.open {
        position: fixed !important;
        top: auto !important;
        right: 12px !important;
        bottom: 12px;
        left: 12px !important;
        width: auto !important;
        min-width: 0 !important;
        max-height: 60vh;
        overflow-y: auto;
        padding: 10px !important;
        border-radius: 18px !important;
        box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.25) !important;
        z-index: 10001 !important;
    }
    .fv-v2 .dropdown-menu .dropdown-item,
    .fv-v2 .dropdown-menu .dropdown-item-mobilite {
        padding: 14px 16px !important;
        font-size: 15px !important;
    }

    .fv-v2 .fv-count { margin: 0; padding: 10px 4px; }

    /* Liste OU carte, selon le bouton flottant */
    .fv-v2 .destinations-list-panel { padding-bottom: 90px !important; }
    .fv-v2.fv-mode-list .destinations-map-panel { display: none !important; }
    .fv-v2.fv-mode-map .destinations-list-panel { display: none !important; }
    /* Aucun résultat en vue carte : le message plutôt qu'une carte vide */
    .fv-v2.fv-mode-map.fv-empty .destinations-list-panel { display: block !important; }
    .fv-v2.fv-mode-map.fv-empty .destinations-map-panel { display: none !important; }
    .fv-v2.fv-mode-map .destinations-map-panel {
        height: calc(100vh - var(--fv-bar-h, 180px)) !important;
        height: calc(100dvh - var(--fv-bar-h, 180px)) !important;
        padding: 0 0 12px !important;
    }

    .fv-view-toggle,
    .fv-view-toggle:hover,
    .fv-view-toggle:focus {
        position: fixed !important;
        left: 50%;
        bottom: 20px;
        z-index: 999;
        display: inline-flex !important;
        align-items: center;
        gap: 8px;
        height: 48px;
        margin: 0;
        padding: 0 22px !important;
        border: none !important;
        border-radius: 50px !important;
        background: #222 !important;
        color: #fff !important;
        font-family: 'Nunito', sans-serif !important;
        font-size: 15px !important;
        font-weight: 800 !important;
        line-height: 1;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25) !important;
        transform: translate(-50%, 16px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }
    .fv-view-toggle.is-visible {
        transform: translate(-50%, 0);
        opacity: 1;
        pointer-events: auto;
    }
    .fv-view-toggle svg { display: block; }
}
