/* Hostgreen · Contacto único: botón flotante, menú (asistente, WhatsApp, llamar) y ventana del asistente (chat de n8n).
   Colores y fuentes del sistema Hostgreen 2027. Las fuentes solo se descargan cuando se ve texto con ellas (al abrir). */
@font-face{font-family:"Sora";font-style:normal;font-display:swap;font-weight:100 800;src:url(../fonts/sora-latin-wght-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Inter";font-style:normal;font-display:swap;font-weight:100 900;src:url(../fonts/inter-latin-wght-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
.hg-contacto, .hg-chat {
  --hc-900:#071b10; --hc-800:#103020; --hc-700:#1f5c3a; --hc-400:#76b22e; --hc-300:#9cdb4f; --hc-lima:#c0e967;
  --hc-100:#f0f8e6; --hc-50:#f7fbf3; --hc-tinta:#0e1b13; --hc-texto:#2a3a30; --hc-suave:#55665b; --hc-linea:#e2e9e3;
  --hc-sans:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --hc-display:"Sora",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  --hc-ease:cubic-bezier(.2,.7,.1,1);
  font-family: var(--hc-sans); box-sizing: border-box;
}
.hg-contacto *, .hg-chat * { box-sizing: border-box; }
.hg-ico { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- Botón flotante y menú ---- */
.hg-contacto { position: fixed; right: 24px; bottom: 24px; z-index: 1050; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.hg-contacto-boton {
  width: 60px; height: 60px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  background: var(--hc-400); color: var(--hc-900); box-shadow: 0 10px 28px -8px rgba(7,27,16,.45), 0 0 0 4px rgba(118,178,46,.18);
  transition: transform .2s var(--hc-ease), background .2s var(--hc-ease);
}
.hg-contacto-boton:hover { background: var(--hc-300); transform: translateY(-2px); }
.hg-contacto-boton:focus-visible, .hg-contacto-op:focus-visible { outline: 3px solid var(--hc-700); outline-offset: 3px; }
.hg-contacto-boton .hg-ico { width: 28px; height: 28px; stroke-width: 2.2; }
.hg-contacto-cerrar, .hg-contacto.hg-abierto .hg-contacto-abrir { display: none; }
.hg-contacto.hg-abierto .hg-contacto-cerrar { display: flex; }
.hg-contacto-menu {
  width: 290px; background: #fff; border-radius: 18px; padding: 8px; display: grid; gap: 2px;
  box-shadow: 0 1px 2px rgba(7,27,16,.06), 0 24px 56px -16px rgba(7,27,16,.38); border: 1px solid var(--hc-linea);
  transform-origin: bottom right; animation: hg-menu .22s var(--hc-ease);
}
.hg-contacto-menu[hidden] { display: none; }
@keyframes hg-menu { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.hg-contacto-op {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 12px; border: 0; border-radius: 12px;
  background: none; cursor: pointer; text-align: left; text-decoration: none !important; color: var(--hc-tinta) !important; font: inherit;
}
.hg-contacto-op:hover { background: var(--hc-50); }
.hg-contacto-ico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--hc-100); color: var(--hc-700); }
.hg-contacto-ico .hg-ico { width: 20px; height: 20px; }
.hg-contacto-ico svg { width: 22px; height: 22px; }
.hg-contacto-wa { background: #e7f8ee; color: #1ea952; }
.hg-contacto-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.hg-contacto-txt strong { font: 600 15px/1.25 var(--hc-display); color: var(--hc-tinta); }
.hg-contacto-txt small { font-size: 12.5px; color: var(--hc-suave); margin-top: 2px; }

/* ---- Ventana del asistente ---- */
.hg-chat {
  position: fixed; left: 50%; top: 50%; z-index: 1100; display: flex; flex-direction: column;
  width: 400px; height: min(640px, calc(100vh - 32px)); max-width: calc(100vw - 16px);
  background: #fff; border-radius: 20px; overflow: hidden; border: 1px solid rgba(7,27,16,.08); color: var(--hc-texto);
  box-shadow: 0 40px 80px -32px rgba(4,17,10,.55), 0 4px 14px rgba(7,27,16,.10);
  transition: transform .3s var(--hc-ease), opacity .22s ease; transform-origin: center;
}
.hg-chat[hidden] { display: none; }
.hg-chat.hg-plegada { transform: translate(var(--hg-dx, 0), var(--hg-dy, 40px)) scale(.12); opacity: 0; }
.hg-chat.hg-arrastrando { transition: none; user-select: none; }
.hg-chat-cabecera {
  display: flex; align-items: center; gap: 12px; padding: 14px 10px 14px 16px; flex: none; color: #fff; cursor: grab; touch-action: none; user-select: none;
  background: radial-gradient(120% 140% at 0% 0%, rgba(156,219,79,.28), transparent 55%), linear-gradient(135deg, var(--hc-900) 0%, var(--hc-700) 100%);
}
.hg-chat.hg-arrastrando .hg-chat-cabecera { cursor: grabbing; }
.hg-chat-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--hc-400); color: var(--hc-900); display: flex; align-items: center; justify-content: center; flex: none; }
.hg-chat-avatar .hg-ico { width: 21px; height: 21px; }
.hg-chat-textos { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.hg-chat-titulo { font: 600 16px/1.25 var(--hc-display); color: #fff; }
.hg-chat-estado { font-size: 12.5px; color: rgba(255,255,255,.8); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.hg-chat-punto { width: 8px; height: 8px; border-radius: 50%; background: var(--hc-lima); box-shadow: 0 0 0 3px rgba(192,233,103,.28); flex: none; }
.hg-chat-btn { width: 38px; height: 38px; border-radius: 10px; border: 0; padding: 0; flex: none; cursor: pointer; background: transparent; color: #fff; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.hg-chat-btn:hover { background: rgba(255,255,255,.14); }
.hg-chat-btn:focus-visible { outline: 3px solid var(--hc-lima); outline-offset: -3px; }
.hg-chat-btn .hg-ico { width: 20px; height: 20px; stroke-width: 2.2; }
.hg-chat-cuerpo {
  flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff;
  --chat--font-family: var(--hc-sans);
  --chat--color--primary: var(--hc-700); --chat--color--primary-shade-50: #194d30; --chat--color--primary--shade-100: #143f27;
  --chat--color--secondary: var(--hc-400); --chat--color-secondary-shade-50: #5f9424;
  --chat--color-dark: var(--hc-tinta); --chat--color-light: var(--hc-50);
  --chat--border-radius: 0; --chat--spacing: 14px; --chat--body--background: #fff; --chat--messages-list--padding: 16px;
  --chat--message--font-size: 14.5px; --chat--message-line-height: 1.55; --chat--message--padding: 10px 14px; --chat--message--border-radius: 14px;
  --chat--message--bot--background: var(--hc-50); --chat--message--bot--color: var(--hc-tinta); --chat--message--bot--border: 1px solid var(--hc-linea);
  --chat--message--user--background: var(--hc-700); --chat--message--user--color: #fff; --chat--message--user--border: 0;
  --chat--color-typing: var(--hc-suave);
  --chat--footer--background: #fff; --chat--footer--border-top: 1px solid var(--hc-linea); --chat--footer--padding: 10px 12px;
  --chat--input--font-size: 14.5px; --chat--input--border-radius: 12px; --chat--input--container--border-radius: 12px;
  --chat--input--send--button--color: var(--hc-700); --chat--input--send--button--color-hover: var(--hc-900);
  --chat--input--send--button--background: transparent; --chat--input--send--button--background-hover: var(--hc-100);
}
.hg-chat-cuerpo > * { flex: 1; min-height: 0; height: 100%; }
.hg-chat-cuerpo .chat-header { display: none !important; }
.hg-chat-cuerpo .chat-layout { height: 100%; }
.hg-chat-cuerpo .chat-message p { margin: 0 0 6px; color: inherit; }
.hg-chat-cuerpo .chat-message p:last-child { margin-bottom: 0; }
.hg-chat-cuerpo .chat-message ul, .hg-chat-cuerpo .chat-message ol { margin: 6px 0 6px 18px; padding: 0; }
.hg-chat-cuerpo .chat-message a { color: inherit !important; text-decoration: underline; }
.hg-chat-aviso { margin: auto; padding: 24px; text-align: center; font-size: 14px; color: var(--hc-suave); }
.hg-chat-aviso a { color: var(--hc-700) !important; font-weight: 600; }
.hg-chat-pie { margin: 0 !important; padding: 6px 14px 10px; font-size: 11.5px; line-height: 1.4; color: #8a978e; text-align: center; background: #fff; flex: none; }

/* Con la ventana abierta, el botón flotante se aparta (vuelve al cerrar) */
body.hg-chat-abierto .hg-contacto { display: none; }

/* Móvil: botón algo menor y ventana como panel inferior a lo ancho, sin arrastre */
@media (max-width: 767px) {
  .hg-contacto { right: 16px; bottom: 16px; }
  .hg-contacto-boton { width: 56px; height: 56px; }
  .hg-contacto-menu { width: min(290px, calc(100vw - 32px)); }
  .hg-chat { left: 0 !important; top: auto !important; bottom: 0; width: 100%; max-width: 100%; height: min(86vh, calc(100dvh - 24px)); border-radius: 20px 20px 0 0; border-bottom: 0; }
  .hg-chat-cabecera { cursor: default; padding-top: 12px; padding-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) { .hg-chat, .hg-contacto-boton { transition: none; } .hg-contacto-menu { animation: none; } }

/* ---- Laura (ElevenLabs): con su widget a la vista, el botón único se aparta y una «✕» propia lo cierra ---- */
body.hg-laura-activa .hg-contacto { display: none; }
.hg-contacto-voz { background: #eef3ff; color: #3b5bdb; }
.hg-laura-cerrar {
  position: fixed; z-index: 1060; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; background: #103020; color: #fff; box-shadow: 0 6px 18px rgba(7,27,16,.35);
}
.hg-laura-cerrar[hidden] { display: none; }
.hg-laura-cerrar:hover { background: #1f5c3a; }
.hg-laura-cerrar:focus-visible { outline: 3px solid #76b22e; outline-offset: 2px; }
.hg-laura-cerrar .hg-ico { width: 16px; height: 16px; stroke-width: 2.6; }
