/* ==========================================================================
   POPUPS, OVERLAYS & SCHLIESSEN-KREUZE (FLUSSIG OHNE AUFBLITZEN)
   ========================================================================== */

/* VERHINDERT LAYOUT-SPRUNG BEIM SCROLLBAR-AUSBLENDEN */
html {
    scrollbar-gutter: stable;
}

body.modal-open {
    overflow: hidden !important;
}

/* OVERLAY: VERSTECKT DURCH VISIBILITY & OPACITY FÜR SEIDENWEICHE FADE-IN TRANSITION */
.oerv-modal-overlay,
.kurs-modal-overlay,
.team-modal-overlay,
.anfrage-modal-overlay {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.75) !important;
    z-index: 9999999 !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    
    /* Sanftes Einblenden ohne Aufblitzen */
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out !important;
}

/* WENN DAS MODAL AKTIV IST */
.oerv-modal-overlay.is-active,
.kurs-modal-overlay.is-active,
.team-modal-overlay.is-active,
.anfrage-modal-overlay.is-active,
.oerv-modal-overlay[style*="flex"],
.kurs-modal-overlay[style*="flex"] {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* CONTENT BOX IM POPUP MIT SANFTEM SKALIER-EFFEKT */
.oerv-modal-content,
.kurs-modal-content,
.team-modal-content,
.anfrage-modal-box {
    position: relative !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    max-width: 600px !important;
    width: 100% !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
    border-top: 6px solid #147b71 !important;
    padding: 30px !important;
    box-sizing: border-box !important;
    z-index: 99990 !important;
    transform: scale(0.96);
    transition: transform 0.2s ease-in-out !important;
}

.is-active .oerv-modal-content,
.is-active .kurs-modal-content,
.is-active .team-modal-content,
.is-active .anfrage-modal-box {
    transform: scale(1);
}

/* SCHLIESSEN-KREUZ (X) */
.oerv-modal-close,
button.oerv-modal-close,
.kurs-modal-close,
span.oerv-modal-close,
.modal-close {
    position: absolute !important;
    top: 12px !important;
    right: 15px !important;
    width: 30px !important;
    height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    font-size: 26px !important;
    font-weight: bold !important;
    color: #888888 !important;
    cursor: pointer !important;
    line-height: 30px !important;
    text-align: center !important;
    z-index: 99995 !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    display: block !important;
    pointer-events: auto !important;
}

.oerv-modal-close:hover,
.kurs-modal-close:hover,
.modal-close:hover {
    color: #147b71 !important;
    background: transparent !important;
}