.cma-widget-root {
    display: contents;
}

.asesores-whatsapp,
.asesores-whatsapp * {
    font-family: inherit;
    box-sizing: border-box;
}

button.boton-wsp,
.boton-wsp,
#toggle-whatsapp.boton-wsp {
    position: fixed !important;
    bottom: 30px;
    right: 30px;
    background: #25d366 !important;
    background-color: #25d366 !important;
    width: 60px;
    height: 60px;
    min-width: 60px !important;
    min-height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 9999 !important;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4) !important;
    border: none !important;
    outline: none !important;
    transition: all 0.3s ease !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 0 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    color: transparent !important;
    overflow: visible !important;
}

button.boton-wsp:hover,
.boton-wsp:hover,
#toggle-whatsapp.boton-wsp:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5) !important;
    background: #25d366 !important;
    background-color: #25d366 !important;
}

button.boton-wsp:focus,
.boton-wsp:focus,
#toggle-whatsapp.boton-wsp:focus {
    outline: 3px solid #ffffff !important;
    outline-offset: 3px !important;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5) !important;
}

button.boton-wsp svg,
.boton-wsp svg,
#toggle-whatsapp.boton-wsp svg {
    width: 28px !important;
    height: 28px !important;
    fill: white !important;
    pointer-events: none !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
}

button.boton-wsp .icon-close,
.boton-wsp .icon-close,
#toggle-whatsapp.boton-wsp .icon-close {
    position: absolute !important;
    opacity: 0 !important;
    transform: rotate(90deg) scale(0.8) !important;
}

button.boton-wsp.open .icon-whatsapp,
.boton-wsp.open .icon-whatsapp,
#toggle-whatsapp.boton-wsp.open .icon-whatsapp {
    opacity: 0 !important;
    transform: rotate(-90deg) scale(0.8) !important;
}

button.boton-wsp.open .icon-close,
.boton-wsp.open .icon-close,
#toggle-whatsapp.boton-wsp.open .icon-close {
    opacity: 1 !important;
    transform: rotate(0deg) scale(1) !important;
}

.asesores-whatsapp {
    position: fixed;
    bottom: 100px;
    right: 20px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: none;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18), 0 8px 20px rgba(15, 23, 42, 0.1);
    padding: 0;
    max-width: 380px;
    width: calc(100vw - 40px);
    max-height: 75vh;
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9998;
    overflow: hidden;
}

.asesores-whatsapp.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.asesores-whatsapp .asesores-whatsapp-header {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    background: var(--cma-primary, #25d366) !important;
    color: white !important;
    padding: 24px !important;
    text-align: left !important;
    position: relative !important;
    overflow: hidden !important;
    flex-shrink: 0;
}

.asesores-whatsapp .asesores-whatsapp-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.12) 50%, transparent 80%);
    pointer-events: none;
}

.asesores-whatsapp .asesores-whatsapp-header .asesores-whatsapp-title {
    position: relative !important;
    z-index: 1 !important;
    margin: 0 !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    line-height: 1.3 !important;
    letter-spacing: 0.3px !important;
    text-transform: uppercase !important;
    color: white !important;
    flex: 1;
    min-width: 0;
    text-align: left !important;
}

.cma-chat-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--cma-primary, #25d366) 10%, #ffffff) 0%, #f4f5f7 42%, #f4f5f7 100%);
    overflow: hidden;
}

.cma-chat-messages {
    display: grid;
    gap: 10px;
    padding: 16px 14px 8px;
}

.cma-chat-bubble {
    position: relative;
    max-width: 100%;
    width: 100%;
    background: #ffffff;
    color: #2a2f38;
    border-radius: 16px 16px 16px 4px;
    padding: 16px;
    font-size: 15px;
    line-height: 1.4;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    opacity: 0;
    transform: translateY(8px);
}

.asesores-whatsapp.show .cma-chat-bubble {
    animation: cma-bubble-in 0.35s ease forwards;
}

.cma-chat-bubble::after {
    content: '';
    position: absolute;
    left: -5px;
    bottom: 8px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 2px;
    transform: rotate(45deg);
    box-shadow: -2px 2px 4px rgba(15, 23, 42, 0.04);
}

.contenedor-asesores-wasap {
    display: grid;
    gap: 8px;
    padding: 6px 12px 16px;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #c8cdd5 transparent;
}

.contenedor-asesores-wasap::-webkit-scrollbar {
    width: 6px;
}

.contenedor-asesores-wasap::-webkit-scrollbar-thumb {
    background: #c8cdd5;
    border-radius: 10px;
}

.asesor {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 0;
    background: #ffffff;
    text-decoration: none;
    color: inherit;
    border-radius: 14px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    border: 1px solid #e7e9ee;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.asesor:last-child {
    margin-bottom: 0;
}

.asesor:hover {
    background: #ffffff;
    border-color: var(--cma-primary, #25d366);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.asesor:focus-visible {
    outline: 3px solid var(--cma-primary, #25d366);
    outline-offset: 2px;
}

.asesor img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid var(--cma-primary, #25d366);
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
}

.asesor-avatar-fallback {
    width: 50px;
    height: 50px;
    background: var(--cma-primary, #25d366);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
    border: 2px solid var(--cma-primary, #25d366);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
}

.asesor-info {
    flex: 1;
    min-width: 0;
}

.asesor-nombre {
    font-weight: 600;
    font-size: 14.5px;
    line-height: 1.25;
    margin-bottom: 2px;
    color: #20242c;
}

.asesor-cargo {
    font-weight: 400;
    font-size: 11px;
    color: #717784;
    line-height: 1.3;
    margin-bottom: 3px;
}

.asesor-estado {
    height: 12px;
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 0.2px;
    color: #25d366;
    display: flex;
    align-items: center;
}

.asesor-estado::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #25d366;
    border-radius: 50%;
    margin-right: 5px;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

.asesor-arrow {
    width: 22px;
    height: 22px;
    margin-left: 6px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--cma-primary, #25d366) 12%, #ffffff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.asesor-arrow svg {
    width: 14px;
    height: 14px;
    fill: var(--cma-primary, #25d366);
}

button.boton-wsp::before,
button.boton-wsp::after,
.boton-wsp::before,
.boton-wsp::after,
#toggle-whatsapp.boton-wsp::before,
#toggle-whatsapp.boton-wsp::after {
    content: '' !important;
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    background-color: rgba(37, 211, 102, 0.3) !important;
    animation: ripple 2s infinite ease-out !important;
    z-index: -1 !important;
}

button.boton-wsp::after,
.boton-wsp::after,
#toggle-whatsapp.boton-wsp::after {
    animation-delay: 1s !important;
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes cma-bubble-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.whatsapp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.12);
    z-index: 9997;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.whatsapp-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.cma-position-left .boton-wsp {
    right: auto !important;
    left: 30px !important;
}

.cma-position-left .asesores-whatsapp {
    right: auto;
    left: 20px;
    transform-origin: bottom left;
}

@media (max-width: 768px) {
    .asesores-whatsapp {
        right: 10px;
        bottom: 80px;
    }

    button.boton-wsp#toggle-whatsapp,
    #toggle-whatsapp.boton-wsp {
        bottom: 20px !important;
        right: 12px !important;
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        max-width: 50px !important;
        max-height: 50px !important;
    }

    .cma-position-left .asesores-whatsapp {
        right: auto;
        left: 10px;
    }

    .cma-position-left button.boton-wsp#toggle-whatsapp,
    .cma-position-left #toggle-whatsapp.boton-wsp {
        right: auto !important;
        left: 12px !important;
    }

    button.boton-wsp#toggle-whatsapp svg,
    #toggle-whatsapp.boton-wsp svg {
        width: 24px !important;
        height: 24px !important;
    }
}

@supports not (background: color-mix(in srgb, #000 10%, #fff)) {
    .cma-chat-body {
        background: linear-gradient(180deg, #f7f8fa 0%, #f4f5f7 100%);
    }

    .asesor-arrow {
        background: #f0f2f5;
    }
}

@media (prefers-reduced-motion: reduce) {
    .asesores-whatsapp,
    .boton-wsp,
    .boton-wsp::before,
    .boton-wsp::after,
    .asesor-estado::before,
    .cma-chat-bubble {
        animation: none !important;
        transition: none !important;
    }

    .asesores-whatsapp.show .cma-chat-bubble {
        opacity: 1;
        transform: none;
        animation: none;
    }
}
