/**
 * BIT Popup de Avisos — estilos del modal público.
 *
 * Personalización rápida desde el tema (o desde "Apariencia > CSS adicional"):
 *
 *   .bpa-overlay {
 *       --bpa-acento: #0b5fa5;
 *       --bpa-radio: 18px;
 *   }
 */

.bpa-overlay {
    --bpa-acento: #0b5fa5;
    --bpa-acento-texto: #ffffff;
    --bpa-fondo: #ffffff;
    --bpa-texto: #1d2733;
    --bpa-texto-suave: #5b6875;
    --bpa-borde: #e4e8ee;
    --bpa-radio: 16px;
    --bpa-ancho: 560px;

    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(13, 20, 30, 0.62);
    opacity: 0;
    transition: opacity 0.28s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.bpa-overlay.is-abierto {
    opacity: 1;
}

.bpa-overlay *,
.bpa-overlay *::before,
.bpa-overlay *::after {
    box-sizing: border-box;
}

/**
 * Aislamiento frente al tema: muchos temas (y Elementor) inyectan bordes,
 * sombras, iconos por pseudo-elemento o colores en botones y enlaces
 * genéricos. Aquí se neutraliza dentro del modal.
 */
.bpa-overlay button::before,
.bpa-overlay button::after {
    content: none !important;
}

.bpa-overlay button {
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
}

.bpa-modal {
    position: relative;
    width: 100%;
    max-width: var(--bpa-ancho);
    margin: auto;
    background: var(--bpa-fondo);
    color: var(--bpa-texto);
    border-radius: var(--bpa-radio);
    box-shadow: 0 24px 64px rgba(10, 18, 30, 0.32);
    overflow: hidden;
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    font-family: inherit;
    text-align: left;
}

.bpa-overlay.is-abierto .bpa-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.bpa-modal:focus {
    outline: none;
}

/* --- Botón de cierre -------------------------------------------------- */

.bpa-overlay .bpa-cerrar {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px !important;
    height: 38px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.92) !important;
    color: #1d2733 !important;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(10, 18, 30, 0.18) !important;
    transition: background 0.2s ease, transform 0.2s ease;
}

.bpa-overlay .bpa-cerrar svg {
    display: block;
    width: 20px;
    height: 20px;
}

.bpa-overlay .bpa-cerrar:hover,
.bpa-overlay .bpa-cerrar:focus-visible {
    background: #ffffff !important;
    transform: rotate(90deg);
}

.bpa-cerrar:focus-visible {
    outline: 2px solid var(--bpa-acento);
    outline-offset: 2px;
}

/* --- Imagen ----------------------------------------------------------- */

.bpa-media {
    margin: 0;
    line-height: 0;
    background: #f2f5f8;
}

.bpa-media img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: cover;
    border-radius: 0;
}

/* --- Contenido -------------------------------------------------------- */

.bpa-cuerpo {
    padding: 28px 30px 30px;
}

.bpa-titulo {
    margin: 0 0 12px;
    padding: 0;
    font-size: 25px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--bpa-texto);
    letter-spacing: -0.01em;
}

.bpa-descripcion {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--bpa-texto-suave);
}

.bpa-descripcion p {
    margin: 0 0 12px;
}

.bpa-descripcion p:last-child {
    margin-bottom: 0;
}

.bpa-descripcion a {
    color: var(--bpa-acento);
    text-decoration: underline;
}

.bpa-descripcion ul,
.bpa-descripcion ol {
    margin: 0 0 12px;
    padding-left: 20px;
}

/* --- Archivos adjuntos ------------------------------------------------ */

.bpa-archivos {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--bpa-borde);
}

.bpa-archivos-titulo {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bpa-texto-suave);
}

.bpa-archivos-lista {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bpa-archivos-lista li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.bpa-archivo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--bpa-borde);
    border-radius: 10px;
    text-decoration: none;
    color: var(--bpa-texto);
    background: #fbfcfd;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.bpa-archivo:hover,
.bpa-archivo:focus-visible {
    border-color: var(--bpa-acento);
    background: #ffffff;
    transform: translateY(-1px);
    text-decoration: none;
}

.bpa-archivo:focus-visible {
    outline: 2px solid var(--bpa-acento);
    outline-offset: 2px;
}

.bpa-archivo-ext {
    flex: 0 0 auto;
    min-width: 44px;
    padding: 5px 8px;
    border-radius: 6px;
    background: var(--bpa-acento);
    color: var(--bpa-acento-texto);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
}

.bpa-archivo-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bpa-archivo-nombre {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bpa-archivo-peso {
    font-size: 12px;
    color: var(--bpa-texto-suave);
}

.bpa-archivo-accion {
    flex: 0 0 auto;
    display: inline-flex;
    color: var(--bpa-acento);
}

/* --- Botón de acción -------------------------------------------------- */

.bpa-pie {
    margin-top: 24px;
}

.bpa-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    border-radius: 10px;
    background: var(--bpa-acento);
    color: var(--bpa-acento-texto);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.bpa-cta:hover,
.bpa-cta:focus-visible {
    filter: brightness(1.08);
    color: var(--bpa-acento-texto);
    text-decoration: none;
    transform: translateY(-1px);
}

.bpa-cta:focus-visible {
    outline: 2px solid var(--bpa-acento);
    outline-offset: 3px;
}

/* --- Utilidades ------------------------------------------------------- */

.bpa-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html.bpa-sin-scroll {
    overflow: hidden;
}

html.bpa-sin-scroll body {
    padding-right: var(--bpa-scrollbar, 0px);
}

/* --- Responsive ------------------------------------------------------- */

@media (max-width: 600px) {
    .bpa-overlay {
        padding: 14px;
        align-items: flex-end;
    }

    .bpa-modal {
        max-height: calc(100vh - 28px);
        overflow-y: auto;
    }

    .bpa-cuerpo {
        padding: 22px 20px 24px;
    }

    .bpa-titulo {
        font-size: 21px;
    }

    .bpa-descripcion {
        font-size: 15px;
    }

    .bpa-media img {
        max-height: 190px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .bpa-overlay,
    .bpa-modal,
    .bpa-cerrar,
    .bpa-archivo,
    .bpa-cta {
        transition: none !important;
    }

    .bpa-cerrar:hover {
        transform: none;
    }
}
