/* ================================================
   Hostings Page — Layout
   ================================================ */
.hostings-page {
    margin: 0;
    padding: 0;
    background: var(--white);
    min-height: 100vh;
    font-family: var(--font-rubik);
}

.hostings-page--sale {
    background: var(--light-warm);
    padding-top: 1px; /* empêche le margin collapse du hero premier enfant */
}

/* ================================================
   Hero — bandeau visuel uniquement (sans search)
   Le heading est toujours visible (pas de fade hover)
   ================================================ */
/* margin + border-radius hérités de .hero dans hero-visual.css */
.hero--hostings {
    min-height: 520px;
    padding: 40px 0 60px;
}

.hero--hostings .hero__container {
    position: relative;
    z-index: 2;
    max-width: var(--container-max-width, 1400px);
    width: 100%;
    padding: 0 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero--hostings .hero__search {
    max-width: 1100px;
    width: 100%;
}

/* Heading toujours visible (pas de fade hover comme sur le home) */
.hero--hostings .heading {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .hero--hostings {
        min-height: 280px;
    }
}

/* ── Search float mount — barre fixe collée en haut (style navbar) ── */
.search-float-mount {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    z-index: 99999;
    background: var(--white);
    border-radius: 0 0 16px 16px;
    padding: 12px 56px 16px 24px; /* droite élargie pour le bouton X */
    box-shadow: 0 4px 24px rgba(55, 36, 28, 0.18);
    box-sizing: border-box;
    /* PAS d'overflow:hidden → les pickers absolus peuvent déborder */
}

.search-float-mount .hero__search {
    max-width: 1200px !important;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.search-float-mount .search-bar__shortcuts {
    display: none !important;
}

/* Bouton X du mount */
.search-float-mount__close {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: var(--light-warm, #f5f0eb);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--dark1);
    z-index: 10;
}
.search-float-mount__close:hover {
    background: var(--neutral-200);
}

/* Backdrop derrière le mount */
.search-float-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99998;
}
.search-float-backdrop.is-visible {
    display: block;
}

@media (max-width: 768px) {
    .search-float-mount {
        padding: 10px 48px 14px 12px;
    }
}

/* ================================================
   Panneau de filtres — Prix + Capacité + Global
   (version horizontale au-dessus du listing)
   ================================================ */
.hostings-filters {
    max-width: 1400px;
    margin: 32px auto 0;
    padding: 0 40px;
}

/* Ligne 1 : les deux filter-range côte à côte */
.hostings-filters__ranges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 48px;
    background: var(--white);
    border: 1px solid rgba(55, 36, 28, 0.08);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    padding: 20px 28px;
}

/* Séparateur vertical entre les deux colonnes */
.hostings-filters__range-col + .hostings-filters__range-col {
    border-left: 1px solid rgba(55, 36, 28, 0.07);
    padding-left: 48px;
}

/* Le global-filter en dessous se raccorde visuellement */
.hostings-filters .gf {
    border-radius: 0 0 16px 16px;
}

@media (max-width: 900px) {
    .hostings-filters {
        padding: 0 20px;
    }

    .hostings-filters__ranges {
        grid-template-columns: 1fr;
        gap: 16px 0;
        border-radius: 16px 16px 0 0;
    }

    .hostings-filters__range-col + .hostings-filters__range-col {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid rgba(55, 36, 28, 0.07);
        padding-top: 16px;
    }
}

/* ================================================
   Listing + Map + Sidebar Filters — Split layout
   ================================================ */

/* Wrapper — margin: 0 40px pour s'aligner sur le bord du hero (.hero a margin: 40px) */
.hostings-listing-wrap {
    position: relative;
    margin: 0 40px;
    padding: 0 0 64px;
}

/* Listing-section perd son propre max-width/padding/header quand il est dans le wrapper */
.hostings-listing-wrap .listing-section {
    max-width: none;
    padding: 0 0 64px;
}

.hostings-listing-wrap .listing-section__header {
    display: none;
}

/* ── Header listing : titre + boutons alignés ────────────────── */
.hostings-listing-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 48px 0 36px;
}

.hostings-listing-header__actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* ── Boutons toggle (Filtres + Carte) — style unifié ─────────── */
.hostings-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--dark1);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-family: var(--font-rubik);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.15s ease;
}

.hostings-toggle-btn i {
    font-size: 15px;
}

.hostings-toggle-btn:hover {
    background: var(--main-color-orange);
    color: var(--white);
}

.hostings-toggle-btn.is-active {
    background: var(--main-color);
    color: var(--dark1);
}

/* ── Row : sidebar + listing + map side by side ──────────────── */
.hostings-listing-row {
    display: flex;
    gap: 0;
}

.hostings-listing-col {
    flex: 1;
    min-width: 0;
}

/* ================================================
   Sidebar Filters (panneau latéral, hidden par défaut)
   ================================================ */
.hostings-sidebar-filters {
    flex-shrink: 0;
    width: 0;
    overflow: hidden;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    transition: width 0.3s ease, padding 0.3s ease, opacity 0.25s ease;
    opacity: 0;
}

/* When filters panel is open */
.hostings-listing-wrap.has-filters .hostings-sidebar-filters {
    width: 320px;
    padding-right: 24px;
    overflow-y: auto;
    opacity: 1;
}

/* Sidebar header */
.hostings-sidebar-filters__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(55, 36, 28, 0.08);
}

.hostings-sidebar-filters__title {
    font-family: var(--font-rubik);
    font-size: 17px;
    font-weight: 700;
    color: var(--dark1);
}

.hostings-sidebar-filters__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid rgba(55, 36, 28, 0.12);
    border-radius: 8px;
    cursor: pointer;
    color: var(--neutral-500);
    font-size: 14px;
    transition: background 0.15s ease, color 0.15s ease;
}

.hostings-sidebar-filters__close:hover {
    background: var(--light-warm);
    color: var(--dark1);
}

/* Sidebar body */
.hostings-sidebar-filters__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Le global-filter dans la sidebar n'a pas besoin de border/radius propre */
.hostings-sidebar-filters .gf {
    border: none;
    border-radius: 0;
    padding: 0;
}

/* ── Sidebar Input Groups (prix min/max, capacité min/max) ─── */
.sidebar-input-group {
    padding: 14px 0;
    border-bottom: 1px solid rgba(55, 36, 28, 0.07);
}

.sidebar-input-group__label {
    display: block;
    font-family: var(--font-rubik);
    font-size: 12px;
    font-weight: 700;
    color: var(--neutral-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.sidebar-input-group__row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-input-group__field {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1px solid rgba(55, 36, 28, 0.15);
    border-radius: 8px;
    padding: 0 10px;
    transition: border-color 0.15s ease;
}

.sidebar-input-group__field:focus-within {
    border-color: var(--main-color);
}

.sidebar-input-group__input {
    width: 100%;
    border: none;
    background: none;
    font-family: var(--font-rubik);
    font-size: 13px;
    color: var(--dark1);
    padding: 9px 0;
    outline: none;
    -moz-appearance: textfield;
}

.sidebar-input-group__input::-webkit-inner-spin-button,
.sidebar-input-group__input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sidebar-input-group__input::placeholder {
    color: var(--neutral-500);
    font-weight: 400;
}

.sidebar-input-group__unit {
    font-family: var(--font-rubik);
    font-size: 12px;
    color: var(--neutral-500);
    flex-shrink: 0;
    margin-left: 4px;
}

.sidebar-input-group__sep {
    color: var(--neutral-500);
    font-size: 13px;
    flex-shrink: 0;
}

/* ── Sidebar Checkboxes (type du bien, équipements) ─── */
.sidebar-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

.sidebar-checkboxes .gf__option-label {
    padding: 5px 6px;
    border-radius: 6px;
    cursor: pointer;
}

.sidebar-checkboxes .gf__option-text small {
    font-size: 11px;
}

/* Quand sidebar ouverte : réduire la grille */
.hostings-listing-wrap.has-filters .listing-section__grid {
    grid-template-columns: repeat(3, 1fr);
}

/* Quand sidebar + carte ouverts : masquer les cards, sidebar + map occupent tout */
.hostings-listing-wrap.has-filters.has-map .hostings-listing-col {
    display: none;
}

.hostings-listing-wrap.has-filters.has-map .hostings-sidebar-filters {
    width: 320px;
}

.hostings-listing-wrap.has-filters.has-map .hostings-map-panel {
    flex: 1;
}

/* Scrollbar subtile pour la sidebar */
.hostings-sidebar-filters::-webkit-scrollbar {
    width: 4px;
}

.hostings-sidebar-filters::-webkit-scrollbar-track {
    background: transparent;
}

.hostings-sidebar-filters::-webkit-scrollbar-thumb {
    background: rgba(55, 36, 28, 0.15);
    border-radius: 4px;
}

/* ── Map panel ───────────────────────────────────────────────── */
.hostings-map-panel {
    flex-shrink: 0;
    width: 0;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    height: calc(100vh - 40px);
    overflow: hidden;
}

/* When map is open: listing = 2 cards wide, map = remaining space */
.hostings-listing-wrap.has-map .hostings-map-panel {
    width: 50%;
    padding-left: 24px;
}

/* When map open: force 2 columns on the listing grid */
.hostings-listing-wrap.has-map .listing-section__grid {
    grid-template-columns: repeat(2, 1fr);
}

/* Map inner wrapper — contexte de positionnement pour le bouton expand */
.hostings-map-inner {
    position: relative;
    height: 100%;
}

/* Map panel inner: full height */
.hostings-map-panel .osm-map {
    height: 100%;
    border-radius: 16px;
}

/* ── Map loader overlay ──────────────────────────────────────── */
.hostings-map-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    pointer-events: none;
}

.hostings-map-loader__inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    font-family: var(--font-rubik);
    font-size: 14px;
    font-weight: 600;
    color: var(--dark1);
}

.hostings-map-loader__inner i {
    font-size: 18px;
    color: var(--main-color-orange);
}

.hostings-map-panel.is-fullscreen .hostings-map-loader {
    border-radius: 0;
}

/* ── Bouton expand/collapse map ──────────────────────────────── */
.hostings-map-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--white);
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    color: var(--dark1);
    font-size: 16px;
    transition: background 0.15s ease, transform 0.1s ease;
}

.hostings-map-expand:hover {
    background: var(--light-warm);
    transform: scale(1.05);
}

/* ── Map fullscreen ──────────────────────────────────────────── */
.hostings-map-panel.is-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: none !important;
    z-index: 2000;
    padding: 0 !important;
    border-radius: 0;
    background: var(--white);
    overflow: hidden;
}

.hostings-map-panel.is-fullscreen .osm-map {
    border-radius: 0;
    height: 100%;
}

.hostings-map-panel.is-fullscreen .hostings-map-expand {
    width: 40px;
    height: 40px;
    font-size: 18px;
}

/* ── Map controls containers ─────────────────────────────────── */
.map-controls {
    position: absolute;
    top: 12px;
    z-index: 10;
    display: flex;
    gap: 8px;
}

.map-controls--left {
    left: 12px;
}

.map-controls--right {
    right: 12px;
    display: none !important;
}

.hostings-map-panel.is-fullscreen .map-controls--left {
    top: 16px;
    left: 16px;
}

.hostings-map-panel.is-fullscreen .map-controls--right {
    display: flex !important;
    top: 16px;
    right: 100px;
}

@media (max-width: 768px) {
    .hostings-map-panel.is-fullscreen .map-controls--left {
        top: 16px;
        left: 16px;
    }

    .hostings-map-panel.is-fullscreen .map-controls--right {
        display: flex !important;
        top: 16px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

/* ── Fullscreen-only buttons (Filtres, Recherche) ────────────── */
.map-fs-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    background: var(--white);
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    font-family: var(--font-rubik);
    font-size: 13px;
    font-weight: 600;
    color: var(--dark1);
    transition: background 0.15s ease, transform 0.1s ease;
}

.map-fs-btn i {
    font-size: 14px;
}

.map-fs-btn:hover {
    background: var(--light-warm);
    transform: scale(1.02);
}

.map-fs-btn.is-active {
    background: var(--main-color);
    color: var(--dark1);
}

/* ── Fullscreen overlay panels (Filtres, Recherche) ──────────── */
.map-fs-overlay {
    display: none;
}

.hostings-map-panel.is-fullscreen .map-fs-overlay:not([hidden]) {
    display: block;
    position: absolute;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    width: 90%;
    max-width: 1200px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    animation: map-fs-in 0.2s ease both;
}

@keyframes map-fs-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.map-fs-overlay__content {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    position: relative;
}

/* Close button */
.map-fs-overlay__close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--white);
    border: 1px solid rgba(55, 36, 28, 0.12);
    border-radius: 8px;
    cursor: pointer;
    color: var(--neutral-500);
    font-size: 14px;
    transition: background 0.15s ease, color 0.15s ease;
}

.map-fs-overlay__close:hover {
    background: var(--light-warm);
    color: var(--dark1);
}

/* Filters overlay — padding-top = espace pour le bouton X absolu (8px+32px+8px=48px) */
.map-fs-overlay__content--filters {
    padding: 52px 28px 24px 28px;
}

/* Bouton X au-dessus des sliders, ne chevauche plus les bulles */
.map-fs-overlay__content--filters .map-fs-overlay__close {
    top: 8px;
    right: 8px;
}

.map-fs-overlay__filters-ranges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 48px;
    padding-bottom: 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(55, 36, 28, 0.07);
}

.map-fs-overlay__range-col + .map-fs-overlay__range-col {
    border-left: 1px solid rgba(55, 36, 28, 0.07);
    padding-left: 48px;
}

.map-fs-overlay__content--filters .gf {
    border: none;
    border-radius: 0;
    padding: 0;
}

/* Search overlay — pas de card, transparent */
.map-fs-overlay__content--search {
    background: none;
    box-shadow: none;
    padding: 0;
}

.map-fs-overlay__content--search .map-fs-overlay__close {
    display: none;
}

/* Overlay scrollbar */
.hostings-map-panel.is-fullscreen .map-fs-overlay::-webkit-scrollbar {
    width: 4px;
}

.hostings-map-panel.is-fullscreen .map-fs-overlay::-webkit-scrollbar-thumb {
    background: rgba(55, 36, 28, 0.15);
    border-radius: 4px;
}

@media (max-width: 900px) {
    .hostings-map-panel.is-fullscreen .map-fs-overlay:not([hidden]) {
        width: 95%;
        top: 60px;
    }

    .map-fs-overlay__filters-ranges {
        grid-template-columns: 1fr;
        gap: 16px 0;
    }

    .map-fs-overlay__range-col + .map-fs-overlay__range-col {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid rgba(55, 36, 28, 0.07);
        padding-top: 16px;
    }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hostings-listing-wrap {
        margin: 0 16px;
        padding: 0 0 96px; /* espace pour le bouton Carte flottant */
    }

    /* Bouton Carte → flottant centré en bas sur mobile */
    button[data-map-toggle] {
        position: fixed;
        bottom: 24px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 500;
        padding: 13px 28px;
        border-radius: 100px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
        white-space: nowrap;
        font-size: 14px;
    }

    /* Masquer quand la carte est active (plein écran prend le relais) */
    button[data-map-toggle].is-active {
        display: none;
    }
}

@media (max-width: 1200px) {
    .hostings-listing-wrap.has-map .listing-section__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hostings-listing-wrap.has-filters .listing-section__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .hostings-listing-wrap {
        margin: 0 20px;
        padding: 0 0 64px;
    }

    /* Sidebar : overlay on tablet/mobile */
    .hostings-listing-wrap.has-filters .hostings-sidebar-filters {
        position: fixed;
        top: 0;
        left: 0;
        width: 340px;
        max-width: 85vw;
        height: 100vh;
        max-height: 100vh;
        z-index: 1000;
        background: var(--white);
        padding: 20px;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
        border-radius: 0;
    }

    .hostings-listing-wrap.has-filters .listing-section__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Stack map vertically on tablet */
    .hostings-listing-wrap.has-map .hostings-listing-row {
        flex-direction: column;
    }

    .hostings-listing-wrap.has-map .hostings-map-panel {
        width: 100%;
        height: 400px;
        position: relative;
        padding: 0 20px 24px;
    }

    .hostings-listing-wrap.has-map .listing-section__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .hostings-listing-wrap.has-map .listing-section__grid {
        grid-template-columns: 1fr;
    }

    .hostings-listing-wrap.has-map .hostings-map-panel {
        height: 300px;
        padding: 0 16px 20px;
    }

    .hostings-listing-wrap.has-filters .listing-section__grid {
        grid-template-columns: 1fr;
    }
}

/* ── Backdrop overlay pour sidebar mobile ────────────────────── */
.hostings-sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
}

@media (max-width: 900px) {
    .hostings-listing-wrap.has-filters .hostings-sidebar-backdrop {
        display: block;
    }
}
