/* Excella — chat op ikwilbedrukken.nl */

.ikwbex, .ikwbex * { box-sizing: border-box; }

.ikwbex {
  --rood: #e4022b;
  --rood-diep: #b00121;
  --inkt: #14161a;
  --grijs: #6b7280;
  --lijn: #ececf0;
  --zacht: #f6f7f9;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99998;
  font-family: system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  color: var(--inkt);
}

.ikwbex--hoog { bottom: 96px; }

/* ---------- Belletje ---------- */
.ikwbex__bel {
  width: 60px; height: 60px; border: 0; border-radius: 50%;
  background: linear-gradient(140deg, #ff2f52 0%, var(--rood) 46%, var(--rood-diep) 100%);
  box-shadow: 0 10px 28px rgba(228, 2, 43, .32), 0 2px 6px rgba(0,0,0,.14);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .22s cubic-bezier(.2,.9,.3,1.2), box-shadow .22s ease;
  position: relative;
}
.ikwbex__bel:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 34px rgba(228,2,43,.4); }
.ikwbex__bel:active { transform: scale(.96); }
.ikwbex__bel svg { width: 27px; height: 27px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.ikwbex__stip {
  position: absolute; top: 2px; right: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: #22c55e; border: 2.5px solid #fff;
}
.ikwbex__stip--uit { background: #f59e0b; }

.ikwbex__tip {
  position: absolute; right: 74px; top: 50%; transform: translateY(-50%);
  background: #fff; border: 1px solid var(--lijn); border-radius: 14px;
  padding: 9px 14px; font-size: 13.5px; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(16,20,28,.12); opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.ikwbex__tip--aan { opacity: 1; transform: translateY(-50%) translateX(0); }

/* ---------- Venster ---------- */
.ikwbex__venster {
  position: absolute; right: 0; bottom: 74px;
  width: 384px; max-width: calc(100vw - 32px);
  height: 566px; max-height: calc(100vh - 200px); min-height: 360px;
  background: #fff; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--lijn);
  box-shadow: 0 24px 60px rgba(16,20,28,.22), 0 2px 8px rgba(16,20,28,.08);
  display: none; flex-direction: column;
  transform-origin: bottom right;
  animation: ikwbex-op .26s cubic-bezier(.2,.9,.3,1.1);
}
.ikwbex--open .ikwbex__venster { display: flex; }
@keyframes ikwbex-op { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }

.ikwbex__kop {
  background: linear-gradient(135deg, var(--rood) 0%, var(--rood-diep) 100%);
  color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 12px;
}
.ikwbex__foto {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 42px;
  background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; letter-spacing: .5px;
  border: 1.5px solid rgba(255,255,255,.35);
}
.ikwbex__wie { flex: 1; min-width: 0; }
.ikwbex__naam { font-weight: 640; font-size: 15.5px; line-height: 1.2; }
.ikwbex__status { font-size: 12.5px; opacity: .9; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.ikwbex__status i { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; display: inline-block; }
.ikwbex__status.uit i { background: #fbbf24; }
.ikwbex__dicht {
  background: rgba(255,255,255,.14); border: 0; color: #fff; width: 32px; height: 32px;
  border-radius: 10px; cursor: pointer; font-size: 17px; line-height: 1; display: flex;
  align-items: center; justify-content: center; transition: background .18s;
}
.ikwbex__dicht:hover { background: rgba(255,255,255,.26); }

.ikwbex__loop { flex: 1; overflow-y: auto; padding: 18px 16px 8px; background: var(--zacht); scroll-behavior: smooth; }
.ikwbex__loop::-webkit-scrollbar { width: 8px; }
.ikwbex__loop::-webkit-scrollbar-thumb { background: #d8dbe0; border-radius: 8px; }

.ikwbex__zeg { max-width: 84%; margin-bottom: 12px; animation: ikwbex-in .28s ease both; }
@keyframes ikwbex-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ikwbex__zeg p {
  margin: 0; padding: 11px 15px; border-radius: 18px; font-size: 14.5px; line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word;
}
.ikwbex__zeg--zij { margin-right: auto; }
.ikwbex__zeg--zij p { background: #fff; border: 1px solid var(--lijn); border-bottom-left-radius: 6px; }
.ikwbex__zeg--ik { margin-left: auto; }
.ikwbex__zeg--ik p { background: linear-gradient(135deg, var(--rood) 0%, var(--rood-diep) 100%); color: #fff; border-bottom-right-radius: 6px; }
.ikwbex__zeg a { color: inherit; text-decoration: underline; }

.ikwbex__tikt { display: flex; gap: 4px; padding: 13px 16px; background: #fff; border: 1px solid var(--lijn); border-radius: 18px; border-bottom-left-radius: 6px; width: fit-content; margin-bottom: 12px; }
.ikwbex__tikt span { width: 7px; height: 7px; border-radius: 50%; background: #c3c7ce; animation: ikwbex-tik 1.3s infinite; }
.ikwbex__tikt span:nth-child(2) { animation-delay: .18s; }
.ikwbex__tikt span:nth-child(3) { animation-delay: .36s; }
@keyframes ikwbex-tik { 0%,60%,100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Kaartjes in het gesprek (nummer vragen, bestelling opzoeken) */
.ikwbex__kaart {
  background: #fff; border: 1px solid var(--lijn); border-radius: 16px;
  padding: 14px; margin-bottom: 12px; animation: ikwbex-in .28s ease both;
}
.ikwbex__kaart h4 { margin: 0 0 4px; font-size: 14px; font-weight: 640; }
.ikwbex__kaart p { margin: 0 0 10px; font-size: 13px; color: var(--grijs); line-height: 1.45; }
.ikwbex__kaart input {
  width: 100%; padding: 10px 12px; border: 1px solid #dfe2e7; border-radius: 11px;
  font-size: 14px; margin-bottom: 8px; font-family: inherit; background: #fff; color: var(--inkt);
}
.ikwbex__kaart input:focus { outline: 0; border-color: var(--rood); box-shadow: 0 0 0 3px rgba(228,2,43,.12); }
.ikwbex__kaart button {
  width: 100%; padding: 10px; border: 0; border-radius: 11px; cursor: pointer;
  background: var(--inkt); color: #fff; font-size: 14px; font-weight: 560; font-family: inherit;
  transition: opacity .18s;
}
.ikwbex__kaart button:hover { opacity: .88; }

/* Snelle vragen */
.ikwbex__snel { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px 12px; background: var(--zacht); }
.ikwbex__snel button {
  border: 1px solid var(--lijn); background: #fff; border-radius: 999px;
  padding: 7px 13px; font-size: 12.8px; cursor: pointer; color: var(--inkt);
  font-family: inherit; transition: border-color .18s, transform .12s;
}
.ikwbex__snel button:hover { border-color: var(--rood); transform: translateY(-1px); }

/* Invoer */
.ikwbex__voet { border-top: 1px solid var(--lijn); background: #fff; padding: 11px 12px; }
.ikwbex__rij { display: flex; align-items: flex-end; gap: 9px; }
.ikwbex__rij textarea {
  flex: 1; border: 1px solid #dfe2e7; border-radius: 14px; padding: 11px 14px;
  font-size: 14.5px; font-family: inherit; resize: none; max-height: 120px; line-height: 1.45;
  background: #fff; color: var(--inkt);
}
.ikwbex__rij textarea:focus { outline: 0; border-color: var(--rood); box-shadow: 0 0 0 3px rgba(228,2,43,.1); }
.ikwbex__stuur {
  width: 42px; height: 42px; flex: 0 0 42px; border: 0; border-radius: 13px; cursor: pointer;
  background: linear-gradient(135deg, var(--rood) 0%, var(--rood-diep) 100%);
  display: flex; align-items: center; justify-content: center; transition: transform .16s, opacity .16s;
}
.ikwbex__stuur:disabled { opacity: .4; cursor: default; }
.ikwbex__stuur:not(:disabled):hover { transform: scale(1.06); }
.ikwbex__stuur svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ikwbex__klein { text-align: center; font-size: 11px; color: #9aa0a8; margin: 7px 0 0; }

@media (max-width: 560px) {
  .ikwbex { right: 14px; bottom: 14px; }
  .ikwbex__venster {
    position: fixed; right: 0; left: 0; bottom: 0; top: 0;
    width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ikwbex *, .ikwbex *::before { animation: none !important; transition: none !important; }
}
