:root {
    --azul-principal: #004171;
    --azul-secundario1: #0d5575;
    --azul-secundario2: #297ba2;
    --azul-secundario3: #389eb0;
    --color-destacado1: #00FCDF;
    --gris-fondo: #f9f9f9;
}

/* =========================================================
   BOTÓN FLOTANTE
========================================================= */
#unicenbot-toggle {
    position: fixed;
    bottom: 34px;
    right: 34px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px 12px 16px;
    border-radius: 40px;
    border: none;
    background: linear-gradient(
        135deg,
        var(--azul-secundario3) 0%,
        var(--azul-principal) 100%
    );
    color: #fff;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.22),
        0 3px 6px rgba(0, 0, 0, 0.18);
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

#unicenbot-toggle i {
    font-size: 22px;
    animation: botPulse 3s infinite;
}

#unicenbot-toggle .label {
    letter-spacing: 0.3px;
    white-space: nowrap;
}

#unicenbot-toggle:hover,
#unicenbot-toggle:focus-visible {
    transform: translateY(-3px);
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.25),
        0 6px 10px rgba(0, 0, 0, 0.20);
}

/* =========================================================
   TOOLTIP
========================================================= */
#unicenbot-toggle .unicenbot-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

#unicenbot-toggle:hover .unicenbot-tooltip {
    visibility: visible;
    opacity: 1;
}

.unicenbot-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* =========================================================
   ANIMACIÓN DEL ROBOT
========================================================= */
@keyframes botPulse {
    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    10% {
        transform: rotate(-10deg) scale(1.05);
    }

    20% {
        transform: rotate(10deg) scale(1.05);
    }

    30% {
        transform: rotate(-8deg) scale(1.05);
    }

    40% {
        transform: rotate(8deg) scale(1.05);
    }

    50% {
        transform: rotate(0deg) scale(1);
    }
}

/* =========================================================
   CAJA PRINCIPAL
========================================================= */
#unicenbot-box {
    position: fixed;
    bottom: 80px;
    right: 30px;
    width: 800px;
    height: 400px;
    max-height: 400px;
    background: #fff;
    border: 1px solid #0073aa;
    border-radius: 16px;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.20);
    display: flex;
    flex-direction: column;
    font-family:
        "Segoe UI",
        Tahoma,
        Geneva,
        Verdana,
        sans-serif;
    overflow: hidden;
    z-index: 1000;
    transform: translateY(100%);
    opacity: 0;
    transition:
        transform 0.3s ease,
        opacity 0.3s ease;
}

#unicenbot-box:not(.closed) {
    transform: translateY(0);
    opacity: 1;
}

#unicenbot-box.closed {
    display: none;
}

/* =========================================================
   HEADER
========================================================= */
.unicenbot-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 12px 16px;
    background: var(--azul-principal);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    user-select: none;
}

.unicenbot-header-buttons {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.unicenbot-header-buttons button {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.unicenbot-reset:hover,
.unicenbot-close:hover {
    color: var(--color-destacado1);
}

/* =========================================================
   CUERPO DEL CHAT
========================================================= */
.unicenbot-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.45;
    color: #333;
    overflow-y: auto;
    background: #fff;
    scroll-behavior: smooth;
}

/* =========================================================
   MENSAJES DEL BOT
========================================================= */
.unicenbot-message.bot {
    align-self: flex-start;
    max-width: 90%;
    margin-bottom: 8px;
    color: var(--azul-secundario1);
    font-size: 14px;
    line-height: 1.45;
}

.bot-message-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.bot-avatar {
    flex: 0 0 22px;
    padding-top: 4px;
    text-align: center;
    color: var(--azul-secundario2);
    font-size: 16px;
}

.bot-text {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    background: #e6f0fa;
    border-radius: 12px;
    color: var(--azul-secundario1);
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
}

.bot-text p {
    margin: 0 0 8px;
}

.bot-text p:last-child {
    margin-bottom: 0;
}

.bot-text a {
    color: var(--azul-principal);
    font-weight: 600;
}

.bot-text a:hover {
    text-decoration: underline;
}

/* =========================================================
   MENSAJES DEL USUARIO
========================================================= */
.unicenbot-message.user {
    align-self: flex-end;
    width: fit-content;
    max-width: 80%;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: var(--color-destacado1);
    color: var(--azul-principal);
    border-radius: 12px;
    word-break: break-word;
}

.user-text {
    font-size: 14px;
    line-height: 1.4;
}

/* =========================================================
   BOTONES DE OPCIONES
========================================================= */
.unicenbot-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 8px 0;
}

.unicenbot-option-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 18px;
    background: var(--azul-secundario3);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.unicenbot-option-btn i {
    margin-right: 7px;
}

.unicenbot-option-btn:hover,
.unicenbot-option-btn:focus-visible {
    background: var(--azul-principal);
    transform: translateY(-1px);
}

/* =========================================================
   BOTÓN VOLVER
========================================================= */
.unicenbot-buttons--volver {
    margin-top: 10px;
}

.unicenbot-option-btn--volver {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: 1px solid var(--azul-principal);
    color: var(--azul-principal);
    font-weight: 600;
}

.unicenbot-option-btn--volver:hover,
.unicenbot-option-btn--volver:focus-visible {
    background: var(--azul-principal);
    color: #fff;
}

.unicenbot-option-btn--volver i {
    margin-right: 0;
    font-size: 14px;
}

/* =========================================================
   BOTÓN INSTAGRAM
========================================================= */
.unicenbot-option-btn i.fa-instagram {
    color: #E1306C;
    font-size: 1rem;
}

.unicenbot-option-btn.instagram {
    background: linear-gradient(
        45deg,
        #f58529,
        #dd2a7b,
        #8134af
    );
    color: #fff;
}

/* =========================================================
   BOTÓN CERRAR
========================================================= */

.unicenbot-x {
    position: fixed;
    bottom: 22px;
    right: 60px;
    z-index: 1001;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        #00b4db,
        #0083b0
    );
    color: #fff;
    box-shadow:
        0 8px 15px rgba(0, 180, 219, 0.4),
        0 4px 10px rgba(0, 131, 176, 0.3);
    cursor: pointer;
    font-size: 22px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transform: translateY(100px);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.unicenbot-x.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.unicenbot-x:hover {
    transform: translateY(-3px) rotate(45deg);
    box-shadow:
        0 12px 20px rgba(0, 180, 219, 0.5),
        0 8px 15px rgba(0, 131, 176, 0.4);
}

.unicenbot-x i {
    font-size: 21px;
    pointer-events: none;
}

/* Ajuste de texto del chatbot entre navegadores */
#unicenbot-box .bot-message-container {
    display: flex;
    align-items: flex-start;
    width: 100%;
}

#unicenbot-box .bot-avatar {
    flex: 0 0 24px;
    width: 24px;
}

#unicenbot-box .bot-text {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

/* ================
   MOBILE / TABLET
=================== */
@media (min-width: 768px) and (max-width: 1024px) {
    /* BOTÓN FLOTANTE */
    #unicenbot-toggle {
        right: 16px;
        bottom: 16px;
        width: 120px;
        height: 120px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    /* Solo ícono del robot */
    #unicenbot-toggle .label,
    #unicenbot-toggle .unicenbot-tooltip {
        display: none;
    }

    #unicenbot-toggle i {
        font-size: 58px;
    }

    /* CAJA DEL CHAT */
    #unicenbot-box {
        left: 16px;
        right: 16px;
        bottom: 90px;
        width: auto;
        height: 150dvh;
        max-height: 600px;
        min-height: 400px;
        border-radius: 16px;
    }

    /* HEADER */
    .unicenbot-header {
        min-height: 58px;
        padding: 12px 16px;
        gap: 10px;
        font-size: 32px;
    }

    .unicenbot-header-buttons button {
        width: 36px;
        height: 36px;
        font-size: 32px;
    }

    /* CUERPO */
    .unicenbot-body {
        padding: 18px;
        font-size: 32px;
        line-height: 1.55;
    }

    /* MENSAJES DEL BOT */
    .unicenbot-message.bot {
        max-width: 95%;
        margin-bottom: 11px;
        font-size: 32px;
        line-height: 1.55;
    }

    .bot-message-container {
        gap: 10px;
    }

    .bot-avatar {
        flex: 0 0 24px;
        font-size: 32px;
        padding-top: 5px;
    }

    .bot-text {
        font-size: 32px;
        line-height: 1.55;
        padding: 11px 14px;
        border-radius: 12px;
    }

    .bot-text p {
        margin-bottom: 9px;
        font-size: 32px;
    }

    /* MENSAJES DEL USUARIO */
    .unicenbot-message.user {
        max-width: 85%;
        padding: 10px 14px;
        border-radius: 12px;
    }

    .user-text {
        font-size: 32px;
        line-height: 1.5;
    }

    /* BOTONES DE OPCIONES */
    .unicenbot-buttons {
        gap: 9px;
        margin: 11px 0;
    }

    .unicenbot-option-btn {
        padding: 11px 15px;
        border-radius: 12px;
        font-size: 32px;
        line-height: 1.4;
    }

    .unicenbot-option-btn i {
        margin-right: 8px;
    }

    /* BOTÓN VOLVER */
    .unicenbot-buttons--volver {
        margin-top: 12px;
    }

    .unicenbot-option-btn--volver {
        padding: 11px 15px;
    }

    /* BOTÓN CERRAR */
    .unicenbot-x {
        width: 82px;
        height: 82px;
        right: 22px;
        bottom: 18px;
        font-size: 52px;
    }

    .unicenbot-x i {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    /* CAJA DEL CHAT */
    #unicenbot-box {
        height: 300dvh;
        max-height: 740px;
        min-height: 400px;
        border-radius: 16px;
    }}