/**
 * Shared overlay modals — public site (about, treatments, cookie settings).
 * Safe areas (notched phones), scroll containment, body scroll lock via .bpc-modal-open.
 */

body.bpc-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

body.bpc-modal-open .dpc-back-to-top {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}

/* Outer shell padding for notched / home-indicator devices */
.bpc-modal-safe {
    box-sizing: border-box;
    padding: max(10px, env(safe-area-inset-top, 0px))
        max(12px, env(safe-area-inset-right, 0px))
        max(12px, env(safe-area-inset-bottom, 0px))
        max(12px, env(safe-area-inset-left, 0px));
}

/* Panel: caps height; children use .bpc-modal__scroll for the scrolling region */
.bpc-modal__panel {
    box-sizing: border-box;
    max-height: min(
        90dvh,
        calc(
            100svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) -
                24px
        )
    );
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bpc-modal__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
