/* ===================== CHATBOT ===================== */
.chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.chatbot-toggle {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    /* Gradiente usando a paleta vermelha */
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    border: none;
    color: var(--white);
    padding: 0;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: chatPulse 2.6s infinite;
}

@keyframes chatPulse {

    0%,
    100% {
        box-shadow: var(--shadow-md);
    }

    50% {
        box-shadow: var(--shadow-lg);
    }
}

.chatbot-toggle:hover {
    transform: scale(1.1);
}

.chatbot-toggle.active {
    transform: scale(0.92);
    animation: none;
}

.chatbot-toggle-face,
.chatbot-toggle-close {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .25s ease, transform .25s ease;
}

.chatbot-toggle-face {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.chatbot-toggle-face img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    padding: 4px;
}

.chatbot-toggle-close {
    opacity: 0;
    transform: scale(.4) rotate(-90deg);
    font-size: 22px;
}

.chatbot-toggle.active .chatbot-toggle-face {
    opacity: 0;
    transform: scale(.4) rotate(90deg);
}

.chatbot-toggle.active .chatbot-toggle-close {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--fire);
    color: var(--white);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgeBounce 1s infinite;
}

@keyframes badgeBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* ── Balão de convite proativo ────────────────────────────── */
.chatbot-teaser {
    position: absolute;
    bottom: 10px;
    right: 76px;
    width: max-content;
    max-width: 220px;
    background: var(--white);
    color: var(--text);
    padding: 12px 30px 12px 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    font-family: var(--font-body);
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(.94);
    transition: opacity .3s ease, transform .3s ease, visibility .3s;
    cursor: pointer;
}

.chatbot-teaser.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chatbot-teaser::after {
    content: '';
    position: absolute;
    bottom: 20px;
    right: -6px;
    width: 12px;
    height: 12px;
    background: var(--white);
    transform: rotate(45deg);
}

.chatbot-teaser p {
    margin: 0;
}

.chatbot-teaser-dismiss {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: transparent;
    color: var(--gray);
    border: none;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.chatbot-teaser-dismiss:hover {
    background: var(--gray-light);
    color: var(--text);
}

@media (max-width: 480px) {
    .chatbot-teaser {
        right: -4px;
        bottom: 78px;
        max-width: calc(100vw - 70px);
    }

    .chatbot-teaser::after {
        right: 18px;
        bottom: -6px;
        top: auto;
    }
}

.chatbot-box {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: var(--off-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.85) translateY(20px);
    transition: all var(--transition);
    overflow: hidden;
    border: 1px solid var(--gray-light);
}

.chatbot-box.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.chatbot-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.chatbot-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    flex-shrink: 0;
}

.chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chatbot-info {
    flex: 1;
    min-width: 0;
}

.chatbot-info h4 {
    color: var(--white);
    font-size: 15px;
    margin: 0 0 3px;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
}

.chatbot-status {
    color: var(--gray-light);
    font-size: 12px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
}

.status-dot {
    width: 7px;
    height: 7px;
    background: var(--amber);
    /* Substituto quente para o verde antigo */
    border-radius: 50%;
    display: inline-block;
    animation: blink 2s infinite;
    flex-shrink: 0;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--white);
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbot-close:hover {
    background: var(--red);
    transform: rotate(90deg);
}

.chatbot-body {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    background: var(--off-white);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chatbot-body::-webkit-scrollbar {
    width: 5px;
}

.chatbot-body::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-body::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: var(--radius);
}

.chatbot-message {
    display: flex;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--navy-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 5px;
}

.user-message .message-avatar {
    background: var(--red);
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.user-message .message-avatar i {
    color: var(--white);
    font-size: 16px;
}

.message-content {
    max-width: 72%;
    background: var(--white);
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.bot-message .message-content {
    border-bottom-left-radius: var(--radius);
}

.user-message .message-content {
    background: var(--navy);
    border-bottom-right-radius: var(--radius);
}

.message-content p {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    line-height: 1.65;
    font-family: var(--font-body);
    word-wrap: break-word;
}

.message-content p+p {
    margin-top: 8px;
}

.user-message .message-content p {
    color: var(--white);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 6px 0;
}

.typing-dot {
    width: 7px;
    height: 7px;
    background: var(--red-light);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-9px);
    }
}

.chatbot-footer {
    padding: 10px 14px;
    background: var(--white);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-top: 1.5px solid var(--gray-light);
    max-height: 210px;
    overflow-y: auto;
}

.chatbot-footer::-webkit-scrollbar {
    width: 4px;
}

.chatbot-footer::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-footer::-webkit-scrollbar-thumb {
    background: var(--gray-light);
    border-radius: var(--radius);
}

.chatbot-options {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.option-btn {
    background: var(--white);
    border: 1.5px solid var(--gray-light);
    color: var(--text);
    padding: 8px 10px 8px 8px;
    border-radius: 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    gap: 9px;
    line-height: 1.3;
}

.option-btn-icon {
    flex-shrink: 0;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: rgba(225, 34, 23, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.option-btn-icon i {
    font-size: 12px;
    color: var(--red);
    width: auto;
    transition: color var(--transition);
}

.option-btn-label {
    flex: 1;
}

.option-btn-arrow {
    flex-shrink: 0;
    font-size: 10px;
    color: var(--gray);
    transition: transform var(--transition), color var(--transition);
}

.option-btn:hover {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
    transform: translateX(3px);
}

.option-btn:hover .option-btn-icon {
    background: rgba(255, 255, 255, .15);
}

.option-btn:hover .option-btn-icon i {
    color: var(--amber);
}

.option-btn:hover .option-btn-arrow {
    color: var(--white);
    transform: translateX(2px);
}

.chatbot-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--red);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 2px solid var(--red);
    transition: all var(--transition);
    margin-top: 6px;
    font-size: 13px;
    font-family: var(--font-body);
}

.chatbot-link:hover {
    color: var(--navy);
    border-bottom-color: var(--navy);
}

@media (max-width: 768px) {
    .chatbot-box {
        width: calc(100vw - 30px);
        height: calc(100vh - 100px);
        bottom: 78px;
        right: -8px;
    }
}

@media (max-width: 576px) {
    .chatbot-footer {
        padding: 12px 14px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .chatbot-box {
        height: 85vh;
    }
}