/* ── Whoon Chatbot Widget ── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─────────────────────────────────────
   Toggle button
───────────────────────────────────── */
#whoon-toggle {
  position: fixed;
  bottom: 24px;
  left: 24px;   /* STAGING: links, botst niet met Trengo (rechts). Zet terug op 'right: 24px' voor productie. */
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #463F51;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0,0,0,0.22);
  transition: transform 0.18s, background 0.18s;
  z-index: 2147483001;   /* boven het mobiele menu/hamburger van het thema */
  padding: 0;
  overflow: hidden;
}

#whoon-toggle:hover {
  background: #5a5266;
  transform: scale(1.06);
}

#whoon-toggle img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
}

/* ─────────────────────────────────────
   Chat window
───────────────────────────────────── */
#whoon-window {
  position: fixed;
  bottom: 88px;
  left: 24px;   /* STAGING: links, samen met de toggle. Zet terug op 'right: 24px' voor productie. */
  width: 420px;
  height: min(720px, calc(100vh - 120px));
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483000;   /* boven het mobiele menu/hamburger van het thema */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

#whoon-window.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

/* ─────────────────────────────────────
   Header
───────────────────────────────────── */
#whoon-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  background: #463F51;
  color: #fff;
  flex-shrink: 0;
}

#whoon-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  padding: 2px;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.25);
}

#whoon-header-info {
  flex: 1;
  min-width: 0;
}

#whoon-header-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#whoon-header-sub {
  font-size: 11px;
  opacity: 0.55;
  margin-top: 2px;
}

#whoon-reset {
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

#whoon-reset:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

/* ─────────────────────────────────────
   Messages
───────────────────────────────────── */
#whoon-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

#whoon-messages::-webkit-scrollbar {
  width: 3px;
}
#whoon-messages::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}

.w-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
}

.w-row.bot  { justify-content: flex-start; }
.w-row.user { justify-content: flex-end; }

.w-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
}

.w-bubble {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 16px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-line;
}

.w-row.bot  .w-bubble {
  background: #f1f1f1;
  color: #463F51;
  border-bottom-left-radius: 4px;
}

.w-row.user .w-bubble {
  background: #463F51;
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Typing dots */
.w-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  background: #f1f1f1;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.w-typing span {
  width: 6px;
  height: 6px;
  background: #b0b0b0;
  border-radius: 50%;
  animation: wbounce 1.1s infinite ease-in-out;
}
.w-typing span:nth-child(2) { animation-delay: 0.18s; }
.w-typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes wbounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-5px); }
}

/* Opsommingen in botberichten */
.w-bubble ul {
  margin: 4px 0 4px 2px;
  padding-left: 18px;
}
.w-bubble li {
  margin: 2px 0;
}

/* ─────────────────────────────────────
   Productkaartjes
───────────────────────────────────── */
.w-products {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 4px 4px 33px; /* uitlijnen met botberichten (naast avatar) */
}

.w-product {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px;
  border-radius: 14px;
  background: #f5f5f5;
  text-decoration: none;
  color: #463F51;
  border: 1px solid #ececec;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}

.w-product.alt {
  background: #eef1f0;
}

.w-product:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  background: #463F51;
  color: #fff;
}

.w-product-img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: #fff;
}

.w-product-info {
  flex: 1;
  min-width: 0;
}

.w-product-naam {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
}

.w-product-prijs {
  font-size: 13px;
  margin-top: 3px;
  white-space: nowrap;
  opacity: 0.85;
}

.w-product-meer {
  display: inline-block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: #463F51;
  text-decoration: none;
}
.w-product-meer:hover {
  text-decoration: underline;
}

/* Systeemmelding (bv. "Je praat nu met …") */
.w-system {
  align-self: center;
  text-align: center;
  font-size: 11px;
  color: #888;
  background: #f3f3f3;
  border-radius: 10px;
  padding: 4px 10px;
  margin: 6px auto;
  max-width: 90%;
  white-space: pre-line;
}

/* Feedback (👍/👎) — compact, onopvallend */
.w-feedback {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px 2px 33px;
  margin-top: -2px;
}
.w-feedback-label {
  font-size: 10px;
  color: #aaa;
}
.w-fb-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 5px;
  opacity: 0.45;
  transition: opacity 0.15s, transform 0.1s;
}
.w-fb-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* Sterbeoordeling na afronding live chat (0,5 – 5 sterren) */
.w-rating {
  align-self: center;
  text-align: center;
  background: #faf7f2;
  border: 1px solid #efe7da;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 8px auto;
  max-width: 90%;
}
.w-rating-titel {
  font-size: 13px;
  color: #333;
  margin-bottom: 8px;
}
.w-stars {
  display: inline-flex;
  gap: 2px;
  cursor: pointer;
  user-select: none;
}
.w-star {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 30px;
  font-size: 28px;
  line-height: 30px;
  color: #dcdcdc;
}
.w-star::before { content: '★'; }
.w-star.full { color: #f5b301; }
.w-star.half::before {
  background: linear-gradient(90deg, #f5b301 50%, #dcdcdc 50%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.w-star .w-half {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  z-index: 2;
}
.w-star .w-left  { left: 0; }
.w-star .w-right { right: 0; }
.w-rating-waarde {
  font-size: 12px;
  color: #777;
  margin: 6px 0;
  min-height: 14px;
}
.w-rating-verstuur {
  background: #463F51;
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.w-rating-verstuur:disabled {
  opacity: 0.4;
  cursor: default;
}
.w-rating-skip {
  display: block;
  margin: 8px auto 0;
  background: none;
  border: none;
  color: #999;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

/* ─────────────────────────────────────
   Bottom area
───────────────────────────────────── */
#whoon-bottom {
  flex-shrink: 0;
  border-top: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  position: relative;   /* anker voor de drop-up knoppen */
}

/* FAQ drop-up toggle */
#whoon-faq-toggle {
  display: none;        /* getoond zodra er knoppen zijn */
  width: 100%;
  background: #fafafa;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  color: #555;
  font-family: inherit;
  font-size: 12px;
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
}
#whoon-faq-toggle:hover { background: #f0f0f0; }
#whoon-faq-caret { float: right; transition: transform 0.15s; }
#whoon-faq-toggle.open #whoon-faq-caret { transform: rotate(180deg); }

/* Quick-reply buttons — drop-up overlay boven de onderbalk */
#whoon-buttons {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  box-shadow: 0 -8px 22px rgba(0,0,0,0.10);
  max-height: 320px;
  overflow-y: auto;
}
#whoon-buttons.open { display: flex; }

.w-btn {
  background: #fff;
  border: 1.5px solid #463F51;
  color: #463F51;
  padding: 9px 13px;
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.w-btn:hover {
  background: #463F51;
  color: #fff;
}

/* Text input row */
#whoon-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 14px;
}

#whoon-input {
  flex: 1;
  border: 1.5px solid #e2e2e2;
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  resize: none;
  line-height: 1.4;
  max-height: 90px;
  overflow-y: auto;
  transition: border-color 0.15s;
  color: #463F51;
}

#whoon-input:focus {
  border-color: #8BD2C9;
}

#whoon-input::placeholder {
  color: #b0b0b0;
}

#whoon-send {
  width: 48px;
  height: 48px;
  background: #8BD2C9;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}

#whoon-send:hover {
  background: #6fc2b8;
}
#whoon-send:active {
  transform: scale(0.94);
}

#whoon-send svg {
  width: 26px;
  height: 26px;
  fill: #463F51;
  position: relative;
  left: 1px;   /* optisch centreren van de paper-plane */
}

/* ─────────────────────────────────────
   Utility
───────────────────────────────────── */
.whoon-hidden {
  display: none !important;
}

/* ─────────────────────────────────────
   Proactief pop-up-bericht (teaser)
───────────────────────────────────── */
#whoon-teaser {
  position: fixed;
  bottom: 94px;
  left: 24px;   /* STAGING: links, boven de toggle. Zet terug op 'right: 24px' voor productie. */
  z-index: 2147482999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #8BD2C9;
  color: #463F51;
  border-radius: 24px;
  padding: 14px 20px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.20);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#whoon-teaser.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
#whoon-teaser .whoon-teaser-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
#whoon-teaser .whoon-teaser-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #463F51;
  opacity: 0.7;
  animation: whoon-teaser-bounce 1.1s infinite ease-in-out;
}
#whoon-teaser .whoon-teaser-dots i:nth-child(2) { animation-delay: 0.18s; }
#whoon-teaser .whoon-teaser-dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes whoon-teaser-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-5px); }
}
#whoon-teaser .whoon-teaser-close {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #463F51;
  color: #fff;
  border: 2px solid #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
@media (max-width: 480px) {
  #whoon-teaser {
    bottom: 78px;
    left: 16px;   /* STAGING: links. Zet terug op 'right: 16px' voor productie. */
    font-size: 15px;
    padding: 12px 16px;
    max-width: calc(100vw - 32px);
    white-space: normal;
  }
}

/* ─────────────────────────────────────
   Mobile
───────────────────────────────────── */
@media (max-width: 480px) {
  #whoon-window {
    width: calc(100vw - 16px);
    left: 8px;    /* STAGING: links. Zet terug op 'right: 8px' voor productie. */
    bottom: 78px;
    height: calc(100dvh - 92px);   /* vrijwel volledig scherm, ruimte voor de toggle */
    max-height: none;
    border-radius: 16px;
  }
  #whoon-toggle {
    bottom: 16px;
    left: 16px;   /* STAGING: links. Zet terug op 'right: 16px' voor productie. */
  }
}
