/* ==========================================================
   AMAWTA DIGITAL CHAT
   ========================================================== */

* {
    box-sizing: border-box;
}


/* ==========================================================
   BOTÓN FLOTANTE
   ========================================================== */

.amawta-chat-launcher {

    position: fixed;

    right: 28px;
    bottom: 28px;

    width: 64px;
    height: 64px;

    border: none;
    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            #0b2f55,
            #1264a3
        );

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    z-index: 99998;

    box-shadow:
        0 14px 35px rgba(8, 43, 77, 0.32);

    transition:
        transform .25s ease,
        opacity .25s ease,
        box-shadow .25s ease;
}


.amawta-chat-launcher:hover {

    transform:
        translateY(-3px)
        scale(1.04);

    box-shadow:
        0 18px 40px rgba(8, 43, 77, 0.42);

}


.amawta-chat-launcher.hidden {

    opacity: 0;

    pointer-events: none;

    transform: scale(.7);

}


.amawta-chat-launcher svg {

    width: 29px;
    height: 29px;

    fill: #ffffff;

}


.amawta-chat-status {

    position: absolute;

    width: 14px;
    height: 14px;

    top: 2px;
    right: 2px;

    background: #29c76f;

    border-radius: 50%;

    border: 3px solid #ffffff;

}



/* ==========================================================
   CONTENEDOR CHAT
   ========================================================== */

.amawta-chat {

    position: fixed;

    width: 400px;
    height: min(650px, calc(100vh - 50px));

    right: 28px;
    bottom: 28px;

    background: #ffffff;

    border-radius: 24px;

    overflow: hidden;

    z-index: 99999;

    display: flex;
    flex-direction: column;

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transform:
        translateY(30px)
        scale(.95);

    transform-origin:
        bottom right;

    transition:
        opacity .3s ease,
        transform .3s ease,
        visibility .3s ease;

    box-shadow:
        0 30px 80px rgba(9, 39, 67, 0.24),
        0 8px 25px rgba(9, 39, 67, 0.12);

    border:
        1px solid rgba(16, 73, 122, .08);

}


.amawta-chat.active {

    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform:
        translateY(0)
        scale(1);

}



/* ==========================================================
   HEADER
   ========================================================== */

.amawta-chat-header {

    min-height: 88px;

    padding:
        18px 20px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    background:
        linear-gradient(
            135deg,
            #092b4c 0%,
            #0e4f82 55%,
            #147aad 100%
        );

    color: white;

}


.amawta-chat-header-info {

    display: flex;

    align-items: center;

    gap: 13px;

}


.amawta-chat-avatar {

    position: relative;

    width: 49px;
    height: 49px;

    min-width: 49px;

    display: flex;

    justify-content: center;

    align-items: center;

    border-radius: 15px;

    color: #0d4978;

    background: #ffffff;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-weight: 800;

    font-size: 22px;

    box-shadow:
        0 7px 20px rgba(0, 0, 0, .13);

}


.amawta-avatar-status {

    position: absolute;

    width: 12px;
    height: 12px;

    right: -2px;
    bottom: -2px;

    background: #2dd476;

    border-radius: 50%;

    border: 3px solid #0e4f82;

}


.amawta-chat-title h3 {

    padding: 0;
    margin: 0 0 5px;

    color: #ffffff;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 17px;

    font-weight: 700;

}


.amawta-chat-online {

    display: flex;

    align-items: center;

    gap: 6px;

    color:
        rgba(255, 255, 255, .78);

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 12px;

}


.amawta-chat-online span {

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #35df83;

}


.amawta-chat-close {

    width: 38px;
    height: 38px;

    flex-shrink: 0;

    border: none;

    border-radius: 12px;

    background:
        rgba(255, 255, 255, .1);

    display: flex;

    justify-content: center;

    align-items: center;

    cursor: pointer;

    transition:
        background .2s ease;

}


.amawta-chat-close:hover {

    background:
        rgba(255, 255, 255, .2);

}


.amawta-chat-close svg {

    width: 20px;
    height: 20px;

    fill: none;

    stroke: #ffffff;

    stroke-width: 2;

    stroke-linecap: round;

}



/* ==========================================================
   INTRO
   ========================================================== */

.amawta-chat-intro {

    display: flex;

    gap: 11px;

    padding:
        14px 18px;

    background:
        linear-gradient(
            90deg,
            #f4f9fd,
            #ffffff
        );

    border-bottom:
        1px solid #e6eef5;

}


.amawta-intro-icon {

    width: 31px;
    height: 31px;

    min-width: 31px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 10px;

    background: #e2f1fb;

    color: #116fa8;

    font-size: 16px;

}


.amawta-chat-intro h4 {

    margin:
        0 0 4px;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 13px;

    color: #173852;

    font-weight: 700;

}


.amawta-chat-intro p {

    padding: 0;
    margin: 0;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 11.5px;

    line-height: 1.45;

    color: #74889b;

}



/* ==========================================================
   MENSAJES
   ========================================================== */

.amawta-chat-messages {

    flex: 1;

    overflow-y: auto;

    padding:
        22px 18px;

    background:
        #f7fafc;

    scroll-behavior: smooth;

}


/* Scroll */

.amawta-chat-messages::-webkit-scrollbar {

    width: 5px;

}


.amawta-chat-messages::-webkit-scrollbar-track {

    background: transparent;

}


.amawta-chat-messages::-webkit-scrollbar-thumb {

    background: #cfdce7;

    border-radius: 10px;

}



/* ==========================================================
   MENSAJE
   ========================================================== */

.amawta-message {

    width: 100%;

    display: flex;

    margin-bottom: 18px;

    animation:
        amawtaMessageIn
        .25s ease;

}


@keyframes amawtaMessageIn {

    from {

        opacity: 0;

        transform:
            translateY(8px);

    }

    to {

        opacity: 1;

        transform:
            translateY(0);

    }

}



/* ==========================================================
   AGENTE
   ========================================================== */

.amawta-message-agent {

    justify-content:
        flex-start;

    gap: 8px;

}


.amawta-message-avatar {

    width: 30px;
    height: 30px;

    min-width: 30px;

    border-radius: 9px;

    background:
        linear-gradient(
            135deg,
            #0b365d,
            #1687bf
        );

    color: #ffffff;

    display: flex;

    align-items: center;

    justify-content: center;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-weight: 800;

    font-size: 12px;

    margin-top: 18px;

}


.amawta-message-name {

    margin:
        0 0 5px
        3px;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    color: #7590a5;

    font-size: 10px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: .5px;

}


.amawta-message-agent
.amawta-message-content {

    max-width: 82%;

}


.amawta-message-agent
.amawta-message-bubble {

    background: #ffffff;

    color: #243c50;

    border:
        1px solid #dfE8ef;

    border-radius:
        5px 18px 18px 18px;

    box-shadow:
        0 4px 15px
        rgba(36, 66, 89, .05);

}



/* ==========================================================
   USUARIO
   ========================================================== */

.amawta-message-user {

    justify-content:
        flex-end;

}


.amawta-message-user
.amawta-message-content {

    max-width: 80%;

}


.amawta-message-user
.amawta-message-bubble {

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #0e568b,
            #147cb3
        );

    border-radius:
        18px 5px 18px 18px;

    box-shadow:
        0 6px 18px
        rgba(11, 85, 139, .16);

}



/* ==========================================================
   BURBUJA
   ========================================================== */

.amawta-message-bubble {

    padding:
        12px 15px;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 14px;

    line-height: 1.55;

    white-space: pre-wrap;

    word-break: break-word;

}



/* ==========================================================
   ESCRIBIENDO...
   ========================================================== */

.amawta-typing {

    display: flex;

    align-items: center;

    gap: 5px;

    width: fit-content;

    padding:
        14px 17px;

    background: #ffffff;

    border:
        1px solid #e0e8ef;

    border-radius:
        5px 18px 18px 18px;

}


.amawta-typing span {

    width: 6px;
    height: 6px;

    background: #8ca5b8;

    border-radius: 50%;

    animation:
        amawtaTyping
        1.3s infinite;

}


.amawta-typing span:nth-child(2) {

    animation-delay: .15s;

}


.amawta-typing span:nth-child(3) {

    animation-delay: .3s;

}


@keyframes amawtaTyping {

    0%,
    60%,
    100% {

        opacity: .35;

        transform:
            translateY(0);

    }

    30% {

        opacity: 1;

        transform:
            translateY(-4px);

    }

}



/* ==========================================================
   FOOTER
   ========================================================== */

.amawta-chat-footer {

    padding:
        14px 15px 9px;

    background: #ffffff;

    border-top:
        1px solid #e4ecf2;

}


.amawta-chat-input-wrapper {

    min-height: 54px;

    display: flex;

    align-items: flex-end;

    gap: 8px;

    padding:
        6px 7px 6px 15px;

    border:
        1.5px solid #dce7ef;

    border-radius: 18px;

    background: #f8fafc;

    transition:
        border .2s ease,
        box-shadow .2s ease,
        background .2s ease;

}


.amawta-chat-input-wrapper:focus-within {

    background: #ffffff;

    border-color: #3c8cbc;

    box-shadow:
        0 0 0 4px
        rgba(29, 124, 181, .08);

}


.amawta-chat-input-wrapper textarea {

    flex: 1;

    width: 100%;

    min-height: 40px;

    max-height: 120px;

    border: none;

    outline: none;

    resize: none;

    background: transparent;

    padding:
        10px 2px 8px;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 14px;

    line-height: 20px;

    color: #243c50;

}


.amawta-chat-input-wrapper textarea::placeholder {

    color: #94a8b8;

}



/* ==========================================================
   BOTÓN ENVIAR
   ========================================================== */

.amawta-chat-send {

    width: 42px;
    height: 42px;

    min-width: 42px;

    border: none;

    border-radius: 13px;

    display: flex;

    justify-content: center;

    align-items: center;

    cursor: pointer;

    background:
        linear-gradient(
            135deg,
            #0b4e82,
            #1686be
        );

    transition:
        transform .2s ease,
        opacity .2s ease,
        box-shadow .2s ease;

}


.amawta-chat-send:hover {

    transform:
        translateY(-1px);

    box-shadow:
        0 5px 14px
        rgba(11, 78, 130, .22);

}


.amawta-chat-send:disabled {

    opacity: .45;

    cursor: not-allowed;

    transform: none;

    box-shadow: none;

}


.amawta-chat-send svg {

    width: 20px;
    height: 20px;

    fill: #ffffff;

}



/* ==========================================================
   POWERED
   ========================================================== */

.amawta-chat-powered {

    padding-top: 7px;

    text-align: center;

    color: #a0afbb;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 9.5px;

}


.amawta-chat-powered strong {

    color: #688298;

}



/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media
(max-width: 600px) {

    .amawta-chat {

        width: calc(100% - 20px);

        height: calc(100dvh - 20px);

        max-height: none;

        right: 10px;
        bottom: 10px;

        border-radius: 22px;

    }


    .amawta-chat-launcher {

        right: 18px;
        bottom: 18px;

    }


    .amawta-chat-header {

        min-height: 82px;

    }


    .amawta-chat-intro {

        padding:
            12px 15px;

    }


    .amawta-chat-messages {

        padding:
            18px 14px;

    }


    .amawta-message-agent
    .amawta-message-content {

        max-width: 85%;

    }


    .amawta-message-user
    .amawta-message-content {

        max-width: 84%;

    }

}

/* ==========================================================
   NUEVO DISEÑO 2026
   INPUT HORIZONTAL + CHAT MODAL
   ========================================================== */

body.amawta-chat-open {
    overflow: hidden;
}


/* ----------------------------------------------------------
   BARRA TIPO INPUT
   ---------------------------------------------------------- */

.amawta-chat-launcher {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: 22px;

    width: min(1120px, calc(100% - 40px));
    min-height: 72px;
    height: auto;

    padding: 9px 10px 9px 12px;

    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 13px;

    border: 1px solid rgba(18, 78, 126, .16);
    border-radius: 20px;

    background: rgba(255, 255, 255, .97);

    cursor: text;

    z-index: 99996;

    box-shadow:
        0 18px 55px rgba(7, 35, 63, .16),
        0 3px 12px rgba(7, 35, 63, .08);

    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    transform: translateX(-50%);

    transition:
        transform .25s ease,
        opacity .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;
}

.amawta-chat-launcher::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(
        90deg,
        rgba(14, 79, 130, .34),
        rgba(22, 134, 190, .10),
        rgba(14, 79, 130, .28)
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.amawta-chat-launcher:hover {
    transform: translateX(-50%) translateY(-2px);
    border-color: rgba(18, 100, 163, .28);

    box-shadow:
        0 23px 65px rgba(7, 35, 63, .20),
        0 5px 16px rgba(7, 35, 63, .08);
}

.amawta-chat-launcher.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(18px) scale(.98);
}

.amawta-launcher-avatar {
    position: relative;

    width: 48px;
    height: 48px;
    min-width: 48px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 15px;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #092b4c 0%,
            #0e568b 55%,
            #1686be 100%
        );

    font-family: Arial, Helvetica, sans-serif;
    font-size: 19px;
    font-weight: 800;

    box-shadow:
        0 8px 20px rgba(10, 69, 113, .20);
}

.amawta-launcher-status {
    position: absolute;
    right: -1px;
    bottom: -1px;

    width: 12px;
    height: 12px;

    border: 3px solid #ffffff;
    border-radius: 50%;

    background: #2dd476;
}

.amawta-launcher-copy {
    min-width: 0;
    flex: 1;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;

    text-align: left;
}

.amawta-launcher-title {
    color: #173852;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.15;
    font-weight: 700;
}

.amawta-launcher-placeholder {
    width: 100%;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #8a9baa;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 400;
}

.amawta-launcher-action {
    min-width: 128px;
    height: 50px;

    padding: 0 16px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    border-radius: 15px;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #0b4e82,
            #1686be
        );

    box-shadow:
        0 8px 20px rgba(11, 78, 130, .18);

    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 700;
}

.amawta-launcher-action svg {
    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ----------------------------------------------------------
   BACKDROP
   ---------------------------------------------------------- */

.amawta-chat-backdrop {
    position: fixed;
    inset: 0;

    z-index: 99997;

    background:
        rgba(6, 24, 42, .42);

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .28s ease,
        visibility .28s ease;
}

.amawta-chat-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* ----------------------------------------------------------
   CHAT COMO MODAL CENTRAL
   ---------------------------------------------------------- */

.amawta-chat {
    position: fixed;

    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;

    width: min(860px, calc(100% - 44px));
    height: min(720px, calc(100dvh - 64px));

    border-radius: 28px;

    z-index: 99999;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform:
        translate(-50%, calc(-50% + 24px))
        scale(.975);

    transform-origin: center;

    box-shadow:
        0 35px 110px rgba(4, 25, 44, .32),
        0 10px 35px rgba(4, 25, 44, .14);

    border:
        1px solid rgba(255, 255, 255, .45);

    transition:
        opacity .28s ease,
        transform .28s ease,
        visibility .28s ease;
}

.amawta-chat.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform:
        translate(-50%, -50%)
        scale(1);
}


/* Chat un poco más premium en formato ancho */

.amawta-chat-header {
    min-height: 94px;
    padding: 20px 24px;
}

.amawta-chat-avatar {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 16px;
}

.amawta-chat-title h3 {
    font-size: 18px;
}

.amawta-chat-intro {
    padding: 15px 24px;
}

.amawta-chat-messages {
    padding: 25px 26px;
}

.amawta-message-agent .amawta-message-content {
    max-width: 72%;
}

.amawta-message-user .amawta-message-content {
    max-width: 68%;
}

.amawta-chat-footer {
    padding: 15px 22px 10px;
}

.amawta-chat-input-wrapper {
    min-height: 58px;
    border-radius: 18px;
}

.amawta-chat-input-wrapper textarea {
    font-size: 14.5px;
}


/* ----------------------------------------------------------
   RESPONSIVE TABLET
   ---------------------------------------------------------- */

@media (max-width: 900px) {

    .amawta-chat-launcher {
        width: calc(100% - 28px);
        bottom: 14px;
    }

    .amawta-chat {
        width: calc(100% - 28px);
        height: calc(100dvh - 28px);
        border-radius: 24px;
    }

    .amawta-message-agent .amawta-message-content {
        max-width: 82%;
    }

    .amawta-message-user .amawta-message-content {
        max-width: 80%;
    }
}


/* ----------------------------------------------------------
   RESPONSIVE MÓVIL
   ---------------------------------------------------------- */

@media (max-width: 600px) {

    .amawta-chat-launcher {
        left: 12px;
        right: 12px;
        bottom: 12px;

        width: auto;
        min-height: 64px;

        padding: 7px 7px 7px 9px;

        border-radius: 18px;

        transform: none;
    }

    .amawta-chat-launcher:hover {
        transform: translateY(-1px);
    }

    .amawta-chat-launcher.hidden {
        transform: translateY(15px) scale(.98);
    }

    .amawta-launcher-avatar {
        width: 44px;
        height: 44px;
        min-width: 44px;
        border-radius: 13px;
    }

    .amawta-launcher-title {
        font-size: 12px;
    }

    .amawta-launcher-placeholder {
        font-size: 13px;
    }

    .amawta-launcher-action {
        min-width: 48px;
        width: 48px;
        height: 48px;
        padding: 0;
        border-radius: 14px;
    }

    .amawta-launcher-action-text {
        display: none;
    }

    .amawta-chat {
        top: 7px;
        left: 7px;
        right: 7px;
        bottom: 7px;

        width: auto;
        height: auto;

        border-radius: 22px;

        transform: translateY(18px) scale(.985);
    }

    .amawta-chat.active {
        transform: translateY(0) scale(1);
    }

    .amawta-chat-header {
        min-height: 82px;
        padding: 15px 16px;
    }

    .amawta-chat-intro {
        padding: 12px 15px;
    }

    .amawta-chat-messages {
        padding: 18px 14px;
    }

    .amawta-chat-footer {
        padding: 12px 12px 8px;
    }

    .amawta-message-agent .amawta-message-content {
        max-width: 86%;
    }

    .amawta-message-user .amawta-message-content {
        max-width: 84%;
    }
}
