:root {
    --vdm-bf-overlay-opacity: .72;
    --vdm-bf-overlay-blur: 6px;
    --vdm-bf-max-width: 1100px;
    --vdm-bf-screen-spacing: 0px;
    --vdm-bf-close-size: 42px;
}

/* Evita que el contenido aparezca antes de que cargue JavaScript. */
[class*="vdm-popup-contenido-"]:not([data-vdm-bf-open="1"]) {
    display: none !important;
}

html.vdm-bf-scroll-lock,
body.vdm-bf-scroll-lock {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.vdm-bf-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: var(--vdm-bf-screen-spacing);
    background: rgba(0, 0, 0, var(--vdm-bf-overlay-opacity));
    -webkit-backdrop-filter: blur(var(--vdm-bf-overlay-blur));
    backdrop-filter: blur(var(--vdm-bf-overlay-blur));
    opacity: 0;
    visibility: hidden;
    transition: opacity .24s ease, visibility .24s ease;
}

.vdm-bf-overlay.vdm-bf-is-open {
    opacity: 1;
    visibility: visible;
}

.vdm-bf-dialog {
    position: relative;
    width: min(100%, var(--vdm-bf-max-width));
    max-height: calc(100dvh - (var(--vdm-bf-screen-spacing) * 2));
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: transparent;
    transform: translateY(16px) scale(.975);
    opacity: 0;
    transition: transform .24s ease, opacity .24s ease;
    outline: none;
}

.vdm-bf-overlay.vdm-bf-is-open .vdm-bf-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.vdm-bf-close {
    position: sticky;
    top: 8px;
    z-index: 2147483002;
    display: flex;
    align-items: center;
    justify-content: center;
    float: right;
    width: var(--vdm-bf-close-size);
    height: var(--vdm-bf-close-size);
    margin: 8px 8px calc(var(--vdm-bf-close-size) * -1 - 8px) 8px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 999px;
    background: rgba(0,0,0,.78);
    color: #fff;
    font: inherit;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(0,0,0,.28);
    -webkit-appearance: none;
    appearance: none;
    transition: transform .18s ease, background-color .18s ease;
}

.vdm-bf-close:hover,
.vdm-bf-close:focus-visible {
    background: #000;
    transform: scale(1.06);
}

.vdm-bf-close:focus-visible {
    outline: 3px solid rgba(255,255,255,.78);
    outline-offset: 2px;
}

.vdm-bf-close svg {
    width: 48%;
    height: 48%;
    display: block;
    pointer-events: none;
}

.vdm-bf-content-slot {
    width: 100%;
    min-width: 0;
    clear: both;
}

.vdm-bf-content-slot > [class*="vdm-popup-contenido-"] {
    position: relative;
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .vdm-bf-overlay {
        align-items: flex-start;
        padding: 0;
    }

    .vdm-bf-dialog {
        width: 100%;
        max-height: 100dvh;
        margin: auto 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vdm-bf-overlay,
    .vdm-bf-dialog,
    .vdm-bf-close {
        transition: none !important;
    }
}
