/* ─────────────────────────────────────────────
   SECTION & MAP WRAP
───────────────────────────────────────────── */
#projets-map-europe-section {
  position: relative;
  width: 100%;
}

.pe-map-wrap {
  position: relative;
  width: 100%;
  height: 70svh;
  min-height: 480px;
  border-radius: 16px;
  overflow: hidden;
}

#pe-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

@media (max-width: 991px) {
  .pe-map-wrap {
    height: 90svh;
    border-radius: 12px;
  }
}

/* ─────────────────────────────────────────────
   PINS PAYS
───────────────────────────────────────────── */
.pe-pin-pays {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(.22,1,.36,1), opacity 0.3s ease;
}

.pe-pin-pays-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #AD330A;
  box-shadow: 0 2px 8px rgba(173,51,10,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.pe-pin-pays-count {
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1;
}

.pe-pin-pays-label { display: none; }

/* ─────────────────────────────────────────────
   MARKERS PROJETS
───────────────────────────────────────────── */
.pe-marker {
  position: absolute;
  cursor: pointer;
  width: 64px;
  height: 64px;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.pe-marker[data-pulse-revealed] {
  z-index: 10;
}

.pe-marker-svg {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  overflow: visible;
}

.pe-marker-logo-wrap {
  position: absolute;
  left: 32px;
  bottom: 32px;
  transform: translate(-50%, calc(-100% - 10px));
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s cubic-bezier(.22,1,.36,1);
  white-space: nowrap;
}

.pe-marker-logo {
  max-width: 80px;
  max-height: 32px;
  object-fit: contain;
  display: block;
}

/* Pulse rings */
[data-pulse-ring] {
  opacity: 0;
  transform: scale(0);
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

[data-pulse-revealed] [data-pulse-ring] {
  opacity: 1;
  transform: scale(1);
}

[data-pulse-revealed] [data-pulse-ring="1"] { transition-delay: 0s;    }
[data-pulse-revealed] [data-pulse-ring="2"] { transition-delay: 0.12s; }
[data-pulse-revealed] [data-pulse-ring="3"] { transition-delay: 0.24s; }

/* ─────────────────────────────────────────────
   CLUSTERS PROJETS
───────────────────────────────────────────── */
.pe-cluster {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #AD330A;
  color: #FFFFFF;
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

/* ─────────────────────────────────────────────
   BOUTON RETOUR EUROPE
───────────────────────────────────────────── */
.pe-btn-retour {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #FBF8F2;
  color: #241813;
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(36,24,19,0.12);
  transition: background 0.2s ease, transform 0.2s ease;
}

/* ─────────────────────────────────────────────
   CARD PROJET
   Desktop (≥ 992px) : side panel droit, pleine hauteur, slide depuis droite
   Mobile  (≤ 991px) : bottom sheet, margin équivalent aux côtés
───────────────────────────────────────────── */

/* ── BASE commune ─────────────────────────────────────────── */
.pe-card {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  overflow-y: auto;
  overflow-x: hidden;

  background: #FFFFFF;
  border: 1px solid rgba(36, 24, 19, 0.08);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.12);

  transition: transform 0.45s cubic-bezier(.22,1,.36,1),
              opacity   0.35s cubic-bezier(.22,1,.36,1);
}

/* ── DESKTOP : side panel droit ──────────────────────────── */
@media (min-width: 992px) {
  .pe-card {
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: 300px;
    border-right: none;
    border-top: none;
    border-bottom: none;
    border-radius: 0;
    transform: translateX(100%);
    opacity: 0;
  }

  .pe-card--visible {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  /* Pas de poignée sur desktop */
  .pe-card::before {
    display: none;
  }
}

/* ── MOBILE : bottom sheet ───────────────────────────────── */
@media (max-width: 991px) {
  .pe-card {
    /* Marges latérales = 12px de chaque côté → margin-bottom identique */
    left: 12px;
    right: 12px;
    bottom: 12px;
    top: auto;
    width: auto;
    max-height: 70%;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.88);
    transform: translateY(calc(100% + 12px)); /* sort complètement + compense le margin-bottom */
    opacity: 0;
  }

  .pe-card--visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  /* Poignée tactile */
  .pe-card::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(36, 24, 19, 0.18);
    margin: 12px auto 0;
    flex-shrink: 0;
  }
}

/* ── Bouton fermer ────────────────────────────────────────── */
.pe-card-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(36, 24, 19, 0.08);
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #241813;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 1;
  /* Cible tactile ≥ 44px via padding invisible */
  padding: 8px;
  margin: -8px;
}

/* ── Logo ─────────────────────────────────────────────────── */
.pe-card-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px 0;
  min-height: 80px;
}

.pe-card-logo {
  max-width: 160px;
  max-height: 52px;
  object-fit: contain;
  display: block;
}

.pe-card-logo-placeholder {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #241813;
  text-align: center;
}

/* ── Description ──────────────────────────────────────────── */
.pe-card-desc {
  padding: 16px 24px 0;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
  color: #241813;
  text-align: center;
  margin: 0;
}

/* ── Blocs de stats ───────────────────────────────────────── */
.pe-card-stats {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px 24px 0;
}

.pe-card-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pe-card-stat-label {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #AD330A;
}

.pe-card-stat-value {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.3px;
  color: #241813;
}

.pe-card-stat-divider {
  width: 100%;
  height: 1px;
  background: rgba(36, 24, 19, 0.08);
  margin: 14px 0;
}

/* ── Liste des pays ───────────────────────────────────────── */
.pe-card-pays-list {
  padding: 12px 24px 28px;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
  color: rgba(36, 24, 19, 0.6);
  margin: 0;
}

/* ── Ajustements mobile ───────────────────────────────────── */
@media (max-width: 991px) {
  .pe-card-logo-wrap {
    padding: 20px 20px 0;
    min-height: 60px;
  }

  .pe-card-logo {
    max-width: 130px;
    max-height: 44px;
  }

  .pe-card-desc {
    padding: 12px 20px 0;
  }

  .pe-card-stats {
    padding: 14px 20px 0;
  }

  .pe-card-stat-value {
    font-size: 18px;
  }

  .pe-card-pays-list {
    padding: 10px 20px 24px;
  }
}

/* ── Padding bottom de sécurité quand pas de stats ni liste ─ */
/* Dernier enfant dans la card = toujours au moins 24px de respiration */
.pe-card-logo-wrap:last-child,
.pe-card-desc:last-child {
  padding-bottom: 28px;
}

@media (max-width: 991px) {
  .pe-card-logo-wrap:last-child,
  .pe-card-desc:last-child {
    padding-bottom: 24px;
  }
}

/* ─────────────────────────────────────────────
   BACKDROP
───────────────────────────────────────────── */
.pe-backdrop {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(36, 24, 19, 0.25);
  z-index: 15;
  transition: opacity 0.3s ease;
}

.pe-backdrop--visible {
  display: block;
}

/* ─────────────────────────────────────────────
   SCROLL TRAP
───────────────────────────────────────────── */
.pe-scroll-trap {
  position: absolute;
  inset: 0;
  z-index: 30;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: opacity 0.3s ease;
}

.pe-scroll-trap--actif {
  opacity: 0;
  pointer-events: none;
}

.pe-scroll-trap-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: #0E0000;
  border-radius: 2px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #FFFFFF;
  pointer-events: none;
  white-space: nowrap;
}

@media (min-width: 992px) {
  .pe-scroll-trap {
    align-items: flex-start;
    justify-content: flex-end;
    padding: 32px 32px 0 0;
  }
}

/* ─────────────────────────────────────────────
   BOUTON RECENTRER
───────────────────────────────────────────── */
@media (min-width: 992px) {
  .pe-recentrer {
    position: absolute;
    bottom: 28px;
    right: 32px;
    z-index: 10;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    color: #0E0000;
    cursor: pointer;
    transition: background 0.15s ease;
  }
}

@media (max-width: 991px) {
  .pe-recentrer {
    position: absolute;
    bottom: 8px;
    right: 16px;
    z-index: 10;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    box-shadow: none;
    color: #0E0000;
    cursor: pointer;
  }
}

/* ─────────────────────────────────────────────
   MASQUER LOGO MAPBOX + ATTRIBUTION
───────────────────────────────────────────── */
#projets-map-europe-section .mapboxgl-ctrl-logo,
#projets-map-europe-section .mapboxgl-ctrl-attrib {
  display: none !important;
}

/* ============================================================
   EFFETS HOVER — uniquement sur devices avec pointeur précis
============================================================ */
@media (hover: hover) and (pointer: fine) {

  /* ── Pins pays ────────────────────────────────────────────── */
  .pe-pin-pays {
    transition: transform 0.3s cubic-bezier(.22,1,.36,1), opacity 0.3s ease;
  }
  .pe-pin-pays:hover {
    transform: translateY(-3px) scale(1.06);
  }
  .pe-pin-pays-dot {
    transition: box-shadow 0.25s ease, background 0.2s ease;
  }
  .pe-pin-pays:hover .pe-pin-pays-dot {
    transform: none;
    box-shadow: 0 6px 18px rgba(173,51,10,0.42);
    background: #8E2608;
  }

  /* ── Clusters ────────────────────────────────────────────── */
  .pe-cluster {
    transition: transform 0.25s cubic-bezier(.22,1,.36,1),
                box-shadow 0.25s ease,
                background  0.2s ease;
  }
  .pe-cluster:hover {
    transform: scale(1.1);
    background: #8E2608;
    box-shadow: 0 4px 14px rgba(173,51,10,0.28);
  }

  /* ── Markers projets ─────────────────────────────────────── */
  .pe-marker-svg {
    transition: transform 0.3s cubic-bezier(.22,1,.36,1);
  }
  .pe-marker:hover .pe-marker-svg {
    transform: scale(1.12) translateY(-2px);
  }
  .pe-marker:hover [data-pulse-ring] {
    opacity: 1;
    transform: scale(1);
  }
  .pe-marker:hover [data-pulse-ring="1"] { transition-delay: 0s;    }
  .pe-marker:hover [data-pulse-ring="2"] { transition-delay: 0.10s; }

  /* ── Bouton Vue Europe ───────────────────────────────────── */
  .pe-btn-retour {
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.25s cubic-bezier(.22,1,.36,1);
  }
  .pe-btn-retour:hover {
    background: #EFE9DF;
    transform: translateX(-3px);
    box-shadow: 0 4px 16px rgba(36,24,19,0.16);
  }
  .pe-btn-retour:active {
    transform: translateX(0);
  }

  /* ── Card hover (desktop side panel) ────────────────────── */
  .pe-card:not(:empty):hover {
    box-shadow: 0 6px 40px rgba(0,0,0,0.16);
  }

  /* ── Bouton fermer × ─────────────────────────────────────── */
  .pe-card-close {
    transition: background 0.18s ease, transform 0.2s ease;
  }
  .pe-card-close:hover {
    background: rgba(36,24,19,0.15);
    transform: scale(1.15);
  }

  /* ── Bouton Recentrer ────────────────────────────────────── */
  .pe-recentrer {
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.2s ease !important;
  }
  .pe-recentrer:hover {
    background: #FFFFFF !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
    transform: scale(1.08) !important;
  }

} /* fin @media hover */

/* ── Légende (phrase bas de card) ────────────────────────── */
.pe-card-legend {
  padding: 8px 24px 28px;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
  color: #241813;
  margin: 0;
}

/* Si la légende est le seul élément en bas (sans pays-list avant) */
.pe-card-legend:last-child {
  padding-bottom: 28px;
}

@media (max-width: 991px) {
  .pe-card-legend {
    padding: 6px 20px 24px;
  }
}