/* ── Consent-Overlay ── */
.cts-map-consent {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #f0f4f8;
    border-radius: 0;
    overflow: hidden;
    text-align: center;
    padding: 40px 30px;
    font-family: 'Questrial', sans-serif;
    position: relative;
}
.cts-map-consent-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.45;
}
.cts-map-consent-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(20%);
}
.cts-map-consent-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    padding: 36px 44px;
    border-radius: 16px;
}
.cts-map-consent-subtitle {
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #3073b1;
    margin: 0;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}
.cts-map-consent-title {
    font-size: 34px;
    font-weight: 800;
    color: #0f1f2f;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(255,255,255,0.9);
}
.cts-map-consent-divider {
    width: 60px;
    height: 3px;
    background: #3073b1;
    border-radius: 2px;
    opacity: 0.6;
}
.cts-map-consent-text {
    font-size: 20px;
    color: #1a2a3a;
    max-width: 480px;
    line-height: 1.65;
    margin: 0;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}
.cts-map-consent-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #3073b1;
    color: #fff;
    border: none;
    padding: 14px 36px;
    font-size: 16px;
    font-family: 'Questrial', sans-serif;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(48, 115, 177, 0.35);
    margin-top: 4px;
}
.cts-map-consent-btn:hover {
    background: #255d91;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(48, 115, 177, 0.45);
}
.cts-map-consent-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.cts-map-consent-link {
    font-size: 15px;
    color: #8a9aaa;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.cts-map-consent-link:hover {
    color: #5a6a7a;
    border-bottom-color: #5a6a7a;
}

/* ── Kritische Leaflet-Layout-Regeln ── */
.leaflet-container {
    position: relative !important;
    overflow: hidden !important;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}
.leaflet-pane {
    position: absolute !important;
    left: 0;
    top: 0;
}
.leaflet-map-pane    { z-index: 1 !important; }
.leaflet-tile-pane   { z-index: 2 !important; }
.leaflet-overlay-pane{ z-index: 4 !important; }
.leaflet-shadow-pane { z-index: 5 !important; }
.leaflet-marker-pane { z-index: 6 !important; }
.leaflet-tooltip-pane{ z-index: 7 !important; }
.leaflet-popup-pane  { z-index: 7 !important; }
.leaflet-tile-container {
    position: absolute !important;
    left: 0; top: 0;
}
.leaflet-tile {
    position: absolute !important;
    -webkit-user-select: none;
    user-select: none;
    visibility: visible;
}
.leaflet-zoom-animated { transform-origin: 0 0; }
.leaflet-control-container { position: relative; z-index: 10; }
.leaflet-top, .leaflet-bottom {
    position: absolute;
    z-index: 1000;
    pointer-events: none;
}
.leaflet-top { top: 0; }
.leaflet-bottom { bottom: 0; }
.leaflet-left { left: 0; }
.leaflet-right { right: 0; }
.leaflet-control { pointer-events: auto; float: left; clear: both; }
.leaflet-right .leaflet-control { float: right; clear: right; }

/* ── Theme-CSS-Overrides ── */
.leaflet-container img:not(.leaflet-marker-icon):not(.leaflet-marker-shadow) {
    max-width: none !important; max-height: none !important;
    width: auto !important; height: auto !important;
    padding: 0 !important; margin: 0 !important;
    border: none !important; border-radius: 0 !important;
    box-shadow: none !important;
}
.leaflet-marker-icon,
.leaflet-marker-shadow { display: block !important; }

/* ── CTS Map Container ── */
.cts-map-container {
    width: 100%;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* ── Zoom-Controls ── */
.leaflet-control-zoom { margin: 12px; border: none !important; }
.leaflet-bar {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    border: none !important;
    overflow: hidden;
}
.leaflet-bar a {
    display: block; width: 36px; height: 36px; line-height: 36px;
    text-align: center; text-decoration: none; color: #333;
    font-size: 18px; font-weight: 700; background: #fff;
    border-bottom: 1px solid #e8e8e8;
    transition: background 0.15s ease;
}
.leaflet-bar a:hover { background: #f0f0f0; }
.leaflet-bar a:first-child { border-radius: 8px 8px 0 0; }
.leaflet-bar a:last-child  { border-radius: 0 0 8px 8px; border-bottom: none; }
.leaflet-control-attribution {
    margin: 0 10px 0 0; padding: 0 5px;
    background: rgba(255,255,255,0.8); font-size: 11px;
}
.leaflet-control-attribution a { text-decoration: none; }

/* ── Popup ── */
.leaflet-popup { position: absolute; text-align: center; }
.leaflet-popup-content-wrapper {
    border-radius: 16px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18) !important;
    padding: 0 !important;
    background: #fff !important;
    text-align: left;
}
.leaflet-popup-content {
    margin: 0 !important;
    font-size: 20px !important;
    font-family: 'Questrial', sans-serif !important;
    line-height: 1.5 !important;
}
.leaflet-popup-tip-container {
    width: 40px; height: 20px;
    position: absolute; left: 50%; margin-left: -20px;
    overflow: hidden; pointer-events: none;
}
.leaflet-popup-tip {
    width: 17px; height: 17px; padding: 1px;
    margin: -10px auto 0; transform: rotate(45deg);
    background: white; box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
.leaflet-popup-close-button {
    position: absolute; top: 10px !important; right: 10px !important;
    border: none; text-align: center;
    width: 28px !important; height: 28px !important;
    font: 22px/28px Tahoma, Verdana, sans-serif;
    color: #999 !important; text-decoration: none;
    background: transparent; cursor: pointer;
}
.leaflet-popup-close-button:hover { color: #333 !important; }
.leaflet-fade-anim .leaflet-popup { transition: opacity 0.2s linear; }
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup { opacity: 1; }

.cts-map-popup-inner { padding: 22px 26px 20px; }
.cts-map-popup-title {
    font-weight: 700; font-size: 22px;
    margin: 0 0 16px 0;
    color: #3073b1;
    letter-spacing: 0.02em;
}
.cts-map-popup-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 0;
}
.cts-map-popup-row + .cts-map-popup-row {
    border-top: 1px solid #f0f0f0;
}
.cts-map-popup-icon { flex-shrink: 0; width: 20px; height: 20px; opacity: 0.5; }
.cts-map-popup-label {
    font-weight: 600; font-size: 14px; color: #888;
    text-transform: uppercase; letter-spacing: 0.06em; min-width: 55px;
}
.cts-map-popup-value {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}
.cts-map-popup-value a {
    color: #333; text-decoration: none; font-size: 20px;
    transition: color 0.15s ease;
}
.cts-map-popup-value a:hover { color: #3073b1; }

/* ── Mobile ── */
@media (max-width: 520px) {
    .leaflet-popup-content  { font-size: 16px !important; }
    .cts-map-popup-inner    { padding: 14px 14px 12px; }
    .cts-map-popup-title    { font-size: 18px; }
    .cts-map-popup-label    { min-width: 40px; font-size: 12px; }
    .cts-map-popup-value a  { font-size: 15px; }

    .cts-map-consent-content  { padding: 16px 14px; }
    .cts-map-consent-title    { font-size: 24px; }
    .cts-map-consent-subtitle { font-size: 15px; }
    .cts-map-consent-text     { font-size: 16px; }
}

/* ── Zoom-Hinweis ── */
.cts-map-zoom-hint {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7); color: #fff;
    font-size: 15px; font-family: 'Questrial', sans-serif;
    padding: 10px 20px; border-radius: 8px;
    pointer-events: none; z-index: 1000;
    opacity: 0; transition: opacity 0.3s ease;
    white-space: nowrap;
}
.cts-map-zoom-hint-visible { opacity: 1; }
