/* =====================================================================
   Appslin — WhatsApp chat assistant (v11). Replaces the Elfsight widget.
   Site navy + blue for the chat, WhatsApp green only for WhatsApp actions.
   ===================================================================== */
.wac {
  --wac-navy: #0a1f44; --wac-navy-2: #14305f; --wac-blue: #1c4ed8;
  --wac-green: #25d366; --wac-green-ink: #0b7a3b;
  --wac-bg: #eef2f8; --wac-line: #dbe2ee; --wac-ink: #0b1a33; --wac-muted: #5b6780;
  font-family: inherit; color: var(--wac-ink);
}
.wac *, .wac *::before, .wac *::after { box-sizing: border-box; }

/* hide the old widgets this replaces */
.hx-wa, [class^="elfsight-app-4ce0833b"], [class*=" elfsight-app-4ce0833b"] { display: none !important; }

/* ---------- floating button (same spot as before) ---------- */
.wac-fab {
  position: fixed; z-index: 95;
  right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 60px; height: 60px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--wac-green); color: #fff;
  box-shadow: 0 12px 28px rgba(18, 140, 70, .38), 0 2px 6px rgba(0, 0, 0, .12);
  transition: transform .2s ease, background-color .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.wac-fab svg { width: 32px; height: 32px; }
.wac-fab:hover { transform: translateY(-2px); }
.wac-fab:focus-visible { outline: 3px solid var(--wac-blue); outline-offset: 3px; }
.wac-fab-dot { position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; border-radius: 50%; background: #ff3b30; border: 2px solid #fff; }
.wac.is-seen .wac-fab-dot { display: none; }
.wac.is-open .wac-fab { background: var(--wac-navy); box-shadow: 0 12px 28px rgba(10, 31, 68, .35); }
.wac.is-open .wac-fab svg { display: none; }
.wac.is-open .wac-fab::before, .wac.is-open .wac-fab::after { content: ""; position: absolute; width: 22px; height: 2.5px; border-radius: 2px; background: #fff; transform: rotate(45deg); }
.wac.is-open .wac-fab::after { transform: rotate(-45deg); }
.wac.is-open .wac-fab-dot { display: none; }

/* ---------- panel ---------- */
.wac-panel {
  position: fixed; z-index: 96;
  right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  width: min(370px, calc(100vw - 24px)); height: min(560px, calc(100vh - 120px)); height: min(560px, calc(100dvh - 120px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 20px; box-shadow: 0 30px 70px rgba(10, 31, 68, .28), 0 4px 14px rgba(10, 31, 68, .1);
  opacity: 0; transform: translateY(14px) scale(.98); transform-origin: 100% 100%;
  transition: opacity .2s ease, transform .22s ease;
}
.wac-panel[hidden] { display: none; }
.wac.is-open .wac-panel { opacity: 1; transform: none; }

.wac-head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; background: var(--wac-navy); color: #fff; }
.wac-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; color: var(--wac-navy); background: linear-gradient(140deg, #f3d68a, #c9993f); }
.wac-who { display: grid; gap: 1px; min-width: 0; flex: 1; }
.wac-who b { font-size: 1rem; line-height: 1.2; }
.wac-who small { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: #b9c6de; }
.wac-online { width: 8px; height: 8px; border-radius: 50%; background: var(--wac-green); box-shadow: 0 0 0 3px rgba(37, 211, 102, .2); }
.wac-close { width: 38px; height: 38px; flex: none; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; cursor: pointer; }
.wac-close svg { width: 18px; height: 18px; }
.wac-close:hover { background: rgba(255, 255, 255, .18); }
.wac-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.wac-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 10px; display: flex; flex-direction: column; gap: 8px; background: var(--wac-bg); -webkit-overflow-scrolling: touch; }

.wac-msg { max-width: 84%; padding: 9px 13px; border-radius: 16px; font-size: .92rem; line-height: 1.45; word-wrap: break-word; animation: wac-in .22s ease both; }
.wac-bot { align-self: flex-start; background: #fff; border: 1px solid var(--wac-line); border-bottom-left-radius: 5px; }
.wac-me { align-self: flex-end; background: var(--wac-blue); color: #fff; border-bottom-right-radius: 5px; }
.wac-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.wac-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa6bd; animation: wac-dot 1s infinite ease-in-out; }
.wac-typing i:nth-child(2) { animation-delay: .15s; }
.wac-typing i:nth-child(3) { animation-delay: .3s; }

.wac-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 2px; justify-content: flex-end; animation: wac-in .22s ease both; }
.wac-chip { border: 1.5px solid var(--wac-blue); background: #fff; color: var(--wac-blue); font: inherit; font-size: .88rem; font-weight: 600; padding: 8px 14px; border-radius: 100px; cursor: pointer; transition: background-color .15s, color .15s; }
.wac-chip:hover { background: var(--wac-blue); color: #fff; }
.wac-chip:focus-visible { outline: 3px solid rgba(28, 78, 216, .35); outline-offset: 2px; }

.wac-done { display: grid; gap: 8px; padding: 6px 0 2px; animation: wac-in .22s ease both; }
.wac-go { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 18px; border-radius: 14px; background: var(--wac-green); color: #fff; font-weight: 700; font-size: .98rem; text-decoration: none; box-shadow: 0 10px 22px rgba(18, 140, 70, .28); }
.wac-go:hover { color: #fff; filter: brightness(1.04); }
.wac-go svg { width: 22px; height: 22px; }
.wac-restart { justify-self: center; border: 0; background: none; color: var(--wac-muted); font: inherit; font-size: .82rem; text-decoration: underline; cursor: pointer; padding: 4px 8px; }

/* ---------- footer: text box + agent ---------- */
.wac-foot { padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--wac-line); display: grid; gap: 8px; }
.wac-input { display: flex; gap: 8px; }
.wac-input[hidden] { display: none; }
.wac-input input { flex: 1; min-width: 0; height: 46px; border: 1.5px solid var(--wac-line); border-radius: 12px; padding: 0 14px; font: inherit; font-size: 16px; color: var(--wac-ink); background: #fff; }
.wac-input input:focus { outline: none; border-color: var(--wac-blue); box-shadow: 0 0 0 3px rgba(28, 78, 216, .15); }
.wac-send { width: 46px; height: 46px; flex: none; border: 0; border-radius: 12px; background: var(--wac-blue); color: #fff; display: grid; place-items: center; cursor: pointer; }
.wac-send svg { width: 20px; height: 20px; }
.wac-err { margin: 0; font-size: .8rem; color: #b42318; }
.wac-err[hidden] { display: none; }
.wac-agent { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border-radius: 12px; border: 1.5px solid var(--wac-green); color: var(--wac-green-ink); font-weight: 700; font-size: .9rem; text-decoration: none; }
.wac-agent:hover { background: #e9faf0; color: var(--wac-green-ink); }
.wac-agent svg { width: 18px; height: 18px; color: var(--wac-green); }
.wac-agent:focus-visible, .wac-go:focus-visible, .wac-send:focus-visible { outline: 3px solid rgba(28, 78, 216, .4); outline-offset: 2px; }

@keyframes wac-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes wac-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }

/* ---------- phones: bottom sheet, button above nothing else ---------- */
@media (max-width: 760px) {
  .wac-fab { width: 56px; height: 56px; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .wac-fab svg { width: 30px; height: 30px; }
  .wac-panel { left: 8px; right: 8px; width: auto; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); height: min(560px, calc(100vh - 96px)); height: min(560px, calc(100dvh - 96px)); border-radius: 18px; }
  .hx-modal-open .wac, .hx-nav-open .wac { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wac-panel, .wac-msg, .wac-chips, .wac-done, .wac-fab { transition: none; animation: none; }
  .wac-typing i { animation: none; }
}
