/* Vega Vets — widget del asistente */
.vchat{ position: fixed; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 95; font-family: var(--font-body, system-ui, sans-serif); }
/* Botón flotante: píldora con icono, etiqueta e indicador "en línea" */
.vchat-launcher{
  display: flex; align-items: center; gap: 12px; margin-left: auto; padding: 8px 20px 8px 8px;
  border: 1px solid rgba(214,188,103,0.45); border-radius: 999px; cursor: pointer; text-align: left;
  background: linear-gradient(135deg, var(--color-dark-2), var(--color-dark) 70%); color: #fff;
  box-shadow: 0 16px 36px -12px rgba(13,39,64,0.65), inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.vchat-launcher:hover{ transform: translateY(-3px); border-color: var(--color-accent); box-shadow: 0 22px 42px -12px rgba(13,39,64,0.75), 0 0 0 4px rgba(214,188,103,0.16); }
.vchat-launcher-icon{
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent-hover), var(--color-accent-deep)); color: var(--color-dark);
}
.vchat-dot{ position: absolute; top: 1px; right: 1px; width: 12px; height: 12px; border-radius: 50%; background: #3DD68C; border: 2px solid var(--color-dark); animation: vchat-ping 2.4s ease-out infinite; }
.vchat-launcher-label{ display: flex; flex-direction: column; line-height: 1.25; }
.vchat-launcher-label strong{ font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; }
.vchat-launcher-label small{ font-size: 0.75rem; color: rgba(255,255,255,0.72); }
@keyframes vchat-ping{ 0%{ box-shadow: 0 0 0 0 rgba(61,214,140,0.55); } 70%,100%{ box-shadow: 0 0 0 8px rgba(61,214,140,0); } }
.vchat-launcher:focus-visible, .vchat-close:focus-visible, .vchat-send:focus-visible{ outline: 3px solid var(--color-accent); outline-offset: 2px; }

.vchat-panel{
  position: absolute; right: 0; bottom: 70px;
  display: flex; flex-direction: column;
  width: min(380px, calc(100vw - 32px)); height: min(520px, calc(100vh - 190px));
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(13,39,64,0.55);
}
.vchat-panel[hidden]{ display: none; }

.vchat-head{ display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--color-dark); color: #fff; }
.vchat-head-text{ display: flex; flex-direction: column; line-height: 1.3; }
.vchat-head-text strong{ font-size: 1rem; }
.vchat-head-text span{ font-size: 0.82rem; color: var(--color-accent); }
.vchat-close{ display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer; }
.vchat-close:hover{ background: rgba(255,255,255,0.12); }

.vchat-log{ flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 16px; overflow-y: auto; background: var(--color-background); }
.vchat-msg{ max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 0.95rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.vchat-msg-bot{ align-self: flex-start; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-bottom-left-radius: 4px; }
.vchat-msg-user{ align-self: flex-end; background: var(--color-brand); color: #fff; border-bottom-right-radius: 4px; }
.vchat-msg.is-typing{ color: var(--color-text-muted); letter-spacing: 0.2em; animation: vchat-pulse 1s ease-in-out infinite; }
.vchat-msg.is-error{ color: var(--color-error); }
@keyframes vchat-pulse{ 50%{ opacity: 0.45; } }

.vchat-note{ margin: 0; padding: 8px 14px; font-size: 0.75rem; line-height: 1.4; color: var(--color-text-muted); background: var(--color-surface); border-top: 1px solid var(--color-border); }
.vchat-note a{ color: inherit; text-decoration: underline; }
.vchat-form{ display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--color-border); background: var(--color-surface); }
.vchat-input{ flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--color-border); border-radius: 10px; font: inherit; font-size: 16px; color: var(--color-text); background: #fff; }
.vchat-input:focus{ outline: 2px solid var(--color-brand); outline-offset: 0; }
.vchat-send{ min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; background: var(--color-accent); color: var(--color-dark); }
.vchat-send:hover:not(:disabled){ background: var(--color-accent-hover); }
.vchat-send:disabled{ opacity: 0.6; cursor: default; }

/* En móvil, el chat abierto ocupa casi toda la pantalla */
@media (max-width: 899px){
  .vchat.is-open{ inset: 0; bottom: 0; right: 0; }
  .vchat.is-open .vchat-panel{ position: fixed; inset: 0; width: 100%; height: 100%; bottom: 0; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); }
  .vchat.is-open .vchat-launcher{ display: none; }
}
@media (min-width: 900px){
  .vchat{ right: 24px; bottom: 24px; }
  .vchat-panel{ height: min(520px, calc(100vh - 190px)); }
}
@media (max-width: 899px){
  .vchat-launcher{ padding: 6px; }
  .vchat-launcher-label{ display: none; }
}
@media (prefers-reduced-motion: reduce){
  .vchat-launcher, .vchat-dot, .vchat-msg.is-typing{ transition: none; animation: none; }
}


/* ==== Rediseño 2026: el lanzador no tapa el contenido ==== */
/* Móvil: el lanzador ocupa su propio hueco dentro de la barra inferior de contacto */
@media (max-width: 899px){
  .vchat{ right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); }
  .vchat-launcher{ padding: 0; border: 0; background: transparent; box-shadow: none; }
  .vchat-launcher:hover{ transform: none; box-shadow: none; }
  .vchat-launcher-icon{ width: 50px; height: 50px; }
  body.menu-open .vchat:not(.is-open){ opacity: 0; visibility: hidden; pointer-events: none; }
}
/* Escritorio: círculo compacto; la etiqueta solo se muestra arriba del todo o al pasar el ratón */
@media (min-width: 900px){
  .vchat-launcher{ gap: 0; padding: 7px; }
  .vchat-launcher-label{ max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; transition: max-width 0.45s cubic-bezier(0.16,1,0.3,1), opacity 0.3s ease, margin 0.45s cubic-bezier(0.16,1,0.3,1); }
  body.at-hero .vchat-launcher-label, .vchat-launcher:hover .vchat-launcher-label, .vchat-launcher:focus-visible .vchat-launcher-label{ max-width: 180px; opacity: 1; margin: 0 14px 0 12px; }
}
