/* Basis-Styles (kannst Du hier zentralisieren, statt inline) */
.property .icon.active-marker {
  transform: scale(1.2);
  transition: transform 0.2s ease;
  border-color: #007bff;
  /* z. B. Blau als Highlight */
  z-index: 10;
  /* damit es über anderen Overlays liegt */
}

/* Container: flexbox über volle Viewport-Höhe */
.locations-wrapper {
  display: flex;
  height: 100vh;
  /* nimmt die gesamte Bildschirmhöhe ein */
  margin: 0;
  padding: 0;
  overflow: hidden;
  /* verhindert, dass Wrapper überläuft */
}

/* Linke Liste: fixe Breite, eigener Scroll für den Inhalt */
.location-list {
  width: 30%;
  /* 30% Breite, kannst du anpassen */
  height: 100%;
  /* exakt so hoch wie der Wrapper (100vh) */
  overflow-y: auto;
  /* nur die Liste scrollt */
  box-sizing: border-box;
  padding: 1rem;
  /* optional: etwas Innenabstand */
  background: #fff;
  /* oder passend zu deinem Design */
}

/* Rechte Karte: nimmt den Rest (70%) und volle Höhe */
#map {
  flex: 1;
  /* füllt den restlichen Platz */
  height: 100%;
  /* damit das div 100vh hoch ist */
  position: relative;
  /* kein fixed, damit Flex-Layout greift */
}

.location-item {
  padding: 20px;
  background: rgb(241, 245, 249);
  word-break: break-word;
  cursor: pointer;
  transition: box-shadow 0.3s ease-in-out;
}
.locations-wrapper {
  display: flex;
  width: 95vw;
  height: 100vh;
  overflow: hidden;
}
.location-list {
  width: 30%;
  height: 100%;
  overflow-y: auto;
  padding: 1rem;
  background: #fff;
  box-sizing: border-box;
}
#map {
  flex: 1;
  height: 100%;
  position: relative;
}
.location-item {
  padding: 20px;
  background: rgb(241, 245, 249);
  word-break: break-word;
  cursor: pointer;
  transition: box-shadow 0.3s ease-in-out;
}

/* Mobile bis 768px */
@media (max-width: 768px) {
  .locations-wrapper {
    display: block; /* statt Flexbox */
    height: auto; /* damit gesamte Seite scrollt */
    width: 100%;
  }

  .location-list {
    width: 100% !important;
    max-height: none; /* keine Begrenzung */
    overflow-y: visible; /* volle Höhe */
    padding: 0.5rem;
  }

  #map {
    width: 100% !important;
    height: 70vh; /* große Karte, aber scrollbar bleibt möglich */
    margin-top: 1rem;
  }

  .location-item {
    padding: 14px;
    font-size: 14px;
    line-height: 1.3;
  }

  .location-item img {
    max-width: 120px;
    margin-bottom: 12px;
  }
}

/* ====== Desktop-Optimierungen ====== */

/* Hover auf Listeneintrag */
.location-item:hover {
  background: var(--e-global-color-accent);
  box-shadow: rgba(0, 0, 0, 0.05) 0 2px 6px;
}

/* Aktiver Eintrag klarer sichtbar */
.location-item[active] {
  background: var(--e-global-color-accent);
  border-left: var(--e-global-color-primary);
}

@media (max-width: 768px) {
  .locations-wrapper {
    display: block;
    height: auto;
    width: 100%;
    overflow: visible !important; /* wichtig: nicht ausblenden */
  }

  .location-list {
    width: 100% !important;
    max-height: none;
    overflow: visible;
    padding: 0.5rem;
  }

  #map {
    width: 100% !important;
    /* moderne Viewport-Units mit Fallback */
    height: 70dvh;
    height: 70svh;
    height: 70vh;
    min-height: 60vh; /* safety */
    display: block;
  }
  /* Overlay für Karte */
  .map-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9999;
    flex-direction: column;
  }
  .map-overlay.active {
    display: flex;
  }
  .map-overlay-header {
    background: var(--e-global-color-accent);
    color: black;
    padding: 10px;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .map-overlay-content {
    flex: 1;
  }
}

/* Standard: Buttons und Overlay verstecken */
.map-overlay,
.location-item .show-on-mobile {
  display: none;
}

/* Nur auf Mobile anzeigen */
@media (max-width: 768px) {
  .location-item .show-on-mobile {
    display: block;
  }
  .map-overlay {
    display: none; /* bleibt unsichtbar bis JS 'active' setzt */
  }
  .map-overlay.active {
    display: flex;
  }
}

/* Standard: Overlay versteckt */
.map-overlay {
  display: none;
}

/* Standard ausblenden */
.map-overlay,
.show-on-mobile {
  display: none;
}

/* Nur Mobile sichtbar */
@media (max-width: 768px) {
  .show-on-mobile {
    display: block;
  }
  .map-overlay {
    position: fixed;
    top: 60px; /* Höhe deines Headers */
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    background: white;
    z-index: 9999;
    flex-direction: column;
  }
  .map-overlay.active {
    display: flex;
  }
  .map-overlay-header {
    background: var(--e-global-color-accent);
    color: black;
    padding: 10px;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .map-overlay-content {
    flex: 1;
  }
  .map-overlay-header a {
    font-size: 16px;
  }
}
