/* SUAMMARQ chat — estilos aislados con prefijo sq-chat- */
#suammarq-chat { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 10001; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
#suammarq-chat.sq-visible { opacity: 1; pointer-events: auto; }
.sq-chat-bar { display: flex; align-items: center; gap: 8px; width: min(560px, calc(100vw - 32px)); max-width: 300px; min-height: 42px; box-sizing: border-box; background: rgba(255,255,255,.1); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 7px 8px 7px 8px; box-shadow: 0 25px 60px rgba(0,0,0,.22), inset 0 0 0 1px rgba(0,0,0,.05); }
.sq-chat-bar input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: #aeacac; text-align: center; min-width: 0; }
.sq-chat-bar input::placeholder { color: rgba(255,255,255,.85); }
#suammarq-chat.sq-scrolled .sq-chat-bar { background: rgba(255,255,255,.7); border-color: rgba(0,0,0,.08); }
#suammarq-chat.sq-scrolled .sq-chat-bar input { color: #09090b; }
#suammarq-chat.sq-scrolled .sq-chat-bar input::placeholder { color: #09090b; }
.sq-chat-send { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; background: #FFD800; color: #000; font-size: 18px; font-weight: 900; line-height: 1; flex-shrink: 0; }
.sq-chat-bar .sq-chat-send { display: none; }
.sq-chat-bar { position: relative; }
.sq-chat-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: #FFD800; position: absolute; right: 8px; }
.sq-chat-icon svg { width: 20px; height: 20px; }
.sq-chat-send:disabled { opacity: .5; cursor: default; }
.sq-chat-panel { display: none; width: min(560px, calc(100vw - 32px)); height: min(520px, calc(100vh - 140px)); background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.3); border: 1px solid rgba(0,0,0,.08); flex-direction: column; }
#suammarq-chat.sq-open .sq-chat-panel { display: flex; }
#suammarq-chat.sq-open .sq-chat-bar { display: none; }
.sq-chat-head { background: #09090b; color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 12px; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }
.sq-chat-avatar { position: relative; flex-shrink: 0; display: inline-block; }
.sq-chat-logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 4px 14px rgba(0,0,0,.4); display: block; }
.sq-chat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-right: 5px; }
.sq-chat-head b { font-size: 14px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.sq-chat-head b span { color: #FFD800; font-weight: 800; }
.sq-chat-status { font-size: 11px; color: #a1a1aa; }
.sq-chat-head button { margin-left: auto; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.3); border-radius: 12px; color: #fff; font-size: 26px; font-weight: 900; line-height: 1; width: 40px; height: 40px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sq-chat-head button:hover { background: rgba(255,255,255,.25); }
.sq-chat-body { flex: 1; min-height: 0; box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #F9F9FB; }
.sq-msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.45; }
.sq-msg.user { align-self: flex-end; background: #3f3f46; color: #fff; border-bottom-right-radius: 4px; }
.sq-msg.bot { align-self: flex-start; background: #fff; color: #27272a; border: 1px solid #e4e4e7; border-bottom-left-radius: 4px; }
.sq-msg:first-child { margin-top: auto; }
.sq-msg.typing { color: #71717a; }
.sq-msg.bot a { color: #065f46; font-weight: 700; text-decoration: underline; word-break: break-all; }
.sq-msg.bot strong { font-weight: 800; }
.sq-chat-wa { align-self: flex-start; font-size: 12px; font-weight: 800; color: #000; background: #FFD800; padding: 8px 14px; border-radius: 999px; text-decoration: none; }
.sq-chat-foot { display: flex; gap: 8px; align-items: center; padding: 8px; min-height: 56px; box-sizing: border-box; border-top: 1px solid #e4e4e7; background: #fff; }
.sq-chat-foot input { flex: 1; height: 40px; box-sizing: border-box; border: 1px solid #e4e4e7; border-radius: 999px; padding: 0 18px; font-size: 14px; outline: 0; color: #18181b; }
.sq-chat-foot input::placeholder { color: #3f3f46; }
.sq-chat-mic { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #e4e4e7; background: #fff; color: #3f3f46; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sq-chat-mic svg { width: 18px; height: 18px; }
.sq-chat-mic.sq-rec { background: #dc2626; border-color: #dc2626; color: #fff; animation: sq-pulse 1.2s infinite; }
@keyframes sq-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.5); } 50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); } }
@media (max-width: 640px) {
  #suammarq-chat { left: 16px; right: auto; transform: none; bottom: 20px; }
  /* Colapsado: burbuja circular a la izquierda */
  .sq-chat-bar { width: 64px; max-width: none; min-width: 64px; min-height: 64px; padding: 0; border-radius: 50%; justify-content: center; cursor: pointer; }
.sq-chat-bar input { display: none; }
  .sq-chat-bar .sq-chat-icon { display: flex; align-items: center; justify-content: center; position: static; width: 36px; height: 36px; }
  .sq-chat-bar .sq-chat-icon svg { width: 24px; height: 24px; }
  /* Abierto: pantalla completa anclada ARRIBA (anclada abajo se cae fuera de pantalla) */
  #suammarq-chat.sq-open { left: 0; right: auto; top: 0; bottom: auto; transform: none; width: 100%; }
  #suammarq-chat.sq-open .sq-chat-panel { width: 100vw; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; border: 0; }
  /* iOS hace zoom automatico con inputs <16px: se sube a 16px para evitarlo */
  .sq-chat-foot input { font-size: 16px; }
}
