/* Carte du quartier (prefixe bmap) - composant isole. Prefixe .bmap, .pin, .route-chip (jamais .carte: pris par brand.css). Aucun selecteur global. */

.bmap {
  --c-pink: var(--bougainvillier, #C42A6B);
  --c-pink-d: var(--bougainvillier-fonce, #A81F59);
  --c-pink-l: var(--bougainvillier-clair, #F3A6C4);
  --c-ink: var(--encre, #1A1430);
  --c-ink2: var(--encre-2, #4E4A5E);
  --c-dusk: var(--crepuscule, #331329);
  --c-day: var(--matin, #EEF1E8);
  --c-blush: var(--bg-primary, #F6E4EC);
  --c-sky: #BCD6E4;
  --c-paper: #F8F9F3;
  --c-line: rgba(26, 20, 48, .14);
  --f-display: var(--display, "Oranienbaum", "Noto Serif", Georgia, serif);
  --f-text: var(--text, "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif);
  --peek: 176px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 392px) minmax(0, 1fr);
  height: min(80vh, 780px);
  min-height: 560px;
  overflow: hidden;
  background: var(--c-sky);
  border: 1px solid var(--c-line);
  border-radius: 6px;
  color: var(--c-ink);
  font-family: var(--f-text);
  font-size: 15px;
  line-height: 1.5;
  isolation: isolate;
}
.bmap *, .bmap *::before, .bmap *::after { box-sizing: border-box; }

/* ---------- Panneau (liste) ---------- */
.bmap__panel {
  grid-column: 1; grid-row: 1;
  display: flex; flex-direction: column;
  min-height: 0;
  background: var(--c-paper);
  border-inline-end: 1px solid var(--c-line);
  z-index: 2;
}
.bmap__poignee { display: none; }
.bmap__head { padding: 24px 24px 10px; }
.bmap__titre {
  margin: 0;
  font-family: var(--f-display); font-weight: 400;
  font-size: 1.9rem; line-height: 1.1; letter-spacing: -.01em;
  color: var(--c-ink);
}
.bmap__lede { margin: 6px 0 0; color: var(--c-ink2); font-size: .9rem; }

.bmap__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 24px 14px; margin: 0; list-style: none; }
.bmap__chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 5px 12px 5px 9px;
  font: 500 .8rem/1 var(--f-text); color: var(--c-ink);
  background: #fff; border: 1px solid var(--c-line); border-radius: 999px;
  cursor: pointer; white-space: nowrap;
  transition: background .18s, color .18s, border-color .18s;
}
.bmap__chip svg { width: 15px; height: 15px; flex: none; }
.bmap__chip small { font-size: .72rem; opacity: .7; font-variant-numeric: tabular-nums; }
.bmap__chip:hover { border-color: var(--c-pink); }
.bmap__chip[aria-pressed="true"] { background: var(--c-pink); border-color: var(--c-pink); color: #fff; }
.bmap__chip[aria-pressed="true"] small { opacity: .85; }

.bmap__scroll {
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 0 14px 20px;
  scrollbar-width: thin; scrollbar-color: var(--c-pink-l) transparent;
}

/* Carte chauffeur */
.bmap__driver {
  display: block; width: 100%; margin: 0 0 6px;
  padding: 14px 16px;
  text-align: start; cursor: pointer;
  font: inherit; color: #FFF2F7;
  background: linear-gradient(135deg, var(--c-dusk), #4a1c3b);
  border: 0; border-radius: 12px;
  position: relative; overflow: hidden;
}
.bmap__driver::after {
  content: ""; position: absolute; inset-inline-end: -26px; top: -26px; width: 92px; height: 92px;
  border-radius: 50%; border: 1px solid rgba(243, 166, 196, .35);
  box-shadow: 0 0 0 12px rgba(243, 166, 196, .08);
}
.bmap__driver b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 1.15rem; color: #fff; }
.bmap__driver span { display: block; margin-top: 2px; font-size: .8rem; color: var(--c-pink-l); }
.bmap__driver:hover { filter: brightness(1.12); }

.bmap__group { margin: 16px 0 0; padding: 0; }
.bmap__group[hidden] { display: none; }
.bmap__ghead {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 0 4px; padding: 0 10px;
  font: 600 .68rem/1.2 var(--f-text); letter-spacing: .14em; text-transform: uppercase;
  color: var(--c-ink2);
}
.bmap__ghead span { font-weight: 500; letter-spacing: 0; opacity: .75; }
.bmap__ul { list-style: none; margin: 0; padding: 0; }
.bmap__ul li[hidden] { display: none; }

.bmap__item {
  display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: center;
  width: 100%; padding: 9px 10px; margin: 0;
  text-align: start; font: inherit; color: inherit;
  background: transparent; border: 0; border-radius: 10px; cursor: pointer;
  position: relative;
  transition: background .16s;
}
.bmap__item:hover { background: rgba(246, 228, 236, .55); }
.bmap__glyph {
  display: grid; place-items: center; width: 38px; height: 38px;
  color: var(--c-pink-d); background: var(--c-blush); border-radius: 11px;
}
.bmap__glyph svg { width: 19px; height: 19px; }
.bmap__name { display: block; font-weight: 600; font-size: .94rem; color: var(--c-ink); line-height: 1.3; }
.bmap__walk { display: inline-block; margin-top: 3px; font-size: .74rem; font-weight: 600; color: var(--c-pink-d); }
.bmap__item.is-active { background: #fff; box-shadow: 0 1px 0 var(--c-line), 0 6px 18px -10px rgba(168, 31, 89, .45); }
.bmap__item.is-active::before {
  content: ""; position: absolute; inset-block: 9px; inset-inline-start: 0; width: 3px;
  border-radius: 3px; background: var(--c-pink);
}
.bmap__item.is-active .bmap__name { color: var(--c-pink-d); }
.bmap__item.is-active .bmap__glyph { background: var(--c-pink); color: #fff; }

.bmap :is(button, a):focus-visible {
  outline: 3px solid var(--c-ink); outline-offset: 2px;
  box-shadow: 0 0 0 5px #fff;
}

/* ---------- Carte ---------- */
.bmap__map { grid-column: 2; grid-row: 1; position: relative; min-width: 0; min-height: 0; background: var(--c-sky); }
.bmap__canvas, .bmap__canvas.maplibregl-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.bmap__canvas .maplibregl-canvas { outline: none; }
.bmap__status {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center;
  font-family: var(--f-display); font-size: 1.15rem; color: var(--c-ink2);
  background:
    radial-gradient(circle at 30% 30%, #D8E8F0, transparent 55%),
    var(--c-sky);
}
.bmap__status[hidden] { display: none; }
.bmap__tools { position: absolute; inset-block-start: 14px; inset-inline-start: 14px; z-index: 3; display: flex; gap: 8px; }
.bmap__tool {
  min-height: 40px; padding: 8px 14px;
  font: 600 .8rem/1 var(--f-text); color: var(--c-ink);
  background: rgba(255, 255, 255, .94); border: 1px solid var(--c-line); border-radius: 999px;
  box-shadow: 0 6px 18px -10px rgba(26, 20, 48, .5); cursor: pointer;
}
.bmap__tool:hover { color: var(--c-pink-d); border-color: var(--c-pink); }
.bmap .maplibregl-ctrl-group { border-radius: 10px; box-shadow: 0 6px 18px -10px rgba(26, 20, 48, .5); }
.bmap .maplibregl-ctrl-attrib { font-size: 10.5px; background: rgba(255, 255, 255, .78); }
.bmap .maplibregl-ctrl-attrib a { color: var(--c-ink2); }
.bmap .maplibregl-cooperative-gesture-screen { font-family: var(--f-text); background: rgba(26, 20, 48, .62); }

/* ---------- Epingles ---------- */
.pin {
  position: relative; display: block; width: 34px; height: 42px; padding: 0;
  background: none; border: 0; cursor: pointer; color: var(--c-pink);
  filter: drop-shadow(0 3px 3px rgba(51, 19, 41, .35));
  transition: transform .2s cubic-bezier(.23, 1, .32, 1);
}
.pin svg.pin__drop { display: block; width: 100%; height: 100%; }
.pin--landmark { width: 26px; height: 32px; }
.pin--landmark .pin__drop path.pin__body { fill: #fff; stroke: var(--c-pink); stroke-width: 2.4; }
.pin:hover, .pin.is-active { transform: scale(1.14); z-index: 5; }
.pin.is-active .pin__body { fill: var(--c-pink-d); }
.pin--landmark.is-active .pin__body { fill: var(--c-pink-d); stroke: var(--c-pink-d); }
.pin__glyph { stroke: var(--c-pink); }
.pin.is-active .pin__glyph { stroke: var(--c-pink-d); }
.pin__label {
  position: absolute; inset-inline-start: 50%; top: 100%; margin-top: 1px; transform: translateX(-50%);
  white-space: nowrap; display: none;
  font: 600 11px/1.2 var(--f-text); color: var(--c-ink);
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 5px #fff, 0 0 5px #fff;
  pointer-events: none;
}
[dir="rtl"] .pin__label, .bmap[dir="rtl"] .pin__label { transform: translateX(50%); }
.bmap--labels .pin__label, .pin:hover .pin__label { display: block; }
.pin:hover { z-index: 8; }

.pin-resort {
  position: relative; display: grid; justify-items: center; width: 64px; padding: 0;
  background: none; border: 0; cursor: pointer;
}
.pin-resort__halo {
  position: absolute; top: -9px; width: 74px; height: 74px; border-radius: 50%;
  border: 1.5px dashed var(--c-pink); background: rgba(243, 166, 196, .22);
}
.pin-resort__disc {
  position: relative; display: grid; place-items: center; width: 56px; height: 56px;
  background: var(--c-dusk); border: 2px solid var(--c-pink-l); border-radius: 50%;
  box-shadow: 0 6px 14px -4px rgba(51, 19, 41, .65);
  transition: transform .2s cubic-bezier(.23, 1, .32, 1);
}
.pin-resort__disc img { width: 32px; height: 32px; display: block; }
.pin-resort:hover .pin-resort__disc, .pin-resort.is-active .pin-resort__disc { transform: scale(1.1); }
.pin-resort__label {
  position: relative; margin-top: 7px; padding: 3px 10px 4px;
  font-family: var(--f-display); font-size: 14px; line-height: 1.1; white-space: nowrap;
  color: #fff; background: var(--c-dusk); border-radius: 999px;
}

.route-chip {
  display: flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; width: 152px;
  font: 600 11.5px/1.2 var(--f-text); color: var(--c-pink-d); white-space: normal;
  background: #fff; border: 1.5px solid var(--c-pink); border-radius: 14px;
  box-shadow: 0 6px 14px -8px rgba(168, 31, 89, .6);
  pointer-events: none;
}
.route-chip svg { width: 14px; height: 14px; flex: none; }

/* ---------- Popup ---------- */
.bmap-popup { z-index: 6; }
.bmap-popup .maplibregl-popup-content {
  padding: 16px 18px 16px; min-width: 220px;
  font-family: var(--f-text); color: var(--c-ink);
  background: #FFFDF9; border-radius: 14px;
  box-shadow: 0 18px 40px -16px rgba(26, 20, 48, .55), 0 0 0 1px rgba(26, 20, 48, .06);
}
.bmap-popup .maplibregl-popup-tip { border-top-color: #FFFDF9; border-bottom-color: #FFFDF9; }
.bmap-popup .maplibregl-popup-close-button {
  inset-inline-end: 6px; inset-inline-start: auto; top: 6px; width: 32px; height: 32px;
  font-size: 22px; line-height: 1; color: var(--c-ink2); border-radius: 50%;
}
.bmap-popup .maplibregl-popup-close-button:hover { background: var(--c-blush); color: var(--c-pink-d); }
.bmap-pop__cat {
  display: flex; align-items: center; gap: 7px; margin: 0 28px 4px 0;
  font: 600 .68rem/1.2 var(--f-text); letter-spacing: .13em; text-transform: uppercase; color: var(--c-pink-d);
}
[dir="rtl"] .bmap-pop__cat { margin: 0 0 4px 28px; }
.bmap-pop__cat svg { width: 16px; height: 16px; flex: none; }
.bmap-pop__name { margin: 0 0 6px; font-family: var(--f-display); font-weight: 400; font-size: 1.35rem; line-height: 1.15; }
.bmap-pop__desc { margin: 0; font-size: .86rem; color: var(--c-ink2); }
.bmap-pop__walk { margin: 10px 0 0; font-size: .8rem; font-weight: 600; color: var(--c-pink-d); display: flex; gap: 6px; align-items: center; }
.bmap-pop__walk svg { width: 15px; height: 15px; flex: none; }
.bmap-pop__note { margin: 8px 0 0; font-size: .74rem; color: var(--c-ink2); font-style: italic; }
.bmap-pop__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.bmap-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 16px;
  font: 600 .82rem/1.1 var(--f-text); text-decoration: none; cursor: pointer;
  border-radius: 999px; border: 1.5px solid var(--c-pink);
  color: #fff; background: var(--c-pink);
  transition: background .16s, color .16s;
}
.bmap-btn:hover { background: var(--c-pink-d); border-color: var(--c-pink-d); }
.bmap-btn--ghost { color: var(--c-pink-d); background: transparent; }
.bmap-btn--ghost:hover { color: #fff; }

/* ---------- Dialogue chauffeur ---------- */
.bmap-dialog {
  margin: auto; inset: 0;
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  padding: 0; border: 0; border-radius: 18px; color: #FFF2F7;
  background: var(--c-dusk);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
  font-family: var(--f-text);
}
.bmap-dialog::backdrop { background: rgba(26, 20, 48, .72); }
.bmap-dialog__in { padding: 28px 28px 24px; }
.bmap-dialog h2 { margin: 0 0 18px; font-family: var(--f-display); font-weight: 400; font-size: 1.7rem; color: #fff; }
.bmap-dialog h3 { margin: 18px 0 6px; font: 600 .68rem/1.2 var(--f-text); letter-spacing: .14em; text-transform: uppercase; color: var(--c-pink-l); }
.bmap-dialog p { margin: 0; font-size: 1.12rem; line-height: 1.6; color: #fff; }
.bmap-dialog p[lang="th"] { font-family: "Noto Sans Thai", "Leelawadee UI", "Thonburi", system-ui, sans-serif; font-size: 1.25rem; line-height: 1.85; }
.bmap-dialog__act { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.bmap-dialog .bmap-btn--ghost { color: var(--c-pink-l); border-color: var(--c-pink-l); }
.bmap-dialog .bmap-btn--ghost:hover { background: var(--c-pink-l); color: var(--c-dusk); }
.bmap-dialog :is(button, a):focus-visible { outline: 3px solid #fff; box-shadow: none; }

/* ---------- Mobile : feuille du bas ---------- */
@media (max-width: 799px) {
  .bmap { display: block; height: min(88svh, 740px); min-height: 520px; }
  .bmap__map { position: absolute; inset: 0; }
  .bmap__panel {
    position: absolute; inset-inline: 0; bottom: 0; height: 52%;
    border-inline-end: 0; border-top: 1px solid var(--c-line);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -14px 34px -18px rgba(26, 20, 48, .55);
    transition: height .32s cubic-bezier(.23, 1, .32, 1);
  }
  .bmap[data-sheet="peek"] .bmap__panel { height: var(--peek); }
  .bmap[data-sheet="half"] .bmap__panel { height: 52%; }
  .bmap[data-sheet="full"] .bmap__panel { height: 86%; }
  .bmap.is-dragging .bmap__panel { transition: none; }
  .bmap__poignee {
    display: grid; place-items: center; flex: none; width: 100%; height: 30px; padding: 0;
    background: none; border: 0; cursor: grab; touch-action: none;
  }
  .bmap__poignee::before { content: ""; width: 44px; height: 5px; border-radius: 5px; background: rgba(26, 20, 48, .28); }
  .bmap__head { padding: 0 18px 4px; }
  .bmap__titre { font-size: 1.45rem; }
  .bmap__lede { display: none; }
  .bmap__chips { flex-wrap: nowrap; overflow-x: auto; padding: 8px 18px 12px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .bmap__chips::-webkit-scrollbar { display: none; }
  .bmap__chip { flex: none; }
  .bmap__scroll { padding-inline: 10px; padding-bottom: 36px; }
  .bmap__tools { inset-block-start: 10px; inset-inline-start: 10px; }
  .bmap .maplibregl-ctrl-top-right { inset-block-start: 4px; }
  .bmap-dialog__in { padding: 22px 20px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .bmap *, .bmap *::before, .bmap *::after, .bmap-dialog { transition: none !important; animation: none !important; }
}

.bmap__lead { margin: 0 0 6px; }
.bmap__item--resort .bmap__glyph { background: var(--c-dusk); }
.bmap__item--resort .bmap__glyph img { width: 22px; height: 22px; display: block; }
.bmap__item--resort.is-active .bmap__glyph { background: var(--c-pink-d); }
.bmap-pop__cat img { width: 16px; height: 16px; flex: none; }

.bmap__name, .bmap__walk, .bmap-pop__name, .bmap-pop__desc, .bmap-pop__walk span, .route-chip, .bmap__ghead { unicode-bidi: plaintext; }
.bmap[dir="rtl"] .maplibregl-ctrl-top-left { inset-block-start: 0; }

.pin--named .pin__label { display: block; }
.route-chip--long { color: var(--c-ink2); border: 1.5px dotted var(--c-pink); width: auto; max-width: 170px; background: rgba(255, 255, 255, .92); }

.bmap__dist { display: block; margin-top: 1px; font-size: .76rem; color: var(--c-ink2); }
.bmap__dist:empty { display: none; }
.bmap-pop__dist { margin: 0 0 6px; font-size: .78rem; font-weight: 600; color: var(--c-ink2); }
.ring-chip { padding: 1px 7px; font: 600 10.5px/1.4 var(--f-text); color: #B0577F; background: rgba(255, 255, 255, .8); border-radius: 999px; pointer-events: none; white-space: nowrap; }

.pin--landmark { display: none; }
.bmap--zoomed .pin--landmark, .pin--landmark.is-active { display: block; }

/* Round 21 : epingles collees au medaillon du resort (Fouket's, Austrian Garden...) : pas d'etiquette au survol
   a l'echelle normale (elle passait sous le medaillon, « Fouke... ») ; le nom reste dans la liste et le popup,
   et les etiquettes reviennent au zoom rapproche (bmap--labels) */
.bmap:not(.bmap--labels) .pin--pres .pin__label { display: none; }
