/* Astro: asistente virtual de la web (texto + voz + cotización) */
.astro-launcher {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 60px; padding: 0 20px 0 8px; border-radius: 999px;
  background: var(--ink); color: var(--bg); border: 2px solid var(--ink);
  font: 700 1rem/1 var(--text); cursor: pointer;
  box-shadow: 4px 4px 0 var(--violet), 0 10px 30px rgba(18, 18, 22, .2);
  transition: transform .2s ease, box-shadow .2s ease;
  animation: astro-latido 4s ease-in-out infinite;
}
.astro-launcher:hover { transform: translateY(-2px); box-shadow: 6px 6px 0 var(--violet), 0 14px 34px rgba(90, 60, 240, .35); animation: none; }
.astro-launcher .astro-avatar { width: 44px; height: 44px; }
.astro-launcher .astro-dot { position: absolute; top: 6px; left: 42px; width: 12px; height: 12px; border-radius: 50%; background: #2bd47d; border: 2px solid var(--ink); }
.astro-launcher[aria-expanded="true"] { display: none; }
.astro-launcher-text { white-space: nowrap; }
@keyframes astro-latido { 0%, 100% { box-shadow: 4px 4px 0 var(--violet), 0 10px 30px rgba(18, 18, 22, .2); } 50% { box-shadow: 4px 4px 0 var(--violet), 0 10px 34px rgba(90, 60, 240, .45); } }
@media (max-width: 420px) { .astro-launcher-text { display: none; } .astro-launcher { padding: 0 8px; } }
.wa-float { bottom: 88px; }

.astro-avatar { display: grid; place-items: center; border-radius: 50%; background: var(--bg); overflow: hidden; flex: none; }
.astro-avatar img { width: 120%; height: 120%; object-fit: contain; }

.astro-panel {
  position: fixed; z-index: 70; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
}
.astro-panel[hidden] { display: none !important; }
@media (min-width: 560px) {
  .astro-panel {
    inset: auto 20px 20px auto; width: 410px; height: min(680px, calc(100vh - 40px));
    border: 2px solid var(--ink); border-radius: 24px; overflow: hidden;
    box-shadow: 8px 8px 0 var(--violet), 0 20px 60px rgba(18, 18, 22, .25);
    animation: astro-panel-entra .3s ease both;
  }
}
@keyframes astro-panel-entra { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
html.astro-open { overflow: hidden; }
@media (min-width: 560px) { html.astro-open { overflow: auto; } }

/* ---------- Cabecera ---------- */
.astro-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; background: var(--ink); color: var(--on-night); position: relative; overflow: hidden; }
.astro-head::before { content: ''; position: absolute; inset: -40% -20% auto; height: 160%; background: radial-gradient(circle at 20% 50%, rgba(139, 108, 255, .35), transparent 50%); pointer-events: none; }
.astro-head > * { position: relative; }
.astro-head .astro-avatar { width: 46px; height: 46px; }
.astro-head-text { flex: 1; min-width: 0; }
.astro-head h2 { font-family: var(--display); font-size: 1.2rem; line-height: 1.1; }
.astro-estado { font-size: .8rem; color: var(--on-night-2); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.astro-estado-punto { width: 8px; height: 8px; border-radius: 50%; background: #2bd47d; flex: none; transition: background .3s; }
.astro-estado[data-estado="escuchando"] .astro-estado-punto { background: #ff5c7a; animation: astro-punto 1s ease-in-out infinite; }
.astro-estado[data-estado="pensando"] .astro-estado-punto, .astro-estado[data-estado="cotizando"] .astro-estado-punto { background: #b9a4ff; animation: astro-punto .8s ease-in-out infinite; }
.astro-estado[data-estado="hablando"] .astro-estado-punto { background: var(--star); animation: astro-punto .5s ease-in-out infinite; }
.astro-estado[data-estado="cotizando"] .astro-estado-texto { color: var(--star); font-weight: 700; }
@keyframes astro-punto { 50% { opacity: .35; transform: scale(.8); } }
.astro-modos { display: flex; background: rgba(255, 255, 255, .08); border: 1px solid var(--night-line); border-radius: 999px; padding: 3px; gap: 2px; }
.astro-modo { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--on-night-2); font: 700 .8rem var(--text); cursor: pointer; transition: background .2s, color .2s; }
.astro-modo svg { width: 16px; height: 16px; }
.astro-modo[aria-pressed="true"] { background: var(--violet); color: #fff; }
.astro-modo:hover:not([aria-pressed="true"]) { color: #fff; }
@media (max-width: 400px) { .astro-modo span { display: none; } .astro-modo { padding: 0 9px; } }
.astro-close { width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--night-line); background: transparent; color: var(--on-night); cursor: pointer; display: grid; place-items: center; flex: none; }
.astro-close:hover { background: var(--night-2); }
.astro-close svg { width: 18px; height: 18px; }

/* ---------- Mensajes ---------- */
.astro-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; scroll-behavior: smooth; }
.astro-msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; font-size: .97rem; line-height: 1.5; word-wrap: break-word; overflow-wrap: anywhere; animation: astro-msg-entra .25s ease both; }
@keyframes astro-msg-entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.astro-msg.bot { align-self: flex-start; background: #fff; border: 1.5px solid var(--line); border-bottom-left-radius: 6px; }
.astro-msg.user { align-self: flex-end; background: var(--violet); color: #fff; border-bottom-right-radius: 6px; }
.astro-msg a { color: var(--violet-ink); font-weight: 600; }
.astro-msg.user a { color: #fff; }
.astro-msg.error { align-self: flex-start; background: #fff6f5; border: 1.5px solid #f2c4bf; color: var(--err); }
.astro-msg.error button { margin-left: 6px; font: inherit; font-weight: 700; color: var(--err); background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 4px; }
.astro-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 14px 16px; background: #fff; border: 1.5px solid var(--line); border-radius: 18px; border-bottom-left-radius: 6px; }
.astro-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); animation: astro-bounce 1s infinite ease-in-out; }
.astro-typing span:nth-child(2) { animation-delay: .15s; }
.astro-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes astro-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }

/* Elegir texto o voz */
.astro-elegir { display: grid; gap: 16px; padding: 18px 6px 6px; text-align: center; animation: astro-msg-entra .3s ease both; }
.astro-elegir-hola { font-size: 1.12rem; line-height: 1.45; }
.astro-elegir-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.astro-elegir-botones button {
  display: grid; gap: 4px; justify-items: center; padding: 18px 12px; border-radius: 20px; border: 2px solid var(--ink); background: #fff; color: var(--ink);
  font: 500 .86rem/1.3 var(--text); cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s;
}
.astro-elegir-botones button strong { font-size: 1rem; }
.astro-elegir-botones button:hover, .astro-elegir-botones button:focus-visible { transform: translateY(-3px); box-shadow: 4px 4px 0 var(--violet); background: var(--violet-soft); }
.astro-elegir-icono { font-size: 1.9rem; line-height: 1; margin-bottom: 4px; }

/* Opciones (respuestas rápidas) */
.astro-chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 10px; scrollbar-width: none; }
.astro-chips::-webkit-scrollbar { display: none; }
.astro-chips button { flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--ink); background: #fff; font: 600 .88rem var(--text); cursor: pointer; color: var(--ink); transition: background .15s, transform .15s; }
.astro-chips button:hover { background: var(--violet-soft); transform: translateY(-1px); }

/* Acciones de la cotización */
.astro-acciones { display: grid; gap: 8px; align-self: stretch; animation: astro-msg-entra .3s ease .1s both; }
.astro-acciones button { min-height: 46px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; color: var(--ink); font: 700 .95rem var(--text); cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.astro-acciones button.principal { background: var(--ink); color: var(--bg); box-shadow: 4px 4px 0 var(--violet); }
.astro-acciones button:hover { transform: translateY(-2px); }
.astro-acciones button:not(.principal):hover { background: var(--violet-soft); }

/* Tarjeta de cotización */
.astro-cotizacion { align-self: stretch; border: 2px solid var(--ink); border-radius: 20px; background: #fff; overflow: hidden; box-shadow: 6px 6px 0 var(--violet); animation: astro-cot-entra .45s cubic-bezier(.2, .8, .3, 1.1) both; }
@keyframes astro-cot-entra { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.astro-cotizacion header { padding: 14px 16px 12px; background: var(--ink); color: var(--on-night); position: relative; overflow: hidden; }
.astro-cotizacion header::after { content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(139, 108, 255, .5), transparent 70%); }
.astro-cot-kicker { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--star); margin-bottom: 6px; }
.astro-cotizacion h3 { font-family: var(--display); font-weight: 400; font-size: 1.25rem; line-height: 1.15; position: relative; }
.astro-cotizacion header p { margin-top: 4px; font-size: .84rem; color: var(--on-night-2); position: relative; }
.astro-cot-sub { padding: 12px 16px 4px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.astro-cot-lista { list-style: none; padding: 0 16px; display: grid; gap: 6px; }
.astro-cot-lista li { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; line-height: 1.35; }
.astro-cot-lista svg { width: 16px; height: 16px; flex: none; color: var(--ok); margin-top: 2px; }
.astro-cot-cifras { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin: 14px 16px 0; }
.astro-cot-cifras div { padding: 10px 12px; border-radius: 14px; background: var(--violet-soft); display: grid; gap: 2px; }
.astro-cot-cifras span { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--violet-ink); }
.astro-cot-cifras strong { font-family: var(--display); font-weight: 400; font-size: 1.15rem; line-height: 1.1; }
.astro-cot-cifras small { font-size: .8rem; color: var(--ink-2); font-weight: 600; }
.astro-cot-combo { margin: 12px 16px 0; padding: 10px 12px; border-radius: 14px; border: 1.5px dashed var(--violet); display: grid; gap: 2px; font-size: .88rem; }
.astro-cot-combo strong { color: var(--violet-ink); }
.astro-cot-combo small { color: var(--ink-3); font-size: .78rem; }
.astro-cot-notas { list-style: none; margin: 12px 16px 14px; padding: 0; display: grid; gap: 4px; font-size: .78rem; color: var(--ink-3); }
.astro-cot-notas li::before { content: '· '; }
.astro-cot-notas:last-child { margin-bottom: 14px; }
.astro-cotizacion > :last-child { margin-bottom: 14px; }

/* Datos para pedir la propuesta */
.astro-datos { align-self: stretch; padding: 14px; border-radius: 18px; background: #fff; border: 1.5px solid var(--line); display: grid; gap: 10px; animation: astro-msg-entra .3s ease both; }
.astro-datos-grid { display: grid; gap: 8px; }
.astro-datos label { display: grid; gap: 4px; font-size: .82rem; font-weight: 700; }
.astro-datos input[type="text"], .astro-datos input[type="tel"] { min-height: 44px; padding: 10px 12px; font-size: .95rem; }
.astro-datos-consent { display: flex !important; gap: 8px; align-items: flex-start; font-weight: 500 !important; color: var(--ink-2); }
.astro-datos-consent input { width: 20px; height: 20px; accent-color: var(--violet); flex: none; margin-top: 1px; }
.astro-datos-error { color: var(--err); font-size: .85rem; font-weight: 600; min-height: 0; }
.astro-datos-error:empty { display: none; }
.astro-datos-enviar { min-height: 46px; border-radius: 999px; border: 2px solid var(--ink); background: var(--ink); color: var(--bg); font: 700 .95rem var(--text); cursor: pointer; box-shadow: 4px 4px 0 var(--violet); }
.astro-datos-enviar:disabled { opacity: .6; cursor: progress; }

/* ---------- Entrada de texto ---------- */
.astro-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1.5px solid var(--line); background: #fff; }
.astro-form[hidden] { display: none; }
.astro-form textarea { flex: 1; min-height: 46px; max-height: 120px; resize: none; padding: 12px 14px; border-radius: 16px; font-size: 1rem; }
.astro-send, .astro-mic-btn { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; }
.astro-send { background: var(--ink); color: var(--bg); }
.astro-send:disabled { opacity: .45; cursor: default; }
.astro-mic-btn { background: var(--violet-soft); color: var(--violet-ink); transition: background .2s; }
.astro-mic-btn:hover { background: #ddd6ff; }
.astro-send svg, .astro-mic-btn svg { width: 20px; height: 20px; }

/* ---------- Modo voz ---------- */
.astro-voz { padding: 12px 16px 10px; border-top: 1.5px solid var(--line); background: #fff; display: grid; gap: 10px; justify-items: center; }
.astro-voz[hidden] { display: none; }
.astro-voz-texto { font-size: .92rem; color: var(--ink-2); text-align: center; min-height: 1.4em; max-width: 100%; }
.astro-voz-controles { display: flex; align-items: center; gap: 18px; }
.astro-voz-btn {
  position: relative; width: 74px; height: 74px; border-radius: 50%; border: 0; background: var(--violet); color: #fff; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(90, 60, 240, .4); transition: transform .2s, background .2s;
}
.astro-voz-btn svg { width: 30px; height: 30px; position: relative; }
.astro-voz-btn:hover { transform: scale(1.05); }
.astro-voz-btn:disabled { opacity: .5; cursor: default; }
.astro-voz-btn.activo { background: #ff5c7a; box-shadow: 0 10px 30px rgba(255, 92, 122, .45); animation: astro-mic-pulso 1.2s ease-in-out infinite; }
@keyframes astro-mic-pulso { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 92, 122, .5), 0 10px 30px rgba(255, 92, 122, .45); } 70% { box-shadow: 0 0 0 18px rgba(255, 92, 122, 0), 0 10px 30px rgba(255, 92, 122, .45); } }
.astro-voz-ondas { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 3px; }
.astro-voz-btn.activo .astro-voz-ondas { display: flex; }
.astro-voz-btn.activo > svg { opacity: 0; }
.astro-voz-ondas i { width: 4px; height: 14px; border-radius: 2px; background: #fff; animation: astro-onda .7s ease-in-out infinite alternate; }
.astro-voz-ondas i:nth-child(2) { animation-delay: .1s; } .astro-voz-ondas i:nth-child(3) { animation-delay: .2s; } .astro-voz-ondas i:nth-child(4) { animation-delay: .3s; } .astro-voz-ondas i:nth-child(5) { animation-delay: .4s; }
@keyframes astro-onda { from { height: 8px; } to { height: 30px; } }
.astro-voz-altavoz, .astro-voz-teclado { width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; transition: background .2s, color .2s; }
.astro-voz-altavoz svg, .astro-voz-teclado svg { width: 20px; height: 20px; }
.astro-voz-altavoz[aria-pressed="true"] { background: var(--violet-soft); color: var(--violet-ink); border-color: var(--violet); }
.astro-voz-altavoz[aria-pressed="false"] .ast-onda { display: none; }
.astro-voz-teclado:hover, .astro-voz-altavoz:hover { background: var(--bg-2); }
.astro-panel[data-modo="voz"] .astro-note { padding-bottom: 8px; }

.astro-note { padding: 0 14px 10px; background: #fff; font-size: .72rem; color: var(--ink-3); text-align: center; }
.astro-note a { color: inherit; }
.ask-astro { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ask-astro p { color: var(--ink-2); }

/* Saludo flotante */
.astro-teaser {
  position: fixed; right: 16px; bottom: 90px; z-index: 59; max-width: 290px;
  display: flex; align-items: flex-start; gap: 4px;
  background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 18px 18px 6px 18px;
  box-shadow: 4px 4px 0 var(--violet), 0 10px 30px rgba(18, 18, 22, .18);
  animation: astro-entrar .35s ease both;
}
.astro-teaser-abrir { flex: 1; text-align: left; background: none; border: 0; padding: 12px 4px 12px 14px; font: 500 .95rem/1.45 var(--text); color: inherit; cursor: pointer; }
.astro-teaser-abrir strong { display: block; font-weight: 700; }
.astro-teaser-cerrar { flex: none; width: 36px; height: 36px; margin: 4px; border: 0; border-radius: 10px; background: none; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.astro-teaser-cerrar:hover { background: var(--bg-2); color: var(--ink); }
.astro-teaser-cerrar svg { width: 16px; height: 16px; }
@keyframes astro-entrar { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
html.astro-open .astro-teaser { display: none; }

@media (prefers-reduced-motion: reduce) {
  .astro-launcher, .astro-voz-btn.activo, .astro-cotizacion, .astro-msg, .astro-panel { animation: none !important; }
}

/* El Astro del inicio vuela hasta el botón: el botón nace oculto y aparece cuando él llega */
.astro-launcher { transition: opacity .3s ease, transform .3s ease, box-shadow .2s ease; }
.astro-launcher.astro-launcher-oculto { opacity: 0; pointer-events: none; transform: scale(.7); }
/* Si el botón se esconde (Astro volvió a la portada), sus globos se esconden con él */
.astro-launcher.astro-launcher-oculto ~ .astro-teaser, .astro-launcher.astro-launcher-oculto ~ .astro-companero-burbuja { visibility: hidden; opacity: 0; pointer-events: none; }
.astro-launcher.astro-launcher-llega { animation: astro-llega .6s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes astro-llega { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
.astro-vuelo .am3d-img { filter: drop-shadow(0 18px 30px rgba(90, 60, 240, .3)); }
.astro-vuelo .am3d-img-2 { display: none; }
.astro-vuelo .am3d-img.activa, .astro-vuelo .am3d-img { opacity: 1 !important; }

/* Agujeros negro y blanco (Astro entra y sale por ellos) */
.astro-agujero { position: fixed; z-index: 79; border-radius: 50%; pointer-events: none; transform: scale(0); will-change: transform, opacity; }
.astro-agujero i, .astro-agujero b { position: absolute; inset: 0; border-radius: 50%; }
.astro-agujero-negro { background: radial-gradient(circle, #000 0 34%, #120b2a 46%, rgba(90, 60, 240, .55) 58%, rgba(90, 60, 240, 0) 72%); box-shadow: 0 0 60px 10px rgba(90, 60, 240, .35), 0 0 120px 30px rgba(18, 18, 22, .35); }
.astro-agujero-negro i { background: conic-gradient(from 0deg, transparent 0 40%, rgba(185, 164, 255, .9) 50%, transparent 60%, transparent 85%, rgba(255, 210, 63, .8) 92%, transparent 100%); -webkit-mask: radial-gradient(circle, transparent 0 40%, #000 44% 62%, transparent 66%); mask: radial-gradient(circle, transparent 0 40%, #000 44% 62%, transparent 66%); animation: astro-remolino .9s linear infinite; filter: blur(1px); }
.astro-agujero-negro i:nth-child(2) { inset: -12%; animation-duration: 1.6s; animation-direction: reverse; opacity: .6; -webkit-mask: radial-gradient(circle, transparent 0 46%, #000 50% 58%, transparent 62%); mask: radial-gradient(circle, transparent 0 46%, #000 50% 58%, transparent 62%); }
.astro-agujero-negro b { inset: 30%; background: #000; box-shadow: inset 0 0 20px 6px #2a1a66; }
.astro-agujero-blanco { background: radial-gradient(circle, #fff 0 26%, #efe9ff 36%, rgba(185, 164, 255, .75) 50%, rgba(139, 108, 255, 0) 70%); box-shadow: 0 0 80px 20px rgba(255, 255, 255, .55), 0 0 140px 40px rgba(139, 108, 255, .45); }
.astro-agujero-blanco i { background: conic-gradient(from 0deg, transparent 0 30%, rgba(255, 255, 255, .95) 42%, transparent 54%, transparent 70%, rgba(185, 164, 255, .9) 82%, transparent 94%); -webkit-mask: radial-gradient(circle, transparent 0 30%, #000 36% 64%, transparent 70%); mask: radial-gradient(circle, transparent 0 30%, #000 36% 64%, transparent 70%); animation: astro-remolino 1.1s linear infinite reverse; filter: blur(1.5px); }
.astro-agujero-blanco i:nth-child(2) { inset: -14%; animation-duration: 1.9s; animation-direction: normal; opacity: .7; }
.astro-agujero-blanco b { inset: 36%; background: #fff; box-shadow: 0 0 30px 12px #fff; }
@keyframes astro-remolino { to { transform: rotate(360deg); } }
.am3d-figura { will-change: transform; }
.astro-agujero.astro-agujero-hero { position: absolute; z-index: 2; }
