/* ===== CARTE pleine page ===== */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.carte-fullpage {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  background: #f0f4f8;
  z-index: 2000;
}

/* Top bar */
.carte-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--primary-dark);
  color: white;
  flex-shrink: 0;
  z-index: 10;
}

.carte-back {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.2s;
  white-space: nowrap;
}

.carte-back:hover { color: white; }

.carte-topbar h1 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  flex: 1;
  text-align: center;
  color: white;
}

.carte-total {
  background: rgba(255,255,255,0.15);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Filters bar */
.carte-filters-bar {
  display: flex;
  gap: 6px;
  padding: 8px 24px;
  background: white;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
  z-index: 10;
}

.carte-filter-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.carte-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.carte-filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Map area */
.carte-map-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#leaflet-map {
  width: 100%;
  height: 100%;
}

/* Region labels */
.carte-region-label {
  font-size: 11px;
  font-weight: 600;
  fill: var(--primary-dark);
  pointer-events: none;
  text-anchor: middle;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.carte-region {
  fill: #dce4ef;
  stroke: white;
  stroke-width: 2;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carte-region:hover,
.carte-region-hover {
  fill: var(--primary-light);
  filter: drop-shadow(0 0 10px rgba(26, 58, 107, 0.35));
}

.carte-region-active {
  fill: var(--primary) !important;
  filter: drop-shadow(0 0 14px rgba(26, 58, 107, 0.5));
}

.carte-region-active + .carte-region-label,
.carte-region:hover ~ .carte-region-label {
  opacity: 1;
  fill: white;
}

/* Tooltip */
.carte-tooltip {
  position: absolute;
  background: var(--primary-dark);
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  line-height: 1.4;
}

.carte-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 20px;
  width: 12px;
  height: 12px;
  background: var(--primary-dark);
  transform: rotate(45deg);
}

/* Panel */
.carte-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 90vw;
  background: white;
  box-shadow: -4px 0 30px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.carte-panel-open {
  transform: translateX(0);
}

.carte-panel-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.carte-panel-header h3 {
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin: 0;
}

.carte-panel-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-alt);
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.carte-panel-close:hover { background: #fee2e2; color: #dc2626; }

.carte-panel-filters {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.carte-panel-filters select {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  background: white;
  cursor: pointer;
}

.carte-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.carte-coop-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.carte-coop-card:hover { background: var(--bg-alt); }
.carte-coop-card:last-child { border-bottom: none; }

.carte-coop-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.carte-coop-info { flex: 1; min-width: 0; }

.carte-coop-info strong {
  display: block;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carte-coop-info span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
}

.carte-coop-card > svg:last-child {
  flex-shrink: 0;
  color: var(--text-light);
  opacity: 0;
  transition: opacity 0.2s;
}

.carte-coop-card:hover > svg:last-child { opacity: 1; }

@media (max-width: 768px) {
  .carte-panel {
    width: 100%;
    max-width: 100%;
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    max-height: 55vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -4px 30px rgba(0,0,0,0.2);
  }
  .carte-panel-open {
    transform: translateY(0);
  }
  .carte-topbar { padding: 10px 16px; }
  .carte-topbar h1 { font-size: 0.95rem; }
  .carte-filters-bar { padding: 8px 16px; }
}
