/* Chat en vivo de Virtual Bit — widget del sitio */
.vbc-root {
    --vbc-navy: #0B2D5B;
    --vbc-navy-2: #143D72;
    --vbc-elec: #00AAEF;
    --vbc-turq: #00C896;
    --vbc-gray: #F3F6FA;
    --vbc-line: #DDE5EF;
    --vbc-muted: #4F6A8F;
    --vbc-link: #0A64A8;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--vbc-navy);
}
.vbc-root *, .vbc-root *::before, .vbc-root *::after { box-sizing: border-box; }
.vbc-root [hidden] { display: none !important; }

/* El botón de WhatsApp sube para dejar espacio al chat */
body.vbc-on .whatsapp-float { bottom: 104px; }
body.vbc-open .whatsapp-float { opacity: 0; visibility: hidden; pointer-events: none; animation: none; }

/* ---------- Botón flotante ---------- */
.vbc-launcher {
    position: fixed; right: 30px; bottom: 30px; z-index: 1001;
    width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--vbc-navy); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 28px rgba(11, 45, 91, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.vbc-launcher:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 14px 34px rgba(11, 45, 91, 0.45); }
.vbc-launcher:focus-visible { outline: 3px solid var(--vbc-elec); outline-offset: 3px; }
.vbc-ico { width: 20px; height: 20px; flex: none; }
.vbc-ico-lg { width: 30px; height: 30px; }
.vbc-dot {
    position: absolute; right: 3px; bottom: 3px; width: 15px; height: 15px; border-radius: 50%;
    background: #9AA9BF; border: 3px solid #fff;
}
.vbc-root.is-online .vbc-dot { background: var(--vbc-turq); }
.vbc-badge {
    position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
    background: #E5484D; color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
}
.vbc-tip {
    position: absolute; right: 72px; top: 50%; transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.85); color: #fff; padding: 7px 12px; border-radius: 8px;
    font-size: 0.88rem; font-weight: 500; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.vbc-launcher:hover .vbc-tip, .vbc-launcher:focus-visible .vbc-tip { opacity: 1; }
.vbc-root.is-open .vbc-tip { display: none; }

/* ---------- Panel ---------- */
.vbc-panel {
    position: fixed; right: 30px; bottom: 104px; z-index: 1002;
    width: 380px; max-width: calc(100vw - 32px); height: 580px; max-height: calc(100vh - 140px);
    background: #fff; border-radius: 20px; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 60px rgba(11, 45, 91, 0.28), 0 2px 8px rgba(11, 45, 91, 0.08);
    animation: vbcIn 0.22s ease;
}
@keyframes vbcIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

.vbc-head {
    display: flex; align-items: center; gap: 12px; padding: 16px 14px 16px 18px;
    background: var(--vbc-navy); color: #fff; border-bottom: 4px solid var(--vbc-turq); flex: none;
}
.vbc-avatar {
    width: 42px; height: 42px; border-radius: 12px; flex: none;
    background: linear-gradient(135deg, var(--vbc-elec), var(--vbc-turq)); color: var(--vbc-navy);
    font-family: 'Montserrat', 'Inter', sans-serif; font-weight: 800; font-size: 16px; display: flex; align-items: center; justify-content: center;
}
.vbc-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vbc-head-text strong { font-family: 'Montserrat', 'Inter', sans-serif; font-size: 16px; font-weight: 800; line-height: 1.2; }
.vbc-status { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #C9D6E8; line-height: 1.3; margin-top: 2px; }
.vbc-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #9AA9BF; flex: none; }
.vbc-root.is-online .vbc-status-dot { background: var(--vbc-turq); box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.25); }
.vbc-hbtn {
    width: 36px; height: 36px; border-radius: 10px; border: 0; cursor: pointer; flex: none;
    background: transparent; color: #fff; display: flex; align-items: center; justify-content: center;
}
.vbc-hbtn:hover { background: rgba(255, 255, 255, 0.1); }
.vbc-hbtn:focus-visible { outline: 2px solid var(--vbc-elec); }

.vbc-notice {
    flex: none; background: #FFF6E5; color: #6B4500; font-size: 13px; line-height: 1.45; padding: 9px 16px;
    border-bottom: 1px solid #F2DDB0;
}

/* ---------- Mensajes ---------- */
.vbc-body { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--vbc-gray); }
.vbc-list { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.vbc-msg { max-width: 84%; padding: 9px 12px 6px; border-radius: 16px; position: relative; word-wrap: break-word; overflow-wrap: anywhere; }
.vbc-msg p { margin: 0; white-space: pre-wrap; font-size: 14.5px; line-height: 1.45; }
.vbc-msg time { display: block; font-size: 11px; margin-top: 3px; opacity: 0.7; text-align: right; }
.vbc-msg.is-me { align-self: flex-end; background: var(--vbc-navy); color: #fff; border-bottom-right-radius: 5px; }
.vbc-msg.is-me a { color: #9FE7D2; }
.vbc-msg.is-op { align-self: flex-start; background: #fff; border: 1px solid var(--vbc-line); border-bottom-left-radius: 5px; }
.vbc-msg.is-op a { color: var(--vbc-link); }
.vbc-who { display: block; font-size: 11.5px; font-weight: 700; color: #007A5E; margin-bottom: 1px; }
.vbc-msg.is-sys { align-self: center; background: transparent; color: var(--vbc-muted); font-size: 12.5px; text-align: center; max-width: 92%; }
.vbc-msg.is-sys p { font-size: 12.5px; }
.vbc-msg.is-error { color: #B42318; }
.vbc-typing { display: flex; align-items: center; gap: 4px; padding: 0 18px 10px; color: var(--vbc-muted); font-size: 12.5px; }
.vbc-typing span { width: 6px; height: 6px; border-radius: 50%; background: #9AA9BF; animation: vbcDot 1.2s infinite ease-in-out; }
.vbc-typing span:nth-child(2) { animation-delay: 0.15s; }
.vbc-typing span:nth-child(3) { animation-delay: 0.3s; }
.vbc-typing em { font-style: normal; margin-left: 6px; }
@keyframes vbcDot { 0%, 80%, 100% { opacity: 0.35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Formulario inicial ---------- */
.vbc-form { flex: 1; overflow-y: auto; padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 6px; }
.vbc-intro { margin: 0 0 8px; background: var(--vbc-gray); border-radius: 14px; padding: 12px 14px; font-size: 14.5px; }
.vbc-form label { font-size: 13px; font-weight: 600; margin-top: 6px; }
.vbc-opt { font-weight: 400; color: var(--vbc-muted); }
.vbc-form input[type="text"], .vbc-form input[type="email"], .vbc-form textarea {
    width: 100%; font: inherit; font-size: 15px; color: var(--vbc-navy);
    border: 1.5px solid var(--vbc-line); border-radius: 10px; padding: 9px 11px; background: #fff;
}
.vbc-form textarea { resize: vertical; min-height: 76px; }
.vbc-form input:focus, .vbc-form textarea:focus, .vbc-input:focus { outline: none; border-color: var(--vbc-elec); box-shadow: 0 0 0 3px rgba(0, 170, 239, 0.18); }
.vbc-form .is-invalid { border-color: #D92D20 !important; }
.vbc-hint { font-size: 12px; color: var(--vbc-muted); line-height: 1.35; }
.vbc-check { display: flex; gap: 9px; align-items: flex-start; font-weight: 400 !important; font-size: 12.5px !important; line-height: 1.45; color: var(--vbc-muted); margin-top: 10px !important; cursor: pointer; }
.vbc-check input { margin-top: 2px; width: 17px; height: 17px; flex: none; accent-color: var(--vbc-navy); }
.vbc-check input.is-invalid { outline: 2px solid #D92D20; outline-offset: 1px; }
.vbc-check a { color: var(--vbc-link); }
.vbc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.vbc-error { margin: 6px 0 0; color: #B42318; font-size: 13px; font-weight: 600; }
.vbc-btn {
    margin-top: 10px; width: 100%; border: 0; border-radius: 12px; padding: 12px 16px; cursor: pointer;
    background: var(--vbc-turq); color: var(--vbc-navy); font: inherit; font-weight: 800; font-size: 15px;
    transition: filter 0.2s ease;
}
.vbc-btn:hover { filter: brightness(0.95); }
.vbc-btn:disabled { opacity: 0.6; cursor: wait; }
.vbc-btn-sec { background: var(--vbc-navy); color: #fff; }

.vbc-closed { flex: none; padding: 14px 18px; text-align: center; border-top: 1px solid var(--vbc-line); }
.vbc-closed p { margin: 0 0 4px; font-size: 13.5px; color: var(--vbc-muted); }

/* ---------- Redacción ---------- */
.vbc-composer { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--vbc-line); background: #fff; }
.vbc-input {
    flex: 1; resize: none; font: inherit; font-size: 15px; color: var(--vbc-navy); line-height: 1.4;
    border: 1.5px solid var(--vbc-line); border-radius: 12px; padding: 9px 12px; max-height: 120px; background: #fff;
}
.vbc-send {
    width: 42px; height: 42px; border-radius: 12px; border: 0; cursor: pointer; flex: none;
    background: var(--vbc-turq); color: var(--vbc-navy); display: flex; align-items: center; justify-content: center;
}
.vbc-send:disabled { opacity: 0.6; }
.vbc-send:focus-visible, .vbc-btn:focus-visible { outline: 3px solid var(--vbc-elec); outline-offset: 2px; }

.vbc-foot { flex: none; text-align: center; padding: 8px 12px 10px; font-size: 12.5px; border-top: 1px solid var(--vbc-line); background: #fff; }
.vbc-wa { color: #128C7E; font-weight: 600; text-decoration: none; }
.vbc-wa:hover { text-decoration: underline; }

/* ---------- Celular ---------- */
@media (max-width: 768px) {
    body.vbc-on .whatsapp-float { bottom: 88px; }
    .vbc-launcher { right: 20px; bottom: 20px; width: 56px; height: 56px; }
    .vbc-tip { display: none; }
}
@media (max-width: 520px) {
    .vbc-panel { right: 0; bottom: 0; left: 0; top: 0; width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; }
    .vbc-root.is-open .vbc-launcher { display: none; }
    .vbc-form input[type="text"], .vbc-form input[type="email"], .vbc-form textarea, .vbc-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .vbc-panel, .vbc-typing span { animation: none; }
    .vbc-launcher { transition: none; }
}
@media print { .vbc-root { display: none !important; } }
