/* FULLTECHNICS
   ═══════════════════════════════════════════════════════
   chat.css — Chatbot flotante y botón de WhatsApp
   ═══════════════════════════════════════════════════════ */

/* ── BOTÓN FLOTANTE DEL CHAT ────────────────────────── */
.chat-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 600;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    border: none;
    cursor: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(37, 99, 235, 0.5);
    transition: all 0.3s;
    font-size: 22px;
    animation: fabPop 0.5s ease 1s both;
}

.chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 36px rgba(37, 99, 235, 0.7);
}

/* Punto verde de "en línea" */
.chat-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #10B981;
    border: 2px solid var(--bg);
    animation: pulseRing 2s infinite;
}

/* ── BOTÓN WHATSAPP ─────────────────────────────────── */
.wa-float {
    position: fixed;
    bottom: 100px;
    right: 100px;
    z-index: 590;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #25D366;
    border: none;
    cursor: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    font-size: 22px;
    transition: all 0.2s;
    animation: fabPop 0.5s ease 1.2s both;
    text-decoration: none;
}

.wa-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

/* ── VENTANA DEL CHAT ───────────────────────────────── */
.chatbox {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 600;
    width: 340px;
    background: var(--card);
    border: 1px solid var(--border2);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: none;
    overflow: hidden;
    flex-direction: column;
}

.chatbox.open {
    display: flex;
    animation: slideUp 0.3s ease;
}

/* ── HEADER DEL CHAT ────────────────────────────────── */
.chat-header {
    background: linear-gradient(135deg, var(--blue), #1E40AF);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.chat-hname {
    font-family: var(--orb);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.chat-hstatus {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-hstatus::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
    display: inline-block;
}

.chat-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: none;
    opacity: 0.7;
    padding: 4px;
    line-height: 1;
    transition: opacity 0.2s;
}

.chat-close:hover {
    opacity: 1;
}

/* ── MENSAJES ────────────────────────────────────────── */
.chat-messages {
    height: 260px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 2px;
}

/* Burbuja de mensaje */
.msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 12.5px;
    line-height: 1.5;
    word-break: break-word;
}

/* Mensaje del bot */
.msg.bot {
    background: var(--surface);
    color: var(--gray2);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

/* Mensaje del usuario */
.msg.user {
    background: var(--blue);
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.msg-time {
    font-size: 10px;
    opacity: 0.5;
    margin-top: 4px;
}

/* ── OPCIONES RÁPIDAS ───────────────────────────────── */
.chat-options {
    padding: 0 16px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    flex-shrink: 0;
}

.chat-opt {
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: var(--blue3);
    cursor: none;
    transition: all 0.2s;
    font-family: var(--body);
}

.chat-opt:hover {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

/* ── CAMPO DE TEXTO ─────────────────────────────────── */
.chat-input-row {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-inp {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 9px 16px;
    font-size: 12px;
    color: var(--white);
    font-family: var(--body);
    outline: none;
    transition: border-color 0.2s;
}

.chat-inp:focus {
    border-color: var(--blue);
}

.chat-inp::placeholder {
    color: var(--gray);
}

.chat-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--blue);
    border: none;
    cursor: none;
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send:hover {
    background: #1D4ED8;
}

/* ── INDICADOR DE ESCRITURA ─────────────────────────── */
.typing {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 4px 0;
}

.typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gray);
    animation: typingAnim 1.2s infinite;
}

.typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing span:nth-child(3) {
    animation-delay: 0.4s;
}

/* ── ANIMACIONES ────────────────────────────────────── */
@keyframes fabPop {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseRing {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes typingAnim {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
    }
}