/* =============================================================
   Boost Wellness — chatbot.css
   Widget de chat de preguntas frecuentes
   ============================================================= */

.bw-chat-launcher {
  position: fixed;
  right: clamp(1rem, 4vw, 1.75rem);
  bottom: clamp(1rem, 4vw, 1.75rem);
  z-index: 999;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--olive-dark);
  color: var(--cream-dk);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(29,32,24,0.28);
  transition: transform .25s var(--ease-out, ease), background .2s ease;
}
.bw-chat-launcher:hover { transform: translateY(-2px); background: var(--olive); }
.bw-chat-launcher svg { width: 26px; height: 26px; }
.bw-chat-launcher .bw-chat-icon-close { display: none; }
.bw-chat-launcher[aria-expanded="true"] .bw-chat-icon-chat { display: none; }
.bw-chat-launcher[aria-expanded="true"] .bw-chat-icon-close { display: block; }

.bw-chat-panel {
  position: fixed;
  right: clamp(1rem, 4vw, 1.75rem);
  bottom: calc(clamp(1rem, 4vw, 1.75rem) + 70px);
  z-index: 999;
  width: min(360px, calc(100vw - 2rem));
  height: min(520px, calc(100vh - 8rem));
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(29,32,24,0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  pointer-events: none;
  transition: opacity .22s var(--ease-out, ease), transform .22s var(--ease-out, ease);
}
.bw-chat-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.bw-chat-head {
  background: var(--olive-dark);
  color: var(--cream-dk);
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  flex: none;
}
.bw-chat-head-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--ink-deep);
  display: flex; align-items: center; justify-content: center;
  flex: none;
  overflow: hidden;
  padding: 7px;
}
.bw-chat-head-avatar img { width: 100%; height: 100%; object-fit: contain; }
.bw-chat-head-title { font-family: var(--sans); font-weight: 600; font-size: .95rem; line-height: 1.2; }
.bw-chat-head-sub { font-size: .76rem; color: var(--cream-dk-mute); }

.bw-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  background: var(--bg);
}

.bw-chat-msg {
  max-width: 86%;
  padding: .6rem .8rem;
  border-radius: 14px;
  font-family: var(--sans);
  font-size: .87rem;
  line-height: 1.45;
}
.bw-chat-msg a { color: inherit; text-decoration: underline; }
.bw-chat-msg-bot {
  align-self: flex-start;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.bw-chat-msg-user {
  align-self: flex-end;
  background: var(--olive-dark);
  color: var(--cream-dk);
  border-bottom-right-radius: 4px;
}

.bw-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-self: flex-start;
  max-width: 100%;
}
.bw-chat-chip {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: .78rem;
  padding: .4rem .7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.bw-chat-chip:hover { background: var(--bg-2); border-color: var(--olive-2); }

.bw-chat-form {
  flex: none;
  display: flex;
  gap: .5rem;
  padding: .7rem;
  border-top: 1px solid var(--line-soft);
  background: var(--paper);
}
.bw-chat-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .55rem .9rem;
  font-family: var(--sans);
  font-size: .87rem;
  color: var(--ink);
  background: var(--bg);
}
.bw-chat-input:focus { outline: 2px solid var(--olive-2); outline-offset: 1px; }
.bw-chat-send {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--olive-dark);
  color: var(--cream-dk);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s ease;
}
.bw-chat-send:hover { background: var(--olive); }
.bw-chat-send svg { width: 16px; height: 16px; }

@media (max-width: 480px) {
  .bw-chat-panel {
    right: 1rem;
    left: 1rem;
    width: auto;
    bottom: calc(1rem + 70px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bw-chat-launcher, .bw-chat-panel { transition: none; }
}

.nav.is-open ~ .bw-chat-launcher,
.nav.is-open ~ .bw-chat-panel { display: none; }
