/* Luz: asistente con IA de la home. Usa los tokens de base.css. */
.luz { --luz-w: 392px; font-family: var(--font-body); }
.luz svg { width: 20px; height: 20px; flex: none; }
.luz__sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Botón flotante, arriba del de WhatsApp */
.luz__launcher { position: fixed; right: 20px; bottom: 86px; z-index: 51; display: inline-flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border: 0; border-radius: 99px; background: var(--ink); color: #fff; font: 700 15px var(--font-body); cursor: pointer; box-shadow: 0 12px 28px -10px rgba(2, 49, 42, .6); transition: transform .15s, box-shadow .15s; }
.luz__launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -10px rgba(2, 49, 42, .65); }
.luz__launcher:focus-visible { outline: 3px solid var(--sun, #f5b83d); outline-offset: 3px; }
.luz__launcher .luz__av { display: block; width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(245, 184, 61, .35); animation: luz-glow 3.2s ease-in-out infinite; }
@keyframes luz-glow { 50% { box-shadow: 0 0 0 5px rgba(245, 184, 61, .18); } }

/* Saludo que aparece una vez */
.luz__teaser { position: fixed; right: 20px; bottom: 148px; z-index: 51; max-width: 270px; animation: luz-pop .35s cubic-bezier(.2, .9, .3, 1.2) both; }
.luz__teaser-body { display: grid; gap: 2px; width: 100%; padding: 14px 18px; border: 1px solid var(--line); border-radius: 18px 18px 6px 18px; background: #fff; color: var(--text); font: 400 14px/1.4 var(--font-body); text-align: left; cursor: pointer; box-shadow: var(--shadow-md), 0 14px 30px -14px rgba(2, 49, 42, .35); }
.luz__teaser-body b { font-family: var(--font-display); font-size: 16px; }
.luz__teaser-x { position: absolute; top: -10px; left: -10px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--text-muted); cursor: pointer; box-shadow: var(--shadow-md); }
.luz__teaser-x svg { width: 14px; height: 14px; }
@keyframes luz-pop { from { opacity: 0; transform: translateY(10px) scale(.96); } }

/* Ventana del chat */
.luz__panel { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; width: var(--luz-w); height: min(640px, calc(100vh - 40px)); height: min(640px, calc(100dvh - 40px)); overflow: hidden; border-radius: 24px; background: var(--cream); box-shadow: 0 30px 60px -20px rgba(2, 49, 42, .45), 0 0 0 1px rgba(2, 49, 42, .06); transform-origin: bottom right; animation: luz-open .28s cubic-bezier(.2, .9, .3, 1.05) both; }
.luz__panel[hidden] { display: none; }
@keyframes luz-open { from { opacity: 0; transform: translateY(16px) scale(.97); } }
body.luz-is-open .luz__launcher, body.luz-is-open .luz__teaser, body.luz-is-open .wa-float { display: none; }

.luz__head { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 12px 16px 16px; background: radial-gradient(120% 140% at 0% 0%, #0b4a3f 0%, var(--ink) 55%); color: #fff; }
.luz__head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(245, 184, 61, .5), transparent); }
.luz__head-av img { width: 46px; height: 46px; display: block; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255, 255, 255, .08); }
.luz__head-text { flex: 1; min-width: 0; }
.luz__head h2 { margin: 0; font-size: 20px; line-height: 1.1; color: #fff; }
.luz__head p { display: flex; align-items: center; gap: 6px; margin: 3px 0 0; font-size: 12.5px; color: rgba(255, 255, 255, .72); white-space: nowrap; }
.luz__online { width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 3px rgba(61, 220, 151, .22); flex: none; }
.luz__icon { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: rgba(255, 255, 255, .8); cursor: pointer; transition: background .15s, color .15s; }
.luz__icon:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.luz__icon:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

/* Conversación */
.luz__log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; scroll-behavior: smooth; }
.luz__row { display: flex; align-items: flex-end; gap: 8px; animation: luz-in .25s ease-out both; }
.luz__row--user { justify-content: flex-end; }
@keyframes luz-in { from { opacity: 0; transform: translateY(6px); } }
.luz__row .luz__mini { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.luz__bubble { max-width: 82%; padding: 11px 14px; border-radius: 18px 18px 18px 6px; background: #fff; border: 1px solid var(--line); color: var(--text); font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(2, 49, 42, .04); }
.luz__row--user .luz__bubble { border: 0; border-radius: 18px 18px 6px 18px; background: var(--accent); color: #fff; }
.luz__bubble p { margin: 0; }
.luz__bubble p + p, .luz__bubble p + ul, .luz__bubble ul + p { margin-top: 8px; }
.luz__bubble ul { margin: 6px 0 0; padding-left: 18px; }
.luz__bubble li + li { margin-top: 3px; }
.luz__bubble a { color: var(--accent); font-weight: 600; }
.luz__bubble--note { background: var(--sun-soft, #fff1cc); border-color: #f3dfa6; }
.luz__cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 16px; border-radius: 99px; background: #25d366; color: #fff !important; font-weight: 700; font-size: 14px; text-decoration: none; }
.luz__cta:hover { background: #1fbd5a; }
.luz__cta svg { width: 18px; height: 18px; }

.luz__typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.luz__typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-subtle); opacity: .5; animation: luz-dot 1.1s infinite ease-in-out; }
.luz__typing i:nth-child(2) { animation-delay: .15s; }
.luz__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes luz-dot { 30% { opacity: 1; transform: translateY(-3px); } }

/* Preguntas sugeridas */
.luz__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 12px; }
.luz__chips[hidden] { display: none; }
.luz__chip { padding: 8px 13px; border: 1.5px solid var(--line-strong); border-radius: 99px; background: #fff; color: var(--text); font: 600 13px var(--font-body); cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.luz__chip:hover { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-1px); }

/* Escribir */
.luz__form { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 16px; border: 1.5px solid var(--line-strong); border-radius: 26px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.luz__form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.luz__form textarea { flex: 1; min-height: 40px; max-height: 120px; padding: 9px 0; border: 0; border-radius: 0; background: transparent; resize: none; font: 400 15px/1.45 var(--font-body); color: var(--text); }
.luz__form textarea:focus, .luz__form textarea:focus-visible { outline: none; }
.luz__send { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: #fff; cursor: pointer; flex: none; transition: background .15s, opacity .15s; }
.luz__send:hover { background: var(--accent-hover); }
.luz__send:disabled { opacity: .4; cursor: default; }
.luz__send svg { width: 18px; height: 18px; }
.luz__foot { margin: 8px 16px 12px; font-size: 11.5px; color: var(--text-subtle); text-align: center; }
.luz__foot a { color: var(--accent); font-weight: 600; }

/* Celular: pantalla completa y botón redondo */
@media (max-width: 560px) {
  .luz__launcher { right: 14px; bottom: 82px; padding: 5px; }
  .luz__launcher span { display: none; }
  .luz__launcher .luz__av { width: 48px; height: 48px; }
  .luz__teaser { right: 14px; bottom: 146px; max-width: calc(100vw - 90px); }
  .luz__panel { inset: 0; width: 100%; height: 100%; border-radius: 0; }
  .luz__bubble { max-width: 86%; }
}
@media (prefers-reduced-motion: reduce) {
  .luz__launcher .luz__av, .luz__typing i { animation: none; }
  .luz__panel, .luz__teaser, .luz__row { animation: none; }
}
@media print { .luz { display: none; } }
