/* ============================================================
   FUSION PC — "פיוז" AI shopping advisor widget
   Reuses design tokens from styles.css (teal accent, ink, Heebo/Rubik)
   RTL. Self-contained widget: launcher + floating panel.
   ============================================================ */

/* ---------- launcher (bottom-left in RTL) ---------- */
.fa-launch {
  position: fixed; inset-block-end: 24px; inset-inline-end: 24px; z-index: 120;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(150deg, var(--ink) 0%, #1b1f29 100%);
  color: #fff; padding: 10px 18px 10px 12px; border-radius: 999px;
  box-shadow: 0 14px 38px rgba(13,15,19,.32), 0 0 0 1px rgba(255,255,255,.05) inset;
  cursor: pointer; font-family: var(--font-disp); font-weight: 600; font-size: 15px;
  transition: transform .22s cubic-bezier(.2,.9,.3,1.2), box-shadow .25s, opacity .2s;
}
.fa-launch:hover { transform: translateY(-3px); box-shadow: 0 20px 48px rgba(13,15,19,.4), var(--sh-teal); }
.fa-launch:active { transform: translateY(0); }
.fa-launch.gone { opacity: 0; visibility: hidden; transform: translateY(14px) scale(.9); }
.fa-launch .fa-orb {
  position: relative; width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 32% 28%, var(--teal-bright), var(--teal) 45%, #04786c 100%);
  display: grid; place-items: center; color: #04302b;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset;
}
.fa-launch .fa-orb svg { width: 22px; height: 22px; }
.fa-launch .fa-orb::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid var(--teal); opacity: .55; animation: faPulse 2.4s ease-out infinite;
}
@keyframes faPulse { 0% { transform: scale(.85); opacity: .6; } 70%,100% { transform: scale(1.35); opacity: 0; } }
.fa-launch .fa-launch-txt { display: flex; flex-direction: column; line-height: 1.15; }
.fa-launch .fa-launch-txt b { font-weight: 700; font-size: 15px; }
.fa-launch .fa-launch-txt small { font-weight: 600; font-size: 11px; color: var(--teal-bright); letter-spacing: .02em; }

/* ---------- panel ---------- */
.fa-panel {
  position: fixed; inset-block-end: 24px; inset-inline-end: 24px; z-index: 130;
  width: 408px; max-width: calc(100vw - 32px); height: 640px; max-height: calc(100vh - 48px);
  background: #fff; border-radius: 22px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(13,15,19,.34), 0 0 0 1px rgba(13,15,19,.06);
  transform: translateY(20px) scale(.96); opacity: 0; visibility: hidden; transform-origin: bottom left;
  transition: transform .3s cubic-bezier(.2,.9,.3,1.15), opacity .25s, visibility .25s;
}
.fa-panel.open { transform: none; opacity: 1; visibility: visible; }
.fa-panel.expanded { width: 540px; height: calc(100vh - 48px); }

/* header */
.fa-head {
  position: relative; flex: none; padding: 18px 18px 16px;
  background: linear-gradient(150deg, var(--ink) 0%, #161a23 100%); color: #fff; overflow: hidden;
}
.fa-head::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 82% -10%, var(--teal-glow), transparent 52%); opacity: .6;
}
.fa-head-row { position: relative; display: flex; align-items: center; gap: 13px; }
.fa-ava {
  position: relative; width: 46px; height: 46px; border-radius: 14px; flex: none;
  background: linear-gradient(150deg, #0a0c10, #1d212a); display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.fa-ava::after { content: ""; position: absolute; inset: 0; border-radius: 14px; background: radial-gradient(circle at 30% 25%, var(--teal-glow), transparent 62%); }
.fa-ava svg { position: relative; z-index: 2; width: 24px; height: 24px; color: var(--teal-bright); }
.fa-head h3 { font-family: var(--font-disp); font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.fa-head .fa-on { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-body); font-weight: 600; font-size: 11px; color: var(--teal-bright); }
.fa-head .fa-on i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 var(--teal); animation: faDot 1.8s infinite; }
@keyframes faDot { 0% { box-shadow: 0 0 0 0 rgba(0,214,189,.6); } 70%,100% { box-shadow: 0 0 0 6px rgba(0,214,189,0); } }
.fa-head p { font-size: 12.5px; color: #aab2c0; margin: 3px 0 0; }
.fa-head-tools { margin-inline-start: auto; display: flex; gap: 4px; }
.fa-head-tools button {
  width: 34px; height: 34px; border-radius: 10px; color: #cfd5df; display: grid; place-items: center;
  transition: background .2s, color .2s;
}
.fa-head-tools button:hover { background: rgba(255,255,255,.1); color: #fff; }
.fa-head-tools svg { width: 19px; height: 19px; }

/* body / message stream */
.fa-body {
  flex: 1; overflow-y: auto; padding: 20px 18px 8px;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(0,214,189,.05), transparent 60%),
    var(--bg-soft);
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.fa-body::-webkit-scrollbar { width: 7px; }
.fa-body::-webkit-scrollbar-thumb { background: #d6dae1; border-radius: 999px; }

.fa-msg { display: flex; gap: 9px; margin-bottom: 14px; align-items: flex-end; }
.fa-msg .fa-mava {
  width: 30px; height: 30px; border-radius: 9px; flex: none; align-self: flex-start; margin-top: 2px;
  background: linear-gradient(150deg, var(--ink), #20242e); display: grid; place-items: center;
}
.fa-msg .fa-mava svg { width: 16px; height: 16px; color: var(--teal-bright); }
.fa-bubble {
  font-size: 14.5px; line-height: 1.55; padding: 11px 15px; border-radius: 16px;
  max-width: 80%; word-break: break-word;
}
.fa-bubble strong { font-weight: 700; }
.fa-bubble a.inl { color: var(--teal-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.fa-msg.bot .fa-bubble { background: #fff; border: 1px solid var(--line); border-end-start-radius: 5px; color: var(--ink); box-shadow: var(--sh-1); }
.fa-msg.user { flex-direction: row-reverse; }
.fa-msg.user .fa-bubble { background: var(--ink); color: #fff; border-end-end-radius: 5px; }
.fa-msg .fa-stack { display: flex; flex-direction: column; gap: 9px; max-width: 84%; }
.fa-msg .fa-stack .fa-bubble { max-width: 100%; }

/* typing indicator */
.fa-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.fa-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--slate-2); animation: faType 1.2s infinite; }
.fa-typing i:nth-child(2) { animation-delay: .16s; }
.fa-typing i:nth-child(3) { animation-delay: .32s; }
@keyframes faType { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* product card inside chat */
.fa-prod {
  display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 11px;
  background: #fff; border: 1px solid var(--line); border-radius: 15px;
  transition: border-color .2s, box-shadow .25s, transform .2s;
}
.fa-prod:hover { border-color: transparent; box-shadow: var(--sh-2); transform: translateY(-2px); }
.fa-prod .fa-prod-ph { width: 76px; height: 76px; border-radius: 11px; font-size: 13px; font-weight: 800; }
.fa-prod-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fa-prod-brand { font-family: var(--font-disp); font-weight: 700; font-size: 10.5px; letter-spacing: .08em; color: var(--slate-2); }
.fa-prod-name {
  font-family: var(--font-disp); font-weight: 600; font-size: 13.5px; line-height: 1.3; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fa-prod-name:hover { color: var(--teal-deep); }
.fa-prod-specs { display: flex; flex-wrap: wrap; gap: 4px; }
.fa-prod-specs .sp { font-size: 10px; font-weight: 600; color: var(--slate); background: var(--bg-soft); padding: 2px 6px; border-radius: 5px; direction: ltr; }
.fa-prod-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.fa-prod-price { font-family: var(--font-disp); font-weight: 800; font-size: 16px; color: var(--ink); direction: ltr; }
.fa-prod-price .old { font-size: 11px; font-weight: 600; color: var(--slate-2); text-decoration: line-through; margin-inline-start: 5px; }
.fa-prod-add {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  background: var(--teal); color: #04302b; font-family: var(--font-disp); font-weight: 700; font-size: 12px;
  padding: 7px 12px; border-radius: 9px; transition: background .2s, transform .15s;
}
.fa-prod-add:hover { background: var(--teal-bright); }
.fa-prod-add:active { transform: scale(.95); }
.fa-prod-add svg { width: 14px; height: 14px; }
.fa-prod-add.added { background: #e9fbf7; color: var(--teal-deep); }

/* quick reply chips */
.fa-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 6px 39px; }
.fa-chip {
  font-family: var(--font-disp); font-weight: 600; font-size: 13px; color: var(--ink);
  background: #fff; border: 1.4px solid var(--line); padding: 8px 14px; border-radius: 999px;
  transition: border-color .2s, color .2s, background .2s, transform .15s;
}
.fa-chip:hover { border-color: var(--teal); color: var(--teal-deep); background: #f3fdfb; }
.fa-chip:active { transform: scale(.96); }

/* error note */
.fa-note { font-size: 12.5px; color: var(--warn); background: rgba(255,92,57,.08); border: 1px solid rgba(255,92,57,.2); padding: 9px 13px; border-radius: 12px; }

/* footer / composer */
.fa-foot { flex: none; padding: 12px 14px 14px; background: #fff; border-top: 1px solid var(--line); }
.fa-form { display: flex; align-items: flex-end; gap: 8px; }
.fa-input {
  flex: 1; border: 1.5px solid var(--line); border-radius: 18px; background: var(--bg-soft);
  padding: 11px 16px; font-family: var(--font-body); font-size: 14.5px; color: var(--ink);
  resize: none; max-height: 110px; line-height: 1.45; transition: border-color .2s, background .2s, box-shadow .2s;
}
.fa-input::placeholder { color: var(--slate-2); }
.fa-input:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 4px rgba(0,214,189,.1); }
.fa-send {
  width: 44px; height: 44px; border-radius: 50%; flex: none; background: var(--ink); color: #fff;
  display: grid; place-items: center; transition: background .2s, transform .15s, opacity .2s;
}
.fa-send:hover { background: var(--teal); color: #04302b; }
.fa-send:active { transform: scale(.92); }
.fa-send:disabled { opacity: .4; pointer-events: none; }
.fa-send svg { width: 20px; height: 20px; }
.fa-foot .fa-disc { text-align: center; font-size: 10.5px; color: var(--slate-2); margin-top: 8px; }
.fa-foot .fa-disc b { color: var(--teal-deep); font-weight: 700; }

@media (max-width: 520px) {
  .fa-panel { inset: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .fa-panel.expanded { width: 100vw; height: 100dvh; }
  .fa-launch { inset-block-end: 16px; inset-inline-end: 16px; }
}
