/* ==========================================================================
   RD WHATSAPP CHAT - ESTILOS CORE (PRO)
   ========================================================================== */

/* Reseteo básico para evitar conflictos con temas de WordPress */
.wa__btn_popup, 
.wa__popup_chat_box,
.wa__popup_chat_box * {
    box-sizing: border-box !important;
    outline: none;
}

/* 1. BOTÓN FLOTANTE PRINCIPAL */
.wa__btn_popup {
    position: fixed;
    z-index: 999999999;
    cursor: pointer;
    user-select: none;
}

.wa__btn_popup_icon {
    width: 62px;
    height: 62px;
    background: #2db742;
    border-radius: 50%;
    box-shadow: 0px 6px 15px rgba(0,0,0,0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: transform 0.3s ease, background 0.3s ease;
}

/* Efecto Hover en el botón */
.wa__btn_popup_icon:hover {
    transform: scale(1.05);
}

/* Lógica de cambio de Iconos (WA -> X) */
.rd-icon-close {
    display: none; /* Oculto por defecto */
}

.wa__btn_popup.wa__active .rd-icon-wa {
    display: none;
}

.wa__btn_popup.wa__active .rd-icon-close {
    display: flex;
    animation: rd-rotate-in 0.4s ease forwards;
}

/*.wa__btn_popup.wa__active .wa__btn_popup_icon {
    background: #111; 
}*/

/* 2. CAJA DE CHAT (POPUP) */
.wa__popup_chat_box {
    width: 350px;
    max-width: calc(100vw - 40px);
    position: fixed;
    background: #fff;
    z-index: 999999998;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wa__popup_chat_box.wa__active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Cabecera del Chat */
.wa__popup_heading {
    background: #2db742;
    padding: 25px 20px;
    color: #fff;
    position: relative;
}

.wa__popup_title {
    margin: 0;
    line-height: 1;
    display: block;
}

.wa__popup_intro {
    margin-top: 8px;
    opacity: 0.9;
    line-height: 1;
    display: block;
}

/* 3. LISTA DE AGENTES */
.wa__popup_content {
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
}

/* Scrollbar personalizado para la lista de agentes */
.wa__popup_content::-webkit-scrollbar {
    width: 5px;
}
.wa__popup_content::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 10px;
}

.wa__stt {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none !important;
    border-left: 4px solid #2db742;
    transition: all 0.3s ease;
}

.wa__stt:last-child {
    margin-bottom: 0;
}

.wa__stt:hover {
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transform: translateX(5px);
}

/* Avatar del Asesor */
.wa__popup_avatar {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    flex-shrink: 0;
    overflow: hidden;
    background: #eee;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wa__popup_avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Textos del Asesor */
.wa__popup_txt {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wa__member_name {
    margin-bottom: 2px;
    line-height: 1.2 !important;
}

.wa__member_duty {
    margin: 0;
    line-height: 1.2 !important;
}

/* 4. ANIMACIONES */

/* Animación de Pulso (Atención) */
.wa__btn_popup_icon {
    animation: rd-wa-pulse 2s infinite;
}

@keyframes rd-wa-pulse {
    0% { box-shadow: 0 0 0 0 rgba(45, 183, 66, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(45, 183, 66, 0); }
    100% { box-shadow: 0 0 0 0 rgba(45, 183, 66, 0); }
}

/* Animación de Rotación para el icono cerrar */
@keyframes rd-rotate-in {
    from { transform: rotate(-90deg); opacity: 0; }
    to { transform: rotate(0deg); opacity: 1; }
}

/* Responsive: Ajustes para móviles */
@media (max-width: 480px) {
    .wa__popup_chat_box {
        width: calc(100vw - 30px);
        bottom: 85px !important; /* Asegurar que no tape el botón en móvil */
    }
    .wa__btn_popup {
        bottom: 20px !important;
        right: 20px !important;
        left: auto !important; /* Forzar derecha en móvil si prefieres */
    }
}
/* ==========================================================================
   Ajustes visuales de Iconos (Tamaño y Centrado)
   ========================================================================== */

/* 1. Nudge (empujoncito) visual para compensar la colita del globo de WhatsApp */
.rd-icon-wa {
    display: flex;
    transform: translateX(1px) translateY(0); 
    /*transform: translateX(1px) translateY(1px); */
}

/* 2. Agrandamos el icono de WhatsApp */
.rd-icon-wa svg {
    width: 42px !important;
    height: 42px !important;
}

/* 3. Agrandamos el icono de la X de cerrar */
.rd-icon-close svg {
    width: 28px !important;
    height: 28px !important;
}