/* ==========================================================================
   Orbex website assistant (free, built-in chat) – uses the site's own colours
   ========================================================================== */
#ox-assistant {
  --oxa-dark: var(--ox-heading, var(--heading-color, #3e0925));
  --oxa-accent: var(--ox-accent, var(--accent-color, #6c95d9));
  --oxa-ease: cubic-bezier(.22, .61, .36, 1);
  position: fixed; right: 20px; bottom: 20px; z-index: 1050;
  font-family: var(--default-font, inherit); font-size: 14px; line-height: 1.5;
}
/* the back-to-top button moves up so the two never overlap */
.scroll-top.active { bottom: 92px !important; }

/* ---------- launcher ---------- */
.oxa-launch {
  position: relative; width: 58px; height: 58px; border: 0; border-radius: 50%; cursor: pointer;
  color: #fff; font-size: 1.45rem; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--oxa-dark), var(--oxa-accent));
  box-shadow: 0 10px 28px -8px color-mix(in srgb, var(--oxa-dark), transparent 25%);
  transition: transform .3s var(--oxa-ease), box-shadow .3s var(--oxa-ease);
}
.oxa-launch:hover { transform: translateY(-3px) scale(1.04); }
.oxa-launch:focus-visible { outline: 3px solid var(--oxa-accent); outline-offset: 3px; }
.oxa-launch::after {           /* soft pulse ring, three times on load */
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--oxa-accent), transparent 40%);
  animation: oxa-pulse 2.4s ease-out 2s 3;
}
@keyframes oxa-pulse { to { box-shadow: 0 0 0 16px transparent; } }
.oxa-launch i { grid-area: 1 / 1; transition: transform .3s var(--oxa-ease), opacity .2s; }
.oxa-ico-close { opacity: 0; transform: rotate(-90deg) scale(.6); }
#ox-assistant.is-open .oxa-ico-open { opacity: 0; transform: rotate(90deg) scale(.6); }
#ox-assistant.is-open .oxa-ico-close { opacity: 1; transform: none; }

/* ---------- teaser bubble ---------- */
.oxa-teaser {
  position: absolute; right: 70px; bottom: 8px; width: max-content; max-width: 230px; cursor: pointer;
  padding: 10px 30px 10px 14px; border-radius: 14px 14px 4px 14px; background: #fff; color: var(--oxa-dark);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .3); font-weight: 500;
  animation: oxa-pop .45s cubic-bezier(.34, 1.56, .64, 1) both;
}
.oxa-teaser[hidden] { display: none; }
.oxa-teaser-x { position: absolute; top: 2px; right: 6px; border: 0; background: none; font-size: 1.1rem; line-height: 1; color: #888; cursor: pointer; }
@keyframes oxa-pop { from { opacity: 0; transform: translateY(8px) scale(.9); } }

/* ---------- panel ---------- */
.oxa-panel {
  margin: 0; padding: 0;
  position: absolute; right: 0; bottom: 74px; width: 370px; height: min(580px, calc(100vh - 120px));
  display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: #fff;
  box-shadow: 0 24px 60px -16px rgba(20, 10, 30, .38), 0 0 0 1px rgba(0, 0, 0, .04);
  transform-origin: bottom right; opacity: 0; transform: translateY(14px) scale(.96);
  transition: opacity .22s var(--oxa-ease), transform .3s var(--oxa-ease);
}
#ox-assistant.is-open .oxa-panel { opacity: 1; transform: none; }
.oxa-panel[hidden] { display: none; }

.oxa-head {
  margin: 0;
  display: flex; align-items: center; gap: 10px; padding: 14px 12px 14px 16px; color: #fff;
  background: linear-gradient(120deg, var(--oxa-dark), color-mix(in srgb, var(--oxa-dark), var(--oxa-accent) 45%));
}
.oxa-head > div:nth-child(2) { flex: 1; min-width: 0; }
.oxa-head h2 { margin: 0; font-size: 1rem; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oxa-head p { margin: 0; font-size: .75rem; opacity: .85; }
.oxa-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; margin-right: 3px; vertical-align: 1px; }
.oxa-avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); font-size: 1.15rem; }
.oxa-head button { border: 0; background: rgba(255, 255, 255, .12); color: #fff; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; transition: background-color .2s; }
.oxa-head button:hover { background: rgba(255, 255, 255, .26); }

.oxa-log { flex: 1; overflow-y: auto; padding: 16px 14px 6px; background: color-mix(in srgb, var(--oxa-accent), #fff 94%); scroll-behavior: smooth; }
.oxa-msg { display: flex; flex-direction: column; margin-bottom: 10px; }
.oxa-bubble { max-width: 86%; padding: 9px 13px; border-radius: 16px; word-wrap: break-word; }
.oxa-bot .oxa-bubble { align-self: flex-start; background: #fff; color: #2b2b2b; border-bottom-left-radius: 5px; box-shadow: 0 2px 8px rgba(0, 0, 0, .05); }
.oxa-user .oxa-bubble { align-self: flex-end; background: var(--oxa-dark); color: #fff; border-bottom-right-radius: 5px; }
.oxa-bubble a { color: var(--oxa-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.oxa-bubble ul { margin: 6px 0 2px; padding-left: 18px; }
.oxa-bubble li { margin-bottom: 2px; }
.oxa-bubble .oxa-sum { list-style: none; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--oxa-accent), #fff 90%); }
.oxa-in { animation: oxa-rise .35s var(--oxa-ease) both; }
@keyframes oxa-rise { from { opacity: 0; transform: translateY(8px); } }

.oxa-typing .oxa-bubble { display: inline-flex; gap: 4px; padding: 12px 14px; }
.oxa-typing span { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--oxa-dark), transparent 55%); animation: oxa-blink 1s infinite; }
.oxa-typing span:nth-child(2) { animation-delay: .15s; }
.oxa-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes oxa-blink { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* product results */
.oxa-cards { display: grid; gap: 6px; margin-top: 6px; max-width: 92%; }
.oxa-card {
  display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 7px; border-radius: 12px; background: #fff; color: inherit; text-decoration: none;
  border: 1px solid rgba(0, 0, 0, .06); transition: transform .2s var(--oxa-ease), box-shadow .2s;
}
.oxa-card:hover { transform: translateX(3px); box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .25); }
.oxa-card img { grid-row: 1 / span 2; width: 52px; height: 52px; object-fit: contain; border-radius: 8px; background: #f5f5f7; }
.oxa-card-t { font-weight: 600; color: var(--oxa-dark); line-height: 1.3; font-size: .86rem; }
.oxa-card-c { font-size: .74rem; color: #777; }
.oxa-card:not(:has(img)) { grid-template-columns: 1fr; }

/* suggestion chips */
.oxa-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; background: color-mix(in srgb, var(--oxa-accent), #fff 94%); }
.oxa-chips:empty { display: none; }
.oxa-chip {
  border: 1px solid color-mix(in srgb, var(--oxa-accent), transparent 45%); background: #fff; color: var(--oxa-dark);
  border-radius: 999px; padding: 5px 12px; font-size: .8rem; font-weight: 500; cursor: pointer;
  transition: background-color .2s, color .2s, transform .2s;
}
.oxa-chip:hover { background: var(--oxa-accent); color: #fff; transform: translateY(-1px); }

.oxa-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid rgba(0, 0, 0, .06); background: #fff; }
.oxa-form input { flex: 1; min-width: 0; border: 1px solid rgba(0, 0, 0, .12); border-radius: 999px; padding: 9px 15px; font-size: .9rem; outline: none; transition: border-color .2s, box-shadow .2s; }
.oxa-form input:focus { border-color: var(--oxa-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--oxa-accent), transparent 80%); }
.oxa-form button { width: 40px; height: 40px; flex: 0 0 40px; border: 0; border-radius: 50%; background: var(--oxa-accent); color: #fff; cursor: pointer; transition: transform .2s; }
.oxa-form button:hover { transform: scale(1.06); }

/* ---------- phones: panel becomes a bottom sheet ---------- */
@media (max-width: 575px) {
  #ox-assistant { right: 14px; bottom: 14px; }
  .oxa-launch { width: 54px; height: 54px; }
  .oxa-panel { position: fixed; left: 8px; right: 8px; bottom: 80px; width: auto; height: min(70vh, calc(100vh - 100px)); }
  .oxa-teaser { max-width: 190px; }
  .scroll-top.active { bottom: 82px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .oxa-launch::after, .oxa-in, .oxa-teaser { animation: none; }
  .oxa-panel, .oxa-launch, .oxa-launch i { transition: none; }
}
@media print { #ox-assistant { display: none; } }
