/* ==========================================================================
   TRAMEI — Chatbot de Atendimento (coleta dados e encaminha pro WhatsApp)
   ========================================================================== */

.tool-item button.tramei-chatbot-trigger {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tramei-chatbot-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 16, 14, 0.4);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.tramei-chatbot-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0s;
}

.tramei-chatbot {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 370px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 110px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(24px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
}

.tramei-chatbot.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s;
}

.tramei-chatbot__header {
    background: #111111;
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.tramei-chatbot__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
}

.tramei-chatbot__close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.tramei-chatbot__close:hover { opacity: 1; }

.tramei-chatbot__body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #faf9f7;
}

.tramei-chat-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
}

.tramei-chat-msg--bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #ececec;
    color: #111111;
    border-bottom-left-radius: 4px;
}

.tramei-chat-msg--user {
    align-self: flex-end;
    background: #AC4C16;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.tramei-chat-input-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.tramei-chat-input {
    flex: 1;
    min-width: 120px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13.5px;
    font-family: inherit;
}

.tramei-chat-input:focus {
    outline: none;
    border-color: #AC4C16;
}

.tramei-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #111111;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
    transition: background 0.2s ease;
}

.tramei-chat-send:hover { background: #AC4C16; }

.tramei-chat-choice {
    padding: 9px 16px;
    border-radius: 20px;
    border: 1px solid #111111;
    background: #fff;
    color: #111111;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tramei-chat-choice:hover {
    background: #111111;
    color: #fff;
}

.tramei-chat-whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border-radius: 24px;
    background: #25D366;
    color: #fff !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s ease;
}

.tramei-chat-whatsapp-btn:hover { background: #1ebd58; }

@media (max-width: 480px) {
    .tramei-chatbot {
        right: 16px;
        left: 16px;
        bottom: 16px;
        width: auto;
        height: 72vh;
        max-height: none;
    }
}

/* --- Floating WhatsApp launcher (bottom-right, pulsing) ----------------- */
.tramei-chatbot-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: #25D366;
    color: #fff;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 9997;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.tramei-chatbot-float:hover { transform: scale(1.07); }

.tramei-chatbot-float.is-hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.7);
    pointer-events: none;
}

.tramei-chatbot-float__pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #25D366;
    opacity: 0.55;
    z-index: -1;
    animation: tramei-chatbot-pulse 2.2s ease-out infinite;
}

@keyframes tramei-chatbot-pulse {
    0%   { transform: scale(1);   opacity: 0.55; }
    70%  { transform: scale(1.9); opacity: 0; }
    100% { transform: scale(1.9); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .tramei-chatbot-float__pulse { animation: none; }
}

@media (max-width: 480px) {
    .tramei-chatbot-float {
        right: 16px;
        bottom: 16px;
        width: 54px;
        height: 54px;
        font-size: 24px;
    }
}
