/* ── Chatassistent (zie includes/chatbot.php en assets/js/chat.js) ───────────── */
.cb-panel {
  position: fixed; right: 1.75rem; bottom: 1.75rem; z-index: 2100; /* boven de cookiebalk (2000) */
  width: 390px; height: min(640px, calc(100vh - 3.5rem)); height: min(640px, calc(100dvh - 3.5rem));
  display: flex; flex-direction: column; background: #fff; border-radius: 22px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.24), 0 4px 16px rgba(0,0,0,.08);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; color: #161616;
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(.98); transform-origin: bottom right;
  transition: opacity .22s ease, transform .22s cubic-bezier(.16,1,.3,1), visibility .22s;
}
.cb-panel.open { opacity: 1; visibility: visible; transform: none; }

.cb-head { display: flex; align-items: center; gap: .7rem; padding: .85rem .9rem .85rem 1rem; border-bottom: 1px solid #EEECE8; flex-shrink: 0; }
.cb-avatar { width: 38px; height: 38px; border-radius: 12px; background: #FBE8DE; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cb-avatar img { width: 26px; height: 26px; }
.cb-title { flex: 1; min-width: 0; }
.cb-title strong { display: block; font-size: .95rem; }
.cb-title span { display: block; font-size: .74rem; color: #64748b; }
.cb-title .cb-tag { display: inline; color: #1D4ED8; font-weight: 700; }
.cb-icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: none; background: none; color: #64748b; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem; text-decoration: none; flex-shrink: 0;
}
.cb-icon-btn:hover, .cb-icon-btn:focus-visible { background: #F6F5F2; color: #161616; outline: none; }
.cb-icon-btn.is-wa { color: #16A34A; }

.cb-body { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; background: #FAF9F7; overscroll-behavior: contain; }
.cb-msg { max-width: 86%; padding: .7rem .9rem; border-radius: 16px; font-size: .9rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.cb-msg.is-bot { align-self: flex-start; background: #fff; border: 1px solid #EEECE8; border-bottom-left-radius: 6px; }
.cb-msg.is-user { align-self: flex-end; background: #C04218; color: #fff; border-bottom-right-radius: 6px; }
.cb-msg.is-agent { align-self: flex-start; background: #0F0F0F; color: #fff; border-bottom-left-radius: 6px; }
.cb-author { display: block; font-size: .7rem; font-weight: 700; color: #FBBF9F; margin-bottom: .2rem; }
.cb-notice { align-self: center; text-align: center; font-size: .74rem; color: #64748b; background: #EEECE8; border-radius: 100px; padding: .3rem .8rem; max-width: 92%; line-height: 1.4; }
/* Lopend gesprek terwijl het venster dicht is: kaartje boven de knop (zie updateResume in chat.js) */
.cf-resume-box { position: relative; }
.cf-resume-box[hidden] { display: none; }
.whatsapp-fab-wrap.has-session .wa-bubble, .whatsapp-fab-wrap.menu-open .cf-resume-box { display: none; }
.cf-resume {
  display: flex; align-items: center; gap: .7rem; width: 270px; max-width: calc(100vw - 2.5rem);
  background: #fff; color: #0F0F0F; border: none; border-radius: 18px; padding: .65rem .9rem .65rem .65rem;
  box-shadow: 0 10px 32px rgba(0,0,0,.2); font: inherit; text-align: left; cursor: pointer; position: relative;
  animation: cf-resume-in .3s cubic-bezier(.16,1,.3,1);
}
.cf-resume:hover { box-shadow: 0 12px 36px rgba(0,0,0,.26); }
.cf-resume:focus-visible { outline: 3px solid #C04218; outline-offset: 3px; }
.cf-resume-av { width: 40px; height: 40px; border-radius: 12px; background: #FBE8DE; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; }
.cf-resume-av img { width: 27px; height: 27px; }
.cf-resume-av::after { content: ''; position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; background: #22C55E; border: 2px solid #fff; }
.cf-resume-text { flex: 1; min-width: 0; }
.cf-resume-text strong { display: block; font-size: .84rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-resume-msg {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: .78rem; line-height: 1.4; color: #64748b; margin-top: .1rem;
}
.cf-resume.has-msg .cf-resume-msg { color: #0F0F0F; }
.cf-resume.has-msg { box-shadow: 0 10px 32px rgba(0,0,0,.2), 0 0 0 2px #C04218; }
.cf-resume-count {
  position: absolute; top: -7px; left: -7px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: #C04218; color: #fff; font-size: .72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.cf-resume-count[hidden] { display: none; }
.cf-resume-close {
  position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
  background: #fff; color: #64748b; box-shadow: 0 2px 8px rgba(0,0,0,.2); display: flex; align-items: center; justify-content: center; font-size: .8rem;
}
.cf-resume-close:hover { color: #0F0F0F; }
.cf-resume.pop { animation: cf-resume-pop .5s cubic-bezier(.16,1,.3,1); }
@keyframes cf-resume-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes cf-resume-pop { 0% { transform: translateY(8px) scale(.94); opacity: .4; } 60% { transform: translateY(-3px) scale(1.02); opacity: 1; } 100% { transform: none; } }
@media (max-width: 640px) { .cf-resume { width: 250px; } }
@media (prefers-reduced-motion: reduce) { .cf-resume, .cf-resume.pop { animation: none; } }

/* Nieuw bericht terwijl het venster dicht is: stip op de groene knop */
.whatsapp-fab.has-new::after { content: ''; position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: #C04218; border: 2px solid #fff; }
.cb-msg.is-error { align-self: flex-start; background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }

.cb-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.cb-chip { -webkit-appearance: none; appearance: none; border: 1.5px solid #E8E7E4; background: #fff; border-radius: 100px; padding: .45rem .8rem; font: inherit; font-size: .8rem; font-weight: 600; color: #161616; cursor: pointer; text-align: left; }
.cb-chip:hover { border-color: #C04218; color: #C04218; }

.cb-cards { align-self: stretch; display: flex; flex-direction: column; gap: .45rem; }
.cb-card { display: grid; grid-template-columns: 46px 1fr auto; gap: .65rem; align-items: center; background: #fff; border: 1px solid #EEECE8; border-radius: 14px; padding: .5rem .6rem .5rem .5rem; }
.cb-card-img { width: 46px; height: 46px; border-radius: 10px; background: #EEE9DF; overflow: hidden; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .75rem; color: #94a3b8; }
.cb-card-img img { width: 100%; height: 100%; object-fit: cover; }
.cb-card-name { font-size: .84rem; font-weight: 700; line-height: 1.3; color: #161616; text-decoration: none; display: block; }
.cb-card-name:hover { color: #C04218; }
.cb-card-price { font-size: .76rem; color: #C04218; font-weight: 700; margin-top: .1rem; }
.cb-add { border: none; background: #0F0F0F; color: #fff; border-radius: 10px; padding: .45rem .7rem; font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: .3rem; }
.cb-add:hover { background: #C04218; }
.cb-add.is-done { background: #16A34A; cursor: default; }
.cb-card-act { display: flex; align-items: center; gap: .3rem; }
.cb-qty { display: inline-flex; align-items: center; border: 1.5px solid #0F0F0F; border-radius: 10px; overflow: hidden; }
.cb-qty button { -webkit-appearance: none; appearance: none; width: 30px; height: 30px; border: none; background: #fff; color: #0F0F0F; font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; }
.cb-qty button:hover { background: #F6F5F2; }
.cb-qty span { min-width: 26px; text-align: center; font-size: .82rem; font-weight: 700; color: #0F0F0F; }
.cb-remove { -webkit-appearance: none; appearance: none; width: 30px; height: 30px; border: none; border-radius: 9px; background: none; color: #94a3b8; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
.cb-remove:hover { background: #FEF2F2; color: #b91c1c; }
.cb-add-all.is-undo { border-color: #94a3b8; color: #64748b; }
.cb-cartbar { display: flex; align-items: center; gap: .65rem; background: #0F0F0F; color: #fff; text-decoration: none; border-radius: 14px; padding: .6rem .8rem; margin-bottom: .55rem; }
.cb-cartbar > i { font-size: 1.2rem; color: #FBBF9F; }
.cb-cartbar > span:nth-child(2) { flex: 1; min-width: 0; }
.cb-cartbar strong { display: block; font-size: .82rem; }
.cb-cartbar small { display: block; font-size: .7rem; color: rgba(255,255,255,.65); }
.cb-cartbar-go { font-size: .8rem; font-weight: 700; color: #FBBF9F; white-space: nowrap; display: inline-flex; align-items: center; gap: .2rem; }
.cb-cartbar:hover .cb-cartbar-go { text-decoration: underline; }
.cb-paused { display: flex; gap: .55rem; align-items: flex-start; background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; border-radius: 12px; padding: .65rem .8rem; font-size: .8rem; line-height: 1.45; margin-bottom: .55rem; }
.cb-paused a { color: #991B1B; font-weight: 700; }
.cb-cartbar[hidden], .cb-paused[hidden] { display: none; }
.cb-add-all { align-self: flex-start; border: 1.5px solid #0F0F0F; background: #fff; color: #0F0F0F; border-radius: 10px; padding: .45rem .75rem; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.cb-add-all:hover { background: #0F0F0F; color: #fff; }
.cb-add-all.is-done { border-color: #16A34A; color: #16A34A; background: #fff; cursor: default; }

.cb-wa { align-self: flex-start; display: inline-flex; align-items: center; gap: .45rem; background: #25D366; color: #fff; text-decoration: none; border-radius: 12px; padding: .55rem .85rem; font-size: .84rem; font-weight: 700; }
.cb-wa:hover { background: #1EBE5A; }

.cb-typing { align-self: flex-start; display: inline-flex; gap: .3rem; background: #fff; border: 1px solid #EEECE8; border-radius: 16px; border-bottom-left-radius: 6px; padding: .8rem .9rem; }
.cb-typing span { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: cb-dot 1.2s ease-in-out infinite; }
.cb-typing span:nth-child(2) { animation-delay: .15s; }
.cb-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cb-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }

.cb-foot { border-top: 1px solid #EEECE8; padding: .65rem .75rem .7rem; background: #fff; flex-shrink: 0; }
.cb-form { display: flex; align-items: flex-end; gap: .5rem; }
.cb-input {
  flex: 1; resize: none; border: 1.5px solid #E8E7E4; border-radius: 14px; padding: .65rem .85rem; max-height: 120px;
  font: inherit; font-size: 16px; line-height: 1.4; color: #161616; background: #fff;
}
.cb-input:focus { outline: none; border-color: #C04218; box-shadow: 0 0 0 3px rgba(192,66,24,.12); }
.cb-send { width: 44px; height: 44px; border-radius: 14px; border: none; background: #C04218; color: #fff; font-size: 1.15rem; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cb-send:hover { background: #9A3412; }
.cb-send:disabled { opacity: .45; cursor: default; }
.cb-input { overflow-y: hidden; scrollbar-width: thin; }
.cb-wait { display: flex; align-items: center; gap: .55rem; background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; border-radius: 12px; padding: .55rem .8rem; font-size: .8rem; font-weight: 600; margin-bottom: .55rem; }
.cb-wait-dot { width: 9px; height: 9px; border-radius: 50%; background: #F59E0B; flex-shrink: 0; animation: cb-dot 1.2s ease-in-out infinite; }
.cb-about { display: flex; align-items: center; gap: .45rem; background: #FBE8DE; color: #9A3412; border-radius: 10px; padding: .4rem .5rem .4rem .7rem; font-size: .8rem; font-weight: 600; margin-bottom: .5rem; }
.cb-about span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-about button { border: none; background: none; color: inherit; cursor: pointer; padding: .1rem .25rem; font-size: .9rem; }
.cb-wait[hidden], .cb-about[hidden], .cb-icon-btn[hidden] { display: none; }
.cb-user-about { display: flex; align-items: center; gap: .3rem; margin-top: .4rem; padding-top: .35rem; border-top: 1px solid rgba(255,255,255,.3); font-size: .75rem; font-weight: 600; opacity: .9; }
.cb-agent-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: .45rem; border: 1.5px solid #0F0F0F; background: #fff; color: #0F0F0F; border-radius: 12px; padding: .55rem .85rem; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }
.cb-agent-btn:hover { background: #0F0F0F; color: #fff; }
.cb-restart {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: .45rem; padding: .8rem 1rem;
  border: none; border-radius: 14px; background: #C04218; color: #fff; font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer;
}
.cb-restart:hover { background: #9A3412; }
.cb-restart[hidden], .cb-form[hidden] { display: none; }
.cb-note { font-size: .68rem; color: #94a3b8; line-height: 1.4; margin-top: .45rem; text-align: center; }

@media (max-width: 640px) {
  /* Volledig scherm; chat.js zet top en hoogte gelijk aan het zichtbare deel (boven het toetsenbord) */
  .cb-panel {
    top: 0; left: 0; right: 0; bottom: auto; width: 100%; height: 100%; height: 100dvh; border-radius: 0;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
    transform-origin: bottom center; overscroll-behavior: contain;
  }
  .cb-panel.kb-open { padding-bottom: 0; }   /* toetsenbord open: geen extra ruimte voor de thuisbalk */
  .cb-panel.kb-open .cb-note { display: none; }
  html.cb-lock, html.cb-lock body { overflow: hidden; overscroll-behavior: none; }
  body.cb-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .cb-panel { transition: none; }
  .cb-typing span { animation: none; }
}

/* ── Ingangen naar Toby op de pagina's (includes/toby.php) ───────────────────── */
.toby-link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; color: #C04218; text-decoration: none; cursor: pointer; }
.toby-link i { font-size: 1.05em; }
.toby-link:hover span, .toby-link:focus-visible span { text-decoration: underline; text-underline-offset: 3px; }
.toby-link--light { color: #FBBF9F; }
.toby-link--plain { color: inherit; font-weight: inherit; display: inline; }
.toby-card {
  display: flex; align-items: center; gap: 1rem; max-width: 640px; margin: 1rem auto 0; padding: 1.1rem 1.25rem;
  background: #fff; border: 1.5px solid #E8E7E4; border-radius: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
  text-decoration: none; color: #161616; transition: border-color .2s, transform .2s, box-shadow .2s;
}
.toby-card:hover { border-color: #C04218; transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.1); }
.toby-card-av { width: 48px; height: 48px; border-radius: 14px; background: #FBE8DE; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; }
.toby-card-av img { width: 32px; height: 32px; }
.toby-card-av::after { content: ''; position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%; background: #22C55E; border: 2px solid #fff; }
.toby-card-text { flex: 1; min-width: 0; text-align: left; }
.toby-card-text strong { display: block; font-size: 1rem; margin-bottom: .15rem; }
.toby-card-text > span { display: block; font-size: .86rem; color: #64748b; line-height: 1.5; }
.toby-card-text em { display: inline-flex; align-items: center; gap: .3rem; margin-top: .35rem; font-style: normal; font-size: .72rem; font-weight: 600; color: #1D4ED8; }
.toby-card-go { display: inline-flex; align-items: center; gap: .4rem; flex-shrink: 0; padding: .6rem 1rem; border-radius: 12px; background: #C04218; color: #fff; font-size: .84rem; font-weight: 700; transition: background .2s; }
.toby-card:hover .toby-card-go { background: #9A3412; }
.faq-toby, .cart-toby, .fg-toby, .nf-toby { margin-top: .9rem; font-size: .9rem; color: #64748b; }
.cart-toby { font-size: .82rem; margin-top: .75rem; }
.catering-toby { margin-top: .6rem; font-size: .875rem; }
@media (max-width: 600px) {
  .toby-card { padding: 1rem; gap: .8rem; }
  .toby-card-go { padding: .6rem; }
  .toby-card-go span { display: none; }
}
