/**
 * Cookie-Consent-Overlay – scrollbarer Inhalt, fixierte Aktions-Buttons
 */
#cookieConsentOverlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.8);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    box-sizing: border-box;
}

#cookieConsentOverlay.is-open {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

#cookieConsentOverlay .cookie-consent-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    max-height: min(90vh, calc(100dvh - 24px));
    max-height: min(90vh, calc(100vh - 24px));
    margin: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#cookieConsentOverlay .cookie-consent-header {
    flex-shrink: 0;
}

#cookieConsentOverlay .cookie-consent-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#cookieConsentOverlay .cookie-consent-footer {
    flex-shrink: 0;
}

#cookieConsentOverlay .cookie-consent-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

#cookieConsentOverlay .cookie-consent-buttons button {
    flex: 1 1 auto;
    min-width: min(100%, 140px);
}

body.cookie-consent-open {
    overflow: hidden !important;
}

@media (max-height: 700px) {
    #cookieConsentOverlay {
        align-items: flex-start;
    }

    #cookieConsentOverlay .cookie-consent-modal {
        max-height: calc(100dvh - 16px);
        max-height: calc(100vh - 16px);
        margin-top: 8px;
        margin-bottom: 8px;
    }
}
