/* =========================================================
   COLABORAWEB | ASISTENTE FÉNIX
   Diseño premium + responsive para todos los dispositivos
========================================================= */

.cw-assistant,
.cw-assistant * {
    box-sizing: border-box;
}

.cw-assistant {
    --cw-assistant-blue: #087CF0;
    --cw-assistant-green: #10D982;

    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9998;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;

    width: max-content;
    max-width: calc(100vw - 44px);

    font-family: inherit;
}


/* =========================================================
   BOTÓN FLOTANTE DE FÉNIX
========================================================= */

.cw-assistant__launcher {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 86px;
    height: 86px;
    flex: 0 0 auto;
    padding: 0;

    border: 2px solid rgba(255, 255, 255, .95);
    border-radius: 50%;

    background: linear-gradient(145deg, #e8f7ff, #fff);
    box-shadow: 0 8px 28px rgba(8, 86, 175, .25);

    cursor: pointer;

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.cw-assistant__launcher:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(8, 86, 175, .32);
}

.cw-assistant__launcher:focus-visible,
.cw-assistant__close:focus-visible,
.cw-assistant__whatsapp:focus-visible {
    outline: 3px solid rgba(8, 124, 240, .45);
    outline-offset: 4px;
}


/* Imagen de Fénix */

.cw-assistant__mascot {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
    padding: 3px;
}


/* Indicador de disponibilidad */

.cw-assistant__status {
    position: absolute;
    right: 2px;
    bottom: 5px;

    width: 17px;
    height: 17px;

    border: 3px solid #fff;
    border-radius: 50%;

    background: var(--cw-assistant-green);
}


/* =========================================================
   MENSAJE FLOTANTE JUNTO AL ICONO
========================================================= */

.cw-assistant__hint {
    position: absolute;
    right: 96px;
    bottom: 19px;

    width: max-content;
    max-width: min(220px, calc(100vw - 130px));

    padding: 10px 14px;

    border: 1px solid #e2edf8;
    border-radius: 14px 14px 4px 14px;

    background: #fff;
    box-shadow: 0 5px 18px rgba(20, 55, 95, .12);

    color: #17345d;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;

    overflow-wrap: anywhere;
    pointer-events: none;

    animation: cwAssistantHint .5s ease both;
}

.cw-assistant__hint strong {
    color: var(--cw-assistant-blue);
}


/* =========================================================
   PANEL PRINCIPAL
========================================================= */

.cw-assistant__panel {
    width: min(360px, calc(100vw - 44px));
    max-width: 100%;

    min-width: 0;
    overflow: hidden;

    border: 1px solid rgba(8, 124, 240, .15);
    border-radius: 22px;

    background: #fff;
    box-shadow: 0 18px 55px rgba(16, 45, 85, .22);

    transform-origin: bottom right;
    animation: cwAssistantOpen .2s ease both;
}

.cw-assistant__panel[hidden],
.cw-assistant__hint[hidden] {
    display: none !important;
}


/* =========================================================
   CABECERA DEL PANEL
========================================================= */

.cw-assistant__head {
    display: flex;
    align-items: center;
    gap: 12px;

    min-width: 0;
    padding: 16px 16px 15px;

    color: #fff;

    background: linear-gradient(
        120deg,
        #087CF0 0%,
        #06a9db 58%,
        #10c987 100%
    );
}

.cw-assistant__head-mascot {
    display: block;

    width: 72px;
    height: 72px;
    flex: 0 0 72px;

    object-fit: contain;

    border-radius: 18px;
    background: rgba(255, 255, 255, .94);
}

.cw-assistant__heading {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}

.cw-assistant__title {
    display: block;
    margin: 0 0 4px;

    color: #fff;
    font-size: 21px;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.cw-assistant__heading p {
    margin: 0;

    color: rgba(255, 255, 255, .94);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}


/* Botón de cierre */

.cw-assistant__close {
    align-self: flex-start;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    padding: 0;

    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;

    background: rgba(255, 255, 255, .14);
    color: #fff;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;
}


/* =========================================================
   CUERPO DEL PANEL
========================================================= */

.cw-assistant__body {
    min-width: 0;
    padding: 19px;
}

.cw-assistant__message {
    margin: 0 0 17px;

    color: #52627a;
    font-size: 14px;
    line-height: 1.7;

    overflow-wrap: anywhere;
}


/* =========================================================
   BOTÓN DE WHATSAPP
========================================================= */

.cw-assistant__whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 13px 18px;

    border-radius: 14px;

    background: linear-gradient(
        110deg,
        #10d982,
        #06b96f
    );

    box-shadow: 0 7px 18px rgba(16, 217, 130, .22);

    color: #fff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;

    overflow-wrap: anywhere;

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.cw-assistant__whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 23px rgba(16, 217, 130, .3);
    color: #fff;
}

.cw-assistant__whatsapp svg {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
}


/* =========================================================
   PIE DEL PANEL
========================================================= */

.cw-assistant__foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    margin: 13px 0 0;

    color: #8090a7;
    font-size: 12px;
}

.cw-assistant__foot span {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;

    border-radius: 50%;
    background: var(--cw-assistant-green);
}


/* =========================================================
   ANIMACIONES
========================================================= */

@keyframes cwAssistantOpen {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes cwAssistantHint {
    from {
        opacity: 0;
        transform: translateX(6px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* =========================================================
   TABLETAS: HASTA 900 PX
========================================================= */

@media (max-width: 900px) {

    .cw-assistant {
        right: 22px;
        bottom: 20px;
        gap: 10px;
        max-width: calc(100vw - 44px);
    }

    .cw-assistant__launcher {
        width: 76px;
        height: 76px;
    }

    .cw-assistant__hint {
        right: 85px;
        bottom: 16px;
        max-width: min(200px, calc(100vw - 115px));
    }

    .cw-assistant__panel {
        width: min(350px, calc(100vw - 44px));
    }
}


/* =========================================================
   MÓVILES: HASTA 600 PX
========================================================= */

@media (max-width: 600px) {

    .cw-assistant {
        right: 20px;
        bottom: 18px;
        gap: 10px;
        max-width: calc(100vw - 40px);
    }

    .cw-assistant__launcher {
        width: 68px;
        height: 68px;
    }

    .cw-assistant__status {
        right: 1px;
        bottom: 4px;

        width: 15px;
        height: 15px;

        border-width: 2px;
    }

    .cw-assistant__hint {
        right: 76px;
        bottom: 12px;

        width: max-content;
        max-width: calc(100vw - 112px);

        padding: 8px 10px;
        font-size: 12px;
    }

    .cw-assistant__panel {
        width: min(340px, calc(100vw - 40px));
        max-width: 100%;
        border-radius: 19px;
    }

    .cw-assistant__head {
        padding: 12px;
        gap: 9px;
    }

    .cw-assistant__head-mascot {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
        border-radius: 14px;
    }

    .cw-assistant__title {
        font-size: 18px;
    }

    .cw-assistant__heading p {
        font-size: 12px;
    }

    .cw-assistant__close {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    .cw-assistant__body {
        padding: 15px;
    }

    .cw-assistant__message {
        margin-bottom: 14px;
        font-size: 13px;
        line-height: 1.6;
    }

    .cw-assistant__whatsapp {
        min-height: 48px;
        padding: 11px 12px;
        gap: 8px;
        font-size: 14px;
    }

    .cw-assistant__whatsapp svg {
        width: 22px;
        height: 22px;
        flex-basis: 22px;
    }

    .cw-assistant__foot {
        font-size: 11px;
    }
}

/* =========================================================
   MÓVILES COMPACTOS: 351 A 400 PX
   Asistente desplazado hacia el centro
========================================================= */

@media (min-width: 351px) and (max-width: 400px) {

    .cw-assistant {
        right: 80px;
        bottom: 16px;
        max-width: calc(100vw - 100px);
    }

    .cw-assistant__panel {
        width: calc(100vw - 100px);
        max-width: 300px;
    }

    .cw-assistant__hint {
        right: 58px;
        bottom: 10px;
        max-width: calc(100vw - 155px);
    }
}


/* =========================================================
   MÓVILES MUY ESTRECHOS: HASTA 350 PX
   Asistente desplazado hacia el centro
========================================================= */

@media (max-width: 350px) {

    .cw-assistant {
        right: 70px;
        bottom: 12px;
        gap: 9px;
        max-width: calc(100vw - 90px);
    }

    .cw-assistant__panel {
        width: calc(100vw - 90px);
        max-width: 250px;
    }

    .cw-assistant__hint {
        right: 54px;
        bottom: 9px;
        max-width: calc(100vw - 150px);
    }
}

/* =========================================================
   ACCESIBILIDAD: MOVIMIENTO REDUCIDO
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .cw-assistant__launcher,
    .cw-assistant__whatsapp {
        transition: none;
    }

    .cw-assistant__hint,
    .cw-assistant__panel {
        animation: none;
    }

    .cw-assistant__launcher:hover,
    .cw-assistant__whatsapp:hover {
        transform: none;
    }
}


/* =========================================================
   FIN | COLABORAWEB ASISTENTE FÉNIX
========================================================= */
