/* ==========================================================================
   Hun Wereld Chat — floating assistant
   Own scope (.hw-chat*) — independent of theme/Elementor.
   Colors follow the Hun Wereld design tokens.
   ========================================================================== */
.hw-chat-root {
  --hwc-ink: #153c3d;
  --hwc-teal: #087d79;
  --hwc-yellow: #ffd35e;
  --hwc-mint: #e2f4ed;
  --hwc-paper: #fffdf8;
  --hwc-muted: #4d6560;
  font-family: 'DM Sans', -apple-system, sans-serif;
}

.screen-reader-text {
  position: absolute;
  left: -10000px;
}

/* Bubble ------------------------------------------------------------------ */
.hw-chat-bubble {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  cursor: pointer;
  background: var(--hwc-teal);
  color: #fff;
  font: 700 15px/1 'DM Sans', sans-serif;
  padding: 15px 20px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(21, 60, 61, .28);
  transition: transform .2s cubic-bezier(.22, .61, .36, 1), box-shadow .2s ease;
}
.hw-chat-bubble:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(21, 60, 61, .34); }
.hw-chat-bubble__icon { font-size: 18px; line-height: 1; }
.hw-chat-bubble__text { display: inline; }
@media (max-width: 700px) {
  .hw-chat-bubble { bottom: 84px; right: 16px; padding: 14px; }
  .hw-chat-bubble__text { display: none; } /* icon-only above the mobile contact bar */
  .hw-chat-bubble__icon { font-size: 22px; }
}

/* Panel ------------------------------------------------------------------- */
.hw-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 88px;
  z-index: 9991;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  background: var(--hwc-paper);
  border: 1px solid #d9e6df;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(21, 60, 61, .25);
  overflow: hidden;
  animation: hwc-pop .28s cubic-bezier(.22, .61, .36, 1);
}
.hw-chat-panel[hidden] { display: none; }
@media (max-width: 700px) {
  .hw-chat-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 148px;
    height: min(520px, calc(100vh - 200px));
  }
}
@media (prefers-reduced-motion: reduce) {
  .hw-chat-panel { animation: none; }
}
@keyframes hwc-pop {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* Head -------------------------------------------------------------------- */
.hw-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--hwc-ink);
  color: #fff;
}
.hw-chat-head__logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  background: var(--hwc-yellow);
  color: var(--hwc-ink);
  border-radius: 50% 50% 40% 40%;
  font: 800 13px/1 'Outfit', sans-serif;
}
.hw-chat-head__meta { flex: 1; line-height: 1.25; }
.hw-chat-head__meta strong { display: block; font: 600 15px 'Outfit', sans-serif; }
.hw-chat-head__meta span { font-size: 12px; opacity: .75; }
.hw-chat-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.hw-chat-close:hover { background: rgba(255, 255, 255, .12); }

/* Messages ---------------------------------------------------------------- */
.hw-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, var(--hwc-mint) 0%, var(--hwc-paper) 30%);
}
.hw-chat-msg {
  max-width: 85%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: hwc-in .25s ease;
}
.hw-chat-msg--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #d9e6df;
  border-bottom-left-radius: 4px;
  color: var(--hwc-ink);
}
.hw-chat-msg--user {
  align-self: flex-end;
  background: var(--hwc-teal);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.hw-chat-msg--typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 5px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #d9e6df;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}
.hw-chat-msg--typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hwc-teal);
  opacity: .4;
  animation: hwc-blink 1.1s infinite;
}
.hw-chat-msg--typing i:nth-child(2) { animation-delay: .18s; }
.hw-chat-msg--typing i:nth-child(3) { animation-delay: .36s; }
@keyframes hwc-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .hw-chat-msg--typing i { animation: none; opacity: .6; }
  .hw-chat-msg { animation: none; }
}
@keyframes hwc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Quick replies ------------------------------------------------------------ */
.hw-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 0;
}
.hw-chat-quick button {
  border: 1px solid var(--hwc-teal);
  background: #fff;
  color: var(--hwc-teal);
  font: 600 12.5px 'DM Sans', sans-serif;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.hw-chat-quick button:hover { background: var(--hwc-teal); color: #fff; transform: translateY(-1px); }

/* Form --------------------------------------------------------------------- */
.hw-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
}
.hw-chat-input {
  flex: 1;
  border: 1px solid #b4c8bd;
  border-radius: 12px;
  padding: 12px 14px;
  font: 400 14.5px 'DM Sans', sans-serif;
  color: var(--hwc-ink);
  background: #fff;
  outline-offset: 2px;
}
.hw-chat-input:focus { border-color: var(--hwc-teal); }
.hw-chat-send {
  flex: 0 0 44px;
  border: 0;
  cursor: pointer;
  background: var(--hwc-yellow);
  color: var(--hwc-ink);
  border-radius: 12px;
  font-size: 17px;
  transition: transform .2s ease, background .2s ease;
}
.hw-chat-send:hover { transform: translateY(-2px); background: #f0c24a; }
.hw-chat-send:disabled { opacity: .5; cursor: wait; transform: none; }

/* Note --------------------------------------------------------------------- */
.hw-chat-note {
  margin: 0;
  padding: 0 14px 12px;
  font-size: 11.5px;
  color: var(--hwc-muted);
  text-align: center;
}
.hw-chat-note a { color: var(--hwc-teal); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Focus visibility ---------------------------------------------------------- */
.hw-chat-root button:focus-visible,
.hw-chat-root .hw-chat-input:focus-visible {
  outline: 3px solid #ee8e75;
  outline-offset: 2px;
}

/* Follow-up chips (contextual) ------------------------------------------- */
.hw-chat-quick button {
  background: var(--hwc-mint);
  border-color: transparent;
  color: var(--hwc-ink);
}
.hw-chat-quick button:hover { background: var(--hwc-teal); color: #fff; transform: translateY(-1px); }

/* Reset link -------------------------------------------------------------- */
.hw-chat-reset {
  border: 0;
  background: transparent;
  color: var(--hwc-muted);
  font: 600 11.5px 'DM Sans', sans-serif;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}
.hw-chat-reset:hover { color: var(--hwc-teal); }
.hw-chat-note { display: flex; gap: 10px; align-items: baseline; justify-content: center; }
