/* Zwevende WhatsApp-knop op de klantsite (_SiteWhatsAppButton) — voor elke template gelijk.
   WhatsApp-groen is bewust vast (zo herkent een bezoeker de knop meteen), niet de merkkleur van de klant.
   Staat onder de cookiemelding (z-index), en houdt afstand tot twee andere vaste onderdelen:
   het cookie-icoon linksonder (.wfcc-reopen) en Crafto's scroll-balk rechts op brede schermen. */

@keyframes wfWaIn {
  from { opacity: 0; transform: translateY(14px) scale(.9); }
  to   { opacity: 1; transform: none; }
}

.wf-wa-fab {
  position: fixed; bottom: 20px; z-index: 1040;
  display: inline-flex; align-items: center; gap: 4px;
  height: 56px; padding: 0; border-radius: 999px;
  background: #25d366; color: #fff !important; text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
  /* backwards: na het binnenkomen geen vaste transform meer, anders werkt het hover-effect niet */
  animation: wfWaIn .45s ease-out .6s backwards;
}
.wf-wa-fab.-rechts { right: 20px; }
.wf-wa-fab.-links  { left: 20px; }
.wf-wa-fab.-tekst  { padding-right: 22px; }

.wf-wa-fab-ico { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.75rem; }
.wf-wa-fab-ico i { color: #fff !important; }
.wf-wa-fab-tekst { font-size: 15px; font-weight: 600; line-height: 1.2; white-space: nowrap; color: #fff; }

.wf-wa-fab:hover,
.wf-wa-fab:focus-visible { background: #1ebe5b; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, .26); color: #fff !important; }
.wf-wa-fab:focus-visible { outline: 3px solid rgba(37, 211, 102, .45); outline-offset: 3px; }

/* Links staat ook het cookie-icoon: de knop schuift er dan boven. */
body.wfcc-has-pill .wf-wa-fab.-links { bottom: 76px; }

/* Rechts op brede schermen staat Crafto's scroll-balk (alleen ≥1400px, als "naar boven" aan staat en rechts staat). */
@media (min-width: 1400px) {
  body[data-wf-fx~="naarboven"]:not([data-wf-fx~="naarboven-links"]) .wf-wa-fab.-rechts { right: 64px; }
}

/* Telefoon: alleen het rondje — een tekst neemt daar te veel van het scherm. */
@media (max-width: 575.98px) {
  .wf-wa-fab { bottom: 16px; height: 52px; }
  .wf-wa-fab.-rechts { right: 16px; }
  .wf-wa-fab.-links { left: 16px; }
  body.wfcc-has-pill .wf-wa-fab.-links { bottom: 64px; }
  .wf-wa-fab.-tekst { padding-right: 0; }
  .wf-wa-fab-ico { width: 52px; height: 52px; font-size: 1.6rem; }
  .wf-wa-fab-tekst { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .wf-wa-fab { animation: none; transition: none; }
}

/* Voorbeeld in het dashboard (Marketing → WhatsApp): dezelfde knop, maar binnen het voorbeeldvlak. */
.wf-wa-fab.-voorbeeld { position: absolute; animation: none; }

/* Zichtbaarheid per apparaat (Marketing → WhatsApp). */
@media (max-width: 767.98px) { .wf-wa-fab.-geen-mobiel, .wf-wa-venster.-geen-mobiel { display: none !important; } }
@media (min-width: 768px)    { .wf-wa-fab.-geen-desktop, .wf-wa-venster.-geen-desktop { display: none !important; } }

/* ── Berichtvenster (modus "venster", 23-10-2026) ─────────────────────────────────────────────────────────────
   Een klein venster in WhatsApp-stijl boven de knop: kop met logo en naam, een "berichtje" van de klant,
   snelkeuzes, velden en een groene verstuurknop. Kleuren bewust WhatsApp en niet de merkkleur. */
@keyframes wfWaVensterIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.wf-wa-venster {
  position: fixed; bottom: 88px; z-index: 1041; width: 340px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px); display: flex; flex-direction: column;
  background: #efeae2; border-radius: 16px; overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .28); font-size: 14px; color: #111b21;
  animation: wfWaVensterIn .22s ease-out;
}
.wf-wa-venster[hidden] { display: none; }
.wf-wa-venster.-rechts { right: 20px; }
.wf-wa-venster.-links  { left: 20px; }
.wf-wa-kop { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #075e54; color: #fff; }
.wf-wa-avatar { width: 40px; height: 40px; border-radius: 50%; background: #fff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.wf-wa-avatar img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.wf-wa-avatar.-ico { background: #25d366; color: #fff; font-size: 1.3rem; }
.wf-wa-kop-tekst { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.wf-wa-kop-tekst strong { font-size: 15px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-wa-kop-tekst span { font-size: 12px; opacity: .85; }
.wf-wa-sluit { background: none; border: 0; color: #fff; font-size: 1rem; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.wf-wa-sluit:hover, .wf-wa-sluit:focus-visible { background: rgba(255, 255, 255, .15); }
.wf-wa-lijf { padding: 14px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.wf-wa-ballon { align-self: flex-start; max-width: 90%; background: #fff; border-radius: 0 10px 10px 10px; padding: 8px 12px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); white-space: pre-line; }
.wf-wa-keuzes { display: flex; flex-wrap: wrap; gap: 6px; }
.wf-wa-keuze input { position: absolute; opacity: 0; pointer-events: none; }
.wf-wa-keuze span { display: inline-block; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid #d1d7db; cursor: pointer; font-size: 13px; color: #111b21; }
.wf-wa-keuze input:checked + span { background: #d9fdd3; border-color: #25d366; font-weight: 600; }
.wf-wa-keuze input:focus-visible + span { outline: 2px solid #25d366; outline-offset: 2px; }
.wf-wa-veld { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.wf-wa-veld > span { font-size: 12px; font-weight: 600; color: #54656f; }
.wf-wa-veld input, .wf-wa-veld textarea { width: 100%; border: 1px solid #d1d7db; border-radius: 8px; padding: 8px 10px; font: inherit; color: #111b21; background: #fff; resize: vertical; }
.wf-wa-veld input:focus, .wf-wa-veld textarea:focus { outline: none; border-color: #25d366; box-shadow: 0 0 0 3px rgba(37, 211, 102, .2); }
.wf-wa-veld [aria-invalid="true"] { border-color: #d93025; }
.wf-wa-fout { margin: 0; color: #d93025; font-size: 12px; }
.wf-wa-verstuur { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 10px 16px; background: #25d366; color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }
.wf-wa-verstuur:hover, .wf-wa-verstuur:focus-visible { background: #1ebe5b; }
.wf-wa-uitleg { margin: 0; font-size: 11px; color: #667781; text-align: center; }
.wf-wa-fab.-open { transform: scale(.94); }

/* Rechts op brede schermen schuift het venster mee met de knop (scroll-balk). */
@media (min-width: 1400px) {
  body[data-wf-fx~="naarboven"]:not([data-wf-fx~="naarboven-links"]) .wf-wa-venster.-rechts { right: 64px; }
}
body.wfcc-has-pill .wf-wa-venster.-links { bottom: 144px; }
@media (max-width: 575.98px) {
  .wf-wa-venster { bottom: 80px; width: auto; left: 12px !important; right: 12px !important; max-width: none; max-height: calc(100vh - 100px); }
}
@media (prefers-reduced-motion: reduce) { .wf-wa-venster { animation: none; } }

/* Compact houden: de templates (Crafto) geven invoervelden, labels en tekst ruime hoogtes en regelafstanden;
   in dit kleine venster moet alles passen zonder te scrollen op een laptop. */
.wf-wa-venster, .wf-wa-venster * { box-sizing: border-box; }
.wf-wa-venster .wf-wa-lijf { gap: 8px; padding: 12px; line-height: 1.4; }
.wf-wa-venster .wf-wa-ballon { line-height: 1.45; font-size: 14px; padding: 8px 11px; margin: 0; }
.wf-wa-venster .wf-wa-keuze span { line-height: 1.3; padding: 5px 11px; }
.wf-wa-venster .wf-wa-keuzes { gap: 5px; }
.wf-wa-venster .wf-wa-veld > span { line-height: 1.2; margin: 0; }
.wf-wa-venster .wf-wa-veld input,
.wf-wa-venster .wf-wa-veld textarea { height: auto !important; min-height: 0 !important; line-height: 1.4 !important; padding: 7px 10px !important; font-size: 14px !important; margin: 0 !important; }
.wf-wa-venster .wf-wa-veld textarea { min-height: 54px !important; }
.wf-wa-venster .wf-wa-verstuur { line-height: 1.2; padding: 10px 14px; margin-top: 2px; flex-shrink: 0; }
.wf-wa-venster .wf-wa-uitleg { line-height: 1.3; color: #54656f !important; opacity: 1 !important; }
.wf-wa-venster .wf-wa-kop-tekst span { line-height: 1.25; }
