/* Scripted chat demo for the Lekker Fix page. Uses the colour tokens defined in index.html. */
/* Launcher is an icon square in the right-hand stack (WhatsApp below, back-to-top above) so it never sits on the page's own buttons. */
.chat-launch{position:fixed;right:16px;bottom:84px;z-index:300;width:48px;height:48px;background:var(--yellow);color:var(--ink);border:0;cursor:pointer;padding:0;display:inline-flex;align-items:center;justify-content:center;clip-path:polygon(0 0,100% 0,100% 80%,80% 100%,0 100%);transition:background .2s,transform .2s var(--ease)}
.chat-launch-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.chat-launch:hover{background:var(--white)}
.chat-launch svg{width:22px;height:22px}
.chat-launch[aria-expanded="true"]{display:none}

.chat{position:fixed;right:24px;bottom:24px;z-index:400;width:380px;max-width:calc(100vw - 32px);height:560px;max-height:calc(100vh - 110px);background:var(--grey);border:1px solid var(--line);border-top:3px solid var(--yellow);display:flex;flex-direction:column;box-shadow:0 24px 60px rgba(0,0,0,.6)}
.chat-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid var(--line)}
.chat-title{font-family:var(--display);font-size:22px;letter-spacing:.05em;line-height:1}
.chat-sub{font-size:12px;color:var(--mid);margin-top:4px}
.chat-close{background:none;border:1px solid var(--line);color:var(--white);width:40px;height:40px;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.chat-close:hover{color:var(--accent);border-color:var(--yellow)}
.chat-close svg{width:18px;height:18px}

.chat-log{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:10px;overscroll-behavior:contain}
.chat-msg{max-width:84%;padding:10px 14px;font-size:15px;line-height:1.45;animation:chat-in .3s var(--ease) both}
.chat-msg.bot{align-self:flex-start;background:var(--grey-2);border-left:3px solid var(--yellow)}
.chat-msg.user{align-self:flex-end;background:var(--yellow);color:var(--ink)}
.chat-msg.note{align-self:stretch;max-width:none;background:none;border:1px dashed rgba(245,196,0,.35);color:var(--mid);font-size:13px}
.chat-msg a{color:var(--accent);font-weight:700}
.chat-typing{align-self:flex-start;background:var(--grey-2);border-left:3px solid var(--yellow);padding:14px;display:flex;gap:5px}
.chat-typing i{width:6px;height:6px;background:var(--mid);border-radius:50%;animation:chat-dot 1s infinite}
.chat-typing i:nth-child(2){animation-delay:.15s}
.chat-typing i:nth-child(3){animation-delay:.3s}
@keyframes chat-in{from{opacity:0;transform:translateY(8px)}}
@keyframes chat-dot{0%,60%,100%{opacity:.3}30%{opacity:1}}

.chat-chips{display:flex;flex-wrap:wrap;gap:8px;padding:0 16px 12px}
.chat-chip{font-family:var(--body);font-size:14px;font-weight:500;background:none;color:var(--accent);border:1px solid var(--yellow);padding:10px 14px;cursor:pointer;min-height:42px;transition:background .2s,color .2s}
.chat-chip:hover{background:var(--yellow);color:var(--ink)}

.chat-form{display:flex;border-top:1px solid var(--line)}
.chat-form input{flex:1;min-width:0;background:var(--black);border:0;color:var(--white);font-family:var(--body);font-size:16px;padding:16px}
.chat-form input:focus{outline:2px solid var(--yellow);outline-offset:-2px}
.chat-form input::placeholder{color:rgba(var(--hair),.4)}
.chat-form button{font-family:var(--display);font-size:17px;letter-spacing:.08em;background:var(--yellow);color:var(--ink);border:0;padding:0 20px;cursor:pointer}
.chat-form button:hover{background:var(--white)}

@media (max-width:600px){
  /* On phones the launcher docks into the right end of the Call/WhatsApp bar and slides in with it. */
  .chat-launch{right:0;bottom:env(safe-area-inset-bottom);width:64px;height:64px;z-index:301;clip-path:none;border-left:1px solid var(--ink)}
  .js body:not(.scrolled) .chat-launch{transform:translateY(calc(100% + env(safe-area-inset-bottom)))}
  .chat{left:0;right:0;bottom:0;width:auto;max-width:none;height:min(78vh,620px);max-height:none;border-left:0;border-right:0}
}
@media (prefers-reduced-motion:reduce){
  .chat-msg,.chat-typing i{animation:none}
  .chat-launch,.chat-chip{transition:none}
}
[data-theme="light"] .chat-launch:hover,[data-theme="light"] .chat-form button:hover{background:var(--ink);color:var(--yellow)}
