/* ── Variablen ───────────────────────────────────────────── */
:root {
    --green:  #1b5e20;
    --green-l:#2e7d32;
    --bg:     #fafaf7;
    --card:   #ffffff;
    --border: #e8e6df;
    --text:   #1a1a18;
    --muted:  #6b6860;
    --radius: 12px;
    --map-h:  320px;
}
@media (min-width: 600px) { :root { --map-h: 420px; } }
@media (min-width: 900px) { :root { --map-h: 540px; } }

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; }

/* ── Hero ───────────────────────────────────────────────── */
.hero { background: var(--green); color: #fff; padding: 1.75rem 1rem 1.5rem; text-align: center; position: relative; }
.hero h1 { font-size: clamp(1.35rem, 5vw, 2.1rem); font-weight: 700; margin-bottom: .3rem; }
.hero-meta { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: .5rem; }
.hero-meta span { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2); border-radius: 20px; padding: 3px 10px; font-size: .78rem; }
.hero-desc { max-width: 500px; margin: .6rem auto 0; font-size: .85rem; opacity: .9; line-height: 1.55; }
.admin-link { position: absolute; top: .75rem; right: .75rem; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: rgba(255,255,255,.85); text-decoration: none; border-radius: 8px; padding: 4px 10px; font-size: .73rem; }

/* ── Container ──────────────────────────────────────────── */
.container { max-width: 1060px; margin: 0 auto; padding: 1rem; }

/* ── Karten-Tabs ────────────────────────────────────────── */
.map-tabs { display: flex; gap: .35rem; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: .85rem; padding-bottom: 2px; scrollbar-width: none; }
.map-tabs::-webkit-scrollbar { display: none; }
.map-tab { flex-shrink: 0; padding: 6px 14px; border: 1.5px solid var(--border); border-radius: 20px; background: var(--card); font-size: .82rem; cursor: pointer; transition: all .18s; white-space: nowrap; font-family: inherit; }
.map-tab.active { background: var(--green); color: #fff; border-color: var(--green); }
.map-tab:hover:not(.active) { border-color: var(--green); color: var(--green); }

/* ── Map Panel ──────────────────────────────────────────── */
.map-view { display: none; }
.map-view.active { display: block; }

/* ── Einheitliche Map-Box ───────────────────────────────── */
.map-box { width: 100%; height: var(--map-h); position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #eef0e8; }

.map-box .leaflet-container { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; border-radius: var(--radius); }
.no-map-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; color: var(--muted); font-size: .88rem; }
.no-map-ph .ic { font-size: 2.5rem; }

/* ── Pins ───────────────────────────────────────────────── */
.pin { position: absolute; transform: translate(-50%, -100%); cursor: pointer; z-index: 10; -webkit-tap-highlight-color: transparent; }
.pin-body { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: flex; align-items: center; justify-content: center; border: 2px solid rgba(255,255,255,.7); box-shadow: 0 2px 8px rgba(0,0,0,.28); transition: transform .15s; }
.pin:hover .pin-body { transform: rotate(-45deg) scale(1.15); }
.pin-body span { transform: rotate(45deg); font-size: 12px; line-height: 1; }
.pin-label { position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 10px; font-weight: 600; background: rgba(255,255,255,.95); border: 1px solid #ddd; border-radius: 3px; padding: 1px 5px; pointer-events: none; opacity: 0; transition: opacity .15s; }
.pin:hover .pin-label { opacity: 1; }

/* ── Legende ────────────────────────────────────────────── */
.legend { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .75rem; }
.legend-chip { display: flex; align-items: center; gap: 4px; background: var(--card); border: 1.5px solid var(--border); border-radius: 20px; padding: 3px 9px; font-size: .75rem; cursor: pointer; transition: all .15s; user-select: none; }
.legend-chip.active { border-color: var(--green); background: #f0fdf4; }

/* ── Standliste ─────────────────────────────────────────── */
.section-title { font-size: .95rem; font-weight: 600; margin: 1.1rem 0 .6rem; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .55rem; }
@media (min-width: 600px) { .cards-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .65rem; } }

.stand-card { background: var(--card); border: 1.5px solid var(--border); border-radius: 10px; padding: .75rem; cursor: pointer; transition: border-color .18s, transform .15s; -webkit-tap-highlight-color: transparent; }
.stand-card:hover, .stand-card:active { border-color: var(--green); transform: translateY(-1px); }
.stand-card.filtered { display: none; }
.c-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; margin-bottom: .35rem; }
.c-name { font-weight: 500; font-size: .85rem; margin-bottom: .1rem; }
.c-cat  { font-size: .7rem; color: var(--muted); }
.c-desc { font-size: .72rem; color: var(--muted); margin-top: .3rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }




@media (min-width: 600px) {
    .popup-overlay { align-items: center; padding: 1rem; }
    .popup { border-radius: 14px; max-width: 360px; }
    .popup-handle { display: none; }
    @keyframes slideUp { from { transform: scale(.93); opacity: 0; } to { transform: scale(1); opacity: 1; } }
}

/* ── Footer ─────────────────────────────────────────────── */
footer { text-align: center; padding: 1.25rem 1rem; font-size: .72rem; color: var(--muted); border-top: 1px solid var(--border); margin-top: 1.5rem; }

/* ── Leaflet Popup ───────────────────────────────────────── */
.lf-popup-wrap .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.18);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
}
.lf-popup-wrap .leaflet-popup-content {
    margin: 0;
    line-height: 1.5;
}
.lf-popup-wrap .leaflet-popup-tip-container {
    margin-top: -1px;
}
.lf-popup-wrap .leaflet-popup-tip {
    box-shadow: none;
}
.lf-popup-wrap .leaflet-popup-close-button {
    top: 8px; right: 8px;
    width: 22px; height: 22px;
    font-size: 16px;
    background: rgba(0,0,0,.06);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
}

.lf-popup {
    padding: .85rem .95rem .9rem;
    min-width: 160px;
}
.lf-popup-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: .4rem;
}
.lf-popup-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.lf-popup-name {
    font-weight: 600;
    font-size: .88rem;
    color: var(--text);
}
.lf-popup-cat {
    font-size: .72rem;
    color: var(--muted);
}
.lf-popup-desc {
    font-size: .8rem;
    color: var(--muted);
    line-height: 1.55;
    white-space: pre-wrap;
    border-top: 1px solid var(--border);
    margin-top: .5rem;
    padding-top: .5rem;
}

/* ── Stand-Karte aktiv + Hinweis ─────────────────────────── */
.stand-card { cursor: pointer; position: relative; transition: border-color .18s, transform .15s, box-shadow .18s; }
.stand-card:hover { box-shadow: 0 2px 12px rgba(27,94,32,.1); }
.stand-card.card-active {
    border-color: var(--green);
    background: #f0fdf4;
    box-shadow: 0 2px 12px rgba(27,94,32,.15);
}
.c-hint {
    font-size: .68rem;
    color: var(--green);
    margin-top: .4rem;
    opacity: 0;
    transition: opacity .15s;
}
.stand-card:hover .c-hint { opacity: 1; }
.stand-card.card-active .c-hint { opacity: 1; }
