.lulu-carto-wrapper {
  font-family: 'Montserrat', -apple-system, sans-serif;
  position: relative;
  width: 100%;
  height: 100%;
}

/* ── Elementor : forcer le widget à remplir la hauteur du conteneur parent
   (les conteneurs Elementor sont flex column, donc on utilise flex-grow plutôt que height: 100%) ── */
.elementor-element:has(> .elementor-widget-container > .lulu-carto-wrapper) {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  align-self: stretch;
}
.elementor-element:has(> .elementor-widget-container > .lulu-carto-wrapper) > .elementor-widget-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.elementor-element:has(> .elementor-widget-container > .lulu-carto-wrapper) > .elementor-widget-container > .lulu-carto-wrapper {
  flex-grow: 1;
}

/* ── DESKTOP / MOBILE SWITCH ── */
.lulu-desktop-view { display: block; height: 100%; }
.lulu-mobile-card { display: none; }

@media (max-width: 768px) {
  .lulu-desktop-view { display: none !important; }
  .lulu-mobile-card { display: block !important; }
}

/* ── CARTE DESKTOP ── */
.lulu-desktop-view #lulu-map {
  width: 100%;
  height: 100%;
  min-height: 400px;
  background: #F8F9FA;
  position: relative;
}

/* ── PANNEAU DE FILTRES (DESKTOP) ── */
.lulu-filter-card {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lulu-filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  transition: all 0.15s;
  user-select: none;
  white-space: nowrap;
}
.lulu-filter-item:hover { background: #F1F5F9; }
.lulu-filter-item.active {
  background: #0F172A;
  color: white;
  font-weight: 600;
}
.lulu-filter-item .icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lulu-filter-item .icon svg { width: 18px; height: 18px; }
.lulu-filter-item .count { margin-left: auto; font-size: 11px; font-weight: 600; opacity: 0.6; padding-left: 8px; }

/* ── PINS ── */
.lulu-pin { width: 22px; height: 28px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25)); }

/* ── CLUSTERS ── */
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large {
  background: rgba(15, 23, 42, 0.15) !important;
}
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
  background: #0F172A !important;
  color: white !important;
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 700 !important;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.marker-cluster span { line-height: 28px !important; font-size: 12px !important; }

/* ── POPUP ── */
.leaflet-popup-content-wrapper {
  border-radius: 12px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12) !important;
  padding: 0 !important;
}
.leaflet-popup-content { margin: 0 !important; min-width: 220px; }
.leaflet-popup-tip { box-shadow: none !important; }
.lulu-popup { font-family: 'Montserrat', sans-serif; padding: 14px 16px; }
.lulu-popup .tag {
  display: inline-block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 3px 8px; border-radius: 5px; margin-bottom: 8px;
}
.lulu-popup h4 { font-size: 14px; font-weight: 700; color: #0F172A; margin: 0 0 3px 0; line-height: 1.3; }
.lulu-popup p { font-size: 12px; color: #64748B; line-height: 1.4; margin: 0; }
.lulu-popup a { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 600; color: #1B9E5C; text-decoration: none; }

/* Boutons d'action dans popup (autopartage notamment) */
.lulu-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.lulu-popup-actions .lulu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  margin: 0;
  transition: all 0.15s ease;
  text-align: center;
}
.lulu-popup-actions .lulu-btn-primary {
  background: #e73363;
  color: #fff !important;
}
.lulu-popup-actions .lulu-btn-primary:hover {
  background: #cc2855;
}
.lulu-popup-actions .lulu-btn-secondary {
  background: #F8F9FA;
  color: #582483 !important;
  border: 1px solid #E2E8F0;
}
.lulu-popup-actions .lulu-btn-secondary:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}
.lulu-popup-actions .lulu-btn svg {
  flex-shrink: 0;
}

/* Mode "légende" du panneau de filtres (quand un seul type est forcé via shortcode) */
.lulu-filter-card.lulu-legend-mode {
  padding: 14px 16px;
  min-width: 0;
  width: auto;
}
.lulu-legend-header {
  font-size: 10px;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.lulu-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Montserrat', sans-serif;
}
.lulu-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lulu-legend-label {
  font-size: 14px;
  font-weight: 600;
  color: #0F172A;
}
.lulu-legend-count {
  margin-left: auto;
  font-size: 12px;
  color: #94A3B8;
  font-weight: 500;
}

/* ── LEAFLET CONTROLS ── */
.leaflet-control-zoom a {
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(10px);
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  border: none !important;
  color: #475569 !important;
  font-weight: 600 !important;
  width: 32px !important; height: 32px !important; line-height: 32px !important;
}
.leaflet-control-zoom a:first-child { margin-bottom: 4px; }
.leaflet-control-attribution { background: rgba(255, 255, 255, 0.75) !important; font-size: 10px !important; padding: 2px 6px !important; }

/* ── CARTE MOBILE COMPACTE ── */
.lulu-mobile-card {
  background: white;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  font-family: 'Montserrat', sans-serif;
}
.lulu-mobile-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.lulu-mobile-header h3 { font-size: 17px; font-weight: 700; color: #0F172A; margin: 0; }
.lulu-expand-btn {
  background: none; border: none; color: #1B9E5C;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; padding: 4px 8px;
}
.lulu-mobile-map-wrap { position: relative; border-radius: 16px; overflow: hidden; margin-bottom: 16px; }
#lulu-mini-map { height: 180px; width: 100%; background: #E2E8F0; pointer-events: none; }
.lulu-mini-label {
  position: absolute; bottom: 12px; left: 12px;
  background: white; padding: 7px 14px; border-radius: 50px;
  font-size: 12px; font-weight: 600; color: #0F172A;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.lulu-mobile-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.lulu-mobile-chips::-webkit-scrollbar { display: none; }
.lulu-mobile-chip {
  padding: 10px 18px; border-radius: 50px; background: white;
  border: 1.5px solid #E2E8F0;
  font-family: inherit; font-size: 13px; font-weight: 600; color: #475569;
  cursor: pointer; white-space: nowrap; transition: all 0.15s; flex-shrink: 0;
}
.lulu-mobile-chip.active { background: #0F172A; color: white; border-color: #0F172A; }

/* ── OVERLAY PLEIN ÉCRAN ── */
.lulu-fullscreen-overlay {
  display: none; position: fixed; inset: 0;
  z-index: 2147483646;
  background: white; flex-direction: column;
}
.lulu-fullscreen-overlay.active { display: flex; }
.lulu-fullscreen-close {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  right: 16px;
  z-index: 2147483647;
  background: #0F172A;
  color: #fff !important;
  border: none;
  border-radius: 50px;
  min-width: 48px;
  min-height: 48px;
  padding: 12px 20px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: rgba(255,255,255,0.2);
  touch-action: manipulation;
}
.lulu-fullscreen-close:active {
  transform: scale(0.96);
}
.lulu-fullscreen-close svg {
  stroke: #fff;
}
#lulu-fullscreen-map { flex: 1; width: 100%; }
.lulu-fullscreen-chips {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  left: 12px; right: 12px;
  display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  z-index: 2147483647;
}
.lulu-fullscreen-chips::-webkit-scrollbar { display: none; }

/* Bloque le scroll du body quand l'overlay carte est ouvert sur mobile */
body.lulu-fullscreen-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Badges lignes desservies dans popup arrêt */
.lulu-popup .lulu-lignes {
  margin: 8px 0;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.lulu-ligne-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.3px;
}
.lulu-ligne-badge.ligne-L1A { background: #D6184C; }
.lulu-ligne-badge.ligne-L1B { background: #F49A60; color: #4A2800; }
.lulu-ligne-badge.ligne-L2  { background: #6DB656; }

/* Prochains passages temps réel */
.lulu-popup .lulu-passages {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  font-size: 12px;
}
.lulu-passages-title {
  font-weight: 700;
  color: #374151;
  margin-bottom: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.lulu-passages-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lulu-passages-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  color: #1F2937;
}
.lulu-passages-list .lulu-heure {
  color: #9CA3AF;
  font-size: 11px;
  margin-left: auto;
}
.lulu-no-passages {
  color: #9CA3AF;
  font-style: italic;
  font-size: 12px;
}

.lulu-passages-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  align-items: center;
  padding: 6px 0;
}
.lulu-passages-list li .lulu-src-live {
  grid-row: 1 / 3;
}
.lulu-passages-list li .lulu-ligne-badge {
  grid-column: 1 / 2;
  grid-row: 1;
}
.lulu-direction {
  grid-column: 2;
  grid-row: 1;
  font-size: 12px;
  color: #6B7280;
  font-style: italic;
}
.lulu-quand {
  grid-column: 2;
  grid-row: 2;
  font-size: 12px;
  color: #1F2937;
  font-weight: 500;
}
.lulu-passages-list li .lulu-heure {
  grid-column: 3;
  grid-row: 1 / 3;
  font-size: 11px;
  color: #9CA3AF;
  align-self: center;
}

.lulu-src-theo {
  grid-row: 1 / 3;
  color: #9CA3AF;
  font-size: 10px;
  margin-right: 4px;
}
.lulu-src-live {
  grid-row: 1 / 3;
  color: #10B981;
  font-size: 10px;
  margin-right: 4px;
  animation: lulu-pulse 1.5s ease-in-out infinite;
}
@keyframes lulu-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.lulu-popup .lulu-passages {
  max-height: 200px;
  overflow-y: auto;
}

/* ── FIX Z-INDEX : contrôles Leaflet sous le menu de nav ── */
.leaflet-top,
.leaflet-bottom,
.leaflet-control-zoom,
.leaflet-control-container {
  z-index: 400 !important;
}

.lulu-desktop-view #lulu-map {
  z-index: 1;
}