/*
 * Carte communautaire — Direction A "Cinématique cohérente avec la vitrine".
 * Charge uniquement sur /carte-communautaire (pages/carte-statues.php) en mode LT26.
 * 100% scopé à .carte-page → aucun débordement sur les autres pages Leaflet
 * (boutiques publiques, fiches user, etc.).
 *
 * Effets livrés :
 *   1. Cascade d'entrée (hero blocks + 3 colonnes layout)
 *   2. Count-up sur les KPI numériques
 *   3. Spotlight souris doré dans le hero
 *   4. Particules de poussière dorée (canvas dans le hero)
 *   5. Hover/focus doré sur les inputs et selects de filtres
 *   6. Aura pulsante sur le CTA "Ajouter une pièce"
 *   7. Ripple doré au clic "Filtrer"
 */

.carte-page {
  --carte-cin-mx: 50%;
  --carte-cin-my: 50%;
}

/* ============================================================
 * Stacking : particules en arrière-plan, contenu au-dessus
 * ============================================================ */
.carte-page .carte-page__head > div {
  position: relative;
  z-index: 1;
}
.carte-page .carte-cin-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
 * 1 — Cascade d'entrée
 * Hero blocks (i=0,1) + 3 colonnes layout (i=2,3,4)
 * ============================================================ */
.carte-page .carte-page__head > div,
.carte-page .carte-layout > * {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(8px);
  transition:
    opacity 620ms cubic-bezier(0.22, 1, 0.36, 1) calc(var(--carte-cin-i, 0) * 80ms),
    transform 620ms cubic-bezier(0.22, 1, 0.36, 1) calc(var(--carte-cin-i, 0) * 80ms),
    filter  620ms cubic-bezier(0.22, 1, 0.36, 1) calc(var(--carte-cin-i, 0) * 80ms);
}
.carte-page.is-cin-mounted .carte-page__head > div,
.carte-page.is-cin-mounted .carte-layout > * {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* ============================================================
 * 3 — Spotlight souris dans le hero
 * ============================================================ */
.carte-page .carte-page__head {
  /* on s'assure que le hero porte un stacking context propre */
  position: relative;
}
.carte-page .carte-page__head::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    480px circle at var(--carte-cin-mx) var(--carte-cin-my),
    rgba(212, 160, 23, 0.14),
    rgba(212, 160, 23, 0.04) 32%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 420ms ease;
}
.carte-page .carte-page__head.is-cin-spotlight::after {
  opacity: 1;
}
@media (pointer: coarse) {
  .carte-page .carte-page__head::after { display: none; }
}

/* ============================================================
 * 5 — Filtres : focus / hover doré sur inputs et selects
 * ============================================================ */
.carte-page .carte-input,
.carte-page select.carte-input {
  transition:
    border-color 240ms ease,
    box-shadow 240ms ease,
    background-color 240ms ease;
}
.carte-page .carte-input:hover:not(:focus) {
  border-color: rgba(212, 160, 23, 0.32);
}
.carte-page .carte-input:focus,
.carte-page .carte-input:focus-visible {
  outline: none;
  border-color: rgba(212, 160, 23, 0.55);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.14);
}

/* Bloc filtres + détails : highlight doux au hover (pas la map) */
.carte-page .carte-filters,
.carte-page .carte-detail {
  transition:
    border-color 320ms ease,
    box-shadow 320ms ease;
}
.carte-page .carte-filters:hover,
.carte-page .carte-detail:hover {
  border-color: rgba(212, 160, 23, 0.42);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(212, 160, 23, 0.18);
}

/* ============================================================
 * 6 — CTA "Ajouter une pièce" : aura dorée pulsante
 * On utilise filter:drop-shadow pour épouser le clip-path du bouton
 * (les .lt26-btn ont une polygon clip dans polish.css).
 * ============================================================ */
.carte-page .carte-detail .lt26-btn--champ {
  animation: carte-cin-cta-pulse 4.4s ease-in-out infinite;
}
@keyframes carte-cin-cta-pulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(212, 160, 23, 0)); }
  50%      { filter: drop-shadow(0 0 14px rgba(212, 160, 23, 0.45)); }
}

/* ============================================================
 * 7 — Bouton "Filtrer" : ripple doré au clic (déclenché par .is-cin-flash)
 * ============================================================ */
.carte-page #flt_apply {
  position: relative;
  overflow: hidden;
}
.carte-page #flt_apply::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at center,
    rgba(255, 245, 210, 0.85),
    rgba(255, 215, 120, 0.35) 40%,
    transparent 70%
  );
  pointer-events: none;
  opacity: 0;
  transform: scale(0.4);
}
.carte-page #flt_apply.is-cin-flash::after {
  animation: carte-cin-flash 720ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes carte-cin-flash {
  0%   { opacity: 0.95; transform: scale(0.4); }
  60%  { opacity: 0.55; transform: scale(1.6); }
  100% { opacity: 0;    transform: scale(2.4); }
}

/* ============================================================
 * Phase 2 — Spécifique à la carte Leaflet.
 * Tous les overrides scopés à .carte-page → bundle-boutique-map.css
 * (utilisé par les boutiques publiques) reste intact.
 * ============================================================ */

/* ---- 8. Marker clusters recolorés en palette dorée ---- */
.carte-page .leaflet-container .marker-cluster {
  background-color: transparent !important;
}
.carte-page .leaflet-container .marker-cluster-small {
  background-color: rgba(212, 160, 23, 0.18) !important;
}
.carte-page .leaflet-container .marker-cluster-small div {
  background-color: rgba(212, 160, 23, 0.85) !important;
  color: #1a1410 !important;
}
.carte-page .leaflet-container .marker-cluster-medium {
  background-color: rgba(192, 138, 11, 0.20) !important;
}
.carte-page .leaflet-container .marker-cluster-medium div {
  background-color: rgba(192, 138, 11, 0.92) !important;
  color: #1a1410 !important;
}
.carte-page .leaflet-container .marker-cluster-large {
  background-color: rgba(168, 111, 18, 0.26) !important;
}
.carte-page .leaflet-container .marker-cluster-large div {
  background-color: rgba(168, 111, 18, 0.95) !important;
  color: #f4ead9 !important;
}
.carte-page .leaflet-container .marker-cluster div {
  font-family: Cinzel, serif !important;
  font-weight: 700 !important;
}
.carte-page .leaflet-container .marker-cluster span {
  line-height: 30px !important;
}

/* ---- 9. Marker "Vous" : pulsation dorée ---- */
.carte-page .lt-you-icon {
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}
.carte-page .lt-you {
  background: linear-gradient(135deg, #f0c842, #d4a017);
  color: #1a1410;
  border-color: rgba(255, 215, 120, 0.7);
  font-family: Cinzel, serif;
  letter-spacing: 0.12em;
  animation: carte-cin-you-pulse 2.2s ease-in-out infinite;
}
@keyframes carte-cin-you-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 0 rgba(212, 160, 23, 0.55),
      0 0 12px 0 rgba(212, 160, 23, 0.40);
  }
  60% {
    box-shadow:
      0 0 0 14px rgba(212, 160, 23, 0),
      0 0 16px 2px rgba(212, 160, 23, 0.50);
  }
}

/* ---- Bubble markers : scale subtil au hover ---- */
.carte-page .lt-bubble {
  transition:
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 240ms ease;
  transform-origin: center;
}
.carte-page .lt-bubble-icon:hover .lt-bubble {
  transform: scale(1.14);
}
.carte-page .lt-bubble-icon--sell:hover .lt-bubble {
  box-shadow:
    0 14px 28px rgba(185, 28, 28, 0.28),
    0 0 0 2px rgba(185, 28, 28, 0.32);
}
.carte-page .lt-bubble-icon--wanted:hover .lt-bubble {
  box-shadow:
    0 14px 28px rgba(29, 78, 216, 0.28),
    0 0 0 2px rgba(29, 78, 216, 0.32);
}
.carte-page .lt-bubble-icon--showcase:hover .lt-bubble {
  box-shadow:
    0 14px 28px rgba(180, 83, 9, 0.28),
    0 0 0 2px rgba(180, 83, 9, 0.32);
}

/* ---- 10. Légende overlay (injectée par JS dans .carte-canvas__map) ---- */
.carte-page .carte-canvas__map {
  position: relative;
}
.carte-page .carte-cin-legend {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 1000;
  padding: 10px 12px 12px;
  background: rgba(8, 18, 36, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 160, 23, 0.28);
  border-radius: 10px;
  color: var(--lt26-ink, #f4ead9);
  font-family: Rajdhani, system-ui, sans-serif;
  font-size: 11.5px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 360ms ease, transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}
.carte-page .carte-cin-legend.is-cin-ready {
  opacity: 1;
  transform: translateY(0);
}
.carte-page .carte-cin-legend__title {
  font-family: Cinzel, serif;
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--lt26-champagne, #d4a574);
  margin-bottom: 2px;
}
.carte-page .carte-cin-legend__row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.carte-page .carte-cin-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.carte-page .carte-cin-legend__dot.is-sell {
  background: #b91c1c;
  box-shadow: 0 0 8px rgba(185, 28, 28, 0.55);
}
.carte-page .carte-cin-legend__dot.is-wanted {
  background: #1d4ed8;
  box-shadow: 0 0 8px rgba(29, 78, 216, 0.55);
}
.carte-page .carte-cin-legend__dot.is-showcase {
  background: #b45309;
  box-shadow: 0 0 8px rgba(180, 83, 9, 0.55);
}

[data-theme="light"] .carte-page .carte-cin-legend {
  background: rgba(255, 250, 240, 0.94);
  color: #17202a;
  border-color: rgba(168, 111, 18, 0.34);
  box-shadow: 0 12px 28px rgba(23, 32, 42, 0.14);
}
[data-theme="light"] .carte-page .carte-cin-legend__title {
  color: #a86f12;
}

@media (max-width: 600px) {
  .carte-page .carte-cin-legend {
    bottom: 10px;
    right: 10px;
    font-size: 10.5px;
    padding: 8px 10px 10px;
  }
}

/* ---- 12. Status badge live (#carte-status) ---- */
.carte-page #carte-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(212, 160, 23, 0.10);
  border: 1px solid rgba(212, 160, 23, 0.28);
  color: var(--lt26-champagne, #d4a574);
  font-family: Cinzel, serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: opacity 240ms ease, transform 240ms ease;
}
.carte-page #carte-status:empty {
  opacity: 0;
  transform: translateY(-4px);
  border-color: transparent;
  background: transparent;
}
.carte-page #carte-status:not(:empty)::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lt26-champagne, #d4a574);
  flex-shrink: 0;
  animation: carte-cin-status-pulse 1.8s ease-in-out infinite;
}
@keyframes carte-cin-status-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(212, 160, 23, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(212, 160, 23, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 160, 23, 0); }
}

[data-theme="light"] .carte-page #carte-status {
  background: rgba(168, 111, 18, 0.08);
  border-color: rgba(168, 111, 18, 0.32);
  color: #a86f12;
}

/* ---- 13. Contrôles zoom Leaflet (+/-) ---- */
.carte-page .leaflet-control-zoom {
  border: 1px solid rgba(212, 160, 23, 0.32) !important;
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28) !important;
  background: rgba(8, 18, 36, 0.88) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.carte-page .leaflet-control-zoom a {
  background: transparent !important;
  color: var(--lt26-champagne, #d4a574) !important;
  font-family: Cinzel, serif !important;
  font-weight: 700 !important;
  width: 32px !important;
  height: 32px !important;
  line-height: 30px !important;
  border-bottom: 1px solid rgba(212, 160, 23, 0.18) !important;
  transition: background 200ms ease, color 200ms ease;
}
.carte-page .leaflet-control-zoom a:last-child {
  border-bottom: none !important;
}
.carte-page .leaflet-control-zoom a:hover {
  background: rgba(212, 160, 23, 0.15) !important;
  color: #f0c842 !important;
}
.carte-page .leaflet-control-zoom a.leaflet-disabled {
  opacity: 0.4;
}

[data-theme="light"] .carte-page .leaflet-control-zoom {
  background: rgba(255, 250, 240, 0.94) !important;
  border-color: rgba(168, 111, 18, 0.42) !important;
  box-shadow: 0 8px 20px rgba(23, 32, 42, 0.10) !important;
}
[data-theme="light"] .carte-page .leaflet-control-zoom a {
  color: rgba(168, 111, 18, 0.92) !important;
  border-bottom-color: rgba(168, 111, 18, 0.18) !important;
}
[data-theme="light"] .carte-page .leaflet-control-zoom a:hover {
  background: rgba(168, 111, 18, 0.12) !important;
  color: #a86f12 !important;
}

/* ---- Popups Leaflet : style cohérent avec le thème ---- */
.carte-page .leaflet-popup-content-wrapper {
  background: rgba(8, 18, 36, 0.95) !important;
  color: var(--lt26-ink, #f4ead9) !important;
  border: 1px solid rgba(212, 160, 23, 0.32) !important;
  border-radius: 10px !important;
  font-family: Rajdhani, system-ui, sans-serif !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45) !important;
}
.carte-page .leaflet-popup-content {
  font-size: 13px !important;
  line-height: 1.55 !important;
  margin: 12px 14px !important;
}
.carte-page .leaflet-popup-content strong {
  color: var(--lt26-champagne, #d4a574);
  font-family: Cinzel, serif;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.carte-page .leaflet-popup-content a {
  color: var(--lt26-champagne, #d4a574) !important;
  font-weight: 600;
}
.carte-page .leaflet-popup-tip {
  background: rgba(8, 18, 36, 0.95) !important;
  border: 1px solid rgba(212, 160, 23, 0.32) !important;
}
.carte-page .leaflet-popup-close-button {
  color: var(--lt26-ink-soft, rgba(244, 234, 217, 0.7)) !important;
  font-family: serif !important;
  font-size: 18px !important;
}
.carte-page .leaflet-popup-close-button:hover {
  color: var(--lt26-champagne, #d4a574) !important;
}

[data-theme="light"] .carte-page .leaflet-popup-content-wrapper {
  background: rgba(255, 250, 240, 0.96) !important;
  color: #17202a !important;
  border-color: rgba(168, 111, 18, 0.34) !important;
  box-shadow: 0 16px 36px rgba(23, 32, 42, 0.16) !important;
}
[data-theme="light"] .carte-page .leaflet-popup-content strong {
  color: #a86f12;
}
[data-theme="light"] .carte-page .leaflet-popup-content a {
  color: #a86f12 !important;
}
[data-theme="light"] .carte-page .leaflet-popup-tip {
  background: rgba(255, 250, 240, 0.96) !important;
  border-color: rgba(168, 111, 18, 0.34) !important;
}

/* ---- Reduced motion overrides Phase 2 ---- */
@media (prefers-reduced-motion: reduce) {
  .carte-page .lt-you,
  .carte-page #carte-status:not(:empty)::before { animation: none; }
  .carte-page .lt-bubble { transition: none; }
  .carte-page .lt-bubble-icon:hover .lt-bubble { transform: none; }
  .carte-page .carte-cin-legend { transition: none; }
}

/* ============================================================
 * Phase 3 — Mobile : filtres en bottom sheet + FAB.
 * À ≤900px le layout passe en flux block, la map prend la priorité,
 * les filtres deviennent un panneau slide-up déclenché par un FAB.
 * ============================================================ */

/* FAB et close-button : cachés par défaut (desktop) */
.carte-page .carte-cin-fab,
.carte-page .carte-cin-sheet-close {
  display: none;
}

@media (max-width: 900px) {
  /* Layout : flux block, on laisse tomber la grid à 2 cols */
  .carte-page .carte-layout {
    display: block;
  }
  .carte-page .carte-canvas {
    width: 100%;
    height: 62vh;
    height: 62dvh;
    min-height: 420px;
    margin-bottom: 14px;
  }
  .carte-page .carte-detail {
    width: 100%;
    margin-top: 14px;
  }

  /* Filtres → bottom sheet slide-up depuis le bas.
     Sélecteurs surdimensionnés en spécificité (0,4,0 / 0,5,0) pour battre
     la règle cascade Phase 1 .carte-page.is-cin-mounted .carte-layout > *
     qui sinon force transform:translateY(0) après le mount. */
  .carte-page .carte-layout > .carte-filters,
  .carte-page.is-cin-mounted .carte-layout > .carte-filters {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: 82vh;
    max-height: 82dvh;
    margin: 0;
    padding: 32px 20px 24px;
    background: var(--lt26-bg, #050a1a);
    border: 1px solid rgba(212, 160, 23, 0.32);
    border-bottom: none;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.55);
    transform: translateY(100%);
    opacity: 1;
    filter: none;
    transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 5060;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .carte-page .carte-layout > .carte-filters.is-cin-sheet-open,
  .carte-page.is-cin-mounted .carte-layout > .carte-filters.is-cin-sheet-open {
    transform: translateY(0);
  }

  /* Drag handle visuel (purement décoratif) */
  .carte-page .carte-filters::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    width: 42px;
    height: 4px;
    margin-left: -21px;
    border-radius: 4px;
    background: rgba(212, 160, 23, 0.42);
    z-index: 1;
  }

  /* Close button (× en haut-droite du sheet) */
  .carte-page .carte-cin-sheet-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(212, 160, 23, 0.32);
    color: var(--lt26-champagne, #d4a574);
    font-size: 22px;
    line-height: 1;
    font-family: serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 200ms, border-color 200ms;
    z-index: 2;
  }
  .carte-page .carte-cin-sheet-close:hover {
    background: rgba(212, 160, 23, 0.12);
    border-color: rgba(212, 160, 23, 0.55);
  }

  /* FAB "Filtres" (toujours visible sur mobile, en bas-droite) */
  .carte-page .carte-cin-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 5040;
    padding: 14px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f0c842, #d4a017);
    color: #1a1410;
    border: none;
    box-shadow:
      0 14px 28px rgba(0, 0, 0, 0.45),
      0 0 0 1px rgba(212, 160, 23, 0.55),
      0 0 22px rgba(212, 160, 23, 0.30);
    font-family: Cinzel, serif;
    font-weight: 700;
    font-size: 11.5px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    transition:
      transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 240ms ease,
      box-shadow 240ms ease;
  }
  .carte-page .carte-cin-fab__icon {
    font-size: 16px;
    line-height: 1;
  }
  .carte-page .carte-cin-fab:hover,
  .carte-page .carte-cin-fab:focus-visible {
    transform: translateY(-2px);
    outline: none;
  }

  /* Sheet ouvert → cache le FAB */
  body:has(.carte-page .carte-filters.is-cin-sheet-open) .carte-page .carte-cin-fab {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
  }

  /* Backdrop overlay + scroll-lock body via :has() */
  body:has(.carte-page .carte-filters.is-cin-sheet-open) {
    overflow: hidden;
  }
  body:has(.carte-page .carte-filters.is-cin-sheet-open)::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 26, 0.58);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 5050;
    animation: carte-cin-mobile-overlay 260ms ease both;
  }
  @keyframes carte-cin-mobile-overlay {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  /* Topbar de la map : items en colonne propre sur mobile */
  .carte-page .carte-canvas__topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .carte-page .carte-canvas__topbar-r {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* Light theme : sheet en blanc cassé */
  [data-theme="light"] .carte-page .carte-filters {
    background: rgba(255, 250, 240, 0.97);
    border-color: rgba(168, 111, 18, 0.34);
    box-shadow: 0 -16px 40px rgba(23, 32, 42, 0.18);
  }
  [data-theme="light"] .carte-page .carte-filters::before {
    background: rgba(168, 111, 18, 0.42);
  }
  [data-theme="light"] .carte-page .carte-cin-sheet-close {
    border-color: rgba(168, 111, 18, 0.34);
    color: #a86f12;
  }

  /* Affichage du FAB et close-button uniquement en mobile */
  .carte-page .carte-cin-fab {
    display: inline-flex;
  }
  .carte-page .carte-cin-sheet-close {
    display: flex;
  }
}

/* Mobile très petit : FAB plus compact */
@media (max-width: 480px) {
  .carte-page .carte-cin-fab {
    padding: 12px 16px;
    font-size: 11px;
    bottom: 16px;
    right: 16px;
  }
  .carte-page .carte-cin-fab__icon {
    font-size: 15px;
  }
}

/* ============================================================
 * Phase 3 — Corrections responsive supplémentaires
 * Le titre h1 débordait à droite sur petit écran (le <br> est
 * caché par polish.css → "communautaire." sortait de la largeur).
 * On réactive le break + on autorise le wrap des longs mots.
 * ============================================================ */
@media (max-width: 700px) {
  /* Réactive le saut de ligne caché par polish.css */
  .carte-page .carte-page__h1 br {
    display: inline;
  }
  /* Permet aux mots longs de wrapper */
  .carte-page .carte-page__h1 {
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: clamp(2rem, 9vw, 2.8rem);
    line-height: 1.02;
  }
  .carte-page .carte-page__intro p {
    font-size: 0.95rem;
    line-height: 1.55;
  }
  .carte-page .carte-page__intro-meta {
    gap: 18px;
    row-gap: 14px;
  }
}

@media (max-width: 480px) {
  .carte-page .carte-page__h1 {
    font-size: clamp(1.85rem, 8vw, 2.3rem);
    letter-spacing: -0.01em;
  }
  /* Padding latéral plus serré pour gagner de la largeur */
  .carte-page {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  /* KPI nums plus compacts */
  .carte-page .carte-kpi__num {
    font-size: clamp(1.15rem, 5.5vw, 1.55rem);
  }
  .carte-page .carte-kpi__label {
    font-size: 0.58rem;
    letter-spacing: 0.22em;
  }
  /* Status badge plus petit pour ne pas wrapper bizarre */
  .carte-page #carte-status {
    font-size: 9.5px;
    letter-spacing: 0.14em;
    padding: 5px 10px;
  }
}

/* Safety net : pas de scroll horizontal sur la page en mobile */
@media (max-width: 900px) {
  .carte-page {
    overflow-x: hidden;
  }
}

@media (max-width: 768px) {
  .carte-page {
    padding: calc(var(--gl-nav-h, 76px) + 1rem) 12px 2rem;
  }
  .carte-page .carte-layout {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
  .carte-page .carte-page__head {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .carte-page .carte-page__h1 {
    font-size: clamp(2rem, 10vw, 3.5rem);
  }
  .carte-page #carte-map,
  .carte-page .carte-map-wrap {
    min-height: 50vh;
    max-width: 100%;
  }
}

@media (max-width: 360px) {
  .carte-page {
    padding-left: 8px;
    padding-right: 8px;
  }
  .carte-page .carte-filters {
    padding: 10px 8px;
  }
  .carte-page .carte-cin-fab {
    right: 8px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

/* Reduced motion : pas de slide ni de fade */
@media (prefers-reduced-motion: reduce) {
  .carte-page .carte-filters {
    transition: none;
  }
  body:has(.carte-page .carte-filters.is-cin-sheet-open)::after {
    animation: none;
  }
  .carte-page .carte-cin-fab {
    transition: none;
  }
}

/* ============================================================
 * Garde-fou : prefers-reduced-motion → tout figé
 * ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .carte-page .carte-page__head > div,
  .carte-page .carte-layout > * {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
  .carte-page .carte-page__head::after { display: none; }
  .carte-page .carte-cin-particles { display: none; }
  .carte-page .carte-detail .lt26-btn--champ { animation: none; }
  .carte-page #flt_apply::after { display: none; }
}
