/* Zwevende hulp-popup rechtsonder (publieke site). Zelf-bevattend. */
.hw {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
  font-family: var(--font);
  /* De container zelf vangt GEEN taps: alleen de bubble en het open paneel
     zijn klikbaar. Anders legt het onzichtbare (opacity:0) paneel een groot
     dood klikvlak over de pagina, waardoor knoppen eronder (bv. Inloggen op
     mobiel) niet reageren. */
  pointer-events: none;
}
.hw * { box-sizing: border-box; }

/* Ronde knop */
.hw-toggle {
  width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--brand, #4f46e5); color: #fff;
  box-shadow: 0 10px 26px rgba(79, 70, 229, .45);
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s ease, background .18s ease;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}
.hw-toggle:hover { transform: translateY(-2px); background: var(--brand-dark, #4338ca); }
.hw-toggle:active { transform: translateY(0); }
.hw-toggle-close { font-size: 30px; line-height: 1; display: none; }
.hw.is-open .hw-toggle-open { display: none; }
.hw.is-open .hw-toggle-close { display: block; }

/* Subtiele aandacht-tik: de knop wipt een paar keer zacht op bij het laden */
.hw-toggle { animation: hw-bob 2.6s ease-in-out 2; }
@keyframes hw-bob { 0%, 88%, 100% { transform: translateY(0); } 92% { transform: translateY(-5px); } 96% { transform: translateY(-2px); } }

/* Paneel */
.hw-panel {
  width: min(340px, calc(100vw - 32px));
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(17, 24, 39, .28);
  transform-origin: bottom right;
  opacity: 0; transform: translateY(12px) scale(.96); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.hw.is-open .hw-panel { opacity: 1; transform: none; pointer-events: auto; }

.hw-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px;
  background: linear-gradient(135deg, #4f46e5, #4338ca); color: #fff;
}
.hw-avatar { position: relative; width: 46px; height: 46px; flex-shrink: 0; }
.hw-avatar img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.7); }
.hw-avatar span {
  width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.2); color: #fff; font-weight: 800; font-size: 20px; border: 2px solid rgba(255,255,255,.6);
}
.hw-online { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
.hw-head-text { flex: 1; min-width: 0; line-height: 1.3; }
.hw-head-text strong { display: block; font-size: 15px; }
.hw-head-text span { font-size: 12px; opacity: .85; }
.hw-close { background: none; border: none; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; opacity: .8; padding: 0 2px; }
.hw-close:hover { opacity: 1; }

.hw-body { padding: 16px 16px 18px; }
.hw-intro { font-size: 13.5px; color: var(--muted, #6b7280); margin: 0 0 14px; line-height: 1.5; }
.hw-actions { display: flex; flex-direction: column; gap: 10px; }
.hw-action {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border: 1px solid var(--line, #e5e7eb); border-radius: 12px; text-decoration: none;
  color: var(--ink, #111827); transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; background: #fff;
}
.hw-action:hover { border-color: transparent; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(17,24,39,.1); text-decoration: none; }
.hw-ic { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
.hw-wa .hw-ic { background: #25d366; }
.hw-mail .hw-ic { background: #4f46e5; }
.hw-call .hw-ic { background: #0ea5e9; }
.hw-action-text { display: flex; flex-direction: column; min-width: 0; }
.hw-action-text strong { font-size: 14px; }
.hw-action-text small { font-size: 12px; color: var(--muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 520px) {
  .hw { right: 14px; bottom: 14px; }
  .hw-toggle { width: 54px; height: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  .hw-toggle, .hw-panel, .hw-action { transition: none; }
  .hw-toggle { animation: none; }
}
