/* assets/css/chat.css - VERSIÓN SEGURA (NO BLOQUEA) */

/* EL CONTENEDOR FLOTANTE */
.chat-widget-container {
    position: fixed;
    bottom: 160px; 
    right: 20px;
    z-index: 8000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    /* ¡CRUCIAL! Esto permite hacer clic a través del contenedor vacío */
    pointer-events: none; 
}

/* LOS BOTONES DE OPCIONES */
.chat-options {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 5px;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.chat-options.active {
    opacity: 1;
    transform: translateY(0);
}

/* ESTILO DE CADA BURBUJA */
.chat-pill {
    display: flex;
    align-items: center;
    background: white;
    padding: 5px 5px 5px 12px; 
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    text-decoration: none;
    transition: transform 0.2s;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.05);
    /* Reactivamos los clics solo para los botones */
    pointer-events: auto; 
}

.chat-pill:active { transform: scale(0.95); }

/* TEXTOS E ICONOS */
.pill-text {
    text-align: right;
    margin-right: 10px;
    line-height: 1.1;
}

.pill-title {
    display: block;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #666;
}

.pill-desc {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #222;
}

.pill-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

/* COLORES */
.bg-whatsapp { background: #25D366; }
.bg-internal { background: #B61943; }

/* BOTÓN PRINCIPAL (GATILLO) */
.chat-toggle-btn {
    position: relative !important;
    width: 50px;
    height: 50px;
    background: #B61943;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(182, 25, 67, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    border: none;
    transition: transform 0.3s, background 0.3s;
    outline: none;
    /* Reactivamos los clics solo para el botón */
    pointer-events: auto; 
}

.chat-toggle-btn.open {
    transform: rotate(45deg);
    background: #333;
}

/* --- ESTILOS DEL MODAL (CORREGIDO PARA NO BLOQUEAR) --- */
.chat-modal-overlay {
    position: fixed;
    z-index: 9000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    
    /* ¡CAMBIO IMPORTANTE! Oculto por defecto para no bloquear la web */
    display: none; 
    
    justify-content: center;
    align-items: center;
}

/* Clase para cuando se abre via JS */
.chat-modal-overlay.show {
    display: flex !important;
}

.chat-modal-box {
    background: #fff;
    width: 90%;
    max-width: 400px;
    height: 70vh;
    border-radius: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: popIn 0.3s ease forwards;
}

@keyframes popIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.chat-header {
    background: #B61943;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 { margin: 0; font-size: 1rem; }
.chat-header span { cursor: pointer; font-size: 1.5rem; line-height: 1; }

.chat-frame-container {
    flex: 1;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* RESPONSIVE */
@media (max-width: 480px) {
    .chat-widget-container { bottom: 160px; right: 15px; }
    .pill-title { display: none; }
    .pill-desc { font-size: 0.85rem; }
}

/* --- BURBUJA DE NOTIFICACIÓN --- */
.notification-badge {
    position: absolute;
    top: 0px !important;
    right: 0px !important;
    background-color: #ff0000;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    font-weight: bold;
    display: none; /* Oculto por defecto */
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 8002;
    animation: bounceIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}