/* ============================================================
   Coxeur Chatbot CSS
   ============================================================ */
:root {
    --cxr-chat-navy: #060912;
    --cxr-chat-lime: #8cc63f;
    --cxr-chat-lime2: #a8d84f;
    --cxr-chat-w: 360px;
    --cxr-chat-h: 520px;
}

/* ── Toggle bubble ────────────────────────────────────────── */
.cxr-chat__toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99998;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--cxr-chat-lime);
    color: #000;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(140, 198, 63, .45);
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s;
    animation: cxr-chat-pulse 3s ease-in-out infinite;
}

.cxr-chat__toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(140, 198, 63, .6);
    animation: none;
}

@keyframes cxr-chat-pulse {

    0%,
    100% {
        box-shadow: 0 8px 24px rgba(140, 198, 63, .45);
    }

    50% {
        box-shadow: 0 8px 32px rgba(140, 198, 63, .7), 0 0 0 12px rgba(140, 198, 63, .1);
    }
}

.cxr-chat__notif {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    font-size: .7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.cxr-chat__notif.hidden {
    display: none;
}

/* ── Chat window ──────────────────────────────────────────── */
.cxr-chatbot {
    position: fixed;
    bottom: 100px;
    right: 28px;
    z-index: 99997;
    width: var(--cxr-chat-w);
    max-height: var(--cxr-chat-h);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(.95);
    transition: opacity .3s, transform .3s cubic-bezier(.34, 1.56, .64, 1);
    font-family: 'Outfit', -apple-system, sans-serif;
}

.cxr-chatbot.open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

/* ── Header ───────────────────────────────────────────────── */
.cxr-chat__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 14px;
    background: linear-gradient(135deg, var(--cxr-chat-navy), #121a60);
    color: #fff;
}

.cxr-chat__avatar {
    width: 42px;
    height: 42px;
    background: rgba(140, 198, 63, .15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(140, 198, 63, .3);
    flex-shrink: 0;
}

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

.cxr-chat__name {
    display: block;
    font-weight: 700;
    font-size: .95rem;
}

.cxr-chat__status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    opacity: .7;
}

.cxr-chat__dot {
    width: 7px;
    height: 7px;
    background: var(--cxr-chat-lime);
    border-radius: 50%;
    animation: cxr-blink 2s ease-in-out infinite;
}

@keyframes cxr-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .3;
    }
}

.cxr-chat__close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, .6);
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: background .2s, color .2s;
}

.cxr-chat__close:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

/* ── Messages area ────────────────────────────────────────── */
.cxr-chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.cxr-chat__messages::-webkit-scrollbar {
    width: 4px;
}

.cxr-chat__messages::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

/* Bubbles */
.cxr-msg {
    display: flex;
    gap: 8px;
    animation: cxr-msg-in .25s ease;
    max-width: 85%;
}

@keyframes cxr-msg-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

.cxr-msg--bot {
    align-self: flex-start;
}

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

.cxr-msg__avatar {
    width: 30px;
    height: 30px;
    background: var(--cxr-chat-navy);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .7rem;
    font-weight: 700;
    color: var(--cxr-chat-lime);
}

.cxr-msg__bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: .875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.cxr-msg--bot .cxr-msg__bubble {
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 6px;
}

.cxr-msg--user .cxr-msg__bubble {
    background: linear-gradient(135deg, var(--cxr-chat-navy), #121a60);
    color: #fff;
    border-bottom-right-radius: 6px;
}

/* Typing indicator */
.cxr-msg--typing .cxr-msg__bubble {
    background: #f1f5f9;
    padding: 12px 16px;
}

.cxr-typing-dots {
    display: flex;
    gap: 4px;
}

.cxr-typing-dots span {
    width: 7px;
    height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    animation: cxr-dot 1.4s ease-in-out infinite;
}

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

.cxr-typing-dots span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes cxr-dot {

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

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

/* ── Quick replies ────────────────────────────────────────── */
.cxr-chat__quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 12px 8px;
}

.cxr-quick-btn {
    background: #fff;
    border: 1.5px solid var(--cxr-chat-lime);
    color: var(--cxr-chat-navy);
    border-radius: 50px;
    padding: 5px 12px;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
    font-family: inherit;
}

.cxr-quick-btn:hover {
    background: var(--cxr-chat-lime);
    color: #000;
}

/* ── Input ────────────────────────────────────────────────── */
.cxr-chat__input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #f1f5f9;
    background: #fff;
}

.cxr-chat__input {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 50px;
    padding: 10px 16px;
    font-size: .875rem;
    font-family: inherit;
    outline: none;
    color: #1e293b;
    transition: border-color .25s;
}

.cxr-chat__input:focus {
    border-color: var(--cxr-chat-lime);
}

.cxr-chat__send {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: var(--cxr-chat-lime);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    transition: background .2s, transform .2s;
}

.cxr-chat__send:hover {
    background: var(--cxr-chat-lime2);
    transform: scale(1.05);
}

/* ── Footer note ──────────────────────────────────────────── */
.cxr-chat__footer-note {
    text-align: center;
    font-size: .65rem;
    color: #94a3b8;
    padding: 4px 0 8px;
}

/* ── Lead form inside chat ────────────────────────────────── */
.cxr-chat-form {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px;
    margin: 4px 0;
}

.cxr-chat-form input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: .82rem;
    font-family: inherit;
    margin-bottom: 6px;
    outline: none;
}

.cxr-chat-form input:focus {
    border-color: var(--cxr-chat-lime);
}

.cxr-chat-form button {
    width: 100%;
    padding: 9px;
    background: var(--cxr-chat-lime);
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
    color: #000;
}

/* ── WhatsApp button ──────────────────────────────────────── */
.cxr-chat-wa {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #25d366;
    color: #fff !important;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    margin: 4px 0;
    transition: transform .2s;
}

.cxr-chat-wa:hover {
    transform: translateY(-2px);
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 480px) {
    .cxr-chatbot {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 90px;
    }

    .cxr-chat__toggle {
        right: 16px;
        bottom: 20px;
    }
}