/**
 * BM Annuaire — carte.css
 * Page « Carte des prestataires » : carte Leaflet plein écran + panneau filtrable
 * + recherche par rayon. Design Claude Design 2026 (tokens BM ardoise/framboise,
 * Margot lavande). Classes préfixées bmc- pour éviter toute collision. Verrous
 * !important ponctuels = anti-fuite du thème hôte là où il bave réellement.
 */

/* ---------- layout pleine hauteur ---------- */
.bmc-page { display: grid; grid-template-columns: 412px 1fr; height: calc(100vh - 68px); min-height: 540px; border-top: 1px solid var(--border-subtle, #e7e2da); }

/* ---------- panneau gauche ---------- */
.bmc-panel { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border-subtle, #e7e2da); background: var(--bg-page, #fff); }
.bmc-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--border-subtle, #e7e2da); }
.bmc-head h1 { font-size: 23px; letter-spacing: -.02em; margin: 0 0 2px; }
.bmc-count { font-size: 13.5px; color: var(--text-secondary, #6f6a62); margin: 4px 0 0; }
.bmc-count strong { color: var(--ardoise-700, #3f5b8c); font-variant-numeric: tabular-nums; }
.bmc-scroll { overflow-y: auto; overflow-x: hidden; padding: 18px 18px 26px; min-height: 0; flex: 1 1 auto; scrollbar-width: thin; }

/* ---------- bloc PHARE rayon ---------- */
.bmc-radius { background: var(--bg-elevated, #fff); border: 1.5px solid var(--framboise-300, #e3a3bb); border-radius: var(--r-lg, 16px); box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,.06)); overflow: hidden; margin-bottom: 16px; }
.bmc-radius .bmc-rtop { background: linear-gradient(180deg, var(--framboise-tint, #f9e8ef), var(--bg-elevated, #fff)); padding: 15px 16px 14px; }
.bmc-radius h2 { font-size: 16.5px; line-height: 1.25; margin: 0; }
.bmc-radius h2 .hl { color: var(--framboise-700, #a23c61); }
.bmc-radius .bmc-rsub { font-size: 12.5px; color: var(--text-secondary, #6f6a62); margin: 4px 0 0; }
.bmc-rbody { padding: 0 16px 15px; }
.bmc-floc { position: relative; margin-top: 13px; }
.bmc-rlabel { font-size: 12px; font-weight: 600; color: var(--text-secondary, #6f6a62); margin: 13px 0 0; }
.bmc-rlabel strong { color: var(--framboise-700, #a23c61); font-variant-numeric: tabular-nums; }
.bmc-chips-r { display: flex; gap: 7px; margin-top: 9px; }
.bmc-chip-r { flex: 1; min-height: 40px; border: 1.5px solid var(--border-strong, #d8d2c8); background: var(--bg-elevated, #fff); border-radius: 10px; font-family: inherit; font-weight: 700; font-size: 14px; color: #45505f; cursor: pointer; font-variant-numeric: tabular-nums; transition: border-color .12s, background .12s, color .12s; }
.bmc-chip-r:hover { border-color: var(--framboise-300, #e3a3bb); }
.bmc-chip-r[aria-pressed="true"] { background: var(--framboise-500, #c4527a); border-color: var(--framboise-500, #c4527a); color: #fff; }
.bmc-radius .bmc-rgo { margin-top: 14px; width: 100%; }

/* bandeau rayon actif */
.bmc-rbanner { display: none; background: var(--ardoise-tint, #eaeef7); border: 1.5px solid var(--ardoise-300, #9fb0d0); border-radius: var(--r-md, 12px); padding: 11px 13px; margin-bottom: 14px; }
.bmc-rbanner.on { display: block; }
.bmc-rbanner .row { display: flex; align-items: center; gap: 8px; }
.bmc-rbanner svg { flex: none; }
.bmc-rbanner .txt { font-size: 13.5px; color: var(--ardoise-900, #27395c); line-height: 1.35; }
.bmc-rbanner .clr { margin-left: auto; flex: none; background: transparent; border: none; color: var(--ardoise-700, #3f5b8c); font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; text-decoration: underline; text-underline-offset: 2px; padding: 4px; }

/* ---------- barre de filtres ---------- */
.bmc-filters { position: sticky; top: -18px; z-index: 5; background: var(--bg-page, #fff); padding-top: 2px; padding-bottom: 10px; margin-bottom: 6px; }
.bmc-fname { margin-bottom: 9px; min-height: 42px; }
.bmc-fname svg { flex: none; }
.bmc-frow { display: flex; gap: 7px; flex-wrap: wrap; }
.bmc-frow + .bmc-frow { margin-top: 7px; }
.bmc-sel { position: relative; flex: 1 1 auto; min-width: 0; }
.bmc-sel select { -webkit-appearance: none; appearance: none; width: 100%; min-height: 40px; padding: 8px 30px 8px 12px; background: var(--bg-elevated, #fff); border: 1.5px solid var(--border-strong, #d8d2c8); border-radius: 10px; font-family: inherit; font-size: 13.5px; font-weight: 600; color: #45505f; cursor: pointer; }
.bmc-sel select:focus { border-color: var(--ardoise-700, #3f5b8c); outline: none; box-shadow: 0 0 0 3px rgba(63,91,140,.16); }
.bmc-sel::after { content: '▾'; position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--framboise-500, #c4527a); font-size: 12px; pointer-events: none; }
.bmc-list-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 13px; border: 1.5px solid var(--framboise-500, #c4527a); border-radius: 999px; background: var(--bg-elevated, #fff); color: var(--framboise-700, #a23c61); font-size: 13px; font-weight: 700; text-decoration: none; }
.bmc-list-cta:hover, .bmc-list-cta:focus { background: var(--framboise-500, #c4527a); color: #fff; }
.bmc-list-cta svg { flex: none; }
.bmc-cap-row[hidden] { display: none; }
.bmc-cap-note { flex: 1 1 100%; margin: 4px 2px 0; font-size: 12px; line-height: 1.35; color: var(--text-secondary, #6f6a62); }
.bmc-cap-note[hidden] { display: none; }
.bmc-seg { display: flex; background: var(--bg-sand, #f3efe7); border-radius: 10px; padding: 3px; flex: 1 1 auto; }
.bmc-seg button { flex: 1; min-height: 34px; border: none; background: transparent; border-radius: 8px; font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--text-secondary, #6f6a62); cursor: pointer; white-space: nowrap; }
.bmc-seg button[aria-pressed="true"] { background: var(--bg-elevated, #fff); color: var(--framboise-700, #a23c61); box-shadow: 0 1px 4px rgba(39,57,92,.1); }

/* puces de filtre actives */
.bmc-chips { display: none; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bmc-chips.on { display: flex; }
.bmc-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--ardoise-tint, #eaeef7); color: var(--ardoise-700, #3f5b8c); border-radius: var(--r-full, 999px); padding: 5px 9px 5px 12px; font-size: 12.5px; font-weight: 600; }
.bmc-chip button { border: none; background: transparent; color: var(--ardoise-700, #3f5b8c); font-size: 13px; cursor: pointer; line-height: 1; padding: 2px; border-radius: 50%; font-family: inherit; }
.bmc-chip button:hover { background: rgba(63,91,140,.16); }
.bmc-reset { background: transparent; border: none; color: var(--framboise-700, #a23c61); font-weight: 700; font-size: 12.5px; cursor: pointer; font-family: inherit; text-decoration: underline; text-underline-offset: 2px; padding: 5px 4px; }

/* ---------- liste ---------- */
.bmc-list { display: flex; flex-direction: column; gap: 9px; }
.bmc-card { display: flex; gap: 12px; background: var(--bg-elevated, #fff); border: 1px solid var(--border-subtle, #e7e2da); border-radius: var(--r-md, 12px); padding: 10px; text-decoration: none !important; color: inherit !important; transition: border-color .12s, box-shadow .12s; }
.bmc-card:hover, .bmc-card.hot { border-color: var(--ardoise-300, #9fb0d0); box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,.06)); }
.bmc-card[hidden] { display: none; }
.bmc-card .thumb { flex: none; width: 76px; height: 76px; border-radius: 10px; object-fit: cover; background: var(--framboise-tint, #f9e8ef); }
.bmc-card .thumb.vide { display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--framboise-500, #c4527a); }
.bmc-card .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bmc-card .meta { font-size: 11.5px; color: var(--text-muted, #8a8579); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bmc-card .ptag { color: var(--framboise-700, #a23c61); font-weight: 700; }
.bmc-card .nm { font-family: var(--font-display, inherit); font-weight: 600; font-size: 15.5px; color: var(--text-primary, #2a2722); margin: 3px 0; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bmc-card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.bmc-card .price { color: #45505f; }
.bmc-card .price strong { color: var(--text-primary, #2a2722); font-variant-numeric: tabular-nums; }
.bmc-card .price.none { color: var(--text-muted, #8a8579); font-style: italic; }
.bmc-card .stars { color: var(--framboise-500, #c4527a); white-space: nowrap; letter-spacing: .5px; }
.bmc-card .stars .rev { color: var(--text-muted, #8a8579); }
.bmc-card .dist { flex: none; align-self: flex-start; background: var(--ardoise-tint, #eaeef7); color: var(--ardoise-700, #3f5b8c); font-weight: 700; font-size: 11px; padding: 2px 8px; border-radius: var(--r-full, 999px); font-variant-numeric: tabular-nums; }

/* liste vide */
.bmc-empty { display: none; text-align: center; padding: 30px 18px; }
.bmc-empty.on { display: block; }
.bmc-empty .ico { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 14px; background: var(--warning-tint, #fbf0d8); display: flex; align-items: center; justify-content: center; }
.bmc-empty h3 { font-size: 17px; margin-bottom: 6px; }
.bmc-empty p { font-size: 13.5px; color: var(--text-secondary, #6f6a62); max-width: 30ch; margin: 0 auto 14px; }

/* Margot lavande */
.bmc-margot { display: flex; gap: 11px; align-items: flex-start; background: #efeaf7; border-left: 4px solid #6f5aa6; border-radius: 0 13px 13px 0; padding: 12px 14px; }
.bmc-margot.foot { margin-top: 16px; }
.bmc-margot .spark { flex: none; width: 26px; height: 26px; border-radius: 8px; background: #6f5aa6; display: flex; align-items: center; justify-content: center; }
.bmc-margot .lab { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #6f5aa6; margin: 0 0 3px; }
.bmc-margot p { font-size: 13px; line-height: 1.5; color: #4a3a73; margin: 0; }
.bmc-margot a { color: #5a4690; font-weight: 700; }

/* ---------- carte (Leaflet) ---------- */
.bmc-map { position: relative; min-width: 0; background: var(--ardoise-tint, #eaeef7); }
.bmc-map .leaflet-container { position: absolute; inset: 0; height: 100%; width: 100%; font: inherit; background: #e9eef3; }

/* marqueur goutte (divIcon) */
.bmc-pin { position: relative; display: block; width: 30px; height: 30px; }
.bmc-pin .drop { position: absolute; inset: 0; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 4px 9px rgba(27,36,51,.5); transition: transform .12s; }
.bmc-pin.standard .drop { background: var(--ardoise-500, #5872a3); }
.bmc-pin.prestige .drop { background: var(--framboise-500, #c4527a); }
.bmc-pin .sym { position: absolute; top: 0; left: 0; width: 100%; height: 70%; display: flex; align-items: center; justify-content: center; color: #fff; line-height: 1; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.4); pointer-events: none; }
.bmc-pin.prestige .sym { font-size: 14px; }
.bmc-pin.standard .sym { font-size: 11px; }
.bmc-pin.hot { z-index: 1000 !important; }
.bmc-pin.hot .drop { transform: rotate(-45deg) scale(1.32); box-shadow: 0 7px 16px rgba(27,36,51,.55); }
.bmc-cluster { width: 42px; height: 42px; border-radius: 50%; background: var(--ardoise-900, #27395c); color: #fff; border: 3px solid rgba(255,255,255,.92); box-shadow: 0 4px 13px rgba(27,36,51,.5), 0 0 0 6px rgba(63,91,140,.18); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.bmc-venue .vp { width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--framboise-600, #b34770); border: 3px solid #fff; box-shadow: 0 5px 14px rgba(162,60,97,.45); display: flex; align-items: center; justify-content: center; }
.bmc-venue .vp svg { transform: rotate(45deg); }

/* popup Leaflet (façon carte Claude Design) */
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: 0 12px 32px rgba(27,36,51,.26); padding: 0; overflow: hidden; }
.leaflet-popup-content { margin: 0; width: 224px !important; }
.leaflet-popup-close-button { z-index: 3; color: #fff !important; right: 6px !important; top: 6px !important; width: 24px !important; height: 24px !important; background: rgba(27,36,51,.45) !important; border-radius: 50%; line-height: 22px !important; font-size: 16px !important; }
.bmc-pop { display: block; text-decoration: none !important; color: inherit !important; }
.bmc-pop .ptop { display: block; position: relative; height: 104px; background: linear-gradient(135deg, var(--framboise-tint, #f9e8ef), var(--ardoise-tint, #eaeef7)); overflow: hidden; }
.bmc-pop .pimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; border: 0; }
.bmc-pop .pbadge { position: absolute; top: 8px; left: 8px; z-index: 2; background: var(--framboise-500, #c4527a); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 999px; box-shadow: 0 2px 6px rgba(162,60,97,.4); }
.bmc-pop .pbody { display: block; padding: 11px 13px 13px; }
.bmc-pop .meta { display: block; font-size: 11px; color: var(--text-muted, #8a8579); }
.bmc-pop .nm { display: block; font-family: var(--font-display, inherit); font-weight: 600; font-size: 15.5px; margin: 2px 0 8px; color: var(--text-primary, #2a2722); line-height: 1.2; }
.bmc-pop .pfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bmc-pop .price { font-size: 12.5px; color: #45505f; }
.bmc-pop .price strong { color: var(--text-primary, #2a2722); font-variant-numeric: tabular-nums; }
.bmc-pop .go { background: var(--framboise-500, #c4527a); color: #fff !important; border-radius: 999px; padding: 7px 13px; font-size: 12.5px; font-weight: 700; text-decoration: none !important; white-space: nowrap; box-shadow: 0 4px 12px rgba(196,82,122,.3); }

/* légende + chargement */
.bmc-legend { position: absolute; left: 14px; bottom: 14px; z-index: 600; background: rgba(255,255,255,.94); backdrop-filter: blur(4px); border-radius: 10px; box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,.08)); padding: 9px 12px; font-size: 11.5px; color: var(--text-secondary, #6f6a62); display: flex; gap: 14px; flex-wrap: wrap; }
.bmc-legend .item { display: flex; align-items: center; gap: 6px; }
.bmc-legend .dot { width: 12px; height: 12px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 1.5px solid #fff; }
.bmc-loading { position: absolute; inset: 0; z-index: 700; background: var(--ardoise-tint, #eaeef7); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; color: var(--ardoise-700, #3f5b8c); }
.bmc-loading.off { display: none; }
.bmc-loading .sk { width: 34px; height: 34px; border: 3px solid rgba(63,91,140,.25); border-top-color: var(--ardoise-700, #3f5b8c); border-radius: 50%; animation: bmc-spin 1s linear infinite; }
.bmc-loading span { font-size: 13.5px; font-weight: 600; }
@keyframes bmc-spin { to { transform: rotate(360deg); } }

/* ---------- bascule + sheet (tablette/mobile) ---------- */
.bmc-toggle { display: none; }
.bmc-topbar { display: none; }
.bmc-fab { display: none; }

/* tablette + mobile : la carte occupe tout l'espace, le panneau se superpose.
   .bmc-page passe en display:block (la grille créait une ligne de 0px car le
   panneau, en absolu, sortait du flux) et la carte est posée en absolu. */
@media (max-width: 1023px) {
	.bmc-page { display: block; position: relative; }
	.bmc-map { position: absolute; inset: 0; }
	.bmc-panel { position: absolute; top: 0; left: 0; bottom: 0; width: min(420px, 88%); z-index: 600; box-shadow: var(--shadow-lg, 0 12px 40px rgba(0,0,0,.18)); transition: transform .26s ease; }
	body.bmc-show-map .bmc-panel { transform: translateX(-101%); }
	.bmc-toggle { display: flex; position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 650; background: var(--bg-elevated, #fff); border-radius: var(--r-full, 999px); box-shadow: var(--shadow-md, 0 6px 18px rgba(0,0,0,.14)); padding: 4px; gap: 2px; }
	.bmc-toggle button { min-height: 40px; padding: 0 20px; border: none; background: transparent; border-radius: var(--r-full, 999px); font-family: inherit; font-weight: 700; font-size: 14px; color: var(--text-secondary, #6f6a62); cursor: pointer; }
	.bmc-toggle button[aria-pressed="true"] { background: var(--ardoise-700, #3f5b8c); color: #fff; }
	.bmc-legend { display: none; }
}

/* mobile : panneau en feuille montante (fixée au bas du viewport) */
@media (max-width: 640px) {
	.bmc-page { height: calc(100vh - 60px); }
	.bmc-toggle { display: none; }
	.bmc-panel { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: 86vh; z-index: 1000; border-radius: 18px 18px 0 0; border-right: none; transform: translateY(100%); }
	body.bmc-sheet-open .bmc-panel { transform: translateY(0); }
	.bmc-panel::before { content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 42px; height: 5px; border-radius: 999px; background: var(--border-strong, #d8d2c8); }
	.bmc-head { padding-top: 22px; }
	.bmc-topbar { display: flex; position: absolute; top: 12px; left: 12px; right: 12px; z-index: 500; gap: 8px; align-items: center; }
	.bmc-topbar .loc { flex: 1; min-height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: var(--bg-elevated, #fff); border: 1.5px solid var(--border-strong, #d8d2c8); border-radius: 12px; box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,.1)); font-size: 14px; color: var(--text-muted, #8a8579); font-family: inherit; text-align: left; }
	.bmc-fab { display: inline-flex; position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 500; min-height: 50px; padding: 0 24px; border-radius: 999px; border: none; background: var(--framboise-500, #c4527a); color: #fff; font-family: inherit; font-weight: 700; font-size: 15px; align-items: center; gap: 9px; box-shadow: 0 10px 26px rgba(196,82,122,.42); }
	body.bmc-sheet-open .bmc-fab, body.bmc-sheet-open .bmc-topbar { display: none; }
	.bmc-sheet-close { display: inline-flex; }
}
.bmc-sheet-close { display: none; align-items: center; justify-content: center; position: absolute; top: 16px; right: 14px; z-index: 5; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--bg-sand, #f3efe7); color: var(--text-secondary, #6f6a62); font-size: 16px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
	.bmc-panel { transition: none; }
	.bmc-loading .sk { animation: none; }
}
