/* ========================================= */
/* --- ESTILOS DEL POPUP (VENTANA MODAL) --- */
/* ========================================= */

/* 1. OVERLAY (Fondo Oscuro) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* 2. CONTENEDOR PRINCIPAL DEL MODAL (600px de Ancho) */
.promo-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    background-color: #ffffff;
    width: 90%;
    max-width: 600px; /* ANCHO SOLICITADO */

    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);

    display: none;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* 3. CLASES PARA MOSTRAR LA ANIMACIÓN */
.modal-show {
    display: block !important;
    opacity: 1;
}

/* 4. BOTÓN DE CIERRE */
.close-btn {
    position: absolute;
    top: 5px;
    right: 15px;
    color: #444;
    font-size: 36px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    z-index: 10002;
    transition: color 0.2s ease;
}

.close-btn:hover,
.close-btn:focus {
    color: #007bff;
    text-decoration: none;
}

/* 5. INTEGRACIÓN DE LA CAJA DE PLANES (Centrado del Texto) */
.promo-modal .modal-box {
    /* <<< MODIFICACIÓN CLAVE: CENTRAR TODO EL CONTENIDO DE TEXTO >>> */
    text-align: center;

    box-shadow: none;
    border: none;
    margin: 0;
    padding: 30px;
    background-color: transparent;
    position: relative;
}

/* 6. ESTILO DEL ENCABEZADO PROMOCIONAL DENTRO DE LA CAJA */
.promo-modal .modal-box h3 {
    color: #191919;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

/* 7. REFORZAR EL ESTILO DEL BOTÓN PRINCIPAL */
.promo-modal .btn-primary {
    background-color: #6ec0a1;
    border-color: #6ec0a1;
    color: #ffffff;
}

.promo-modal .btn-primary:hover {
    background-color: #4f9d86;
    border-color: #4f9d86;
}

/* 8. ADAPTACIÓN A MÓVILES */
@media (max-width: 650px) {
    .promo-modal {
        max-width: 95%;
    }

    .promo-modal .modal-box {
        padding: 20px;
    }
}

/* =========================================
   AJUSTES DEL MODAL PARA DISPOSITIVOS MÓVILES
   ========================================= */
@media (max-width: 768px) {
    /* Centra el modal y asegura márgenes externos */
    #promo-modal {
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 15px;
    }

    /* Limita la altura y permite hacer scroll interno */
    #promo-modal .modal-content {
        width: 100%;
        max-height: 85vh; /* 85% del alto de la pantalla (Viewport Height) */
        overflow-y: auto; /* Habilita el desplazamiento vertical si es necesario */
        padding-top: 25px; /* Espacio superior para que el título no choque con la X */
        padding-bottom: 15px; /* Espacio inferior para la fecha límite */
    }

    /* Posiciona la X de cierre para que no se pierda */
    #promo-modal .close-btn {
        position: absolute;
        top: 10px;
        right: 15px;
        font-size: 28px;
        z-index: 1060; /* Asegura que esté por encima del texto */
        cursor: pointer;
    }

    /* Ajusta ligeramente el tamaño del título principal para que quepa mejor */
    #promo-modal h3 {
        font-size: 1.3rem;
        line-height: 1.4;
        margin-top: 15px;
    }

    /* Evita que el texto final quede pegado al margen */
    #promo-modal p.mt-3 {
        margin-bottom: 0 !important;
        padding-bottom: 10px;
    }
}
