/* ===========================
   HEALTHCANVAS — chatbot.css
   Usa las variables ya definidas en styles.css (--azul, --menta, --font-display, etc.)
   =========================== */

.hc-chat-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  font-family: var(--font-body);
}

.hc-chat-bubble {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--menta-oscuro);
  color: var(--blanco);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--sombra);
  transition: transform 0.15s ease;
}
.hc-chat-bubble:hover { transform: scale(1.06); background: var(--menta); }
.hc-chat-bubble svg { width: 28px; height: 28px; }

.hc-chat-panel {
  display: none;
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 340px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: 70vh;
  background: var(--blanco);
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  flex-direction: column;
  overflow: hidden;
}

.hc-chat-panel--abierto {
  display: flex;
}

.hc-chat-header {
  background: var(--azul);
  color: var(--blanco);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.hc-chat-cerrar {
  background: none;
  border: none;
  color: var(--blanco);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.hc-chat-mensajes {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: var(--gris-fondo);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hc-chat-msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.hc-chat-msg a { color: inherit; text-decoration: underline; }

.hc-chat-msg--bot {
  align-self: flex-start;
  background: var(--gris-suave);
  color: var(--negro);
  border-bottom-left-radius: 4px;
}

.hc-chat-msg--user {
  align-self: flex-end;
  background: var(--azul);
  color: var(--blanco);
  border-bottom-right-radius: 4px;
}

.hc-chat-escribiendo {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 10px 13px;
  background: var(--gris-suave);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}
.hc-chat-escribiendo span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gris-texto);
  animation: hc-chat-parpadeo 1s infinite ease-in-out;
}
.hc-chat-escribiendo span:nth-child(2) { animation-delay: 0.15s; }
.hc-chat-escribiendo span:nth-child(3) { animation-delay: 0.3s; }
@keyframes hc-chat-parpadeo {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

.hc-chat-botones-rapidos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 10px;
  background: var(--gris-fondo);
}

.hc-chat-boton-rapido {
  background: var(--blanco);
  border: 1.5px solid var(--azul);
  color: var(--azul);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.15s ease;
}
.hc-chat-boton-rapido:hover { background: var(--azul); color: var(--blanco); }

.hc-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--gris-suave);
  background: var(--blanco);
}

.hc-chat-input-row input {
  flex: 1;
  border: 1.5px solid var(--gris-suave);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 0.88rem;
  font-family: var(--font-body);
  outline: none;
}
.hc-chat-input-row input:focus { border-color: var(--azul); }

.hc-chat-input-row button {
  background: var(--azul);
  color: var(--blanco);
  border: none;
  border-radius: 20px;
  padding: 0 16px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}
.hc-chat-input-row button:hover { background: var(--azul-claro); }
.hc-chat-input-row button:disabled { opacity: 0.5; cursor: default; }

/* ---- Variante embebida (placeholder de "Así se ve") ---- */
.hc-chat-wrap--inline {
  position: static;
  z-index: auto;
  width: 100%;
  height: 100%;
  display: block;
}
.hc-chat-wrap--inline .hc-chat-bubble { display: none; }
.hc-chat-wrap--inline .hc-chat-panel {
  display: flex;
  position: static;
  width: 100%;
  height: 100%;
  max-height: none;
  box-shadow: none;
  border-radius: 0;
}

@media (max-width: 480px) {
  .hc-chat-panel { width: calc(100vw - 32px); height: 65vh; }
}