#avedis-chatbot,
#avedis-chatbot * {
    box-sizing: border-box;
}

#avedis-chatbot {
    font-family: Arial, Helvetica, sans-serif;
}

/* BOTÓN FLOTANTE */
#avedis-chat-button {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 50%;
    background: #006898;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 7px 22px rgba(0, 0, 0, 0.28);
    z-index: 999999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#avedis-chat-button:hover {
    transform: scale(1.07);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

#avedis-chat-icon {
    font-size: 27px;
    line-height: 1;
}

/* VENTANA */
#avedis-chat-window {
    position: fixed;
    right: 25px;
    bottom: 105px;
    width: 380px;
    height: 570px;
    max-width: calc(100vw - 30px);
    max-height: calc(100vh - 130px);
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.28);
    z-index: 999998;
    display: flex;
    flex-direction: column;
    transform-origin: bottom right;
    animation: avedisChatOpen 0.2s ease;
}

#avedis-chat-window.avedis-chat-hidden {
    display: none;
}

@keyframes avedisChatOpen {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* CABECERA */
#avedis-chat-header {
    min-height: 76px;
    padding: 14px 15px;
    display: flex;
    align-items: center;
    gap: 11px;
    background: linear-gradient(135deg, #004d7a, #0077a8);
    color: #ffffff;
}

.avedis-chat-brand {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avedis-chat-brand img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    display: block;
}

.avedis-chat-brand span {
    color: #006898;
    font-size: 22px;
    font-weight: bold;
}

.avedis-chat-header-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.avedis-chat-header-info strong {
    color: #ff7f50;
    font-size: 16px;
    line-height: 1.2;
}

.avedis-chat-header-info span {
    margin-top: 4px;
    color: #ffffff;
    font-size: 11px;
}

#avedis-chat-close {
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

/* MENSAJES */
#avedis-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 17px 14px;
    background: #f3f5f7;
}

.avedis-message-row {
    width: 100%;
    display: flex;
    margin-bottom: 10px;
}

.avedis-message-row.bot {
    justify-content: flex-start;
}

.avedis-message-row.user {
    justify-content: flex-end;
}

.avedis-message {
    max-width: 84%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-line;
}

.avedis-message-row.bot .avedis-message {
    background: #ffffff;
    color: #333333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.avedis-message-row.user .avedis-message {
    background: #006898;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

/* ESCRIBIENDO... */
.avedis-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 16px;
}

.avedis-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9aa4ad;
    display: inline-block;
    animation: avedisTyping 1s infinite ease-in-out;
}

.avedis-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.avedis-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes avedisTyping {
    0%, 80%, 100% {
        opacity: 0.35;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* RESUMEN */
.avedis-summary-title {
    font-weight: bold;
    margin-bottom: 8px;
}

.avedis-summary-line {
    margin-bottom: 5px;
}

.avedis-summary-line strong {
    display: inline-block;
    min-width: 72px;
}

/* OPCIONES */
.avedis-options {
    width: 100%;
    margin: 2px 0 15px 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.avedis-option {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #006898;
    border-radius: 9px;
    background: #ffffff;
    color: #006898;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.avedis-option:hover {
    background: #006898;
    color: #ffffff;
}

.avedis-option-confirm {
    background: #1c8b4c;
    border-color: #1c8b4c;
    color: #ffffff;
}

.avedis-option-confirm:hover {
    background: #15703c;
    border-color: #15703c;
}

.avedis-option-secondary {
    border-color: #aaaaaa;
    color: #555555;
}

/* INPUT */
#avedis-chat-input-area {
    min-height: 65px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border-top: 1px solid #dddddd;
}

#avedis-chat-input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 15px;
    border: 1px solid #cccccc;
    border-radius: 22px;
    background: #ffffff;
    color: #222222;
    outline: none;
    font-size: 13px;
}

#avedis-chat-input:focus {
    border-color: #006898;
}

#avedis-chat-send {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #006898;
    color: #ffffff;
    cursor: pointer;
    font-size: 17px;
}

/* MÓVIL */
@media (max-width: 520px) {
    #avedis-chat-button {
        right: 15px;
        bottom: 15px;
        width: 58px;
        height: 58px;
    }

    #avedis-chat-window {
        right: 10px;
        bottom: 83px;
        width: calc(100vw - 20px);
        height: 72vh;
        max-height: 650px;
    }
}