/* ===============================================
   LISTINGS PAGE
=============================================== */
.listings-page {
    padding-top: 80px;
    min-height: 100vh;
    /* width:100% : body est un flex column, margin:auto désactive le stretch */
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 5%;
    padding-right: 5%;
}

/* ===============================================
   SEARCH BAR
=============================================== */
.listings-search {
    padding: 1.5rem 0 1rem;
}
.search-bar {
    position: relative;
}
.search-input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3rem;
    font-size: 1rem;
    border-radius: 100px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--white);
    transition: border-color 0.3s var(--ease-ui);
}
.search-input:focus {
    border-color: var(--gold);
}
.search-bar::before {
    content: '';
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") no-repeat center;
}

/* ===============================================
   FILTERS
=============================================== */
.listings-filters {
    padding: 0.75rem 0;
}
.filters-row {
    display: flex;
    gap: 0.75rem;
    row-gap: 0.85rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Groupes de pills (transaction, chambres) : boutons aérés, repli propre */
.filter-pills {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Pills (transaction, bedrooms) */
.pill {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--grey-light);
    padding: 0.6rem 1.35rem;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s var(--ease-ui);
    white-space: nowrap;
}
.pill:hover {
    border-color: var(--border-hover);
    color: var(--white);
}
.pill.active {
    background: var(--gold-dim);
    border-color: var(--gold);
    color: var(--gold);
}

/* Filter dropdown wrapper */
.filter-dropdown {
    position: relative;
}
.filter-dropdown-btn {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--grey-light);
    padding: 0.6rem 1.35rem;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s var(--ease-ui);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}
.filter-dropdown-btn:hover {
    border-color: var(--border-hover);
    color: var(--white);
}
.filter-dropdown-btn.has-value {
    background: var(--gold-dim);
    border-color: var(--gold);
    color: var(--gold);
}
.filter-dropdown-btn svg {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
}
.filter-dropdown.open .filter-dropdown-btn svg {
    transform: rotate(180deg);
}
.filter-dropdown-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.8rem;
    min-width: 220px;
    z-index: 100;
    display: none;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.filter-dropdown.open .filter-dropdown-panel {
    display: block;
    animation: fadeUp 0.2s var(--ease-ui);
}
.filter-dropdown-panel label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.6rem;
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--grey-light);
    cursor: pointer;
    transition: background 0.15s;
    min-height: 44px;
}
.filter-dropdown-panel label:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--white);
}
.filter-dropdown-panel input[type="checkbox"] {
    accent-color: var(--gold);
    width: 16px;
    height: 16px;
}
.filter-dropdown-panel .filter-group-title {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey-mid);
    padding: 0.6rem 0.5rem 0.3rem;
}
.filter-range {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.4rem 0;
}
.filter-range select {
    flex: 1;
    background: var(--black-elevated);
    border: 1px solid var(--border-color);
    color: var(--white);
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
}
.filter-range span {
    color: var(--grey-mid);
    font-size: 0.8rem;
}

/* Active filter tags */
.filters-active {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.6rem 0;
}
.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--gold-dim);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
}
.filter-tag-remove {
    background: none;
    border: none;
    color: var(--gold);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0.6rem;
    margin: -0.6rem;
}
.filter-tag-clear {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--grey-light);
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-tag-clear:hover {
    color: var(--white);
    border-color: var(--border-hover);
}

/* ===============================================
   TOOLBAR
=============================================== */
.listings-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}
.results-count {
    font-size: 0.85rem;
    color: var(--grey-light);
}
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.sort-select {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--grey-light);
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    width: auto;
}
.view-toggle {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}
.view-btn {
    background: none;
    border: none;
    color: var(--grey-mid);
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    min-height: 44px;
}
.view-btn:hover {
    color: var(--white);
}
.view-btn.active {
    background: var(--grey-dark);
    color: var(--white);
}

/* ===============================================
   LISTINGS GRID
=============================================== */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding-bottom: 2rem;
}

/* ===============================================
   LISTING CARD
=============================================== */
.listing-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s var(--ease-ui);
}
.listing-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.listing-card.highlighted {
    border-color: var(--gold);
}

/* Card carousel */
.card-carousel {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--black-elevated);
    /* Le geste horizontal est laissé au JS (swipe photo), le vertical au
       scroll natif. Sans ça, iOS/Android revendiquent le toucher dès le
       moindre mouvement et coupent le touchend (touchcancel) : swipe mort. */
    touch-action: pan-y;
}
.card-carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}
.card-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, color 0.2s, transform 0.2s;
}
.listing-card:hover .card-carousel-nav {
    opacity: 1;
}
.card-carousel-nav:hover {
    background: var(--gold);
    color: var(--black);
    transform: translateY(-50%) scale(1.08);
}
@media (hover: none) {
    .card-carousel-nav { opacity: 1; width: 44px; height: 44px; }
}
.card-carousel-nav.prev {
    left: 8px;
}
.card-carousel-nav.next {
    right: 8px;
}
.card-carousel-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
}
.card-carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s;
}
@media (hover: none) {
    .card-carousel-dot { width: 8px; height: 8px; padding: 6px; box-sizing: content-box; }
}
.card-carousel-dot.active {
    background: var(--white);
}

/* Badges */
.card-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
}
.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.badge-type {
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    backdrop-filter: blur(10px);
}
.badge-new {
    background: var(--gold);
    color: var(--black);
}

/* Favorite button */
.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--ease-spring);
    backdrop-filter: blur(10px);
}
.favorite-btn:hover {
    transform: scale(1.1);
}
.favorite-btn.active {
    background: var(--gold);
}
.favorite-btn.active svg {
    fill: var(--black);
    stroke: var(--black);
}
/* Pop élastique au clic — partagé carte + fiche (le bouton de la fiche
   n'avait AUCUNE animation, seule .favorite-btn.bounce existait) */
.favorite-btn.bounce,
.detail-action-btn.bounce {
    animation: favBounce 0.5s var(--ease-spring);
}
@keyframes favBounce {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.35); }
    55%  { transform: scale(0.85); }
    75%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}
/* Bouton favori de la fiche à l'état actif : cœur doré */
.detail-action-btn.active {
    border-color: var(--gold);
    color: var(--gold);
}
/* Connecté avec un rôle non-acheteur : favoris grisés, info au survol */
.favorite-btn.fav-disabled,
.detail-action-btn.fav-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.favorite-btn.fav-disabled:hover { transform: none; }
@media (prefers-reduced-motion: reduce) {
    .favorite-btn.bounce, .detail-action-btn.bounce { animation: none; }
}

/* Card info */
.card-info {
    padding: 1rem 1.2rem;
}
.card-price {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}
.card-price-period {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--grey-light);
}
.card-location {
    color: var(--grey-light);
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
}
.card-specs {
    display: flex;
    gap: 1rem;
    color: var(--grey-mid);
    font-size: 0.78rem;
}
.card-spec {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ===============================================
   MAP VIEW
=============================================== */
.listings-map-container {
    display: flex;
    height: calc(100vh - 250px);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.map-sidebar {
    width: 40%;
    overflow-y: auto;
    background: var(--black-elevated);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.map-sidebar .listing-card {
    flex-shrink: 0;
}
.map-sidebar .card-carousel {
    height: 140px;
}
.map-view {
    flex: 1;
    min-height: 400px;
}
.map-view .leaflet-tile-pane {
    filter: saturate(0.3) brightness(0.8);
}

/* Custom marker */
.custom-marker {
    width: 28px;
    height: 28px;
    border-radius: 50% 50% 50% 0;
    background: var(--gold);
    transform: rotate(-45deg);
    border: 2px solid var(--black);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.custom-marker.bounce {
    animation: markerBounce 0.5s var(--ease-spring);
}
@keyframes markerBounce {
    0%, 100% { transform: rotate(-45deg) translateY(0); }
    50% { transform: rotate(-45deg) translateY(-10px); }
}

/* ===============================================
   LOADING / EMPTY
=============================================== */
.listings-loading {
    display: flex;
    justify-content: center;
    padding: 3rem;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.load-more-btn {
    display: block;
    margin: 1.5rem auto 3rem;
    padding: 0.8rem 2.5rem;
}
/* État vide — centré dans la grille (toutes colonnes), icône or animée */
.no-results {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    text-align: center;
    padding: 5rem 2rem;
    color: var(--grey-light);
    font-size: 0.95rem;
    animation: fadeUp 0.5s var(--ease-ui) both;
}
.no-results-ico {
    position: relative;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--gold-dim);
    border: 1px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    animation: norez-float 3.2s ease-in-out infinite;
}
.no-results-ico::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid var(--gold);
    opacity: 0;
    animation: norez-pulse 2.4s var(--ease-ui) infinite;
}
.no-results-text { max-width: 42ch; line-height: 1.7; margin: 0; }
@keyframes norez-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes norez-pulse {
    0% { opacity: 0.55; transform: scale(0.9); }
    70% { opacity: 0; transform: scale(1.35); }
    100% { opacity: 0; transform: scale(1.35); }
}
@media (prefers-reduced-motion: reduce) {
    .no-results { animation: none; }
    .no-results-ico { animation: none; }
    .no-results-ico::after { animation: none; }
}

/* ===============================================
   LISTING DETAIL
=============================================== */
.listing-detail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black);
    z-index: 8000;
    overflow-y: auto;
    animation: pageIn 0.3s var(--ease-ui);
}
.detail-back {
    /* absolute (et non fixed) : le bouton reste ancré en haut de la fiche
       et défile avec le contenu — il ne doit pas suivre le scroll */
    position: absolute;
    top: 80px;
    left: 5%;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--grey-light);
    padding: 0.5rem 1.2rem;
    border-radius: 10px;
    font-size: 0.82rem;
    cursor: pointer;
    z-index: 8001;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.detail-back:hover {
    color: var(--white);
    border-color: var(--border-hover);
}

/* Gallery */
.detail-gallery {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-auto-rows: 0;        /* any extra image adds no height — stays a hero */
    gap: 4px;
    height: 70vh;             /* large hero images; the text block flows below it */
    min-height: 460px;
    margin-top: 64px;
    cursor: pointer;
    position: relative;
    overflow: hidden;         /* photos never bleed past the hero into the text */
}
.detail-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s;
}
.detail-gallery img:hover {
    opacity: 0.85;
}
.detail-gallery img:first-child {
    grid-row: 1 / 3;
}
.detail-gallery-placeholder {
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-mid);
}
.detail-gallery-more {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
}

/* Lightbox */
.detail-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.detail-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 4px;
}
.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.lightbox-nav:hover {
    background: var(--gold);
    color: var(--black);
}
.lightbox-nav.prev {
    left: 1.5rem;
}
.lightbox-nav.next {
    right: 1.5rem;
}
.lightbox-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--grey-light);
    font-size: 0.85rem;
}

/* Detail content */
.detail-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 5%;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 3rem;
}
.detail-main {
    min-width: 0;
}
.detail-sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
}

/* Detail header */
.detail-header {
    margin-bottom: 2rem;
}
.detail-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}
.detail-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}
.detail-price {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.5rem;
}
.detail-positioning {
    display: inline-block;
    margin-bottom: 0.6rem;
    padding: 0.3rem 0.85rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: help;
}
.detail-positioning.pos-under { background: rgba(52, 168, 83, 0.15); color: #34A853; }
.detail-positioning.pos-over  { background: rgba(212, 175, 55, 0.15); color: var(--gold); }
/* Détail de la fourchette visible sous le badge (title inaccessible au tactile) */
.detail-positioning-sub {
    font-size: 0.75rem;
    color: var(--grey-mid);
    margin-top: 0.25rem;
}
/* Bloc « À proximité » (location intelligence) — carte + liste, charte Vantage */
.prox-radius { font-size: 0.8rem; font-weight: 400; color: var(--grey-mid); }
.prox-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.1rem;
    align-items: stretch;
}
.prox-map {
    position: relative;
    min-height: 344px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--surface);
}
.prox-map canvas { border-radius: 12px; }
.prox-map.expanded {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw; height: 75vh;
    z-index: 9500;
    border-radius: 18px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6);
}
.prox-map .maplibregl-ctrl-top-right { pointer-events: auto; }
.prox-panel {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    max-height: 344px;
    overflow-y: auto;
    padding-right: 0.35rem;
}
.prox-cat-head {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.11em;
    color: var(--grey-light); margin-bottom: 0.5rem;
}
.prox-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.prox-row { display: flex; align-items: baseline; gap: 0.55rem; padding: 0.11rem 0; }
.prox-n {
    min-width: 1.8rem; text-align: right;
    font-weight: 700; color: var(--white); font-variant-numeric: tabular-nums;
}
.prox-l { color: var(--grey-light); font-size: 0.9rem; }
.prox-station {
    display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem;
    padding: 0.2rem 0; border-bottom: 1px solid var(--border-color);
}
.prox-station:last-of-type { border-bottom: none; }
.prox-st-name { color: var(--white); font-size: 0.9rem; }
.prox-st-dist { color: var(--gold); font-size: 0.78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 760px) {
    .prox-layout { grid-template-columns: 1fr; }
    .prox-map { min-height: 260px; }
    .prox-panel { max-height: none; }
}

/* Bloc « Risques » (Géorisques + providers pays) — charte Vantage */
.detail-risks .risk-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.75rem;
}
.risk-group-head {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.11em;
    color: var(--grey-light); margin-bottom: 0.6rem;
}
.risk-item { display: flex; gap: 0.6rem; padding: 0.28rem 0; align-items: flex-start; }
.risk-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 0.4rem; flex: none; }
.risk-name { color: var(--white); font-size: 0.9rem; line-height: 1.3; }
.risk-status { color: var(--grey-mid); font-size: 0.76rem; margin-top: 0.05rem; }
.risk-footer {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    margin-top: 1.1rem; padding-top: 0.8rem; border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
}
.risk-source { color: var(--grey-mid); }
.risk-report-link { color: var(--gold); text-decoration: none; white-space: nowrap; }
.risk-report-link:hover { text-decoration: underline; }
@media (max-width: 760px) {
    .detail-risks .risk-cols { grid-template-columns: 1fr; }
}
.detail-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--grey-light);
    font-size: 0.88rem;
    flex-wrap: wrap;
}
.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Detail actions */
.detail-actions {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.detail-action-btn {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--grey-light);
    padding: 0.5rem 1.2rem;
    border-radius: 100px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.detail-action-btn:hover {
    color: var(--white);
    border-color: var(--border-hover);
}

/* Share dropdown */
.share-dropdown {
    position: relative;
}
.share-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 180px;
    z-index: 100;
    display: none;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.share-menu.open {
    display: block;
}
.share-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--grey-light);
    cursor: pointer;
    transition: background 0.15s;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}
.share-menu-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--white);
}

/* Detail sections */
.detail-section {
    margin-bottom: 2.5rem;
}
.detail-section-title {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--grey-mid);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}
.detail-description {
    color: var(--grey-light);
    font-size: 0.92rem;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* Features grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}
.feature-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.8rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.82rem;
    color: var(--grey-light);
}
.feature-icon {
    color: var(--gold);
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}
.feature-value {
    color: var(--white);
    font-weight: 600;
}

/* Energy bar */
.energy-bar {
    display: flex;
    gap: 2px;
    margin-bottom: 0.5rem;
}
.energy-class {
    flex: 1;
    padding: 0.4rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    opacity: 0.3;
    transition: opacity 0.2s;
}
.energy-class.active {
    opacity: 1;
    transform: scaleY(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.energy-A { background: #00B050; color: #fff; }
.energy-B { background: #5CB85C; color: #fff; }
.energy-C { background: #8BC34A; color: #fff; }
.energy-D { background: #FFC107; color: #000; }
.energy-E { background: #FF9800; color: #000; }
.energy-F { background: #FF5722; color: #fff; }
.energy-G { background: #F44336; color: #fff; }

/* Virtual tour */
.virtual-tour-frame {
    width: 100%;
    height: 400px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
}
.virtual-tour-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Detail map */
.detail-map {
    height: 380px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s;
}
.detail-map.expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 75vh;
    z-index: 9500;
    border-radius: 18px;
    cursor: default;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6);
}
.detail-map.expanded:hover { box-shadow: 0 32px 80px rgba(0,0,0,0.6); }
.detail-map-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 9400;
    animation: fadeUp 0.2s ease;
}
.detail-map-close {
    position: absolute;
    top: 14px;
    /* Décalé à gauche des contrôles de zoom MapLibre (coin haut-droit) */
    right: 64px;
    z-index: 9600;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--white);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.detail-map-close:hover { background: var(--gold); color: var(--black); border-color: var(--gold); }
.detail-map .maplibregl-ctrl-top-right { pointer-events: auto; }
.detail-map-expand-hint {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    background: rgba(5,5,5,0.7);
    color: var(--grey-light);
    font-size: 0.72rem;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    pointer-events: auto;
    cursor: pointer;
    letter-spacing: 0.03em;
    backdrop-filter: blur(6px);
    transition: background 0.2s, color 0.2s;
}
.detail-map-expand-hint:hover {
    background: rgba(5,5,5,0.9);
    color: var(--white);
}
/* Cibles tactiles confortables sur écrans sans hover */
@media (hover: none) {
    .detail-map-expand-hint {
        min-height: 40px;
        padding: 0.6rem 0.9rem;
    }
    .detail-map-close {
        width: 40px;
        height: 40px;
    }
}

/* Contact form (sidebar) */
.contact-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
}
.contact-agency-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.contact-agency-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--grey-dark);
}
.contact-agency-name {
    font-weight: 600;
    font-size: 0.92rem;
}
.contact-agency-phone {
    color: var(--grey-light);
    font-size: 0.82rem;
}
/* Bandeau préversion d'un brouillon (bouton Aperçu des dashboards) :
   texte à gauche, pill or « Retour au tableau de bord » à droite. */
.detail-preview-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    border: 1px dashed var(--gold);
    background: var(--gold-dim);
    color: var(--gold);
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    /* L'overlay détail démarre à top:0 : on passe SOUS la nav fixe (64px)
       avec les mêmes gouttières 5% que le reste du site. */
    margin: 84px 5% 1.25rem;
}
.detail-preview-banner .dash-back { margin: 0; flex-shrink: 0; }
.detail-preview-text { min-width: 0; }

/* Bloc agence cliquable -> page publique de l'agence */
a.contact-agency-info {
    color: inherit;
    text-decoration: none;
    margin: -0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    padding-bottom: 1rem;
    border-radius: 10px;
    transition: background 0.25s var(--ease-ui);
}
a.contact-agency-info:hover { background: rgba(255, 255, 255, 0.04); }
a.contact-agency-info:hover .contact-agency-name { color: var(--gold); }
.contact-agency-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.35rem;
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 600;
}
.contact-agency-cta::after {
    content: "\2192";
    transition: transform 0.25s var(--ease-ui);
}
a.contact-agency-info:hover .contact-agency-cta::after { transform: translateX(3px); }
.contact-form .form-group {
    margin-bottom: 1rem;
}
.contact-form .form-input,
.contact-form .form-textarea {
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
}
.contact-form .form-textarea {
    min-height: 100px;
    resize: vertical;
}
.char-counter {
    font-size: 0.72rem;
    color: var(--grey-mid);
    text-align: right;
    margin-top: 0.3rem;
}
.char-counter--max { color: var(--gold); }
.contact-form .btn-cta-gold {
    margin-top: 0.5rem;
}

/* Confirmation d'envoi : repli du formulaire puis « check » VANTAGE
   (réutilise .pc-circle/.pc-check + @keyframes pcDraw/pubPop de main.css) */
.contact-form.is-folding {
    overflow: hidden;
    transition: height 0.42s var(--ease-out), opacity 0.3s ease;
}
.contact-sent {
    text-align: center;
    padding: 1.25rem 0.5rem 0.5rem;
    animation: pubPop 0.5s var(--ease-out);
}
.contact-sent-ico {
    width: 72px;
    height: 72px;
    display: block;
    margin: 0 auto 1rem;
    fill: none;
}
.contact-sent-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--white);
    margin-bottom: 0.45rem;
}
.contact-sent-sub {
    color: var(--grey-light);
    font-size: 0.9rem;
    line-height: 1.55;
}
.contact-sent-agency {
    color: var(--gold);
    font-weight: 600;
}

/* Similar listings */
.similar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.similar-grid .listing-card .card-carousel {
    height: 140px;
}
.similar-grid .card-info {
    padding: 0.8rem 1rem;
}
.similar-grid .card-price {
    font-size: 1.05rem;
}

/* ===============================================
   MOBILE FILTER DRAWER
=============================================== */
.mobile-filter-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70vh;
    background: var(--black-elevated);
    border-top: 1px solid var(--border-color);
    border-radius: 24px 24px 0 0;
    z-index: 9500;
    transform: translateY(100%);
    transition: transform 0.4s var(--ease-spring);
    overflow-y: auto;
    padding: 0 1.5rem 2rem;
}
.mobile-filter-drawer.open {
    transform: translateY(0);
}
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
    font-weight: 600;
    font-size: 1.1rem;
    position: sticky;
    top: 0;
    background: var(--black-elevated);
    z-index: 1;
}
.drawer-close {
    background: none;
    border: none;
    color: var(--grey-light);
    font-size: 1.5rem;
    cursor: pointer;
}
.drawer-filters {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.drawer-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey-mid);
    margin-bottom: 0.5rem;
}
.mobile-filter-btn {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: var(--black);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    z-index: 8500;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(201, 169, 110, 0.3);
}

/* ===============================================
   RESPONSIVE
=============================================== */
@media (max-width: 1024px) {
    .listings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .detail-content {
        grid-template-columns: 1fr;
    }
    .detail-sidebar {
        position: static;
    }
    .detail-gallery {
        height: 56vh;
        min-height: 360px;
    }
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .similar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .map-sidebar {
        width: 45%;
    }
}

@media (max-width: 768px) {
    .listings-page {
        padding-left: 4%;
        padding-right: 4%;
    }
    .pill,
    .filter-dropdown-btn {
        min-height: 44px;
    }
    .listings-grid {
        grid-template-columns: 1fr;
    }
    .filters-row {
        display: none;
    }
    .mobile-filter-btn {
        display: flex;
    }
    .listings-map-container {
        flex-direction: column-reverse;
        height: calc(100vh - 200px);
    }
    .map-sidebar {
        width: 100%;
        height: 200px;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.5rem;
    }
    .map-sidebar .listing-card {
        min-width: 260px;
    }
    /* Le bandeau de cartes du mode carte défile HORIZONTALEMENT ici : le
       pan-y des carousels rendrait ce défilement impossible depuis les photos. */
    .map-sidebar .card-carousel {
        touch-action: auto;
    }
    .map-view {
        flex: 1;
    }
    .detail-gallery {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        height: 280px;
        gap: 0;
    }
    .detail-gallery img {
        min-width: 100%;
        scroll-snap-align: start;
    }
    .detail-content {
        padding: 1.5rem 4%;
        gap: 2rem;
    }
    .detail-title {
        font-size: 1.5rem;
    }
    .detail-price {
        font-size: 1.4rem;
    }
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .similar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .view-toggle {
        display: none;
    }
}

@media (max-width: 500px) {
    .card-carousel {
        height: 180px;
    }
    .similar-grid {
        grid-template-columns: 1fr;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .detail-gallery {
        height: 220px;
        margin-top: 64px;
    }
}

/* ===============================================
   CHARGEMENT D'IMAGES 2026-07-18 — apparition en fondu
   Le JS (smoothLoad) pose img-load à la création puis img-in une fois
   l'image décodée ; le conteneur porte img-wait pendant l'attente.
   (En fin de fichier : ces règles gagnent les égalités de spécificité.)
=============================================== */
img.img-load {
    opacity: 0;
}
img.img-load.img-in {
    opacity: 1;
    transition: opacity 0.45s ease;
}
/* La galerie garde son voile au survol malgré la règle img-in ci-dessus */
.detail-gallery img.img-load.img-in:hover {
    opacity: 0.85;
}
/* Fond stable sous les photos le temps du chargement */
.detail-gallery {
    background: var(--black-elevated);
}
/* Monogramme discret derrière les photos de carte (visible pendant l'attente) */
.card-carousel::before {
    content: 'V';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.4rem;
    color: rgba(201, 169, 110, 0.16);
    pointer-events: none;
}
/* Reflet qui balaie le placeholder tant qu'une image charge */
.img-wait::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.05) 50%, transparent 65%);
    background-size: 220% 100%;
    animation: imgSheen 1.6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes imgSheen {
    from { background-position: 130% 0; }
    to   { background-position: -90% 0; }
}
/* Lightbox : anneau de chargement plutôt qu'un reflet plein écran */
.detail-lightbox.img-wait::after {
    display: none;
}
.detail-lightbox.img-wait::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
    img.img-load { opacity: 1; }
    img.img-load.img-in { transition: none; }
    .img-wait::after { animation: none; background: none; }
}
