/* =========================================================================
   rundum-zahn.com – Rahmen-Styling für den JS-API-Rechner
   --------------------------------------------------------------------------
   Der Rechner selbst rendert in einem iFrame (Domain maklerinfo.biz) und
   bringt sein eigenes Design + das übergebene Theme (4568, Sky-Blue) mit.
   Dieses CSS gestaltet nur die UMGEBUNG (Container, Auto-Höhe, Vollbild),
   die tatsächlich zu rundum-zahn.com gehört.
   ========================================================================= */

/* Container um den Rechner – wächst dank Auto-Höhe mit dem Inhalt -------- */
.rz-rechner__frame-wrap--jsapi {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, rgba(0,0,0,0.05));
    border-radius: 24px;
    box-shadow: var(--shadow-soft, 0 14px 40px -24px rgba(14,165,233,0.45));
    overflow: hidden;
    max-width: 1120px;
    margin: 0 auto;
    min-height: 400px;
    height: auto;            /* keine feste Höhe – JS-API setzt min-height */
    position: relative;
}

/* Mount-Container, in den die JS-API injiziert ------------------------- */
.rz-jsapi-mount {
    width: 100%;
    height: auto;
}

/* Der von der API erzeugte iFrame soll volle Breite nutzen ------------- */
.rz-jsapi-mount iframe {
    width: 100% !important;
    border: 0 !important;
    display: block;
}

/* Toolbar mit Vollbild-Button ----------------------------------------- */
.rz-rechner__toolbar {
    max-width: 1120px;
    margin: 0 auto 0.75rem;
    display: flex;
    justify-content: flex-end;
}

.rz-fullscreen-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body, "Inter", sans-serif);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--tech-dark, #0284c7);
    background: var(--tech-glow, rgba(14,165,233,0.12));
    border: 1px solid transparent;
    padding: 0.55rem 1rem;
    border-radius: 100px;
    cursor: pointer;
    transition: var(--transition, all 0.2s ease);
}

.rz-fullscreen-btn:hover {
    background: var(--tech-primary, #0ea5e9);
    color: #fff;
}

.rz-fullscreen-btn__icon { width: 18px; height: 18px; }

/* Fehler-/Fallback-Box ------------------------------------------------- */
.rz-jsapi-error {
    text-align: center;
    padding: clamp(2rem, 5vw, 3.5rem) 1.5rem;
    color: var(--text-muted, #475569);
}
.rz-jsapi-error a { color: var(--tech-primary, #0ea5e9); font-weight: 600; }
.rz-jsapi-error__hint { font-size: 0.9rem; margin-top: 0.75rem; }

/* Vollbild-Zustand des Containers ------------------------------------- */
.rz-rechner__frame-wrap--jsapi.rz-fs-active {
    position: fixed;
    inset: 0;
    z-index: 2000;
    max-width: none;
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    border: 0;
    overflow: auto;
}
.rz-rechner__frame-wrap--jsapi.rz-fs-active .rz-jsapi-mount iframe {
    min-height: 100vh;
}

.rz-fs-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2001;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.rz-fs-close svg { width: 22px; height: 22px; }
.rz-fs-close:hover { background: rgba(15, 23, 42, 1); }

body.rz-fs-lock { overflow: hidden; }

/* Mobile -------------------------------------------------------------- */
@media (max-width: 600px) {
    .rz-rechner__frame-wrap--jsapi {
        border-radius: 16px;
    }
    .rz-rechner__toolbar {
        justify-content: stretch;
        margin-bottom: 1rem;
    }
    .rz-fullscreen-btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        background: var(--tech-primary, #0ea5e9);
        color: #fff;
    }
    .rz-fullscreen-btn__icon { width: 20px; height: 20px; }
}

/* Mobile iFrame Fix: verhindert Abschneiden nach Ergebnis-Ansicht ------- */
@media (max-width: 600px) {
    .rz-rechner__frame-wrap--jsapi {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* iFrame-Inhalt auf verfügbare Breite skalieren statt abschneiden.
       Das JS in rechner-jsapi.js setzt --rz-iframe-scale dynamisch.
       Fallback 1 = keine Skalierung (schadet nicht). */
    .rz-jsapi-mount iframe {
        transform-origin: top left;
        transform: scale(var(--rz-iframe-scale, 1));
    }
}
