/* HotelDelta MapLibre — moteur cartographique natif */
#map-zone { position:absolute; inset:0; overflow:hidden; }
#maplibre-map { position:absolute; inset:0; z-index:2; }
#maplibre-map .maplibregl-canvas { outline:none; }
#maplibre-map .maplibregl-popup-content {
  border-radius:10px;
  font:13px/1.35 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
html,body,#ecran-carte,#map-zone { max-width:100vw; overflow-x:hidden; }

/* Commandes terrain — V0.8 : pile compacte et repliable */
#maplibre-map .maplibregl-ctrl-top-right {
  top:max(10px, env(safe-area-inset-top, 0px));
  right:10px;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
}
#maplibre-map .maplibregl-ctrl-top-right .maplibregl-ctrl { margin:0; }
#maplibre-map .maplibregl-ctrl-top-right > .maplibregl-ctrl-group:not(.hd-native-geolocate-helper) {
  border-radius:9px;
  overflow:hidden;
  box-shadow:0 1px 5px rgba(0,0,0,.40);
}
#maplibre-map .maplibregl-ctrl-top-right > .maplibregl-ctrl-group:not(.hd-native-geolocate-helper) button {
  width:38px;
  height:38px;
}

/* Le contrôle GPS MapLibre reste uniquement le moteur technique. */
#maplibre-map .hd-native-geolocate-helper { display:none !important; }

/* On ne déplace plus les boutons historiques : ils restent uniquement des relais JS. */
#btn-locate-me,
#btn-feux-carte,
#btn-layers {
  display:none !important;
}

/* Pile compacte MapLibre sous + / - / boussole. */
#maplibre-map .hd-quick-control {
  position:relative;
  background:transparent;
  box-shadow:none;
  border:0;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
}
#maplibre-map .hd-quick-toggle,
#maplibre-map .hd-quick-action {
  width:44px;
  height:44px;
  min-width:44px;
  border:0;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  box-shadow:0 2px 8px rgba(0,0,0,.30);
  color:#fff;
  -webkit-tap-highlight-color:transparent;
}
#maplibre-map .hd-quick-toggle {
  background:#17213a;
}
#maplibre-map .hd-quick-toggle svg,
#maplibre-map .hd-quick-action svg {
  width:21px;
  height:21px;
  stroke:currentColor;
  fill:none;
  stroke-width:2.2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
#maplibre-map .hd-quick-actions {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  max-height:0;
  opacity:0;
  transform:translateY(-8px) scale(.96);
  pointer-events:none;
  overflow:hidden;
  transition:max-height .18s ease, opacity .15s ease, transform .18s ease;
}
#maplibre-map .hd-quick-control.open .hd-quick-actions {
  max-height:180px;
  opacity:1;
  transform:translateY(0) scale(1);
  pointer-events:auto;
  overflow:visible;
}
#maplibre-map .hd-quick-action.locate { background:#1769c2; }
#maplibre-map .hd-quick-action.fire {
  background:#8d949e;
  transition:background .15s ease, transform .1s ease, filter .15s ease;
}
#maplibre-map .hd-quick-action.fire.active {
  background:#d93025;
}
#maplibre-map .hd-quick-action.layers { background:#17213a; }
#maplibre-map .hd-quick-action:active,
#maplibre-map .hd-quick-toggle:active { transform:scale(.92); }
#maplibre-map .hd-quick-action .fire-emoji {
  font-size:22px;
  line-height:1;
  filter:grayscale(1) saturate(0) brightness(1.7);
  opacity:.95;
}
#maplibre-map .hd-quick-action.fire.active .fire-emoji {
  filter:none;
  opacity:1;
}

/* La recherche reste séparée, en bas à droite. */
#btn-chercher-icone {
  top:auto !important;
  right:12px !important;
  bottom:calc(18px + env(safe-area-inset-bottom,0px)) !important;
  width:46px !important;
  height:46px !important;
  border-radius:50% !important;
  background:#17213a !important;
  color:#fff !important;
  border:0 !important;
  z-index:1300 !important;
  box-shadow:0 2px 8px rgba(0,0,0,.30) !important;
}
#btn-chercher-icone svg { stroke:#fff !important; }

/* Position utilisateur native MapLibre */
#maplibre-map .maplibregl-user-location-dot,
#maplibre-map .maplibregl-user-location-dot:before { z-index:4; }

/* V0.9 — GPS toujours visible comme le prototype ; recherche dans la pile */
#maplibre-map .hd-locate-always {
  width:38px;
  height:38px;
  min-width:38px;
  border-radius:9px;
  background:#fff;
  color:#2f343a;
  box-shadow:0 1px 5px rgba(0,0,0,.40);
}
#maplibre-map .hd-quick-action.search { background:#17213a; }

/* La loupe historique reste le relais fonctionnel mais n'est plus visible. */
#btn-chercher-icone {
  display:none !important;
}

/* V0.10 — popup feux lisible */
#maplibre-map .maplibregl-popup.hd-fire-popup .maplibregl-popup-content {
  background:#121a2b;
  color:#fff;
  border-radius:12px;
  padding:14px 16px 13px;
  box-shadow:0 6px 22px rgba(0,0,0,.35);
  min-width:220px;
}
#maplibre-map .maplibregl-popup.hd-fire-popup .maplibregl-popup-tip {
  border-top-color:#121a2b;
  border-bottom-color:#121a2b;
}
#maplibre-map .hd-fire-popup__title {
  font-size:15px;
  font-weight:700;
  color:#fff;
  margin:0 22px 9px 0;
}
#maplibre-map .hd-fire-popup__body {
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:12.5px;
  line-height:1.35;
}
#maplibre-map .hd-fire-popup__body div {
  display:flex;
  justify-content:space-between;
  gap:14px;
}
#maplibre-map .hd-fire-popup__body span {
  color:#aeb8ca;
}
#maplibre-map .hd-fire-popup__body strong {
  color:#fff;
  font-weight:600;
  text-align:right;
}
#maplibre-map .maplibregl-popup.hd-fire-popup .maplibregl-popup-close-button {
  color:#fff;
  font-size:20px;
  line-height:20px;
  padding:7px 9px;
  opacity:.85;
}
#maplibre-map .maplibregl-popup.hd-fire-popup .maplibregl-popup-close-button:hover {
  background:transparent;
  opacity:1;
}

#maplibre-map {
  position:absolute !important;
  inset:0 !important;
  z-index:2 !important;
}

/* V0.12 — appui long pour définir une destination */
#maplibre-map .hd-longpress-ring{
  position:absolute;
  width:48px;
  height:48px;
  margin:-24px 0 0 -24px;
  border:3px solid rgba(23,105,194,.25);
  border-radius:50%;
  pointer-events:none;
  z-index:1500;
  transform:scale(.58);
  opacity:.25;
}
#maplibre-map .hd-longpress-ring::after{
  content:"";
  position:absolute;
  inset:5px;
  border-radius:50%;
  border:3px solid #1769c2;
  border-top-color:transparent;
  transform:rotate(0deg);
}
#maplibre-map .hd-longpress-ring.holding{
  opacity:1;
  transform:scale(1);
  transition:transform .55s linear,opacity .12s ease;
}
#maplibre-map .hd-longpress-ring.holding::after{
  transform:rotate(720deg);
  transition:transform .55s linear;
}
#maplibre-map .hd-longpress-ring.done{
  background:rgba(23,105,194,.22);
  border-color:#1769c2;
  transform:scale(.82);
  transition:transform .12s ease,background .12s ease;
}
#maplibre-map .hd-fire-popup__commune strong{
  color:#74b6ff;
}

/* V0.13 — popup type de forêt, cohérent avec le popup feu */
#maplibre-map .maplibregl-popup.hd-forest-popup .maplibregl-popup-content {
  background:#121a2b;
  color:#fff;
  border-radius:12px;
  padding:14px 16px 13px;
  box-shadow:0 6px 22px rgba(0,0,0,.35);
  min-width:230px;
}
#maplibre-map .maplibregl-popup.hd-forest-popup .maplibregl-popup-tip {
  border-top-color:#121a2b;
  border-bottom-color:#121a2b;
}
#maplibre-map .hd-forest-popup__title {
  color:#fff;
  font-size:14px;
  font-weight:700;
  margin:0 24px 7px 0;
}
#maplibre-map .hd-forest-popup__type {
  color:#8ed1a5;
  font-size:16px;
  font-weight:750;
  line-height:1.25;
  margin-bottom:10px;
}
#maplibre-map .hd-forest-popup__body {
  display:flex;
  flex-direction:column;
  gap:5px;
  font-size:12.5px;
}
#maplibre-map .hd-forest-popup__body div {
  display:flex;
  justify-content:space-between;
  gap:14px;
}
#maplibre-map .hd-forest-popup__body span {
  color:#aeb8ca;
}
#maplibre-map .hd-forest-popup__body strong {
  color:#fff;
  font-weight:600;
  text-align:right;
}
#maplibre-map .hd-forest-popup__note {
  margin-top:10px;
  padding-top:9px;
  border-top:1px solid rgba(255,255,255,.10);
  color:#9da9bd;
  font-size:11px;
  line-height:1.35;
}
#maplibre-map .maplibregl-popup.hd-forest-popup .maplibregl-popup-close-button {
  color:#fff;
  font-size:20px;
  line-height:20px;
  padding:7px 9px;
  opacity:.85;
}
#maplibre-map .maplibregl-popup.hd-forest-popup .maplibregl-popup-close-button:hover {
  background:transparent;
  opacity:1;
}

/* V0.14 — tous les popups MapLibre génériques sont lisibles */
#maplibre-map .maplibregl-popup.hd-info-popup .maplibregl-popup-content {
  background:#121a2b;
  color:#fff;
  border-radius:12px;
  padding:14px 16px 13px;
  box-shadow:0 6px 22px rgba(0,0,0,.35);
  min-width:210px;
  font-size:13px;
  line-height:1.4;
}
#maplibre-map .maplibregl-popup.hd-info-popup .maplibregl-popup-tip {
  border-top-color:#121a2b;
  border-bottom-color:#121a2b;
}
#maplibre-map .hd-info-popup__body,
#maplibre-map .hd-info-popup__body b,
#maplibre-map .hd-info-popup__body strong {
  color:#fff;
}
#maplibre-map .hd-info-popup__body b {
  display:block;
  font-size:14px;
  margin:0 22px 5px 0;
}
#maplibre-map .hd-info-popup__body .route-hint {
  color:#aeb8ca;
}
#maplibre-map .maplibregl-popup.hd-info-popup .maplibregl-popup-close-button {
  color:#fff;
  font-size:20px;
  line-height:20px;
  padding:7px 9px;
  opacity:.85;
}
#maplibre-map .maplibregl-popup.hd-info-popup .maplibregl-popup-close-button:hover {
  background:transparent;
  opacity:1;
}
