/* Öffentlicher 3D-Gebäude-Viewer auf den Exposé-Landing-Pages (landing-building-3d.js).
   Alle Klassen mit Präfix lpb-, Light-Design, Variablen mit Fallbacks. */

.lpb {
    --lpb-current: #00C48C;
    --lpb-current-dark: #0d3b2e;
    --lpb-available: #bfeedd;
    --lpb-reserved: #f5c26b;
    --lpb-sold: #c9ccd1;
    --lpb-text: var(--color-text, #1f2937);
    --lpb-muted: var(--color-text-secondary, #4b5563);
    --lpb-line: var(--color-border, #e5e7eb);
    --lpb-surface: var(--color-surface, #fff);
    color: var(--lpb-text);
    font-size: 15px;
    line-height: 1.45;
}

/* ---------- Kopf: Zählzeile + Legende ---------- */

.lpb-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 20px;
    margin: 0 0 12px;
}

.lpb-count {
    margin: 0;
    font-weight: 600;
    color: var(--lpb-text);
}

.lpb-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    color: var(--lpb-muted);
}

.lpb-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lpb-swatch {
    flex: 0 0 auto;
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.lpb-swatch--current { background: var(--lpb-current); }
.lpb-swatch--available { background: var(--lpb-available); }
.lpb-swatch--reserved { background: var(--lpb-reserved); }
.lpb-swatch--sold { background: var(--lpb-sold); }

/* ---------- 3D-Bühne ---------- */

.lpb-stage {
    position: relative;
    height: 420px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(180deg, #eef4f8 0%, #f8fafb 62%, #ffffff 100%);
    box-shadow: 0 0 0 1px var(--lpb-line);
}

.lpb-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    outline: none;
}

.lpb-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--lpb-muted);
}

.lpb-stage--loading .lpb-hint {
    display: none;
}

.lpb-hint {
    position: absolute;
    left: 12px;
    bottom: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    color: var(--lpb-muted);
    pointer-events: none;
}

/* Mini-Karte nach Tap/Klick auf eine Einheit */
.lpb-tip {
    position: absolute;
    z-index: 2;
    min-width: 200px;
    max-width: 280px;
    padding: 12px 36px 12px 14px;
    border-radius: 10px;
    background: var(--lpb-surface);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(15, 23, 42, 0.06);
    font-size: 14px;
    color: var(--lpb-text);
}

.lpb-tip[hidden] {
    display: none;
}

.lpb-tip--current {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16), inset 4px 0 0 var(--lpb-current);
}

.lpb-tip-title {
    font-weight: 700;
    margin-bottom: 2px;
}

.lpb-tip-meta {
    color: var(--lpb-muted);
}

.lpb-tip-current {
    margin-top: 6px;
    font-weight: 600;
    color: #00704f;
}

.lpb-tip-link {
    display: inline-block;
    margin-top: 8px;
    font-weight: 600;
    color: #00704f;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.lpb-tip-link:hover,
.lpb-tip-link:focus-visible {
    color: var(--lpb-current-dark);
}

.lpb-tip-close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font: inherit;
    font-size: 20px;
    line-height: 1;
    color: var(--lpb-muted);
    cursor: pointer;
}

.lpb-tip-close:hover,
.lpb-tip-close:focus-visible {
    background: #f1f3f5;
    color: var(--lpb-text);
}

/* ---------- 2D-Etagenübersicht ---------- */

.lpb-overview {
    margin-top: 14px;
}

.lpb--flat .lpb-overview {
    margin-top: 4px;
}

.lpb-overview-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--lpb-muted);
    cursor: pointer;
    list-style: none;
}

.lpb-overview-summary::-webkit-details-marker {
    display: none;
}

.lpb-overview-summary::before {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}

.lpb-overview[open] > .lpb-overview-summary::before {
    transform: rotate(45deg);
}

.lpb-floors {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--lpb-line);
}

.lpb-floor {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--lpb-line);
}

.lpb-floor-label {
    flex: 0 0 72px;
    padding-top: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--lpb-muted);
}

.lpb-floor--current .lpb-floor-label {
    color: #00704f;
}

.lpb-floor--unknown .lpb-floor-label {
    font-weight: 600;
}

.lpb-chips {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lpb-chip-wrap {
    min-width: 0;
}

.lpb-chip {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 13px;
    color: var(--lpb-text);
    text-decoration: none;
}

.lpb-chip-name {
    font-weight: 600;
}

.lpb-chip-meta {
    color: var(--lpb-muted);
}

.lpb-chip-status {
    font-weight: 600;
}

.lpb-chip--available {
    background: #ecf9f4;
    border-color: var(--lpb-available);
}

.lpb-chip--available .lpb-chip-status {
    color: #00704f;
}

.lpb-chip--reserved {
    background: #fdf3e1;
    border-color: var(--lpb-reserved);
}

.lpb-chip--reserved .lpb-chip-status {
    color: #8a5300;
}

.lpb-chip--sold {
    background: #f3f4f6;
    border-color: var(--lpb-sold);
}

.lpb-chip--sold .lpb-chip-status {
    color: #4b5563;
}

.lpb-chip--current {
    background: var(--lpb-current);
    border-color: #00a877;
    color: #04281d;
}

.lpb-chip--current .lpb-chip-meta,
.lpb-chip--current .lpb-chip-status {
    color: #04281d;
}

.lpb-chip--current .lpb-swatch {
    box-shadow: inset 0 0 0 2px #ffffff;
}

a.lpb-chip:hover {
    border-color: #00a877;
    background: #ddf5ec;
}

a.lpb-chip:focus-visible,
.lpb-tip-link:focus-visible,
.lpb-tip-close:focus-visible,
.lpb-overview-summary:focus-visible {
    outline: 2px solid #00704f;
    outline-offset: 2px;
}

/* ---------- Mobil ---------- */

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

    .lpb-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .lpb-tip {
        left: 8px !important;
        right: 8px;
        top: auto !important;
        bottom: 8px;
        max-width: none;
    }

    .lpb-hint {
        display: none;
    }

    .lpb-floor {
        flex-direction: column;
        gap: 6px;
    }

    .lpb-floor-label {
        flex-basis: auto;
        padding-top: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lpb-overview-summary::before {
        transition: none;
    }
}
