/* ============================================
   CARTE.CSS – Vue carte OpenStreetMap
   Leaflet, marqueurs, popup, grille des lieux
   et bouton de géolocalisation.
   ============================================ */

/* --- Vue Carte --- */
#vue-carte {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}
#vue-carte.active { display: flex; }

#carte-leaflet {
  height: 260px;
  flex-shrink: 0;
  z-index: 1;
  border-bottom: 0.5px solid var(--bordure);
}

/* Surcharges Leaflet pour s'intégrer au thème */
.leaflet-container { font-family: inherit; }
.leaflet-popup-content-wrapper {
  border-radius: var(--rayon-sm) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
  padding: 0 !important;
}
.leaflet-popup-content {
  margin: 0 !important;
  width: auto !important;
}
.popup-lieu {
  padding: 10px 14px;
  min-width: 160px;
}
.popup-numero {
  font-size: 10px;
  font-weight: 700;
  color: var(--vert);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.popup-nom {
  font-size: 13px;
  font-weight: 600;
  color: var(--texte);
  margin-bottom: 6px;
}
.popup-spectacles {
  font-size: 11px;
  color: var(--texte-sec);
  line-height: 1.5;
}

/* Bouton "Voir tous les spectacles →" dans la popup */
.popup-btn-lieu {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 0;
  background: var(--vert-clair);
  color: var(--vert);
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

/* Marqueur numéroté personnalisé */
.marqueur-lieu {
  background: var(--vert);
  color: var(--vert-texte);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.15s;
}
.marqueur-lieu:hover { transform: scale(1.15); }

/* --- Liste des lieux sous la carte --- */
#carte-liste {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 80px;
  -webkit-overflow-scrolling: touch;
}
#carte-titre-liste {
  font-size: 13px;
  font-weight: 600;
  color: var(--texte-sec);
  margin-bottom: 10px;
}
.grille-lieux {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.carte-lieu-item {
  background: var(--surface);
  border-radius: var(--rayon-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--ombre-sm);
  transition: box-shadow 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.carte-lieu-item:hover  { box-shadow: var(--ombre); transform: translateY(-1px); }
.carte-lieu-item:active { background: var(--vert-clair); }
.numero-lieu {
  background: var(--vert);
  color: var(--vert-texte);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.nom-lieu { font-size: 11px; color: var(--texte); }

/* --- Bouton géolocalisation flottant --- */
#btn-geoloc {
  position: absolute;
  top: calc(260px - 48px);
  right: 10px;
  z-index: 10;
  width: 38px;
  height: 38px;
  background: var(--surface);
  border: 0.5px solid var(--bordure-med);
  border-radius: var(--rayon-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--texte-sec);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: color 0.15s, background 0.15s;
}
#btn-geoloc:hover     { color: var(--vert); background: var(--vert-clair); }
#btn-geoloc.chargement { color: var(--vert); }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.8s linear infinite; transform-origin: center; }
