/* Chatknop en chatvenster. Kleuren en lettertype komen uit de instellingen (inline CSS); dit zijn de standaarden. */
.lmm-launcher,
.lmm-panel {
  --lmm-primary: #0d0d0d;
  --lmm-on-primary: #ffffff;
  --lmm-accent: #c9a96e;
  --lmm-on-accent: #0d0d0d;
  --lmm-send: #1e8449;
  --lmm-on-send: #ffffff;
  --lmm-text: #0d0d0d;
  --lmm-grey: #f5f5f5;
  --lmm-line: #e0e0e0;
  font-family: 'DM Sans', system-ui, sans-serif;
  box-sizing: border-box;
}
.lmm-panel *, .lmm-panel *::before, .lmm-panel *::after { box-sizing: border-box; }

/* ── Knop ── */
.lmm-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 9990;
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 20px 0 16px; border: 0; border-radius: 24px;
  background: var(--lmm-primary); color: var(--lmm-on-primary); font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22); cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.lmm-launcher:hover { filter: brightness(1.15); transform: translateY(-1px); }
.lmm-launcher svg { width: 20px; height: 20px; color: var(--lmm-accent); }
.lmm-is-open .lmm-launcher { display: none; }

/* ── Venster ── */
.lmm-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 9991;
  width: 380px; height: min(600px, calc(100vh - 40px));
  display: flex; flex-direction: column;
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.lmm-panel[hidden] { display: none; }

.lmm-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 12px 14px 16px; background: var(--lmm-primary); color: var(--lmm-on-primary);
}
.lmm-avatar {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--lmm-accent); color: var(--lmm-on-accent); font-weight: 700; font-size: 16px;
}
.lmm-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lmm-who { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.lmm-who strong { font-size: 15px; }
.lmm-who span { font-size: 12px; opacity: 0.7; }
.lmm-icon-btn {
  border: 0; background: transparent; color: inherit; opacity: 0.8; cursor: pointer;
  height: 32px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
}
.lmm-icon-btn:hover { background: rgba(128, 128, 128, 0.2); opacity: 1; }
.lmm-close { width: 32px; padding: 0; display: flex; align-items: center; justify-content: center; }
.lmm-close svg { width: 18px; height: 18px; }

.lmm-log {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px; background: var(--lmm-grey);
}
.lmm-msg {
  max-width: 85%; padding: 10px 14px; border-radius: 14px;
  font-size: 14px; line-height: 1.5; overflow-wrap: anywhere;
}
.lmm-msg--assistant { align-self: flex-start; background: #fff; color: var(--lmm-text); border-bottom-left-radius: 4px; }
.lmm-msg--user { align-self: flex-end; background: var(--lmm-primary); color: var(--lmm-on-primary); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.lmm-msg a { color: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--lmm-accent); text-decoration-thickness: 2px; text-underline-offset: 2px; }

.lmm-typing { display: inline-flex; gap: 4px; padding: 14px; }
.lmm-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #bbb;
  animation: lmm-dot 1.2s infinite ease-in-out;
}
.lmm-typing span:nth-child(2) { animation-delay: 0.15s; }
.lmm-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes lmm-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.lmm-note {
  margin: 0; padding: 8px 16px; font-size: 11px; line-height: 1.4; color: #888;
  background: #fff; border-top: 1px solid var(--lmm-line);
}
.lmm-note a { color: inherit; }

.lmm-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; background: #fff; }
.lmm-input {
  flex: 1; resize: none; min-height: 42px; max-height: 120px; margin: 0;
  padding: 10px 12px; border: 1px solid var(--lmm-line); border-radius: 10px;
  font: inherit; font-size: 15px; line-height: 1.4; color: var(--lmm-text); background: #fff;
}
.lmm-input:focus { outline: none; border-color: var(--lmm-primary); }
.lmm-send {
  flex: 0 0 42px; width: 42px; height: 42px; border: 0; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--lmm-send); color: var(--lmm-on-send); cursor: pointer;
}
.lmm-send:hover { filter: brightness(0.88); }
.lmm-send:disabled { opacity: 0.5; cursor: default; }
.lmm-send svg { width: 20px; height: 20px; }

/* Op mobiel boven de vaste "In winkelwagen"-balk van de productpagina */
@media (max-width: 768px) {
  .single-product .lmm-launcher { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* Mobiel: compacte ronde knop, venster schermvullend */
@media (max-width: 560px) {
  .lmm-launcher { right: 14px; bottom: 14px; width: 52px; height: 52px; padding: 0; justify-content: center; border-radius: 50%; }
  .lmm-launcher span { display: none; }
  .lmm-launcher svg { width: 22px; height: 22px; }
  .lmm-panel { inset: 0; width: auto; height: auto; border-radius: 0; }
  .lmm-is-open, .lmm-is-open body { overflow: hidden; }
  .lmm-form { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
