/* === Preiskalkulator Mobile-Fix: Collapsible Bottom-Sheet === */

@media (max-width: 1100px) {

    /* === Wizard bekommt padding-bottom damit Sheet ihn nicht überdeckt === */
    .kalk-main .container {
        padding-bottom: 90px;
    }

    /* === SUMMARY als Bottom-Sheet === */
    .kalk-summary {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        margin: 0 !important;
        z-index: 9988;
        max-height: 70vh;
        transform: translateY(calc(100% - 80px));
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: visible;
    }
    .kalk-summary.is-expanded {
        transform: translateY(0);
    }

    /* === Sheet-Inner === */
    .kalk-summary-inner {
        position: relative;
        padding: 18px 22px 22px;
        margin: 0;
        border-radius: 22px 22px 0 0;
        max-height: 70vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 -12px 32px rgba(0,0,0,0.35);
    }

    /* === Drag-Handle (Swipe-Indicator) === */
    .kalk-summary-inner::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255,255,255,0.35);
        border-radius: 2px;
        cursor: pointer;
    }

    /* === Tap-Bar (Collapsed-State) === */
    .kalk-summary-collapse-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 6px 6px;
        cursor: pointer;
        user-select: none;
    }
    .kalk-summary-collapse-bar-label {
        color: rgba(255,255,255,0.7);
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-weight: 600;
    }
    .kalk-summary-collapse-bar-price {
        color: #fff;
        font-weight: 700;
        font-size: 1.05rem;
    }
    .kalk-summary-collapse-bar-toggle {
        background: rgba(232,93,63,0.18);
        color: #FFB89A;
        border: none;
        padding: 6px 12px;
        border-radius: 999px;
        font-size: 0.78rem;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        cursor: pointer;
    }
    .kalk-summary-collapse-bar-toggle::after {
        content: '▲';
        font-size: 0.7rem;
        transition: transform 0.3s ease;
    }
    .kalk-summary.is-expanded .kalk-summary-collapse-bar-toggle::after {
        transform: rotate(180deg);
    }

    /* === Eyebrow + Stats: Hide wenn collapsed === */
    .kalk-summary:not(.is-expanded) .kalk-summary-eyebrow,
    .kalk-summary:not(.is-expanded) .kalk-summary-price,
    .kalk-summary:not(.is-expanded) .kalk-disclaimer-banner,
    .kalk-summary:not(.is-expanded) .kalk-summary-list,
    .kalk-summary:not(.is-expanded) .kalk-summary-cta,
    .kalk-summary:not(.is-expanded) .kalk-summary-note {
        display: none;
    }

    /* === Expanded-State: Bar oben + Inhalt drunter === */
    .kalk-summary.is-expanded .kalk-summary-collapse-bar {
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        margin-bottom: 8px;
    }

    /* === Backdrop bei Expanded === */
    .kalk-summary-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(4px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 9987;
    }
    .kalk-summary.is-expanded ~ .kalk-summary-backdrop,
    body.kalk-summary-open .kalk-summary-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}

/* === Sehr kleine Screens: nochmal kompakter === */
@media (max-width: 480px) {
    .kalk-summary-collapse-bar-price { font-size: 0.95rem; }
    .kalk-summary { max-height: 80vh; }
    .kalk-summary-inner { max-height: 80vh; }
}
