/* ── Reset & Base ─────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  color: #3b201b;
  overflow: hidden;
}

/* ── Map (füllt gesamtes Fenster) ─────────────────────── */
#map {
  width: 100%;
  height: 100%;
  z-index: 1;
  background-color: #fdf8f2;
}

/* Kartenkacheln in Graustufen */
.leaflet-tile-pane {
  filter: grayscale(1) brightness(1.05) contrast(0.95);
}

/* MarkerCluster: Polygon-Linien ausblenden */
.leaflet-overlay-pane svg path {
  stroke: none !important;
  fill: none !important;
}

/* ── Legende (schwebendes Panel) ──────────────────────── */
.legend {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  font-size: 0.88rem;
}

.legend-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fdf8f2;
  border: 1px solid #faf2e7;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(59, 32, 27, 0.12);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #3b201b;
  transition: background 0.15s;
}

.legend-toggle:hover {
  background: #faf2e7;
}

.legend-toggle-icon {
  font-size: 1rem;
}

.legend-body {
  display: none;
  margin-top: 6px;
  background: #fdf8f2;
  border: 1px solid #faf2e7;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(59, 32, 27, 0.12);
  padding: 10px 14px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

.legend--open .legend-body {
  display: block;
}

/* ── Kategorie-Einträge ───────────────────────────────── */
.category-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  cursor: pointer;
  font-size: 0.88rem;
  user-select: none;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.category-filter--off {
  opacity: 0.4;
}

.category-filter input[type='checkbox'] {
  display: none;
}

/* ── Alle ein-/ausblenden ─────────────────────────────── */
.legend-toggle-all {
  display: block;
  width: 100%;
  padding: 6px 0;
  margin-bottom: 6px;
  border: none;
  border-bottom: 1px solid #faf2e7;
  background: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #3b201b;
  cursor: pointer;
  text-align: left;
}

.legend-toggle-all:hover {
  color: #000000;
}

.category-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 15px;
  flex-shrink: 0;
  transition: transform 0.12s, box-shadow 0.12s;
}

.category-dot svg {
  width: 14px;
  height: 14px;
}

.category-filter:hover .category-dot {
  transform: scale(1.1);
}

.category-label {
  font-weight: 500;
  color: #3b201b;
}

/* ── Custom Map Markers ───────────────────────────────── */
.marker-pin {
  --pin-color: #3b82f6;
  position: relative;
  width: 32px;
  height: 32px;
  background: var(--pin-color);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.marker-pin span {
  transform: rotate(45deg);
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-pin span svg {
  width: 16px;
  height: 16px;
}

.marker-pin--coworking span svg {
  width: 20px;
  height: 20px;
}

.marker-pin--coworking {
  --pin-color: #3b201b;
  width: 40px;
  height: 40px;
  border: 3px solid #fdf8f2;
}

.marker-pin--coworking span {
  font-size: 18px;
}

/* ── Leaflet Popup ────────────────────────────────────── */
.leaflet-popup-content-wrapper {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(59, 32, 27, 0.15);
  background: #fdf8f2;
}

.leaflet-popup-tip {
  box-shadow: 0 2px 6px rgba(59, 32, 27, 0.1);
  background: #fdf8f2;
}

.popup-content h3 {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #3b201b;
  margin-bottom: 0.1rem;
  padding-top: 0.4rem;
  padding-bottom: 0;
}

.popup-content p {
  font-size: 0.85rem;
  color: #3b201b;
  opacity: 0.75;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.popup-content .popup-address {
  font-size: 0.8rem;
  color: #3b201b;
  opacity: 0.6;
}

.popup-content a {
  display: inline-block;
  margin-top: 0.4rem;
  color: #3b201b;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
}

.popup-content a:hover {
  text-decoration: underline;
}

.popup-content--main h3 {
  color: #3b201b;
  font-size: 1.1rem;
}

/* ── Coworking Button ─────────────────────────────────── */
.btn-coworking {
  position: absolute;
  bottom: 28px;
  left: 12px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fdf8f2;
  border: 1px solid #faf2e7;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(59, 32, 27, 0.12);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #3b201b;
  transition: background 0.15s;
}

.btn-coworking:hover {
  background: #faf2e7;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 480px) {
  .legend {
    top: 8px;
    right: 8px;
  }

  .legend-toggle-label {
    display: none;
  }

  .legend-body {
    max-width: calc(100vw - 60px);
  }

  .category-label {
    font-size: 0.82rem;
  }
}
