:root {
    --sb-green: #82b02a;
    --sb-dark: #4a4a49;
    --sb-orange: #eb991d;
    --sb-blue: #77c7f0;
}

/*
 * Leaflet core layout fallback.
 *
 * Leaflet is loaded on demand. These essential layout rules are kept locally
 * so tiles, markers and controls stay positioned correctly when the external
 * Leaflet stylesheet is delayed or blocked.
 */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
    position: absolute;
    left: 0;
    top: 0;
}

.leaflet-container {
    overflow: hidden;
    background: #ddd;
    outline-offset: 1px;
    -webkit-tap-highlight-color: transparent;
    font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
    display: block;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
    max-width: none !important;
    max-height: none !important;
    width: auto;
    padding: 0;
}

.leaflet-tile { visibility: hidden; }
.leaflet-tile-loaded { visibility: inherit; }
.leaflet-pane { z-index: 400; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg { z-index: 200; }

.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
    pointer-events: none;
}

.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive {
    pointer-events: auto;
}

.leaflet-control {
    position: relative;
    z-index: 800;
    clear: both;
    pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
    position: absolute;
    z-index: 1000;
    pointer-events: none;
}

.leaflet-top { top: 0; }
.leaflet-right { right: 0; }
.leaflet-bottom { bottom: 0; }
.leaflet-left { left: 0; }
.leaflet-left .leaflet-control { float: left; margin-left: 10px; }
.leaflet-right .leaflet-control { float: right; margin-right: 10px; }
.leaflet-top .leaflet-control { margin-top: 10px; }
.leaflet-bottom .leaflet-control { margin-bottom: 10px; }

.leaflet-bar {
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .65);
}

.leaflet-bar a {
    display: block;
    width: 26px;
    height: 26px;
    border-bottom: 1px solid #ccc;
    background: #fff;
    color: #000;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
    text-decoration: none;
}

.leaflet-bar a:first-child { border-radius: 4px 4px 0 0; }
.leaflet-bar a:last-child { border: 0; border-radius: 0 0 4px 4px; }
.leaflet-bar a:hover,
.leaflet-bar a:focus { background: #f4f4f4; }

.leaflet-control-attribution {
    margin: 0;
    padding: 0 5px;
    background: rgba(255, 255, 255, .8);
    color: #333;
    line-height: 1.4;
}

.leaflet-popup {
    position: absolute;
    margin-bottom: 20px;
    text-align: center;
}

.leaflet-popup-content-wrapper {
    padding: 1px;
    border-radius: 12px;
    background: #fff;
    color: #333;
    text-align: left;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .4);
}

.leaflet-popup-content {
    min-height: 1px;
    margin: 13px 24px 13px 20px;
    font-size: 13px;
    line-height: 1.3;
}

.leaflet-popup-tip-container {
    position: absolute;
    left: 50%;
    width: 40px;
    height: 20px;
    margin-top: -1px;
    margin-left: -20px;
    overflow: hidden;
    pointer-events: none;
}

.leaflet-popup-tip {
    width: 17px;
    height: 17px;
    margin: -10px auto 0;
    padding: 1px;
    transform: rotate(45deg);
    background: #fff;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .4);
}

.leaflet-container a.leaflet-popup-close-button {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    color: #757575;
    font: 16px/24px Tahoma, Verdana, sans-serif;
    text-align: center;
    text-decoration: none;
}

.leaflet-zoom-animated { transform-origin: 0 0; }
.leaflet-zoom-anim .leaflet-zoom-animated { transition: transform .25s cubic-bezier(0, 0, .25, 1); }
.leaflet-zoom-anim .leaflet-zoom-hide { visibility: hidden; }
.leaflet-grab { cursor: grab; }
.leaflet-dragging .leaflet-grab { cursor: grabbing; }

.sb-map-shell {
    margin: 1.25rem 0;
}

.sb-map-stage {
    position: relative;
}

.sb-map {
    position: relative;
    z-index: 0;
    min-height: min(var(--sb-map-height, 620px), 75vh);
    overflow: hidden;
    border: 1px solid rgba(74, 74, 73, .16);
    border-radius: 18px;
    background: #eef1eb;
}

.sb-map .leaflet-tile-pane {
    filter: saturate(.38) brightness(1.08) contrast(.9);
}

.sb-map-wheel-hint {
    position: absolute;
    z-index: 1200;
    top: 50%;
    left: 50%;
    padding: .7rem 1rem;
    border-radius: 999px;
    background: rgba(63, 70, 59, .92);
    color: #fff;
    box-shadow: 0 7px 24px rgba(37, 44, 31, .2);
    font: 700 .82rem/1.2 Montserrat, sans-serif;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -42%);
    transition: opacity .18s ease, transform .18s ease;
    white-space: nowrap;
}

.sb-map-wheel-hint.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%);
}

@media (max-width: 520px) {
    .sb-map-wheel-hint {
        max-width: calc(100% - 32px);
        text-align: center;
        white-space: normal;
    }
}

.sb-map-consent,
.sb-map-error,
.sb-map-empty {
    min-height: min(var(--sb-map-height, 620px), 75vh);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
}

.sb-map-consent strong {
    display: block;
    color: var(--sb-dark);
    font: 700 clamp(1.25rem, 2vw, 1.75rem)/1.2 Montserrat, sans-serif;
}

.sb-map-consent p {
    max-width: 620px;
    margin: .65rem auto 0;
}

.sb-map-load {
    border: 0;
    border-radius: 999px;
    padding: .85rem 1.35rem;
    background: var(--sb-green);
    color: #fff;
    font: 700 1rem/1 Montserrat, sans-serif;
    cursor: pointer;
}

.sb-map-load:hover,
.sb-map-load:focus-visible {
    background: #6f9822;
}

.sb-map.is-loading::after {
    content: "Karte wird geladen …";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--sb-dark);
    background: rgba(238, 241, 235, .92);
    font-weight: 700;
}

.sb-map-note {
    margin: .55rem .15rem 0;
    color: #666;
    font-size: .85rem;
}

.sb-map-info {
    position: absolute;
    z-index: 760;
    right: 16px;
    bottom: 16px;
}

.sb-map-legend + .sb-map-info { bottom: 74px; }

.sb-map-info button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(74, 74, 73, .15);
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    color: var(--sb-dark);
    box-shadow: 0 5px 18px rgba(37, 44, 31, .16);
    cursor: help;
    font: 700 1rem/1 Montserrat, sans-serif;
    backdrop-filter: blur(6px);
}

.sb-map-info p {
    position: absolute;
    right: 0;
    bottom: 43px;
    width: min(310px, calc(100vw - 44px));
    margin: 0;
    padding: 11px 13px;
    border-radius: 9px;
    background: rgba(63, 70, 59, .96);
    color: #fff;
    box-shadow: 0 8px 26px rgba(37, 44, 31, .22);
    font-size: .82rem;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
    transition: opacity .18s ease, transform .18s ease;
}

.sb-map-info:hover p,
.sb-map-info:focus-within p {
    opacity: 1;
    transform: translateY(0);
}

.sb-map-legend {
    position: absolute;
    z-index: 750;
    bottom: 16px;
    left: 50%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .65rem 1rem;
    max-width: calc(100% - 32px);
    margin: 0;
    padding: .55rem .8rem;
    border: 1px solid rgba(74, 74, 73, .12);
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: #51514e;
    box-shadow: 0 5px 18px rgba(37, 44, 31, .14);
    font-size: .82rem;
    transform: translateX(-50%);
    backdrop-filter: blur(6px);
}

.sb-map-legend > span {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
}

.sb-map-legend__status {
    width: 11px;
    height: 11px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--sb-green);
    box-shadow: 0 0 0 1px rgba(74, 74, 73, .18);
}

.sb-map-legend__status--reserved { background: var(--sb-orange); }
.sb-map-legend__kind { display: inline-grid; width: 20px; height: 20px; place-items: center; color: var(--sb-dark); }
.sb-map-legend__kind svg { width: 18px; height: 18px; }

.sb-view-switch {
    display: inline-flex;
    gap: .25rem;
    margin: 0 0 1.25rem;
    padding: .25rem;
    border-radius: 999px;
    background: #f0f1ee;
}

.sb-view-switch button {
    border: 0;
    border-radius: 999px;
    padding: .7rem 1.15rem;
    background: transparent;
    color: var(--sb-dark);
    font: 700 .95rem/1 Montserrat, sans-serif;
    cursor: pointer;
}

.sb-view-switch button[aria-selected="true"] {
    background: var(--sb-green);
    color: #fff;
}

.sb-estate-browser [hidden] { display: none !important; }

.sb-map-stats {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin: 1rem 0;
}

.sb-map-stats > div {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .65rem .85rem;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    background: #fff;
}

.sb-map-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--sb-green);
}

.sb-map-dot--reserved { background: var(--sb-orange); }
.sb-map-dot--sold,
.sb-map-dot--hidden { background: var(--sb-dark); }

.sb-leaflet-marker-wrap {
    background: none;
    border: 0;
}

.sb-leaflet-marker {
    position: relative;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    box-sizing: border-box;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--sb-green);
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .28);
    font: 700 12px/1 Montserrat, sans-serif;
}

.sb-leaflet-marker::before {
    display: none;
}

.sb-leaflet-marker b {
    transform: rotate(45deg);
    font: inherit;
}
.sb-map-marker-icon { display: grid; transform: rotate(45deg); }
.sb-map-marker-icon svg { width: 18px; height: 18px; }
.sb-leaflet-marker--reserved { background: var(--sb-orange); }
.sb-leaflet-marker--sold,
.sb-leaflet-marker--hidden { background: var(--sb-dark); }
.sb-leaflet-marker--available { background: var(--sb-green); }

.sb-map-popup {
    max-height: 410px;
    overflow: auto;
}

.sb-map-popup__heading {
    display: block;
    padding: .75rem .8rem .35rem;
    color: var(--sb-dark);
}

.sb-map-popup-card {
    margin: 0;
    border-bottom: 1px solid #e5e5e5;
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
}

.sb-map-popup-card:last-child { border-bottom: 0; }

.sb-map-popup-card img {
    display: block;
    width: 100%;
    height: 130px;
    object-fit: cover;
}

.sb-map-popup-card__body {
    display: flex;
    flex-direction: column;
    gap: .28rem;
    padding: .75rem .8rem .85rem;
}

.sb-map-popup-card__body strong {
    color: var(--sb-dark);
    font: 700 1rem/1.25 Montserrat, sans-serif;
}

.sb-map-popup-card__location,
.sb-map-popup-card__meta,
.sb-map-popup-card__reference,
.sb-map-popup-card__coordinates {
    color: #686868;
    font-size: .82rem;
}

.sb-map-popup-card__price {
    margin-bottom: .12rem;
    color: #5d8420;
    font: 700 1.05rem/1.2 Montserrat, sans-serif;
}

.sb-map-popup-card__location { color: #535650; font-weight: 600; }
.sb-map-popup-card__meta { margin-bottom: .06rem; text-transform: none; }

.sb-map-popup-card a {
    align-self: flex-start;
    margin-top: .3rem;
    color: #5d8420;
    font-weight: 700;
}

.sb-map-shell--admin .sb-map {
    border-radius: 10px;
}

@media (max-width: 640px) {
    .sb-map { min-height: min(var(--sb-map-height, 520px), 70vh); }
    .sb-map-consent { min-height: min(var(--sb-map-height, 520px), 70vh); padding: 1.25rem; }
    .sb-map-legend { right: 10px; bottom: 10px; left: 10px; max-width: none; gap: .4rem .7rem; border-radius: 12px; font-size: .72rem; transform: none; }
    .sb-map-legend__kind { width: 17px; height: 17px; }
    .sb-map-legend__kind svg { width: 16px; height: 16px; }
    .sb-map-legend + .sb-map-info { right: 10px; bottom: 82px; }
    .sb-view-switch { display: flex; width: 100%; }
    .sb-view-switch button { flex: 1; }
}
