/* ==========================================================================
   PERSINOVAA - MODALS.CSS
   Modales, Pop-ups y Botón Flotante de WhatsApp
   Agencia: Web Total México
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BOTÓN FLOTANTE DE WHATSAPP
   -------------------------------------------------------------------------- */
.float-whatsapp {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background-color: #25d366; /* Verde oficial de WhatsApp */
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.float-whatsapp:hover {
    transform: translateY(-5px) scale(1.05);
    background-color: #128c7e;
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
}

.float-whatsapp i {
    margin-top: -2px; /* Ajuste óptico fino para el icono de FontAwesome */
    margin-left: 2px;
}

/* --------------------------------------------------------------------------
   2. OVERLAY DEL MODAL (Fondo Oscuro/Blur)
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px); /* Efecto cristalino premium */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    padding: 1rem;
}

/* Estado oculto controlado por JavaScript */
.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Evita clics accidentales cuando está invisible */
}

/* --------------------------------------------------------------------------
   3. CAJA DEL MODAL (Contenedor Principal)
   -------------------------------------------------------------------------- */
.modal-box {
    background-color: #ffffff;
    width: 100%;
    max-width: 450px;
    padding: 3rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transform: scale(1);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Efecto de "Pop" al aparecer */
.modal-overlay.hidden .modal-box {
    transform: scale(0.9);
}

.relative-box {
    position: relative;
}

/* --------------------------------------------------------------------------
   4. ELEMENTOS INTERNOS DEL MODAL
   -------------------------------------------------------------------------- */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: var(--color-gray-light, #f8f9fa);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--color-gray-dark, #6c757d);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    background: #ff4757; /* Rojo sutil para denotar cierre */
    color: #ffffff;
    transform: rotate(90deg); /* Interacción lúdica */
}

.modal-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--color-primary, #0056b3);
}

.discount-box {
    padding: 1rem;
    border: 2px dashed var(--color-primary, #0056b3);
    border-radius: 12px;
    background-color: rgba(0, 86, 179, 0.05);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.success-checkmark {
    animation: successPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Animación exclusiva para el check de éxito */
@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* --------------------------------------------------------------------------
   5. RESPONSIVIDAD DE MODALES
   -------------------------------------------------------------------------- */
@media (max-width: 576px) {
    .modal-box {
        padding: 2.5rem 1.5rem;
    }
    
    .float-whatsapp {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
        font-size: 1.8rem;
    }
}