/* =========================================================
   Suwie — chat-assistent (widget)
   Gebruikt de bestaande merkvariabelen uit styles.css.
   ========================================================= */

.sw-chat-open {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px 13px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--green-700);
  color: #fff;
  font: 600 15px/1 var(--sans);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(8, 20, 17, 0.28);
  transition: transform .18s ease, background .18s ease, opacity .18s ease;
}
.sw-chat-open:hover { background: var(--green-600); transform: translateY(-2px); }
.sw-chat-open .sw-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(51, 211, 200, .7);
  animation: sw-pulse 2.4s infinite;
}
@keyframes sw-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(51,211,200,.6); }
  70%  { box-shadow: 0 0 0 9px rgba(51,211,200,0); }
  100% { box-shadow: 0 0 0 0 rgba(51,211,200,0); }
}
.sw-chat-open[hidden] { display: none; }

.sw-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 901;
  width: min(400px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 44px));
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: var(--sans);
  opacity: 0;
  transform: translateY(14px) scale(.98);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.sw-chat.is-open { opacity: 1; transform: none; pointer-events: auto; }

.sw-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 15px;
  background: var(--dark);
  color: var(--dark-ink);
  border-bottom: 1px solid var(--dark-line);
}
.sw-chat-avatar {
  width: 36px; height: 36px;
  flex: 0 0 36px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--green-500), var(--green-700));
  color: #fff; font-weight: 700; font-size: 15px;
}
.sw-chat-title { flex: 1; min-width: 0; }
.sw-chat-title strong { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.sw-chat-title span {
  display: flex; align-items: center; gap: 6px;
  font: 500 12px/1.4 var(--mono);
  color: var(--dark-muted);
  margin-top: 2px;
}
.sw-chat-title span::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.sw-chat-close {
  border: 0; background: transparent; color: var(--dark-muted);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 6px; border-radius: 8px;
}
.sw-chat-close:hover { color: #fff; background: rgba(255,255,255,.08); }

.sw-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-alt);
  scroll-behavior: smooth;
}
.sw-msg {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: 15px;
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.sw-msg.bot {
  align-self: flex-start;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.sw-msg.mens {
  align-self: flex-end;
  background: var(--green-700);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.sw-msg.stil { background: var(--green-50); border-color: #cfe9e7; color: var(--green-700); font-size: 13.5px; }

.sw-typing { align-self: flex-start; display: flex; gap: 4px; padding: 13px 15px; background: #fff; border: 1px solid var(--line); border-radius: 15px; border-bottom-left-radius: 5px; }
.sw-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .5; animation: sw-bounce 1.3s infinite; }
.sw-typing i:nth-child(2) { animation-delay: .18s; }
.sw-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes sw-bounce { 0%,60%,100% { transform: none; opacity: .35; } 30% { transform: translateY(-4px); opacity: .9; } }

.sw-suggesties { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 16px 12px; background: var(--bg-alt); }
.sw-suggesties button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green-700);
  font: 500 13px/1 var(--sans);
  padding: 9px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.sw-suggesties button:hover { background: var(--green-50); border-color: var(--green-300); }
.sw-suggesties:empty { display: none; padding: 0; }

.sw-chat-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.sw-chat-form textarea {
  flex: 1;
  resize: none;
  max-height: 110px;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: 400 14.5px/1.45 var(--sans);
  color: var(--ink);
  background: var(--bg-alt);
  outline: none;
}
.sw-chat-form textarea:focus { border-color: var(--green-300); background: #fff; }
.sw-chat-send {
  flex: 0 0 44px;
  width: 44px; height: 44px;
  border: 0; border-radius: 12px;
  background: var(--green-700);
  color: #fff; font-size: 17px;
  cursor: pointer;
  transition: background .15s ease;
}
.sw-chat-send:hover:not(:disabled) { background: var(--green-600); }
.sw-chat-send:disabled { opacity: .45; cursor: default; }

.sw-chat-voet {
  padding: 0 14px 11px;
  font: 400 11px/1.4 var(--sans);
  color: var(--muted);
  text-align: center;
  background: var(--bg);
}

@media (max-width: 520px) {
  .sw-chat { right: 8px; left: 8px; bottom: 8px; width: auto; height: min(78vh, calc(100vh - 16px)); }
  .sw-chat-open { right: 14px; bottom: 14px; padding: 12px 17px 12px 14px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .sw-chat, .sw-chat-open, .sw-typing i, .sw-chat-open .sw-dot { transition: none; animation: none; }
}
