/* ============================================================
   VIDA LOTUS - CHAT DE PRUEBA (estilos). Usa los tokens de styles.css:
   --forest --cream --sage --lotus (solo acento) --r-sm --r --r-lg --ease --shadow-lg
   ============================================================ */
.vlc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.vlc-ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html.vlc-lock { overflow: hidden; }

/* ---------- boton flotante ---------- */
/* Lanzador: pildora magenta con Loti (espiritu-loto) + texto. Borde blanco + sombra teñida = contraste sobre cualquier seccion.
   Movil: abajo a la derecha; sube 72 px sobre el boton de WhatsApp (#fab) cuando aparece (clase .up) o cuando hay carrito (#vlFab, abajo a la izquierda). */
.vlc-fab {
  position: fixed; z-index: 44; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 10px; min-height: 56px; max-width: calc(100vw - 32px); padding: 4px 18px 4px 6px;
  border: 3px solid #fff; border-radius: 999px; color: #fff; cursor: pointer; font: 700 15px/1.15 var(--f-body); text-align: left;
  background: linear-gradient(115deg, #7A1250, #B01A63 55%, #D4237A);
  box-shadow: 0 0 0 1px rgba(122, 18, 80, .35), 0 16px 30px -10px rgba(122, 18, 80, .75), 0 4px 10px rgba(31, 61, 46, .25);
  -webkit-tap-highlight-color: transparent;
  transition: transform 300ms var(--ease), box-shadow 200ms var(--ease);
}
.vlc-fab[hidden], .vlc-panel[hidden], .vlc-hi[hidden] { display: none; }
.vlc-fab-t { display: inline; padding-right: 2px; }
.vlc-fab.up, html:has(#vlFab:not([hidden])) .vlc-fab { transform: translateY(-72px); }
.vlc-fab:active, .vlc-fab.up:active, html:has(#vlFab:not([hidden])) .vlc-fab:active { transform: translateY(-72px) scale(.96); }
.vlc-fab:not(.up):active { transform: scale(.96); }
html:has(#vlFab:not([hidden])) .vlc-fab:not(.up) { transform: translateY(-72px); }
.vlc-fab::before { /* anillo que pulsa */
  content: ""; position: absolute; inset: -6px; border-radius: 999px; border: 2px solid rgba(212, 35, 122, .7); opacity: 0; pointer-events: none;
}
/* personaje */
.vlc-av { position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #FFE3F0 70%); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .8); }
.vlc-av svg { position: absolute; left: -5px; top: -9px; width: 56px; height: 56px; overflow: visible; fill: none; stroke: none; }
.vlc-av .lo-eye, .vlc-av .lo-leaf, .vlc-av .lo-pet { transform-box: fill-box; transform-origin: 50% 50%; }
.vlc-av .lo-leaf { transform-origin: 90% 10%; }
.vlc-av .lo-leaf.r { transform-origin: 10% 10%; }
@media (min-width: 900px) {
  .vlc-fab { right: 24px; bottom: 24px; padding-right: 22px; }
  .vlc-fab.up, html:has(#vlFab:not([hidden])) .vlc-fab, html:has(#vlFab:not([hidden])) .vlc-fab:not(.up) { transform: none; }
  .vlc-fab:active, .vlc-fab.up:active { transform: scale(.96); }
}
@media (hover: hover) and (pointer: fine) { .vlc-fab:hover { box-shadow: 0 0 0 1px rgba(122, 18, 80, .35), 0 20px 36px -10px rgba(212, 35, 122, .85), 0 4px 10px rgba(31, 61, 46, .25); } }
@media (hover: hover) and (pointer: fine) and (min-width: 900px) { .vlc-fab:hover { transform: translateY(-3px); } }
.vlc-fab:focus-visible { outline: 3px solid var(--papaya); outline-offset: 3px; }
@media (max-width: 380px) { .vlc-fab { font-size: 14px; padding-right: 14px; } }

/* globito de saludo (una vez por sesion) */
.vlc-hi { position: fixed; z-index: 44; right: 16px; bottom: calc(16px + 56px + 14px + env(safe-area-inset-bottom)); width: min(272px, calc(100vw - 32px)); padding: 14px 44px 14px 16px; border: 2px solid var(--vl-magenta, #D4237A); border-radius: 22px 22px 6px 22px; background: #fff; color: var(--ink); font-size: 15px; line-height: 1.4; box-shadow: 0 18px 34px -14px rgba(122, 18, 80, .6); }
.vlc-hi-t { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; min-height: 44px; }
.vlc-hi-x { position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.vlc-hi-x .vlc-ico { width: 18px; height: 18px; }
html:has(.vlc-fab.up) .vlc-hi, html:has(#vlFab:not([hidden])) .vlc-hi { bottom: calc(16px + 72px + 56px + 14px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .vlc-hi { right: 24px; bottom: 98px; } html:has(.vlc-fab.up) .vlc-hi, html:has(#vlFab:not([hidden])) .vlc-hi { bottom: 98px; } }
.vlc-hi:focus-visible, .vlc-hi-t:focus-visible, .vlc-hi-x:focus-visible { outline: 3px solid var(--vl-magenta, #D4237A); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .vlc-hi { animation: vlcHi .5s var(--vl-ease, var(--ease)) both; transform-origin: 90% 100%; }
  .vlc-fab:not(.vlc-quiet)::before { animation: vlcRing 3.4s ease-out infinite; }
  .vlc-av .lo-eye { animation: vlcBlink 5.2s infinite; }
  .vlc-av .lo-leaf { animation: vlcFlap 2.6s ease-in-out infinite alternate; }
  .vlc-av .lo-leaf.r { animation-direction: alternate-reverse; }
  .vlc-av .lo-pet { animation: vlcSway 4s ease-in-out infinite alternate; }
  .vlc-av .lo-spark { animation: vlcTw 2.4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 50%; }
}
@keyframes vlcHi { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes vlcRing { 0% { opacity: .75; transform: scale(.94); } 70%, 100% { opacity: 0; transform: scale(1.16); } }
@keyframes vlcBlink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }
@keyframes vlcFlap { from { transform: rotate(-9deg); } to { transform: rotate(8deg); } }
@keyframes vlcSway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
@keyframes vlcTw { from { opacity: .35; transform: scale(.7); } to { opacity: 1; transform: scale(1.1); } }
html.vl-lite .vlc-fab::before, html.vl-lite .vlc-av * { animation: none !important; }

/* ---------- panel ---------- */
.vlc-panel {
  position: fixed; z-index: 60; right: 20px; bottom: 20px;
  width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--cream); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(8px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.vlc-panel.open { opacity: 1; transform: none; }
@media (max-width: 639px) {
  .vlc-panel { right: 0; left: 0; bottom: auto; top: var(--vlc-top, 0); width: 100%; height: var(--vlc-h, 100dvh); border: 0; border-radius: 0; }
}

.vlc-head { display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 8px 14px 18px; background: radial-gradient(80% 140% at 100% 0%, rgba(212, 35, 122, .55), transparent 70%), var(--forest); color: var(--cream); }
.vlc-head-t { flex: 1 1 auto; min-width: 0; }
.vlc-head .vlc-av { width: 52px; height: 52px; margin-top: 8px; }
.vlc-head .vlc-av svg { width: 64px; height: 64px; left: -6px; top: -11px; }
.vlc-title { margin: 0; font: 400 22px/1.2 var(--f-display); font-variation-settings: "SOFT" 60; }
.vlc-title:focus { outline: none; }
.vlc-sub { margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: var(--sage-2); }
.vlc-tag { display: inline; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; color: var(--rose-on-dark); }
.vlc-priv { color: var(--sage-2); text-decoration: underline; text-underline-offset: 3px; }
.vlc-head :focus-visible { outline-color: var(--papaya); }
.vlc-x {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: transparent; color: var(--cream); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 140ms var(--ease), background-color 160ms var(--ease);
}
.vlc-x:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .vlc-x:hover { background: rgba(255, 255, 255, .14); } }

/* ---------- conversacion ---------- */
.vlc-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: auto; }
.vlc-log:focus-visible { outline-offset: -3px; }
.vlc-msg { max-width: 90%; display: flex; flex-direction: column; align-items: flex-start; }
.vlc-user { align-self: flex-end; align-items: flex-end; }
.vlc-b { padding: 10px 14px; border-radius: var(--r-sm); font-size: 17px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.vlc-bot .vlc-b { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.vlc-user .vlc-b { background: var(--forest); color: #fff; }
.vlc-link { color: var(--forest-2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.vlc-wa {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 8px; padding: 0 18px;
  border-radius: 999px; background: var(--forest); color: #fff; font: 600 15px/1 var(--f-body); text-decoration: none;
  transition: transform 140ms var(--ease), background-color 160ms var(--ease);
}
.vlc-wa:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .vlc-wa:hover { background: var(--forest-2); } }

.vlc-typing .vlc-b { display: flex; gap: 5px; padding: 14px 16px; }
.vlc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .35; animation: vlcDot 1.1s var(--ease) infinite; }
.vlc-typing i:nth-child(2) { animation-delay: .15s; }
.vlc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes vlcDot { 0%, 70%, 100% { opacity: .3; } 35% { opacity: 1; } }

/* ---------- sugerencias ---------- */
.vlc-sugs { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 12px; }
.vlc-sugs[hidden] { display: none; }
.vlc-chip {
  min-height: 44px; padding: 0 16px; border: 1.5px solid rgba(31, 61, 46, .28); border-radius: 999px; background: transparent; color: var(--forest);
  font: 600 15px/1.2 var(--f-body); cursor: pointer; text-align: left; -webkit-tap-highlight-color: transparent;
  transition: transform 140ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.vlc-chip:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .vlc-chip:hover { border-color: var(--forest); background: rgba(31, 61, 46, .05); } }

/* ---------- escribir ---------- */
.vlc-form { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--cream-2); }
.vlc-in {
  flex: 1 1 auto; min-width: 0; min-height: 48px; max-height: 112px; padding: 12px 14px; resize: none;
  border: 1.5px solid var(--line-2); border-radius: var(--r-sm); background: #fff; color: var(--ink);
  font: 400 16px/1.4 var(--f-body); /* 16px: iOS no hace zoom al enfocar */
}
.vlc-in::placeholder { color: var(--muted); opacity: 1; }
.vlc-in:focus { border-color: var(--forest); }
.vlc-in:disabled { background: var(--sage-3); }
.vlc-send {
  flex: none; width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: var(--forest); color: #fff; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 140ms var(--ease), background-color 160ms var(--ease), opacity 160ms var(--ease);
}
.vlc-send:active { transform: scale(.94); }
.vlc-send:disabled { opacity: .4; cursor: default; transform: none; }
@media (hover: hover) and (pointer: fine) { .vlc-send:not(:disabled):hover { background: var(--forest-2); } }
.vlc-foot { flex: none; margin: 0; padding: 8px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--cream-2); font-size: 13px; line-height: 1.4; color: var(--muted); }

/* ---------- movimiento reducido: solo fundidos ---------- */
@media (prefers-reduced-motion: reduce) {
  .vlc-panel { transform: none; transition: opacity 200ms var(--ease); }
  .vlc-fab, .vlc-fab.up { transition: box-shadow 160ms var(--ease); }
  .vlc-x:active, .vlc-wa:active, .vlc-chip:active, .vlc-send:active { transform: none; }
  .vlc-fab:hover { transform: none; }
  .vlc-fab::before, .vlc-av * { animation: none; }
  .vlc-typing i { animation: none; opacity: .6; }
}
