/* The AI sales assistant's chat window. Colours, font and corners come from the design's own variables, so it
   matches every theme and the owner's colour choices; the fallbacks only apply to designs that don't set them. */
.bx-assist { --bx-p: var(--primary, #111); --bx-on: var(--on-primary, #fff); --bx-bg: var(--bg, #fff); --bx-tx: var(--text, #111); --bx-mu: var(--muted, #6b6b73); --bx-ln: var(--line, #e7e7ea); --bx-sf: var(--surface, #f5f5f7); --bx-r: var(--radius, 12px); font-family: var(--font, system-ui, sans-serif); }
.bx-assist [hidden] { display: none !important; }
.bx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.bx-fab { position: fixed; z-index: 86; bottom: 24px; inset-inline-end: 24px; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; background: var(--bx-p); color: var(--bx-on); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.22); transition: transform .2s ease, box-shadow .2s ease; }
.bx-fab:hover { transform: scale(1.07); box-shadow: 0 14px 34px rgba(0,0,0,.28); }
.bx-fab:active { transform: scale(.96); }
.bx-fab:focus-visible, .bx-assist button:focus-visible, .bx-assist a:focus-visible, .bx-assist textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--bx-p) 45%, transparent); outline-offset: 2px; }
.bx-open .bx-fab { transform: scale(.9); }
/* The back-to-top button moves up so it doesn't sit under the assistant. */
html:has(.bx-assist) .to-top { bottom: 168px; }

.bx-panel { position: fixed; z-index: 190; bottom: 96px; inset-inline-end: 24px; width: min(390px, calc(100vw - 32px)); height: min(600px, calc(100vh - 130px)); display: flex; flex-direction: column; background: var(--bx-bg); color: var(--bx-tx); border: 1px solid var(--bx-ln); border-radius: calc(var(--bx-r) + 6px); box-shadow: 0 24px 60px rgba(0,0,0,.22); overflow: hidden; animation: bx-in .22s ease; }
.bx-assist[style*='--bx-lift'] .bx-fab { bottom: var(--bx-lift); }
.bx-assist[style*='--bx-lift'] .bx-panel { bottom: calc(var(--bx-lift) + 72px); height: min(600px, calc(100vh - var(--bx-lift) - 104px)); }
@keyframes bx-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .bx-panel { animation: none; } .bx-fab { transition: none; } }

.bx-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 12px 16px; background: var(--bx-p); color: var(--bx-on); }
.bx-head strong { font-size: 15px; flex: 1; }
.bx-dot { width: 9px; height: 9px; border-radius: 50%; background: #34d27b; box-shadow: 0 0 0 3px rgba(52,210,123,.25); }
.bx-link { background: none; border: 0; color: inherit; opacity: .85; font: inherit; font-size: 12.5px; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.bx-link:hover { opacity: 1; background: rgba(255,255,255,.14); }
.bx-x { background: none; border: 0; color: inherit; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.bx-x:hover { background: rgba(255,255,255,.16); }

.bx-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bx-sf); overscroll-behavior: contain; }
.bx-msg { max-width: 88%; }
.bx-msg p { margin: 0; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.bx-bot { align-self: flex-start; }
.bx-bot p { background: var(--bx-bg); border: 1px solid var(--bx-ln); border-start-start-radius: 4px; }
.bx-me { align-self: flex-end; }
.bx-me p { background: var(--bx-p); color: var(--bx-on); border-end-end-radius: 4px; }
.bx-typing p { color: var(--bx-mu); animation: bx-pulse 1.2s ease-in-out infinite; }
@keyframes bx-pulse { 50% { opacity: .45; } }

.bx-cards { display: grid; gap: 8px; margin-top: 8px; }
.bx-card { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; background: var(--bx-bg); border: 1px solid var(--bx-ln); border-radius: var(--bx-r); padding: 8px; }
.bx-card-img img { width: 64px; height: 64px; object-fit: cover; border-radius: calc(var(--bx-r) - 4px); display: block; background: var(--bx-sf); }
.bx-card-body { display: grid; gap: 3px; min-width: 0; justify-items: start; }
.bx-card-name { color: inherit; text-decoration: none; font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bx-card-name:hover { text-decoration: underline; }
.bx-price { font-size: 13.5px; font-weight: 700; }
.bx-price s { color: var(--bx-mu); font-weight: 400; margin-inline-start: 4px; text-decoration-thickness: 1.5px; }

.bx-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--bx-p); background: var(--bx-p); color: var(--bx-on); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; transition: filter .15s ease, transform .15s ease; }
.bx-btn:hover { filter: brightness(1.08); }
.bx-btn:active { transform: scale(.97); }
.bx-ghost { background: transparent; color: var(--bx-tx); border-color: var(--bx-ln); }
.bx-ghost:hover { border-color: var(--bx-p); filter: none; }
.bx-wa { background: #25d366; border-color: #25d366; color: #fff; }
.bx-loading { opacity: .6; pointer-events: none; }

.bx-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; background: var(--bx-sf); }
.bx-chip { border: 1px solid var(--bx-ln); background: var(--bx-bg); color: var(--bx-tx); border-radius: 99px; padding: 7px 12px; font: inherit; font-size: 12.5px; cursor: pointer; transition: border-color .15s ease; }
.bx-chip:hover { border-color: var(--bx-p); }

.bx-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--bx-ln); background: var(--bx-bg); }
.bx-form textarea { flex: 1; resize: none; border: 1px solid var(--bx-ln); border-radius: 20px; padding: 10px 14px; font: inherit; font-size: 14px; line-height: 1.4; max-height: 120px; background: var(--bx-bg); color: var(--bx-tx); }
.bx-form textarea:focus { border-color: var(--bx-p); outline: none; }
.bx-send { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0; background: var(--bx-p); color: var(--bx-on); display: grid; place-items: center; cursor: pointer; transition: transform .15s ease; }
.bx-send:hover { transform: scale(1.06); }
.bx-send:active { transform: scale(.94); }
[dir="rtl"] .bx-send svg { transform: scaleX(-1); }
.bx-note { margin: 0; padding: 0 14px 10px; font-size: 11px; color: var(--bx-mu); background: var(--bx-bg); line-height: 1.4; }

@media (max-width: 720px) {
  .bx-fab { bottom: 78px; inset-inline-end: 16px; width: 52px; height: 52px; }
  .bx-panel, .bx-assist[style*='--bx-lift'] .bx-panel { inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; }
  .bx-panel { animation: none; }
  html.bx-assist-open, html.bx-assist-open body { overflow: hidden; }
  .bx-form { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}
