/* SkyAtlas — /autour-de-moi — écran carte plein viewport (maquette Carte) */

.carte-body {
  margin: 0;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  background: var(--c-bg);
}

.carte-main {
  position: absolute;
  inset: 0;
}

#carte-map {
  position: absolute;
  inset: 0;
}

/* ── Habillage au-dessus de la carte (maquette) ─────────────────────
   Vignette + atmosphère + soleil en z-index 1-2 ; les markers MapLibre
   passent en z-index 3 pour rester au-dessus. */
.maplibregl-marker { z-index: 3; }

.cz-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 80% at 50% 30%, transparent 40%, rgba(8, 8, 20, 0.5) 100%);
}

@keyframes czBreathe {
  0%, 100% { opacity: 0.82; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1; transform: translate(-50%, -50%) scale(1.07); }
}
.cz-atmo {
  position: absolute;
  z-index: 1;
  width: 64vh; height: 64vh;
  max-width: 600px; max-height: 600px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 176, 32, 0.32) 0%, rgba(255, 120, 52, 0.15) 34%, rgba(255, 86, 48, 0.04) 56%, transparent 72%);
  animation: czBreathe 7s ease-in-out infinite;
}

@keyframes czSunRay {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%      { opacity: 0.85; transform: scale(1.08); }
}
.cz-sun {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.cz-sun-disc {
  position: relative;
  width: 44px; height: 44px;
  background: radial-gradient(circle, #ffe6b0 0%, #ffb020 58%, rgba(255, 176, 32, 0) 100%);
  border-radius: 50%;
  box-shadow: 0 0 26px rgba(255, 176, 32, 0.55);
}
.cz-sun-disc i {
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 1px solid rgba(255, 176, 32, 0.32);
  animation: czSunRay 4.5s ease-in-out infinite;
}
.cz-sun-lbl {
  font: 600 9px var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffce7a;
  background: rgba(0, 0, 8, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 176, 32, 0.25);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* h1 visuellement masqué (l'écran = la carte elle-même) */
.carte-sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Header carte (retour · titre + compteur · me localiser) ──────── */
.cz-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: linear-gradient(180deg, rgba(0, 0, 8, 0.85), rgba(0, 0, 8, 0.4) 80%, transparent);
}
.cz-hdr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  flex: none;
  border-radius: 50%;
  background: rgba(0, 0, 8, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--c-border-strong);
  color: var(--c-text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}
.cz-hdr-btn:hover { border-color: var(--c-golden); color: var(--c-golden); }
.cz-hdr-btn:focus-visible { outline: 2px solid var(--c-golden); outline-offset: 2px; }
.cz-hdr-locate { color: var(--c-golden); }
.cz-hdr-title { flex: 1; min-width: 0; text-align: center; }
.cz-hdr-name { font: 600 15px var(--font-sans); color: var(--c-text-primary); }
.cz-hdr-sub {
  margin-top: 3px;
  font: 500 10px var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Bandeau statut (géoloc) — pill flottante sous le header ──────── */
.carte-banner {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 18;
  max-width: calc(100% - 28px);
  margin: 0;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--c-border);
  background: rgba(0, 0, 8, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: rgba(200, 222, 248, 0.82);
  font: 500 12px var(--font-sans);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── « Chercher dans cette zone » — pill dorée ───────────────────── */
.carte-search-area {
  position: fixed;
  top: 116px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 18;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 17px;
  border-radius: 999px;
  border: 1px solid #ffc24d;
  background: var(--c-golden);
  color: #1d1305;
  font: 600 13px var(--font-sans);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(150, 95, 8, 0.3);
}
.carte-search-area:focus-visible { outline: 2px solid #fff5dc; outline-offset: 2px; }
.carte-search-area:active { transform: translateX(-50%) scale(0.97); }

.carte-noscript {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 24px;
  text-align: center;
  color: var(--c-text-secondary);
  font: 400 15px var(--font-sans);
}
.carte-noscript a { color: var(--c-golden); }

/* ── Pin spot : goutte teintée par le score + label « meilleur » ──── */
/* MapLibre positionne le marker via style.transform inline :
   jamais de transition/override sur transform à la racine — les
   animations (pop, flottement, halo) vont sur .cz-pin-inner et le svg. */
/* Pas de `position` ici : MapLibre pose .maplibregl-marker{position:absolute}
   et carte.css chargé après l'écraserait — les pins retomberaient dans le
   flux normal, empilés au bord du conteneur, transform appliqué de travers. */
.cz-pin {
  cursor: pointer;
  display: block;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
  transition: filter 0.2s ease;
}
.cz-pin:hover,
.cz-pin:focus-visible { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 10px rgba(255, 176, 32, 0.7)); }
.cz-pin:focus-visible { outline: 2px solid var(--c-golden); outline-offset: 3px; border-radius: 6px; }
.cz-pin svg { display: block; }
.cz-pin-best { z-index: 4; }

@keyframes czPinPop {
  0%   { transform: translateY(-10px) scale(0.4); opacity: 0; }
  70%  { transform: translateY(0) scale(1.08); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.cz-pin-inner {
  position: relative;
  animation: czPinPop 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@keyframes czFloatPin {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
.cz-pin-inner svg { animation: czFloatPin 3.4s ease-in-out infinite; }

@keyframes czHaloPulse {
  0%   { transform: translate(-50%, -50%) scale(0.65); opacity: 0.55; }
  100% { transform: translate(-50%, -50%) scale(1.75); opacity: 0; }
}
.cz-pin-halo {
  position: absolute;
  left: 20px; top: 17px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 176, 32, 0.5), rgba(255, 176, 32, 0) 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: czHaloPulse 2.6s ease-out infinite;
}

@keyframes czLabelBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-3px); }
}
.cz-pin-lbl {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 8, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 176, 32, 0.38);
  font: 600 10px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffce7a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.cz-pin-lbl .st { color: var(--c-golden); }
.cz-pin-best .cz-pin-lbl { animation: czLabelBob 3.4s ease-in-out infinite; }

/* Position utilisateur : point bleu + halo de précision (maquette) */
@keyframes czAccuracy {
  0%   { transform: translate(-50%, -50%) scale(0.6); opacity: 0.55; }
  100% { transform: translate(-50%, -50%) scale(2.1); opacity: 0; }
}
.carte-pin-user { width: 16px; height: 16px; } /* pas de position : cf. .cz-pin */
.carte-pin-user .ring {
  position: absolute;
  left: 50%; top: 50%;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(90, 150, 250, 0.45);
  animation: czAccuracy 2.8s ease-out infinite;
}
.carte-pin-user .core {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #5a96fa;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 8, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .cz-atmo, .cz-sun-disc i,
  .cz-pin-inner, .cz-pin-inner svg, .cz-pin-halo,
  .cz-pin-best .cz-pin-lbl, .carte-pin-user .ring { animation: none; }
  .cz-pin-halo, .carte-pin-user .ring { opacity: 0; }
  .cz-sheet { transition: none; } /* le cran change, sans glissé */
}

/* ── Bottom-sheet « Les meilleurs spots, près de vous » ──────────── */
.cz-sheet[hidden] { display: none; } /* display:flex ci-dessous battrait l'attribut hidden */
/* Trois crans (replié · moitié · plein) : le panneau garde toujours la hauteur
   du cran « plein » et se translate vers le bas pour n'en montrer qu'une part.
   Le glissement devient un simple translateY, donc fluide sur mobile. */
.cz-sheet {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(66px + env(safe-area-inset-bottom));
  z-index: 19;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: var(--cz-sheet-full, 47vh);
  transform: translateY(var(--cz-sheet-shift, 0px));
  transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
  padding: 0 16px 16px;
  background: rgba(8, 9, 18, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
}
.cz-sheet.is-dragging { transition: none; }

/* La poignée est un vrai bouton : elle cycle les crans au clic et au clavier.
   touch-action:none pour que le doigt pilote le panneau, pas le défilement. */
.cz-sheet-grip {
  flex: none;
  display: block;
  width: 100%;
  padding: 10px 0 12px;
  margin: 0;
  appearance: none;
  background: none;
  border: 0;
  border-radius: 12px;
  cursor: grab;
  touch-action: none;
}
.cz-sheet-grip::before {
  content: '';
  display: block;
  width: 38px; height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 auto;
}
.cz-sheet.is-dragging .cz-sheet-grip { cursor: grabbing; }
.cz-sheet-grip:focus-visible {
  outline: 2px solid rgba(255, 176, 32, 0.75);
  outline-offset: -2px;
}
.cz-sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex: none;
  touch-action: none; /* l'en-tête se saisit comme la poignée */
}
.cz-sheet-title {
  margin: 0;
  font: 400 21px var(--font-display);
  color: rgba(228, 240, 255, 0.96);
}
.cz-sheet-meta {
  flex: none;
  font: 500 11px var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(176, 200, 232, 0.55);
  white-space: nowrap;
}
.cz-sheet-cap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 12px;
  flex: none;
  touch-action: none;
  font: 500 11px var(--font-mono);
  letter-spacing: 0.03em;
  color: rgba(176, 200, 232, 0.55);
}
.cz-sheet-cap .dot {
  flex: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-golden);
  box-shadow: 0 0 8px var(--c-golden-glow);
}
/* La liste occupe ce qui reste du cran courant : c'est le cran qui décide de la
   place laissée à la carte, plus une hauteur figée en vh. */
.cz-sheet-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Survol des lignes : teinte or (maquette .cz-row:hover) */
.cz-sheet-list .sa-spot {
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.cz-sheet-list .sa-spot:hover,
.cz-sheet-list .sa-spot:focus-visible {
  background: rgba(255, 176, 32, 0.07);
  border-color: rgba(255, 176, 32, 0.28);
}
