/* =============================================================================
   lp24-map.css
   Mapbox GL JS component styles for las-palmas-24.com
   Ergänzung zu lp24.css — als separate Datei oder ans Ende von lp24.css anhängen
   ============================================================================= */

/* ── Karten-Container ────────────────────────────────────────────────────── */

.lp24-map {
  width: 100%;
  height: 480px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: var(--lp24-gray-100, #f3f4f6);
}

/* Höhenvarianten via data-Attribut oder Modifier-Klasse */
.lp24-map--tall   { height: 600px; }
.lp24-map--short  { height: 320px; }
.lp24-map--full   { height: 100vh; border-radius: 0; }

/* ── Store-Locator Layout ────────────────────────────────────────────────── */

.lp24-map-locator {
  display: flex;
  gap: 0;
  height: 520px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}

.lp24-map-sidebar {
  width: 300px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--lp24-gray-200, #e5e7eb);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lp24-map-sidebar__inner {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Scrollbar styling (WebKit) */
.lp24-map-sidebar__inner::-webkit-scrollbar { width: 4px; }
.lp24-map-sidebar__inner::-webkit-scrollbar-track { background: transparent; }
.lp24-map-sidebar__inner::-webkit-scrollbar-thumb {
  background: var(--lp24-gray-300, #d1d5db);
  border-radius: 2px;
}

.lp24-map-locator__map {
  flex: 1;
  height: 100% !important;
  border-radius: 0 !important;
}

/* ── Sidebar Items ───────────────────────────────────────────────────────── */

.lp24-map-sidebar__list {
  padding: 8px;
}

.lp24-map-sidebar__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s ease;
  border-bottom: 1px solid var(--lp24-gray-100, #f3f4f6);
  position: relative;
}

.lp24-map-sidebar__item:hover {
  background: var(--lp24-gray-50, #f9fafb);
}

.lp24-map-sidebar__item--active {
  background: #fff5ec;
  border-left: 3px solid var(--lp24-orange, #cc6601);
}

.lp24-map-sidebar__thumb {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 5px;
  overflow: hidden;
}

.lp24-map-sidebar__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lp24-map-sidebar__info {
  flex: 1;
  min-width: 0;
}

.lp24-map-sidebar__name {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--lp24-gray-800, #1f2937);
  line-height: 1.3;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lp24-map-sidebar__teaser {
  display: block;
  font-size: .75rem;
  color: var(--lp24-gray-500, #6b7280);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.lp24-map-sidebar__link {
  display: inline-block;
  margin-top: 4px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--lp24-orange, #cc6601);
  text-decoration: none;
}

.lp24-map-sidebar__link:hover { text-decoration: underline; }

.lp24-map-sidebar__dist {
  font-size: .72rem;
  font-weight: 600;
  color: var(--lp24-gray-400, #9ca3af);
  white-space: nowrap;
  align-self: flex-start;
  padding-top: 2px;
}

/* ── Custom Marker ───────────────────────────────────────────────────────── */

.lp24-map-marker {
  width: 32px;
  height: 40px;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
  --marker-color: #555;
}

.lp24-map-marker svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.35));
}

.lp24-map-marker:hover {
  transform: scale(1.15) translateY(-2px);
}

.lp24-map-marker--active {
  transform: scale(1.2) translateY(-3px);
  filter: brightness(1.1);
  z-index: 10;
}

/* ── Popup ───────────────────────────────────────────────────────────────── */

/* Override Mapbox default popup styles */
.lp24-mapbox-popup .mapboxgl-popup-content {
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
  max-width: 280px;
  font-family: inherit;
}

.lp24-mapbox-popup .mapboxgl-popup-close-button {
  font-size: 18px;
  color: #fff;
  right: 6px;
  top: 4px;
  background: rgba(0,0,0,.25);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  line-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.lp24-mapbox-popup .mapboxgl-popup-close-button:hover {
  background: rgba(0,0,0,.45);
}

.lp24-map-popup {
  font-size: .875rem;
}

.lp24-map-popup__img {
  height: 140px;
  overflow: hidden;
}

.lp24-map-popup__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lp24-map-popup__body {
  padding: 12px 14px 14px;
}

.lp24-map-popup__title {
  margin: 0 0 6px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--lp24-gray-800, #1f2937);
  line-height: 1.3;
}

.lp24-map-popup__teaser {
  margin: 0 0 10px;
  font-size: .8rem;
  color: var(--lp24-gray-500, #6b7280);
  line-height: 1.5;
}

.lp24-map-popup__link {
  display: inline-block;
  padding: 5px 12px;
  background: var(--lp24-orange, #cc6601);
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: .8rem;
  font-weight: 600;
  transition: background .15s ease;
}

.lp24-map-popup__link:hover {
  background: #b35900;
  color: #fff;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .lp24-map {
    height: 340px;
  }

  .lp24-map-locator {
    flex-direction: column;
    height: auto;
    border-radius: 8px;
  }

  .lp24-map-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--lp24-gray-200, #e5e7eb);
    max-height: 240px;
  }

  .lp24-map-locator__map {
    height: 320px !important;
  }

  .lp24-mapbox-popup .mapboxgl-popup-content {
    max-width: 240px;
  }
}

@media (max-width: 480px) {
  .lp24-map-sidebar {
    max-height: 200px;
  }

  .lp24-map-locator__map {
    height: 260px !important;
  }
}
