/* Hulp bij kiezen (assistent.js, window.ShopAssistant): de knop rechtsonder en het gesprekspaneel.
   Gedeeld door Komodo Hardware en Referbo. Alleen de variabelen van de winkels, zodat elke winkel zijn eigen kleuren
   houdt: --paper, --ink, --muted, --line, --bg, --orange (accent: Komodo groen, Referbo paars), --orange-soft en
   --brand-400. Lagen: vergelijkbalk 40, deze knop en het paneel 45, vensters van de winkel 50, melding 100. */

.assistent-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---- Knop ------------------------------------------------------------------------------------------------------------- */
.assistent-knop {
  position: fixed; right: 20px; bottom: 20px; z-index: 45;
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 18px 10px 14px;
  border: 0; border-radius: 999px; background: var(--orange); color: #fff;
  font: inherit; font-size: 15px; font-weight: 700; line-height: 1.2; cursor: pointer;
  box-shadow: 0 8px 24px rgb(0 0 0 / .18);
}
.assistent-knop:hover { filter: brightness(.94); }
.assistent-knop:focus-visible { outline: 3px solid var(--brand-400, var(--ink)); outline-offset: 3px; }
.assistent-knop i[data-icon] { width: 20px; height: 20px; }
.assistent-knop.is-open { display: none; }
body.vergelijk-balk-zichtbaar .assistent-knop { bottom: calc(var(--vergelijk-balk-hoogte, 80px) + 16px); }

/* ---- Paneel ------------------------------------------------------------------------------------------------------------ */
.assistent-paneel {
  position: fixed; right: 20px; bottom: 20px; z-index: 45;
  display: flex; flex-direction: column; width: min(400px, calc(100vw - 40px)); height: min(620px, calc(100vh - 40px));
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper, #fff); color: var(--ink);
  box-shadow: 0 18px 60px rgb(0 0 0 / .2); overflow: hidden; font-size: 14px; line-height: 1.5;
}
.assistent-paneel[hidden] { display: none !important; }
body.vergelijk-balk-zichtbaar .assistent-paneel {
  bottom: calc(var(--vergelijk-balk-hoogte, 80px) + 16px);
  height: min(620px, calc(100vh - var(--vergelijk-balk-hoogte, 80px) - 40px));
}
@media (prefers-reduced-motion: no-preference) {
  .assistent-paneel { animation: assistent-in .18s ease-out; }
  @keyframes assistent-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}
.assistent-kop { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line); background: var(--orange-soft, var(--bg)); }
.assistent-kop h2 { margin: 0; color: var(--ink); font-size: 17px; font-weight: 800; letter-spacing: -.2px; line-height: 1.3; }
.assistent-kop p { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.assistent-sluiten {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -4px -4px 0 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer;
}
.assistent-sluiten:hover { background: rgb(0 0 0 / .06); }
.assistent-sluiten:focus-visible { outline: 3px solid var(--brand-400, var(--orange)); outline-offset: 0; }

/* ---- Gesprek ----------------------------------------------------------------------------------------------------------- */
.assistent-log { position: relative; display: flex; flex: 1 1 auto; flex-direction: column; gap: 10px; min-height: 0; padding: 14px; overflow-y: auto; overscroll-behavior: contain; }
.assistent-log:focus-visible { outline: 3px solid var(--brand-400, var(--orange)); outline-offset: -3px; }
.assistent-bericht { max-width: 88%; padding: 9px 12px; border-radius: 12px; overflow-wrap: anywhere; }
.assistent-bericht p { margin: 0 0 6px; line-height: 1.5; }
.assistent-bericht p:last-of-type { margin-bottom: 0; }
.assistent-bericht.van-hulp { align-self: flex-start; border: 1px solid var(--line); border-bottom-left-radius: 4px; background: var(--bg, #f6f6f4); }
.assistent-bericht.van-klant { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--orange); color: #fff; }
.assistent-bericht.van-hulp:has(.assistent-artikelen) { max-width: 100%; }
.assistent-bezig p { color: var(--muted); font-style: italic; }
@media (prefers-reduced-motion: no-preference) {
  .assistent-bezig { animation: assistent-puls 1.4s ease-in-out infinite; }
  @keyframes assistent-puls { 50% { opacity: .55; } }
}

.assistent-artikelen { display: grid; gap: 8px; margin: 10px 0 2px; padding: 0; list-style: none; }
.assistent-artikel { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper, #fff); }
.assistent-artikel img { width: 64px; height: 48px; object-fit: contain; }
.assistent-artikel-tekst { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.assistent-artikel-tekst > small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.assistent-artikel-naam { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; line-height: 1.35; text-align: left; cursor: pointer; }
.assistent-artikel-naam:hover { text-decoration: underline; }
.assistent-artikel-naam:focus-visible, .assistent-chip:focus-visible, .assistent-link:focus-visible { outline: 3px solid var(--brand-400, var(--orange)); outline-offset: 2px; }
.assistent-artikel-prijs { margin-top: 2px; }
.assistent-artikel-prijs .price { display: block; font-size: 15px; line-height: 1.3; }
.assistent-artikel-prijs small { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; }
.assistent-voorraad { color: var(--ink) !important; font-weight: 600; }
.assistent-voorraad.uit { color: var(--muted) !important; }
.assistent-verschillen { margin: 4px 0 0; padding-left: 16px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.assistent-artikel-knoppen { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.assistent-artikel-knoppen .button { min-height: 36px; padding: 6px 12px; font-size: 13px; }

.assistent-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.assistent-chip {
  min-height: 36px; padding: 6px 12px; border: 1px solid var(--orange); border-radius: 999px; background: var(--paper, #fff);
  color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; line-height: 1.3; text-align: left; cursor: pointer;
}
.assistent-chip:hover { background: var(--orange-soft, var(--bg)); }

/* ---- Invoer ------------------------------------------------------------------------------------------------------------ */
.assistent-invoer { display: flex; gap: 8px; padding: 10px 12px 8px; border-top: 1px solid var(--line); background: var(--paper, #fff); }
.assistent-invoer input {
  flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); font: inherit; font-size: 16px;
}
.assistent-invoer input:focus-visible { outline: 3px solid var(--brand-400, var(--orange)); outline-offset: 0; border-color: var(--orange); }
.assistent-invoer .assistent-verstuur { flex: none; min-height: 44px; padding: 0 16px; }
.assistent-voet { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0 12px 10px; background: var(--paper, #fff); }
.assistent-link { padding: 2px 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.assistent-link:hover { color: var(--ink); }

/* ---- Smal scherm: het paneel vult het scherm, de knop wordt korter ---------------------------------------------------- */
@media (max-width: 600px) {
  .assistent-knop { right: 12px; bottom: 12px; min-height: 44px; padding: 8px 14px 8px 12px; font-size: 14px; }
  .assistent-knop-lang { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  body.vergelijk-balk-zichtbaar .assistent-knop { bottom: calc(var(--vergelijk-balk-hoogte, 64px) + 10px); }
  .assistent-paneel, body.vergelijk-balk-zichtbaar .assistent-paneel { inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; }
  body.assistent-open { overflow: hidden; }
  .assistent-bericht { max-width: 94%; }
}
