/* =========================================================
   ASISTENTE VIRTUAL - SANATORIO SAN JOSÉ
========================================================= */

.asistente-float {
    position: fixed;
    right: 25px;
    bottom: 22px;

    z-index: 9998;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 8px 14px 8px 8px;

    border: none;
    border-radius: 50px;

    background: var(--morado, #493480);
    color: #fff;

    cursor: pointer;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, .25);

    transition: .25s ease;
}

.asistente-float:hover {
    transform: translateY(-4px);
}

.asistente-float img {
    width: 68px;
    height: 68px;

    object-fit: contain;
}

.asistente-float span {
    max-width: 150px;

    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}


/* =========================================================
   VENTANA
========================================================= */

.asistente-chat {
    position: fixed;

    right: 25px;
    bottom: 115px;

    z-index: 9999;

    width: min(390px, calc(100vw - 30px));
    height: 600px;
    max-height: calc(100vh - 145px);

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: #ffffff;

    border: 2px solid #493480;
    border-radius: 22px;

    box-shadow:
        0 25px 70px rgba(25, 18, 43, .32);

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(25px)
        scale(.96);

    transform-origin: bottom right;

    transition:
        opacity .25s ease,
        transform .25s ease,
        visibility .25s;
}


/* CHAT ABIERTO */

.asistente-chat.show {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(0)
        scale(1);
}


/* =========================================================
   HEADER
========================================================= */

.asistente-header {
    min-height: 78px;

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

    padding: 8px 14px;

    background:
        linear-gradient(
            135deg,
            #493480,
            #2f2157
        );

    color: #fff;
}


.asistente-identidad {
    display: flex;
    align-items: center;
    gap: 10px;
}


.asistente-identidad img {
    width: 58px;
    height: 58px;

    object-fit: contain;
}


.asistente-identidad strong {
    display: block;

    font-size: 15px;
}


.asistente-identidad small {
    display: flex;
    align-items: center;
    gap: 5px;

    margin-top: 3px;

    font-size: 11px;

    opacity: .9;
}


.estado-online {
    width: 8px;
    height: 8px;

    display: inline-block;

    border-radius: 50%;

    background: #4ade80;
}


.cerrar-asistente {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    border: none;
    border-radius: 50%;

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

    cursor: pointer;

    transition: .2s ease;
}


.cerrar-asistente:hover {
    background: rgba(255,255,255,.25);
}


/* =========================================================
   MENSAJES
========================================================= */

.asistente-mensajes {
    flex: 1;

    display: flex;
    flex-direction: column;
    gap: 12px;

    padding: 18px 14px;

    overflow-y: auto;

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #ffffff
        );
}


.mensaje {
    display: flex;
    align-items: flex-end;
    gap: 7px;
}


.mensaje-bot {
    justify-content: flex-start;
}


.mensaje-usuario {
    justify-content: flex-end;
}


.mensaje-avatar {
    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    object-fit: contain;
}


.mensaje-contenido {
    max-width: 78%;

    padding: 10px 13px;

    font-size: 13px;
    line-height: 1.45;

    box-shadow:
        0 4px 12px rgba(0,0,0,.07);
}


.mensaje-bot .mensaje-contenido {
    background: #ffffff;

    color: #2b2440;

    border-radius: 16px 16px 16px 4px;
}


.mensaje-usuario .mensaje-contenido {
    background: #493480;

    color: #fff;

    border-radius: 16px 16px 4px 16px;
}


/* =========================================================
   ACCIONES DENTRO DE RESPUESTAS
========================================================= */

.mensaje-accion {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    margin-top: 9px;
    padding: 7px 10px;

    border: none;
    border-radius: 10px;

    background: #493480;
    color: #fff;

    font-size: 11px;
    font-weight: 800;

    text-decoration: none;

    cursor: pointer;
}


.mensaje-accion:hover {
    background: #2f2157;
    color: #fff;
}


/* =========================================================
   OPCIONES RÁPIDAS
========================================================= */

.asistente-opciones {
    display: flex;
    gap: 7px;

    padding: 10px;

    overflow-x: auto;

    background: #ffffff;

    border-top: 1px solid #e4ddd2;
}


.asistente-opciones button {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    gap: 5px;

    padding: 7px 10px;

    border: 1px solid #d8cfdf;
    border-radius: 20px;

    background: #fff;

    color: #493480;

    font-size: 11px;
    font-weight: 800;

    cursor: pointer;

    transition: .2s ease;
}


.asistente-opciones button:hover {
    background: #493480;
    color: #fff;
}


/* =========================================================
   INPUT
========================================================= */

.asistente-input {
    display: grid;
    grid-template-columns: 1fr 44px;
    gap: 8px;

    padding: 10px;

    background: #ffffff;

    border-top: 1px solid #e4ddd2;
}


.asistente-input input {
    width: 100%;
    min-width: 0;

    padding: 10px 13px;

    border: 1px solid #d8d1c7;
    border-radius: 18px;

    outline: none;

    background: #fff;

    color: #2b2440;

    font-size: 13px;
}


.asistente-input input:focus {
    border-color: #493480;

    box-shadow:
        0 0 0 3px rgba(73,52,128,.10);
}


.asistente-input button {
    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    border: none;
    border-radius: 50%;

    background: #493480;
    color: #fff;

    cursor: pointer;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 576px) {

    .asistente-float {
        right: 12px;
        bottom: 12px;

        padding: 6px;
    }

    .asistente-float img {
        width: 60px;
        height: 60px;
    }

    .asistente-float span {
        display: none;
    }


    .asistente-chat {
        right: 10px;
        bottom: 84px;

        width: calc(100vw - 20px);
        height: min(620px, calc(100vh - 100px));

        max-height: calc(100vh - 100px);

        border-radius: 18px;
    }

}