/* =========================================
   zHaus – MAP LAYOUT (Full Screen)
   ========================================= */

:root {
    --zh-primary: #8A7ED9;
    --zh-bg: #f1f3f4;
    --zh-radius-lg: 18px;
    --zh-radius-md: 12px;
    --zh-shadow-soft: 0 4px 18px rgba(0, 0, 0, 0.12);
    --zh-text-muted: #5f6368;
    --zh-marker-color: #ff4b7d;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Noto Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.body-map {
    background-color: #e5e5e5;
}

.body-map .map-main-container {
    padding: 0;
    margin: 0;
    max-width: 100%;
}

/* Vollbild-Map */
.map-page {
    position: relative;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
}

#map {
    position: absolute;
    inset: 0;
}

/* =========================================
   Menü-Button & Offcanvas
   ========================================= */

.map-menu-toggle {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1044;
}

.btn-map-circle {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    color: #424242;
    font-size: 1.1rem;
    cursor: pointer;
}
.btn-map-circle:active {
    transform: translateY(1px);
}

.offcanvas-map {
    width: 260px;
    background: #ffffff;
}
.offcanvas-map .offcanvas-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.offcanvas-map-logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--zh-primary);
}
.offcanvas-map a {
    text-decoration: none;
    color: #333;
}
.offcanvas-map a:hover {
    color: var(--zh-primary);
}

/* =========================================
   TOP-UI: Suche + Filter + Mode-Buttons
   ========================================= */

.event-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.map-top-ui {
    position: absolute;
    top: 10px;
    left: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;        /* damit Map weiter scroll-/zoombar ist */
}
.map-top-ui > * {
    pointer-events: auto;
}

/* Erste Zeile: Suche + Mode-Buttons */
.map-top-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}



/* Suche */
.map-search-wrapper {
    position: relative;
    flex: 1 1 auto;
}

.map-search-bar {
    width: 100%;
    max-width: 680px;
    background: #ffffff;
    border-radius: 999px;
    box-shadow: var(--zh-shadow-soft);
    padding: 4px 4px 4px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 56px;
}

.map-search-bar .search-icon {
    color: var(--zh-text-muted);
}

.map-search-input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 0.95rem;
    background: transparent;
}
.map-search-input::placeholder {
    color: #b0b0b0;
}

.map-search-btn {
    border-radius: 999px;
    border: none;
    padding: 6px 14px;
    background: var(--zh-primary);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.map-search-reset-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}
.map-search-reset-btn:hover {
    background: rgba(148, 163, 184, 0.24);
}
.map-search-reset-btn.is-hidden {
    display: none;
}

/* Suchvorschläge */
.map-search-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    max-height: 260px;
    overflow-y: auto;
    padding: 4px 0;
    z-index: 1100;
    display: none;
}
.map-search-suggestion {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 0.82rem;
    cursor: pointer;
}
.map-search-suggestion:hover {
    background: #f1f3f4;
}
.map-search-suggestion-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}
.map-search-suggestion-text {
    display: flex;
    flex-direction: column;
}
.map-search-suggestion-title {
    font-weight: 600;
    color: #333;
}
.map-search-suggestion-sub {
    font-size: 0.75rem;
    color: #777;
}

/* Typ-Farben */
.map-search-suggestion--event .map-search-suggestion-icon {
    background: rgba(255, 75, 125, 0.12);
    color: #c93360;
}
.map-search-suggestion--city .map-search-suggestion-icon {
    background: rgba(26, 115, 232, 0.12);
    color: #1a73e8;
}

/* Mode-Buttons */
.map-mode-buttons {
    flex: 0 0 auto;
    display: inline-flex;
    gap: 0.35rem;
}

.map-mode-btn {
    border: 1px solid rgba(148, 163, 184, 0.8);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 999px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}
.map-mode-btn.is-active {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
    opacity: 1;
}
/* Desktop: Mode-Buttons rechts in der Top-Bar, keine absolute Position */
@media (min-width: 769px) {
    .map-top-bar {
        align-items: center;
    }
  
}

/* =========================================
   Chips – Kategorien & Datum
   ========================================= */

.map-chip-row {
    position: relative;
}

.map-chip-scroll {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    overflow-x: auto;
    padding: 0.2rem 0.1rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.map-chip-scroll::-webkit-scrollbar {
    display: none;
}

.map-chip-fade {
    pointer-events: none;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    right: 0;
    background: linear-gradient(to right, rgba(255,255,255,0), rgba(248,250,252,0.95));
}

/* eigentliche Chips */
.map-category-chip,
.map-date-chip {
    white-space: nowrap;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(255, 255, 255, 0.95);
    padding: 0.18rem 0.7rem;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #444;
    cursor: pointer;
}
.map-category-chip i,
.map-date-chip i {
    font-size: 0.85rem;
}
.map-category-chip.active,
.map-date-chip.active {
    border-color: var(--zh-primary);
    background: var(--zh-primary);
    color: #ffffff;
}

/* =========================================
   Bottom Controls – Zoom & Locate
   ========================================= */

.map-bottom-controls {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-map-rect {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: #ffffff;
    box-shadow: var(--zh-shadow-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #444;
    font-size: 1rem;
    cursor: pointer;
}
.btn-map-rect--mode {
    position: relative;
}
.map-mode-count-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--zh-primary);
    color: #fff;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.24);
    pointer-events: none;
}
.btn-map-rect:active {
    transform: translateY(1px);
}

/* Locate-Button – Icon dreht sich beim Suchen */
@keyframes zh-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.btn-map-rect.is-locating i {
    animation: zh-spin 0.9s linear infinite;
}
.map-locate-hint {
    position: absolute;
    right: 64px;
    bottom: 14px;
    z-index: 1001;
    width: min(320px, calc(100vw - 96px));
    background: rgba(17, 24, 39, 0.94);
    color: #fff;
    border-radius: 14px;
    padding: 10px 36px 10px 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
    font-size: 0.8rem;
    line-height: 1.35;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}
.map-locate-hint::after {
    content: '';
    position: absolute;
    right: -10px;
    bottom: 15px;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 10px solid rgba(17, 24, 39, 0.94);
}
.map-locate-hint.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.map-locate-hint-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.map-locate-hint-close:hover {
    background: rgba(255, 255, 255, 0.24);
}

/* =========================================
   User-Standort – Pulsierender Punkt
   ========================================= */

.zh-user-marker {
    position: relative;
    width: 18px;
    height: 18px;
    background: #1a73e8;
    border: 4px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(26, 115, 232, 0.7);
}
.zh-user-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    background: rgba(26, 115, 232, 0.4);
    border-radius: 50%;
    animation: zh-pulse 1.6s infinite ease-out;
}
@keyframes zh-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.6);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.3);
        opacity: 0;
    }
}

/* =========================================
   Event-Liste – Panel (Bottom-Sheet / Sidebar)
   ========================================= */

.map-event-panel {
    position: absolute;
    left: 8px;
    right: 72px;
    bottom: 64px; /* Abstand zu Bottom-Controls */
    z-index: 900;

    height: 40vh;
    max-height: 80vh;

    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);

    display: flex;
    flex-direction: column;
    overflow: hidden;

    padding: 0 10px 8px;
    transition: height 0.22s ease-out, transform 0.18s ease-out;
}

.map-event-panel--hidden {
    display: none !important;
}

.map-event-panel-header {
    padding: 6px 4px 6px 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.map-event-panel-grip {
    width: 34px;
    height: 4px;
    border-radius: 999px;
    background: rgba(0,0,0,0.2);
    margin: 3px auto 6px;
}
.map-event-panel-header small {
    color: var(--zh-text-muted);
    font-size: 0.75rem;
}

.map-event-panel-body {
    margin-top: 2px;
    padding: 4px 0 0;
    overflow-y: auto;
}

/* Card-Stack statt Tabelle */
.map-event-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem 0.75rem;
}

.map-event-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 0.55rem 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.4);
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.12s ease, border-color 0.15s ease;
}
.map-event-card:hover {
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.7);
}

.map-event-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: 0.15rem;
}
.map-event-card-title {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .9rem;
    font-weight: 600;
}
.map-event-card-title i {
    font-size: 0.9rem;
}
.map-event-card-date {
    font-size: .78rem;
    color: #6b7280;
    white-space: nowrap;
}

.map-event-card-body {
    justify-content: space-between;
    gap: .5rem;
    margin-top: 0.1rem;
}
.map-event-card-location {
    font-size: 0.82rem;
    line-height: 1.2;
    color: #6b7280;
    margin: 2px 0 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.map-event-card-meta {
    display: flex;
    align-items: center;
    gap: .4rem;
    white-space: nowrap;
}
.map-event-card-distance {
    font-size: .78rem;
    color: #6b7280;
}

/* Details-Button im Chip-Stil */
.map-chip,
.map-chip-outline {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    font-size: .78rem;
    font-weight: 500;
    border: 1px solid transparent;
    background: #f3f4f6;
    color: #111827;
}
.map-chip-outline {
    background: #ffffff;
    border-color: #d1d5db;
}
.map-chip:hover,
.map-chip-outline:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* aktive Card (per JS) */
.map-row-active,
.map-event-card.map-row-active {
    border-color: rgba(59, 130, 246, 0.95) !important;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.6), 0 6px 16px rgba(15,23,42,0.22);
}

/* Drag-Status */
.map-event-panel--dragging {
    transition: none !important;
}

/* Desktop: rechte Sidebar */
@media (min-width: 992px) {
    .map-event-panel {
        left: auto;
        right: 72px;
        top: 90px;
        bottom: 16px;
        width: 380px;
        height: auto;
        max-height: none;
        padding: 8px 10px;
    }
}

/* =========================================
   Event-Overlay (Detailseite als iFrame)
   ========================================= */

.map-event-overlay {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 2000;
}
.map-event-overlay.is-visible {
    display: block;
}
.map-event-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}
.map-event-overlay-dialog {
    position: absolute;
    inset: 5vh 5vw;
    background: #f5f7fb;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.map-event-overlay-frame {
    flex: 1;
    width: 100%;
    border: 0;
    background: transparent;
}
.map-event-overlay-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
    transition: background 0.15s ease, color 0.15s ease;
}
.map-event-overlay-close:hover {
    background: #f2f2f2;
}
.map-event-overlay-close svg,
.map-event-overlay-close i {
    color: #000 !important;
    font-size: 18px;
}
@media (max-width: 768px) {
    .map-event-overlay-dialog {
        inset: 0;
        border-radius: 0;
    }
}
body.map-event-overlay-open {
    overflow: hidden;
}

/* =========================================
   Marker & Cluster
   ========================================= */

.map-marker {
    position: relative;
    width: 32px;
    height: 32px;
    background-color: #ffffff;
    border-radius: 50%;
    border: 1px solid #d3d3d3;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.20);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.map-marker-inner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--zh-marker-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-marker::after {
    content: "";
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 9px solid #ffffff;
}

.map-marker i {
    font-size: 15px;
    color: #ffffff !important;
    --fa-primary-color: #ffffff;
    --fa-secondary-color: rgba(255,255,255,0.85);
    --fa-secondary-opacity: 1;
}

.map-marker--active {
    transform: translateY(-3px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.30);
}

@keyframes zh-bounce {
    0%   { transform: translateY(0); }
    30%  { transform: translateY(-8px); }
    60%  { transform: translateY(0); }
    80%  { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}
.map-marker--bounce {
    animation: zh-bounce 0.7s ease-out;
}

/* Cluster-Marker */
.map-marker--cluster {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    border: 1px solid rgba(0,0,0,0.1);
}

/* =========================================
   Popups
   ========================================= */

.maplibregl-popup {
    z-index: 1040;
}

.maplibregl-popup-content {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.maplibregl-popup-tip {
    display: none;
}

.map-popup {
    min-width: 220px;
    max-width: 260px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    padding: 10px 12px 10px;
    font-size: 0.85rem;
}

.map-popup-header {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 4px;
}

.map-popup-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    background: #f1f3f4;
    color: #555;
}

.map-popup-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.map-popup-meta {
    font-size: 0.78rem;
    color: #666;
    margin-bottom: 3px;
}

.map-popup-date {
    font-size: 0.78rem;
    color: #444;
    margin-bottom: 6px;
}

.map-popup-footer {
    display: flex;
    justify-content: flex-end;
}

.map-popup-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--zh-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.map-popup-link:hover {
    text-decoration: underline;
}

/* =========================================
   Loading Overlay
   ========================================= */

.map-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 1500;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.map-loading-badge {
    pointer-events: auto;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.96);
    box-shadow: 0 8px 24px rgba(0,0,0,0.24);
    font-size: 0.85rem;
    color: #444;
}

/* =========================================
   MapLibre Attribution – Toggle
   ========================================= */

/* Text immer versteckt … */
.maplibregl-ctrl-attrib .maplibregl-ctrl-attrib-inner {
    display: none !important;
}
/* … bis der Button sie aufklappt */
.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {
    display: inline !important;
}


/* Chips auf Mobile: statt Scrollen einfach umbrechen */
@media (max-width: 768px) {
    .map-chip-scroll {
        display: flex;
        flex-wrap: wrap;
        overflow-x: visible;
        padding-bottom: 0.1rem;
    }

    .map-chip-fade {
        display: none;
    }
}
/* =========================================
   Mode Buttons – links unten (wie Bottom-Controls)
   ========================================= */

/* alte Regeln/Media Queries überschreiben */
.map-mode-buttons{
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 1044;
  display: flex; /* immer sichtbar */
  flex-direction: column;
  gap: 6px;
}

/* optional: Active-State (wenn Panel ausgeblendet ist) */
#btn-list-focus.is-active{
  box-shadow: 0 0 0 3px rgba(138,126,217,0.28), var(--zh-shadow-soft);
}

/* ===== zHaus: Badge fuer gleiche Koordinaten ===== */
.map-marker-badge{
  position:absolute;
  top:-7px;
  right:-7px;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  background:#111;
  color:#fff;
  font-size:11px;
  line-height:18px;
  font-weight:700;
  border:2px solid #fff;
  box-shadow:0 2px 6px rgba(0,0,0,0.25);
}
/* ===== Popup: Liste (alle Eintraege am selben Ort) ===== */
.map-popup-chip--count{ opacity: .95; }

.map-popup-list{
  margin-top:10px;
  max-height: 340px;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding-right:4px;
}

.map-popup-row{
  display:block;
  text-decoration:none;
  color:inherit;
  border:1px solid rgba(15,23,42,0.10);
  border-radius:14px;
  padding:10px 12px;
  background:linear-gradient(180deg,#fff 0%, #fbfbfc 100%);
  box-shadow:0 6px 18px rgba(15,23,42,0.06);
}
.map-popup-row:hover{
  transform: translateY(-1px);
  box-shadow:0 10px 22px rgba(15,23,42,0.10);
}
.map-popup-row-title{
  font-weight:850;
  font-size:0.95rem;
  line-height:1.25;
  margin-bottom:6px;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.map-popup-row-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px 12px;
  font-size:0.80rem;
  color:#475569;
}
.map-popup-row-date,
.map-popup-row-place{
  display:inline-flex;
  align-items:center;
  gap:6px;
  white-space:nowrap;
}
@media (max-width:520px){
  .map-popup-row-date,
  .map-popup-row-place{ white-space:normal; }
}
/* Popup: MapLibre inline max-width ueberschreiben (damit Listen nicht abgeschnitten werden) */
.maplibregl-popup.zh-popup{ max-}
.maplibregl-popup.zh-popup .maplibregl-popup-content{
  max-}
@media (max-width:520px){
  .maplibregl-popup.zh-popup .maplibregl-popup-content{
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
  }
}


/* ===== Popup Alignment: wieder sauber über Marker zentrieren ===== */
.maplibregl-popup.zh-popup .maplibregl-popup-content{
  transform: none !important; /* entfernt evtl. translateX clamp */
}


/* ===== Category Chips: einzeilig + horizontal scroll (touch) ===== */
.map-category-chips{
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;
  gap: 10px;
}
.map-category-chips::-webkit-scrollbar{ height: 6px; }
.map-category-chips *{ flex: 0 0 auto; }
.map-category-chip,
.map-category-chips .chip,
.map-category-chips button{
  white-space: nowrap !important;
}



/* ===== Map Event Panel Header Layout ===== */
.map-event-panel-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 10px 12px;
}
.map-event-panel-header-left{ min-width:0; }
.map-event-panel-title{ min-width:0; }
.map-event-panel-header-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex: 0 0 auto;
}

/* Close Button: rund wie andere */
.map-event-panel-close{
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 10px 24px rgba(15,23,42,0.12);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.map-event-panel-close:hover{
  background:#fff;
  box-shadow: 0 14px 28px rgba(15,23,42,0.16);
}

/* ===== Category Chips: wirklich einzeilig + horizontal scroll ===== */
.map-category-chips{
  display:flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;
  gap: 10px;
  touch-action: pan-x;
    padding-top: 10px;
}
.map-category-chip{
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}


/* Popup: Inhalt sauber zentriert */
.maplibregl-popup.zh-popup .maplibregl-popup-content{
  margin: 0 auto;
}


/* Datum unter dem Titel */
.map-event-card-date {
  font-size: 0.82rem;
  line-height: 1.2;
  color: #6b7280;          /* dezentes Grau */
  margin: 2px 0 6px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/

/* Android / Flexbox Overflow Fix */
.map-event-card-body {
  overflow-x: hidden;
}

.map-event-card-body * {
  min-width: 0;
}

@media (max-width: 480px) {
  .map-event-card-date {
    font-size: 0.78rem;
  }
  .map-event-card-location {
    font-size: 0.88rem;
  }
}

/* Local extensions */
.offcanvas-map--front { z-index: 1300; }
.map-marker-icon-white { color: #ffffff !important; }

.map-event-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    margin-left: 12px;
    margin-bottom: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    color: #fff;
    background: #8A7ED9;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(138, 126, 217, 0.45);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.map-event-add-btn:hover {
    background: #7a70cc;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(138, 126, 217, 0.6);
    text-decoration: none;
}

.map-event-add-btn i,
.map-event-add-btn svg {
    font-size: 0.75rem;
}

.map-event-actions {
    display: flex;
    gap: 10px;
}

.map-event-add-btn--whatsapp {
    background: #25D366;
    color: #fff;
    border: none;
    position: relative;
    overflow: hidden;
}

.map-event-add-btn--whatsapp:hover {
    background: #1ebe5d;
}

.map-event-add-btn--whatsapp::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
    animation: waPulse 3s infinite;
}

@keyframes waPulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
    70%  { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
