/* Barre « Filtrer la carte » de l'accueil (assets/js/map-filters.js) — D.A turquoise */
.map-section { scroll-margin-top: 90px; }

.mf-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .9rem;
}
.mf-head .map-title { margin-bottom: 0; }

.mf-count {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .8rem;
    border-radius: 999px;
    background: #e6f8f6;
    color: #0b5f57;
    font-weight: 700;
    font-size: .88rem;
    white-space: nowrap;
}
.mf-count::before {
    content: "";
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: #2EC4B6;
}
.mf-count.is-loading::before { animation: mfPulse 1s ease-in-out infinite; }
.mf-count.is-empty { background: #fff4e5; color: #9a5b00; }
.mf-count.is-empty::before { background: #f5a524; }

/* ---------- Conteneur ---------- */
.mf {
    position: relative;
    z-index: 5;
    background: #f4fbfa;
    border: 1px solid rgba(46, 196, 182, .28);
    border-bottom: none;
    border-radius: 1rem 1rem 0 0;
    padding: .85rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.mf + #map,
.mf ~ #map {
    border-radius: 0 0 12px 12px;
    border: 1px solid rgba(46, 196, 182, .28);
    border-top: 2px solid #2EC4B6;
}
.mf.mf-flash { animation: mfFlash 1.2s ease; }

.mf-ico { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }

/* ---------- Ligne principale : ville + autour de moi ---------- */
.mf-main { display: flex; gap: .6rem; align-items: stretch; }

.mf-where {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #fff;
    border: 1.5px solid #cfe9e6;
    border-radius: .8rem;
    padding: 0 .4rem 0 .8rem;
    color: #0f766e;
    transition: border-color .15s, box-shadow .15s;
}
.mf-where:focus-within { border-color: #2EC4B6; box-shadow: 0 0 0 3px rgba(46, 196, 182, .2); }
.mf-has-place .mf-where { border-color: #2EC4B6; background: #fff; }
.mf-need-place .mf-where { animation: mfNudge .45s ease; border-color: #f5a524; box-shadow: 0 0 0 3px rgba(245, 165, 36, .2); }

.mf-city {
    flex: 1;
    min-width: 0;
    border: none !important;
    outline: none;
    background: transparent !important;
    padding: .7rem 0 !important;
    font-size: 1rem;
    font-weight: 600;
    color: #12352f;
    box-shadow: none !important;
}
.mf-city:focus,
.mf-city:focus-visible,
.mf-price-field input:focus,
.mf-price-field input:focus-visible { outline: none !important; box-shadow: none !important; }
.mf-city::placeholder { color: #7a8f8c; font-weight: 500; }

.mf-city-clear {
    border: none;
    background: #e6f2f1;
    color: #0b5f57;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.mf-city-clear:hover { background: #d3ebe8; }

.mf-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    margin: 0;
    padding: .35rem;
    list-style: none;
    background: #fff;
    border: 1px solid #d6ecea;
    border-radius: .8rem;
    box-shadow: 0 14px 34px rgba(11, 95, 87, .18);
    max-height: 290px;
    overflow-y: auto;
    z-index: 1100;
}
.mf-suggest-item {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    padding: .55rem .7rem;
    border-radius: .55rem;
    cursor: pointer;
}
.mf-suggest-item strong { color: #12352f; font-size: .95rem; }
.mf-suggest-item span { color: #6b7f7c; font-size: .8rem; }
.mf-suggest-item:hover,
.mf-suggest-item.is-active { background: #e6f8f6; }
.mf-suggest-msg { padding: .6rem .7rem; color: #6b7f7c; font-size: .9rem; }

.mf-locate,
.mf-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    flex-shrink: 0;
    border-radius: .8rem;
    padding: 0 1rem;
    font-weight: 700;
    font-size: .92rem;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.mf-locate {
    border: 1.5px solid #2EC4B6;
    background: #fff;
    color: #0f766e;
}
.mf-locate:hover { background: #e6f8f6; }
.mf-locate:active, .mf-more:active { transform: scale(.97); }
.mf-locate.is-busy .mf-ico { animation: mfSpin 1s linear infinite; }
.mf-locate.is-error { border-color: #f5a524; color: #9a5b00; }

.mf-more {
    display: none;
    position: relative;
    border: 1.5px solid #cfe9e6;
    background: #fff;
    color: #0b5f57;
}
.mf-more[aria-expanded="true"] { background: #0f766e; border-color: #0f766e; color: #fff; }
.mf-more-count {
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 .3rem;
    border-radius: 999px;
    background: #2EC4B6;
    color: #fff;
    font-size: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.mf-more-count[hidden] { display: none; }
.mf-more[aria-expanded="true"] .mf-more-count { background: #fff; color: #0f766e; }

/* ---------- Panneau : rayon, budget, catégories ---------- */
.mf-panel { display: flex; flex-direction: column; gap: .75rem; }
.mf-row { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: flex-start; }
.mf-group { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.mf-label {
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #4f7a75;
}

.mf-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.mf-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    border: 1.5px solid #d6ecea;
    background: #fff;
    color: #24423e;
    border-radius: 999px;
    padding: .38rem .8rem;
    font-size: .86rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s;
}
.mf-chip:hover { border-color: #2EC4B6; }
.mf-chip.is-on {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}
.mf-chip:focus-visible,
.mf-locate:focus-visible,
.mf-more:focus-visible,
.mf-tag:focus-visible,
.mf-reset:focus-visible { outline: 3px solid rgba(46, 196, 182, .45); outline-offset: 2px; }

/* Rayon sans ville : estompé, un clic renvoie vers le champ ville */
.mf:not(.mf-has-place) .mf-radius .mf-chip { opacity: .55; }

.mf-price { display: flex; align-items: center; gap: .4rem; }
.mf-price-field {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    background: #fff;
    border: 1.5px solid #d6ecea;
    border-radius: .65rem;
    padding: 0 .6rem;
    margin: 0;
}
.mf-price-field:focus-within { border-color: #2EC4B6; }
.mf-price-field input {
    width: 4.5rem;
    border: none !important;
    outline: none;
    background: transparent !important;
    padding: .4rem 0 !important;
    font-size: .9rem;
    font-weight: 600;
    color: #12352f;
    box-shadow: none !important;
    -moz-appearance: textfield;
}
.mf-price-field input::-webkit-outer-spin-button,
.mf-price-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mf-price-field span { color: #6b7f7c; font-weight: 600; }
.mf-price-sep { color: #6b7f7c; }

/* ---------- Filtres actifs ---------- */
.mf-active {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding-top: .65rem;
    border-top: 1px dashed rgba(46, 196, 182, .4);
}
.mf-active[hidden] { display: none; }
.mf-active-list { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1; min-width: 0; }
.mf-tag {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border: none;
    background: #2EC4B6;
    color: #fff;
    border-radius: 999px;
    padding: .3rem .45rem .3rem .75rem;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    max-width: 100%;
}
.mf-tag > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-tag-x {
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, .25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    line-height: 1;
    flex-shrink: 0;
}
.mf-tag:hover { background: #26ab9f; }
.mf-reset {
    flex-shrink: 0;
    border: none;
    background: none;
    color: #0f766e;
    font-weight: 700;
    font-size: .86rem;
    text-decoration: underline;
    cursor: pointer;
    padding: .3rem .2rem;
}

/* ---------- Carte : chargement et état vide (assets/js/map.js) ---------- */
#map.map-loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 1000;
    background: linear-gradient(90deg, transparent, #2EC4B6, transparent);
    background-size: 50% 100%;
    background-repeat: no-repeat;
    animation: mfLoad 1s linear infinite;
}
.map-empty-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    max-width: min(340px, 86%);
    background: rgba(255, 255, 255, .96);
    color: #24423e;
    border: 1px solid #d6ecea;
    border-radius: .9rem;
    padding: .9rem 1.1rem;
    text-align: center;
    font-weight: 600;
    font-size: .92rem;
    box-shadow: 0 10px 30px rgba(11, 95, 87, .18);
    pointer-events: none;
}
.map-empty-overlay[hidden] { display: none; }

/* ---------- Mobile : rayon, budget et catégories repliés derrière « Filtres » ---------- */
@media (max-width: 700px) {
    :is(body.page-accueil, body.page-index) .map-section { padding: 1rem .75rem; }
    .mf { padding: .65rem; gap: .6rem; }
    .mf-where { padding-left: .65rem; }
    .mf-head { margin-bottom: .7rem; }
    .mf-more { display: inline-flex; padding: 0 .75rem; }
    .mf-locate { padding: 0 .75rem; }
    .mf-locate span { display: none; }
    .mf-panel { display: none; }
    .mf.mf-open .mf-panel { display: flex; }
    .mf-row { gap: .75rem; }
    .mf-row .mf-group { width: 100%; }
    .mf-cats,
    .mf-radius {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        margin: 0 -.65rem;
        padding: 0 .65rem .15rem;
    }
    .mf-cats::-webkit-scrollbar,
    .mf-radius::-webkit-scrollbar { display: none; }
    .mf-price-field { flex: 1; }
    .mf-price-field input { width: 100%; }
}
@media (max-width: 420px) {
    .mf-main { gap: .4rem; }
    .mf-more span:not(.mf-more-count) { display: none; }
    .mf-locate, .mf-more { padding: 0 .65rem; }
}

@keyframes mfPulse { 50% { opacity: .3; } }
@keyframes mfSpin { to { transform: rotate(360deg); } }
@keyframes mfNudge { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes mfFlash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 4px rgba(46, 196, 182, .35); } }
@keyframes mfLoad { from { background-position: -50% 0; } to { background-position: 150% 0; } }
@media (prefers-reduced-motion: reduce) {
    .mf *, .mf, #map.map-loading::after { animation: none !important; }
}
