/* Vox Chat IA - estilos del widget.
   Paleta: color principal (--vch-acc, #ee7012), blanco y negro. Todo color lleva !important para que el tema
   de la tienda no lo pise (los temas suelen restilar a, button e input). Excepciones con significado propio:
   verde de WhatsApp en el icono, verde/rojo del punto de disponibilidad y del stock. */
.vch { --vch-hbg: #111111; --vch-htx: #ffffff; --vch-acc: #ee7012; --vch-ink: #1f1f1f; --vch-bg: #ffffff; --vch-soft: #f5f5f5; --vch-line: #e6e6e6; --vch-mute: #777777; position: fixed; bottom: 20px; z-index: 99990; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji"; font-size: 14px; line-height: 1.4; color: var(--vch-ink) !important; text-align: left; }
.vch.vch-right { right: 20px; }
.vch.vch-left { left: 20px; }
.vch *, .vch *::before, .vch *::after { box-sizing: border-box; }
/* Lo oculto se queda oculto: sin esto, display:flex de la ventana anulaba el atributo hidden y el chat salia abierto */
.vch [hidden], .vch[data-state="closed"] .vch-win { display: none !important; }
.vch button, .vch input, .vch a { font-family: inherit !important; text-transform: none !important; letter-spacing: normal !important; text-shadow: none !important; }
.vch button { font: inherit; }
.vch a { text-decoration: none; }

/* Lanzador redondo estilo WhatsApp (con prioridad forzada: los temas suelen pisar los estilos de button) */
.vch .vch-launcher { position: relative !important; width: var(--vch-size, 60px) !important; height: var(--vch-size, 60px) !important; min-width: 0 !important; min-height: 0 !important; max-width: none !important; border-radius: 50% !important; border: 0 !important; margin: 0 !important; padding: 0 !important; background: var(--vch-acc) !important; color: #fff !important; cursor: pointer; box-shadow: 1px 6px 24px 0 rgba(0,0,0,.24) !important; display: block !important; overflow: visible !important; line-height: 1 !important; -webkit-appearance: none !important; appearance: none !important; transition: background-color .2s linear, transform .2s; animation: vch-show .4s ease both, vch-pulse-swing 1.5s ease-in-out 3s infinite; }
.vch .vch-launcher:hover, .vch .vch-launcher:focus { animation-play-state: paused; transform: scale(1.15); background: var(--vch-acc) !important; outline: none !important; }
.vch-l-ico { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: calc(var(--vch-size, 60px) * .46 + 5px); color: #fff !important; opacity: 0; transition: opacity .5s ease; border-radius: 50%; }
.vch-l-ico svg { width: calc(var(--vch-size, 60px) * .5 + 5px); height: calc(var(--vch-size, 60px) * .5 + 5px); }
.vch-l-ico.vch-l-logo { opacity: 1; }
.vch-l-ico.vch-l-logo.has-img { background-size: calc(60% + 5px); background-repeat: no-repeat; background-position: center; }
.vch[data-ico="wa"] .vch-l-logo, .vch[data-ico="sup"] .vch-l-logo { opacity: 0; }
.vch[data-ico="wa"] .vch-l-wa, .vch[data-ico="sup"] .vch-l-sup { opacity: 1; }
.vch[data-state="open"] .vch-launcher { display: none !important; }
@keyframes vch-pulse-swing { 0% { transform: scale(1) rotate(0deg); } 20% { transform: scale(1.1) rotate(-3deg); } 40% { transform: scale(1.1) rotate(3deg); } 60% { transform: scale(1.1) rotate(-3deg); } 80% { transform: scale(1.1) rotate(3deg); } 100% { transform: scale(1) rotate(0deg); } }
@keyframes vch-show { from { transform: scale3d(0,0,0); } to { transform: scale(1); } }

/* Punto de estado (verde en horario, rojo fuera) */
.vch .vch-dot { position: absolute; top: 2px; right: 2px; width: 13px; height: 13px; border-radius: 50%; background: #c0392b !important; border: 2px solid #fff !important; box-shadow: 0 1px 3px rgba(0,0,0,.3) !important; z-index: 3; }
.vch .vch-dot.on { background: #2ecc71 !important; }
.vch-avatar { position: relative; }
.vch .vch-avatar .vch-dot { top: -2px; right: -2px; width: 11px; height: 11px; }

/* Contador de mensajes del asesor sin leer (ventana cerrada) */
.vch .vch-badge { position: absolute; top: -4px; left: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--vch-acc) !important; color: #fff !important; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; border: 2px solid #fff !important; z-index: 4; box-shadow: 0 1px 3px rgba(0,0,0,.3) !important; }
.vch-badge[hidden] { display: none; }

/* Tooltip tipo WhatsApp */
.vch .vch-tip { position: absolute; bottom: 14px; white-space: nowrap; height: 32px; line-height: 32px; padding: 0 14px; background: #fff !important; color: var(--vch-ink) !important; font-size: 15px; border-radius: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.15) !important; animation: vch-tip-in .3s ease both; }
.vch.vch-right .vch-tip { right: calc(var(--vch-size, 60px) + 12px); }
.vch.vch-left .vch-tip { left: calc(var(--vch-size, 60px) + 12px); }
.vch-tip::after { content: ""; position: absolute; top: 50%; width: 0; height: 0; margin-top: -6px; border: 6px solid transparent; }
.vch.vch-right .vch-tip::after { right: -11px; border-left-color: #fff !important; }
.vch.vch-left .vch-tip::after { left: -11px; border-right-color: #fff !important; }
.vch-tip[hidden] { display: none; }
@keyframes vch-tip-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 480px) { .vch-tip { font-size: 13px; } }

/* Ventana */
.vch .vch-win { position: absolute; bottom: 0; width: 380px; max-width: calc(100vw - 40px); height: 600px; max-height: calc(100vh - 40px); background: #fff !important; border-radius: 18px; box-shadow: 0 16px 48px rgba(0,0,0,.22) !important; display: flex; flex-direction: column; overflow: hidden; animation: vch-in .2s ease; }
.vch.vch-right .vch-win { right: 0; }
.vch.vch-left .vch-win { left: 0; }
@keyframes vch-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 480px) { .vch .vch-win { position: fixed; inset: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; } }

/* Cabecera */
.vch .vch-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background-color: var(--vch-hbg) !important; color: var(--vch-htx) !important; position: relative; }
.vch .vch-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--vch-acc) !important; color: #fff !important; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.vch-head-txt { flex: 1; min-width: 0; }
.vch .vch-title { font-weight: 700; font-size: 15px; line-height: 1.2; color: var(--vch-htx) !important; }
.vch .vch-sub { font-size: 12px; opacity: .85; line-height: 1.3; white-space: normal; color: var(--vch-htx) !important; }
.vch .vch-code { font-size: 10px; opacity: .65; margin-top: 2px; letter-spacing: .03em; color: var(--vch-htx) !important; }
.vch-code:empty { display: none; }
.vch .vch-close, .vch .vch-reset { background: none !important; border: 0 !important; box-shadow: none !important; color: var(--vch-htx) !important; cursor: pointer; font-size: 22px; line-height: 1; padding: 4px 6px; opacity: .85; min-height: 0 !important; }
.vch .vch-reset { font-size: 18px; }
.vch .vch-close:hover, .vch .vch-reset:hover { opacity: 1; background: none !important; color: var(--vch-htx) !important; }

/* Cuerpo */
.vch .vch-body { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; background-color: var(--vch-soft) !important; -webkit-overflow-scrolling: touch; }
.vch .vch-msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; font-size: 14px; line-height: 1.4; }
.vch .vch-msg.bot { background: #fff !important; color: var(--vch-ink) !important; align-self: flex-start; border-bottom-left-radius: 5px; box-shadow: 0 1px 2px rgba(0,0,0,.06) !important; }
.vch .vch-msg.user { background: var(--vch-acc) !important; color: #fff !important; align-self: flex-end; border-bottom-right-radius: 5px; }
.vch .vch-msg.advisor { background: #fff !important; color: var(--vch-ink) !important; align-self: flex-start; border-bottom-left-radius: 5px; border-left: 3px solid var(--vch-acc) !important; box-shadow: 0 1px 2px rgba(0,0,0,.06) !important; }
.vch .vch-msg.advisor::before { content: attr(data-label); display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--vch-acc) !important; margin-bottom: 2px; }
.vch .vch-sys { align-self: center; text-align: center; font-size: 11px; color: var(--vch-mute) !important; padding: 2px 8px; }
.vch .vch-typing { align-self: flex-start; background: #fff !important; border-radius: 16px; padding: 10px 14px; display: flex; gap: 4px; }
.vch .vch-typing i { width: 6px; height: 6px; border-radius: 50%; background: #bbb !important; animation: vch-dot 1s infinite; }
.vch-typing i:nth-child(2) { animation-delay: .15s; } .vch-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes vch-dot { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }

/* Botones rapidos */
.vch-qr { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 92%; }
.vch .vch-qr button { background: #fff !important; border: 1.5px solid var(--vch-acc) !important; color: var(--vch-acc) !important; border-radius: 999px !important; padding: 7px 12px !important; font-size: 13px !important; font-weight: 600 !important; line-height: 1.3 !important; min-height: 0 !important; box-shadow: none !important; cursor: pointer; transition: background .15s, color .15s; }
.vch .vch-qr button:hover { background: var(--vch-acc) !important; color: #fff !important; }
.vch .vch-qr.vch-fb button { border-color: #d9d9d9 !important; color: #555 !important; font-weight: 500 !important; font-size: 12px !important; padding: 5px 10px !important; }
.vch .vch-qr.vch-fb button:hover { border-color: var(--vch-acc) !important; color: var(--vch-acc) !important; background: #fff !important; }

/* Tarjeta de producto */
.vch .vch-card { display: flex; gap: 10px; align-items: center; background: #fff !important; border: 1px solid var(--vch-line) !important; border-radius: 12px; padding: 8px; align-self: flex-start; max-width: 92%; text-decoration: none !important; color: var(--vch-ink) !important; }
.vch .vch-card:hover { border-color: var(--vch-acc) !important; }
.vch .vch-card img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: #f3f3f3 !important; flex-shrink: 0; }
.vch .vch-card .n { font-weight: 600; font-size: 13px; line-height: 1.25; color: var(--vch-ink) !important; }
.vch .vch-card .p { color: var(--vch-acc) !important; font-weight: 700; font-size: 13px; margin-top: 2px; }
.vch .vch-card .s { font-size: 11px; color: #0a7f3f !important; }
.vch .vch-card .s.out { color: #c0392b !important; }
.vch .vch-card .v { font-size: 11px; color: var(--vch-mute) !important; }

/* Lead */
.vch .vch-lead { display: flex; flex-direction: column; gap: 6px; background: #fff !important; border-radius: 12px; padding: 10px; align-self: flex-start; max-width: 92%; width: 92%; }
.vch .vch-lead input { border: 1px solid #d9d9d9 !important; border-radius: 8px !important; padding: 8px 10px !important; font-size: 13px !important; background: #fff !important; color: var(--vch-ink) !important; box-shadow: none !important; min-height: 0 !important; }
.vch .vch-lead input:focus { outline: 2px solid var(--vch-acc) !important; outline-offset: -1px; border-color: var(--vch-acc) !important; }
.vch .vch-lead label { font-size: 11px; color: #666 !important; display: flex; gap: 6px; align-items: center; }
.vch .vch-lead button { align-self: flex-start; background: var(--vch-acc) !important; color: #fff !important; border: 0 !important; border-radius: 8px !important; padding: 8px 14px !important; font-weight: 600 !important; cursor: pointer; box-shadow: none !important; min-height: 0 !important; }

/* Pie */
.vch .vch-foot { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #ececec !important; background: #fff !important; position: relative; }
.vch .vch-slash { position: absolute; left: 10px; right: 10px; bottom: 100%; background: #fff !important; border: 1px solid var(--vch-line) !important; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14) !important; margin-bottom: 6px; overflow: hidden; z-index: 3; }
.vch-slash[hidden] { display: none; }
.vch .vch-slash-h { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: #888 !important; padding: 8px 12px 4px; }
.vch .vch-slash-i { padding: 9px 12px; font-size: 13px; cursor: pointer; display: flex; gap: 8px; align-items: center; color: var(--vch-ink) !important; }
.vch .vch-slash-i:hover, .vch .vch-slash-i.on { background: #fff3ea !important; color: var(--vch-acc) !important; }
.vch .vch-slash-i b { font-weight: 600; color: var(--vch-acc) !important; }
.vch .vch-foot input { flex: 1; min-width: 0; border: 1px solid #d9d9d9 !important; border-radius: 999px !important; padding: 10px 14px !important; font-size: 14px !important; outline: 0; background: #fff !important; color: var(--vch-ink) !important; box-shadow: none !important; min-height: 0 !important; height: auto !important; }
.vch .vch-foot input:focus { border-color: var(--vch-acc) !important; box-shadow: 0 0 0 3px rgba(238,112,18,.18) !important; outline: 0 !important; }
.vch .vch-send { background: var(--vch-acc) !important; color: #fff !important; border: 0 !important; border-radius: 999px !important; padding: 10px 16px !important; font-weight: 600 !important; cursor: pointer; box-shadow: none !important; min-height: 0 !important; line-height: 1.3 !important; }
.vch .vch-send:hover { background: var(--vch-acc) !important; color: #fff !important; opacity: .92; }
.vch .vch-send:disabled { opacity: .5; cursor: not-allowed; }
.vch .vch-hint { font-size: 11px; color: #999 !important; padding: 0 14px 6px; background: #fff !important; }
.vch .vch-priv { font-size: 10px; color: #888 !important; text-align: center; padding: 0 12px 8px; background: #fff !important; }
.vch .vch-priv a { color: #888 !important; text-decoration: underline !important; }
.vch .vch-msg.notice { background: #fff3ea !important; border: 1px solid var(--vch-acc) !important; color: var(--vch-ink) !important; align-self: stretch; max-width: 100%; text-align: center; font-size: 13px; }
.vch .vch-sys.vch-reopen { color: var(--vch-acc) !important; font-weight: 600; }
.vch[data-status="waiting"] .vch-sub::after, .vch[data-status="human"] .vch-sub::after { content: ""; }

/* Enlaces dentro de los mensajes (solo http/https) */
.vch .vch-msg a.vch-link { color: var(--vch-acc) !important; text-decoration: underline !important; text-underline-offset: 2px; word-break: break-all; font-weight: 600; }
.vch .vch-msg.user a.vch-link { color: #fff !important; }
.vch .vch-msg a.vch-link:hover { opacity: .8; }

/* Emojis */
.vch .vch-emoji-btn { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50% !important; border: 1px solid #d9d9d9 !important; background: #fff !important; color: #777 !important; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 !important; display: flex; align-items: center; justify-content: center; box-shadow: none !important; min-height: 0 !important; min-width: 0 !important; }
.vch .vch-emoji-btn:hover { border-color: var(--vch-acc) !important; color: var(--vch-acc) !important; background: #fff !important; }
.vch .vch-emoji { position: absolute; left: 10px; right: 10px; bottom: 100%; background: #fff !important; border: 1px solid var(--vch-line) !important; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14) !important; margin-bottom: 6px; z-index: 3; }
.vch-emoji[hidden] { display: none; }
.vch-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 4px 8px 8px; max-height: 190px; overflow-y: auto; }
.vch .vch-emoji-grid button { background: none !important; border: 0 !important; border-radius: 8px !important; font-size: 22px !important; line-height: 1 !important; padding: 5px 0 !important; cursor: pointer; box-shadow: none !important; min-height: 0 !important; min-width: 0 !important; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif !important; }
.vch .vch-emoji-grid button:hover { background: #f1f1f1 !important; }

/* Tarjeta de contacto (WhatsApp primero; llamadas, horario y disponibilidad como informacion) */
.vch-wa { display: flex; flex-direction: column; gap: 6px; align-self: flex-start; max-width: 92%; width: 92%; }
.vch .vch-contact { display: block; background: #fff !important; border: 1.5px solid var(--vch-line) !important; border-radius: 14px; padding: 10px 12px; text-decoration: none !important; color: var(--vch-ink) !important; box-shadow: 0 1px 2px rgba(0,0,0,.06) !important; transition: border-color .15s, box-shadow .15s; }
.vch .vch-contact:hover { border-color: var(--vch-acc) !important; box-shadow: 0 4px 14px rgba(238,112,18,.2) !important; color: var(--vch-ink) !important; }
.vch .vch-contact-h { display: flex; align-items: center; gap: 10px; }
.vch .vch-contact-h svg { width: 34px; height: 34px; fill: #25d366 !important; flex-shrink: 0; }
.vch .vch-contact-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.vch .vch-contact-t b { font-size: 14px; color: var(--vch-ink) !important; }
.vch .vch-contact-t span { font-size: 15px; font-weight: 700; color: var(--vch-acc) !important; }
.vch .vch-contact-go { font-style: normal; font-size: 18px; color: var(--vch-acc) !important; }
.vch .vch-contact-r { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f0f0f0 !important; font-size: 12px; color: var(--vch-ink) !important; }
.vch .vch-contact-r svg { width: 16px; height: 16px; fill: var(--vch-mute) !important; flex-shrink: 0; }
.vch .vch-contact-r .l { color: var(--vch-mute) !important; }
.vch .vch-contact-r .v { font-weight: 600; color: var(--vch-ink) !important; }
.vch .vch-contact-s { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; color: var(--vch-mute) !important; }
.vch .vch-contact-s .vch-dot { position: static; width: 9px; height: 9px; border: 0 !important; box-shadow: none !important; }
.vch .vch-call-btn { font-size: 12px; color: var(--vch-ink) !important; text-decoration: underline !important; padding-left: 4px; }
.vch .vch-link-btn { align-self: flex-start; background: #fff !important; border: 1.5px solid var(--vch-acc) !important; color: var(--vch-acc) !important; border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; text-decoration: none !important; }

/* Confirmacion para reiniciar */
.vch .vch-confirm { align-self: stretch; background: #fff !important; border: 1px solid var(--vch-acc) !important; border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--vch-ink) !important; }
.vch .vch-confirm b { display: block; margin-bottom: 4px; color: var(--vch-ink) !important; }
.vch .vch-confirm p { margin: 0 0 10px; color: #555 !important; line-height: 1.4; }
.vch-confirm-b { display: flex; gap: 8px; justify-content: flex-end; }
.vch .vch-confirm-b button { border-radius: 999px !important; padding: 7px 14px !important; font-size: 13px !important; font-weight: 600 !important; cursor: pointer; border: 1.5px solid #d9d9d9 !important; background: #fff !important; color: #555 !important; box-shadow: none !important; min-height: 0 !important; }
.vch .vch-confirm-b button.yes { background: var(--vch-ink) !important; border-color: var(--vch-ink) !important; color: #fff !important; }

/* Alternativas bajo el formulario y dots del asesor */
.vch-alt { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.vch .vch-alt button { background: none !important; border: 0 !important; color: #666 !important; font-size: 12px !important; text-decoration: underline !important; cursor: pointer; padding: 2px 4px !important; box-shadow: none !important; min-height: 0 !important; }
.vch .vch-alt button:hover { color: var(--vch-acc) !important; background: none !important; }
.vch .vch-typing-adv { align-self: flex-start; background: #fff !important; border-left: 3px solid var(--vch-acc) !important; border-radius: 16px; padding: 10px 14px; display: flex; gap: 4px; }
.vch .vch-typing-adv i { width: 6px; height: 6px; border-radius: 50%; background: var(--vch-acc) !important; animation: vch-dot 1s infinite; }
.vch-typing-adv i:nth-child(2) { animation-delay: .15s; } .vch-typing-adv i:nth-child(3) { animation-delay: .3s; }
