/*
 * cx-assistant.css — the canvas chat assistant (MKT-WP-REPLICA-CHATBOT). Canvas
 * Main.dc.html l.584-632 (`.cb-*`), rewritten on the --cx-* tokens; the canvas line of
 * each value is in brackets. Markup: inc/cx-assistant.php; behaviour: assets/js/cx-assistant.js.
 *
 * TOKENS ONLY. The few canvas colours that are not brand tokens are declared once in the
 * :root block below, with their canvas line; everything else binds style.css (brand tokens
 * and the GLOW TOKENS block, e.g. --cx-azul-suave for the canvas rgba(110,155,255,…)).
 *
 * MOTION. What moves (panel and bubble entrance, message slide-in, typing dots, the
 * launcher's lift) is under `:where(html.cx-motion)` and `prefers-reduced-motion:
 * no-preference` (docs/knowledge/motion-module.md §3). Without it the panel opens and
 * closes instantly and nothing is ever hidden by an animation. The mascot's sway is the
 * motion module's own `cx-sway` (float-pulse piece: one pass, no pause control,
 * MKT-WP-MOTION-NO-AUTOPLAY-NO-PAUSE-BUTTONS).
 *
 * DEVIATIONS FROM THE CANVAS, MEASURED (C:/tmp/wp-redesign-lanes/chatbot/harness):
 *   - every button is at least 44 x 44 px (close, bubble dismiss and the suggestion pills
 *     were 32, 20 and ~30 px): the close and dismiss keep their 32 / 20 px circle inside
 *     the larger hit area; the pills grow to 44 px;
 *   - status line #F5F7FA instead of #C9D1DC: on the header gradient's #1D5FFF start
 *     #C9D1DC is 3.3:1 for 12 px text, #F5F7FA is 4.7:1;
 *   - visitor bubble and send button end their gradient where white keeps 4.5:1 (bubble,
 *     mix 60/40 of #1D5FFF and #3D74FF) and the send arrow keeps 3:1 (--cx-turquesa-deep,
 *     the theme's accessible action gradient), instead of #3D74FF and #18C9D7;
 *   - placeholder in the muted on-dark token (6.5:1), focus ring on every control;
 *   - the mobile layout switches at the kit's 767 px instead of the canvas' 560 px.
 *
 * SPECIFICITY. Every rule is scoped under `.cx-assistant` (0,2,0 and up) so Hello
 * Elementor's reset (`[type=button]:hover` 0,2,0, loaded earlier) never paints its pink
 * button on the assistant. Nothing here can reach an Elementor widget: the assistant is
 * printed by the theme at the end of <body>, outside every Elementor document; its classes
 * are classified `not_widget` in scripts/theme_widget_hooks.json.
 */

:root {
  /* Start cards [l.588 .cb-start button background]. */
  --cx-assistant-card: #0b2247;
  /* Composer and note band [l.626 .cb-form, l.630 .cb-note]. */
  --cx-assistant-form: #0a2046;
  /* Light turquoise of links and pills [l.616 .cb-m p a, l.624 .cb-q button]. */
  --cx-assistant-link: #7fe6ee;
  /* Light end of the launcher's radial [l.592] and the visitor bubble [l.618]. */
  --cx-assistant-blue-light: #3d74ff;
  /* The bubble's dismiss circle [l.602]. */
  --cx-assistant-tip-close: #e3e8ef;
  /* Shadow colour rgb(3, 10, 25) of the panel, bubble and mascot [l.594, 600, 603], as channels. */
  --cx-assistant-shadow: 221 78.6% 5.5%;
}

/* ------------------------------------------------------------------ base */
/* `hidden` wins over the display each part sets below (0,3,0 against their 0,2,0). */
.cx-assistant[hidden],
.cx-assistant .cx-assistant__tip[hidden],
.cx-assistant .cx-assistant__quick[hidden] {
  display: none;
}

.cx-assistant .cx-assistant__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* While the cookie banner is on screen the launcher, the bubble and the window are not painted
 * (cx-assistant.js sets data-cx-banner from the banner's own state; MKT-WP-REPLICA-CHATBOT-
 * BANNER-OVERLAP). `display: none` also takes them out of the tab order. 0,3,0 against the
 * parts' own 0,2,0 `display`. */
.cx-assistant[data-cx-banner] .cx-assistant__launch,
.cx-assistant[data-cx-banner] .cx-assistant__tip,
.cx-assistant[data-cx-banner] .cx-assistant__panel {
  display: none;
}

.cx-assistant :is(button, input, a):focus-visible {
  outline: 2px solid var(--cx-turquesa);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ launcher [l.592-599] */
.cx-assistant .cx-assistant__launch {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 95;
  display: block;
  width: 72px;
  height: 72px;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--cx-assistant-blue-light), var(--cx-azul-corporativo) 45%, var(--cx-azul-profundo));
  box-shadow: 0 14px 34px hsl(var(--cx-primary-hsl) / 0.45), 0 0 0 4px hsl(var(--cx-accent-hsl) / 0.18);
  color: var(--cx-blanco);
  cursor: pointer;
  transition: none;
}

.cx-assistant .cx-assistant__launch:is(:hover, :focus) {
  background: radial-gradient(circle at 35% 30%, var(--cx-assistant-blue-light), var(--cx-azul-corporativo) 45%, var(--cx-azul-profundo));
  color: var(--cx-blanco);
}
/* Hello Elementor 3.5's reset takes the shadow off a clicked <button> while it keeps the focus
 * (`button:focus:not(:focus-visible) { box-shadow: none }`, 0,2,1): the rest shadow again under any focus,
 * at 0,3,0. The keyboard focus and the hover below, 0,3,0 and printed later, still win
 * (MKT-WP-FOCUS-RING-HELLO-3-5-2; gate: check H of scripts/check_theme_focus_ring.py). */
.cx-assistant .cx-assistant__launch:focus {
  box-shadow: var(--cx-focus-now), 0 14px 34px hsl(var(--cx-primary-hsl) / 0.45), 0 0 0 4px hsl(var(--cx-accent-hsl) / 0.18);
}

/* WCAG 2.2 · 2.4.11 Focus Not Obscured (MKT-WP-REPLICA-HOME-RF-DOCK-FOCUS-OBSCURED): on a
 * phone the launcher (fixed, 60px, 96px up from the bottom edge, above the dock) reaches
 * higher than the dock does, so a control focused with Tab must scroll to above it.
 * `--cx-assistant-clear` = its distance to the bottom edge + its height + 32px (16px for the robot's head, which
 * stands about that far above the circle, and 16px of air: at 16 the ring of a field focused at the limit
 * ran under the head, MKT-WP-REPLICA-HOME-RF-FOCUS-PARTIAL-OVERLAPS), read by
 * `scroll-padding-bottom` in cexum-tb-chrome.css (DOCK block, together with the dock's own
 * value). The numbers repeat the launcher's `bottom` and `height` in the phone step below;
 * tests/test-cx-assistant.php holds the two places together. Only while the assistant is on
 * the page. Not on desktop (measured at 1440): with the dock's own padding no focused
 * control is left under the 72px corner button, and a larger padding there makes the browser
 * scroll the hero's coverflow dots to where the stats panel covers them. */
@media (max-width: 767px) {
  html:has(.cx-assistant:not([hidden])) {
    --cx-assistant-clear: calc(96px + 60px + 32px);
  }
}

/* `var(--cx-focus-now)`: the inner ring of the site's focus ring on keyboard focus (style.css,
 * MKT-WP-FOCUS-RING-ON-LIGHT-BANDS); the launcher floats over light bands too. */
.cx-assistant .cx-assistant__launch:is(:hover, :focus-visible) {
  box-shadow: var(--cx-focus-now), 0 18px 40px hsl(var(--cx-primary-hsl) / 0.55), 0 0 0 6px hsl(var(--cx-accent-hsl) / 0.22);
}

.cx-assistant .cx-assistant__mascot {
  position: absolute;
  /* Behind the launcher's own paint, above its background (the launcher is a stacking context): the robot's head
   * sticks out of the circle and, as a layer of its own (filter), painted over the focus ring there (3 of the
   * ring's sample points at the top right, MKT-WP-REPLICA-HOME-RF-FOCUS-PARTIAL-OVERLAPS). */
  z-index: -1;
  left: 50%;
  bottom: 4px;
  width: 78px;
  max-width: none;
  height: auto;
  translate: -46% 0;
  transform-origin: 50% 90%;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px hsl(var(--cx-assistant-shadow) / 0.35));
}

.cx-assistant .cx-assistant__launch-x {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--cx-blanco);
}

.cx-assistant.cx-assistant--open .cx-assistant__mascot {
  display: none;
}

.cx-assistant.cx-assistant--open .cx-assistant__launch-x {
  display: flex;
}

/* ------------------------------------------------------------------ greeting bubble [l.600-602] */
.cx-assistant .cx-assistant__tip {
  position: fixed;
  right: 108px;
  bottom: 44px;
  z-index: 95;
  max-width: 230px;
  padding: 12px 34px 12px 16px;
  border-radius: 16px 16px 4px 16px;
  background: var(--cx-blanco);
  color: var(--cx-azul-noche);
  font: 600 14px/1.4 var(--cx-font-sans);
  box-shadow: 0 14px 34px hsl(var(--cx-assistant-shadow) / 0.3);
  opacity: 0;
  pointer-events: none;
}

.cx-assistant .cx-assistant__tip.cx-assistant__tip--on {
  opacity: 1;
  pointer-events: auto;
}

.cx-assistant .cx-assistant__tip-text {
  margin: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

/* 44 px hit area centred on the canvas' 20 px circle (right 8 / top 8). */
.cx-assistant .cx-assistant__tip-close {
  position: absolute;
  top: -4px;
  right: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cx-text-muted);
  cursor: pointer;
  transition: none;
}

.cx-assistant .cx-assistant__tip-close:is(:hover, :focus) {
  background: transparent;
  color: var(--cx-text-muted);
}

.cx-assistant .cx-assistant__tip-x {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cx-assistant-tip-close);
}

/* ------------------------------------------------------------------ panel [l.603-610] */
.cx-assistant .cx-assistant__panel {
  position: fixed;
  right: 24px;
  bottom: 110px;
  z-index: 96;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 380px;
  height: min(580px, calc(100vh - 140px));
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--cx-azul-suave) 25%, transparent);
  border-radius: 24px;
  background: var(--cx-azul-noche);
  color: var(--cx-blanco-hielo);
  font-family: var(--cx-font-sans);
  line-height: normal;
  text-align: left;
  box-shadow: 0 30px 80px hsl(var(--cx-assistant-shadow) / 0.6);
  visibility: hidden;
  opacity: 0;
}

.cx-assistant.cx-assistant--open .cx-assistant__panel {
  visibility: visible;
  opacity: 1;
}

.cx-assistant .cx-assistant__head {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--cx-blanco) 8%, transparent);
  background: linear-gradient(135deg, var(--cx-azul-corporativo), var(--cx-azul-profundo) 70%);
}

.cx-assistant .cx-assistant__head-avatar {
  width: 44px;
  max-width: none;
  height: 44px;
  border-radius: 50%;
}

.cx-assistant .cx-assistant__name {
  margin: 0;
  color: var(--cx-blanco-hielo);
  font-size: 16px;
  font-weight: 700;
  line-height: normal;
}

.cx-assistant .cx-assistant__status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--cx-blanco-hielo);
  font-size: 12px;
  line-height: normal;
}

.cx-assistant .cx-assistant__status-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cx-verde-confirmacion);
}

/* 44 px hit area holding the canvas' 32 px circle; -6px keeps the circle where it was. */
.cx-assistant .cx-assistant__close {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -6px -6px -6px auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cx-blanco);
  cursor: pointer;
  transition: none;
}

.cx-assistant .cx-assistant__close:is(:hover, :focus) {
  background: transparent;
  color: var(--cx-blanco);
}

.cx-assistant .cx-assistant__close-x {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--cx-blanco) 12%, transparent);
}

/* ------------------------------------------------------------------ transcript [l.611-622] */
.cx-assistant .cx-assistant__scroll {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 18px 16px 8px;
  overflow-y: auto;
}

.cx-assistant .cx-assistant__log {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cx-assistant .cx-assistant__msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 88%;
}

.cx-assistant .cx-assistant__msg img {
  flex-shrink: 0;
  width: 28px;
  max-width: none;
  height: 28px;
  border-radius: 50%;
}

.cx-assistant .cx-assistant__bubble {
  margin: 0;
  padding: 10px 13px;
  overflow-wrap: anywhere;
  border: 1px solid color-mix(in srgb, var(--cx-azul-suave) 18%, transparent);
  border-radius: 16px 16px 16px 4px;
  background: var(--cx-azul-profundo);
  color: var(--cx-blanco-hielo);
  font-size: 14px;
  line-height: 1.5;
}

.cx-assistant .cx-assistant__bubble a,
.cx-assistant .cx-assistant__bubble a:is(:hover, :focus, :visited) {
  color: var(--cx-assistant-link);
  text-decoration: underline;
}

.cx-assistant .cx-assistant__msg--user {
  align-self: flex-end;
  justify-content: flex-end;
}

.cx-assistant .cx-assistant__msg--user .cx-assistant__bubble {
  border: 0;
  border-radius: 16px 16px 4px 16px;
  background: linear-gradient(135deg, var(--cx-azul-corporativo), color-mix(in srgb, var(--cx-azul-corporativo) 60%, var(--cx-assistant-blue-light)));
  color: var(--cx-blanco);
}

.cx-assistant .cx-assistant__msg--typing .cx-assistant__bubble {
  display: flex;
  gap: 4px;
  padding: 13px 14px;
}

.cx-assistant .cx-assistant__msg--typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: hsl(var(--cx-on-dark-subtle));
}

/* ------------------------------------------------------------------ start cards [l.586-590] */
.cx-assistant .cx-assistant__start {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}

.cx-assistant .cx-assistant__start-title {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  color: hsl(var(--cx-on-dark-subtle));
  font-size: 11px;
  font-weight: 700;
  line-height: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cx-assistant .cx-assistant__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--cx-azul-suave) 22%, transparent);
  border-radius: 14px;
  background: var(--cx-assistant-card);
  color: var(--cx-blanco-hielo);
  font: 600 13px/1.35 var(--cx-font-sans);
  text-align: left;
  white-space: normal;
  cursor: pointer;
  transition: none;
}

.cx-assistant .cx-assistant__card:is(:hover, :focus) {
  background: var(--cx-assistant-card);
  color: var(--cx-blanco-hielo);
}

.cx-assistant .cx-assistant__card:is(:hover, :focus-visible) {
  border-color: var(--cx-turquesa);
  background: var(--cx-azul-profundo);
}

.cx-assistant .cx-assistant__card svg {
  color: var(--cx-turquesa);
}

/* ------------------------------------------------------------------ suggestions [l.623-625] */
.cx-assistant .cx-assistant__quick {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 16px 10px;
}

.cx-assistant .cx-assistant__chip {
  flex: 0 1 auto;
  min-height: 44px;
  max-width: 100%;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid hsl(var(--cx-accent-hsl) / 0.4);
  border-radius: 999px;
  background: hsl(var(--cx-accent-hsl) / 0.08);
  color: var(--cx-assistant-link);
  font: 600 12.5px/1.3 var(--cx-font-sans);
  text-align: left;
  white-space: normal;
  cursor: pointer;
  transition: none;
}

.cx-assistant .cx-assistant__chip:is(:hover, :focus) {
  background: hsl(var(--cx-accent-hsl) / 0.08);
  color: var(--cx-assistant-link);
}

.cx-assistant .cx-assistant__chip:is(:hover, :focus-visible) {
  background: hsl(var(--cx-accent-hsl) / 0.2);
}

/* ------------------------------------------------------------------ composer [l.626-630] */
.cx-assistant .cx-assistant__form {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  margin: 0;
  padding: 12px 14px 14px;
  border-top: 1px solid color-mix(in srgb, var(--cx-gris-soporte) 12%, transparent);
  background: var(--cx-assistant-form);
}

.cx-assistant .cx-assistant__input {
  flex: 1;
  width: auto;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--cx-gris-soporte) 18%, transparent);
  border-radius: 12px;
  outline: none;
  background: var(--cx-azul-noche);
  box-shadow: none;
  color: var(--cx-blanco-hielo);
  font: 14px/normal var(--cx-font-sans);
}

.cx-assistant .cx-assistant__input::placeholder {
  color: hsl(var(--cx-on-dark-subtle));
  opacity: 1;
}

.cx-assistant .cx-assistant__input:focus,
.cx-assistant .cx-assistant__input:focus-visible {
  border-color: var(--cx-turquesa);
  outline: none;
  box-shadow: 0 0 0 1px var(--cx-turquesa), var(--cx-focus-now);
}

.cx-assistant .cx-assistant__send {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cx-azul-corporativo), var(--cx-turquesa-deep));
  color: var(--cx-blanco);
  cursor: pointer;
  transition: none;
}

.cx-assistant .cx-assistant__send:is(:hover, :focus) {
  background: linear-gradient(135deg, var(--cx-azul-corporativo), var(--cx-turquesa-deep));
  color: var(--cx-blanco);
}

.cx-assistant .cx-assistant__note {
  flex-shrink: 0;
  margin: 0;
  padding: 0 16px 10px;
  background: var(--cx-assistant-form);
  color: hsl(var(--cx-on-dark-subtle));
  font-size: 10.5px;
  line-height: normal;
  text-align: center;
}

/* ------------------------------------------------------------------ phone [l.631, at the kit's 767 px] */
@media (max-width: 767px) {
  .cx-assistant .cx-assistant__launch {
    right: 16px;
    bottom: 96px;
    width: 60px;
    height: 60px;
  }

  .cx-assistant .cx-assistant__mascot {
    width: 64px;
  }

  .cx-assistant .cx-assistant__tip {
    right: 86px;
    bottom: 108px;
  }

  .cx-assistant .cx-assistant__panel {
    right: 8px;
    bottom: 170px;
    left: 8px;
    width: auto;
    height: calc(100vh - 190px);
  }
}

/* ------------------------------------------------------------------ forced colours */
@media (forced-colors: active) {
  .cx-assistant .cx-assistant__panel,
  .cx-assistant .cx-assistant__tip,
  .cx-assistant .cx-assistant__launch {
    border: 1px solid CanvasText;
  }
}

/* ------------------------------------------------------------------ motion (module armed only)
 * Same `.cx-assistant` scope as the base, later in the file, so these transitions replace
 * the base's `transition: none` (which is there to cancel Hello Elementor's `all .3s`). */
@media (prefers-reduced-motion: no-preference) {
  :where(html.cx-motion) .cx-assistant .cx-assistant__launch {
    transition: transform 0.25s, box-shadow 0.25s;
  }

  :where(html.cx-motion) .cx-assistant .cx-assistant__launch:hover {
    transform: translateY(-3px) scale(1.04);
  }

  :where(html.cx-motion) .cx-assistant .cx-assistant__tip {
    transform: translateY(8px);
    transition: opacity 0.35s, transform 0.35s;
  }

  :where(html.cx-motion) .cx-assistant .cx-assistant__tip.cx-assistant__tip--on {
    transform: none;
  }

  :where(html.cx-motion) .cx-assistant .cx-assistant__panel {
    transform: translateY(16px) scale(0.97);
    transform-origin: 100% 100%;
    transition: opacity 0.28s, transform 0.28s, visibility 0.28s;
  }

  :where(html.cx-motion) .cx-assistant.cx-assistant--open .cx-assistant__panel {
    transform: none;
  }

  :where(html.cx-motion) .cx-assistant .cx-assistant__card {
    transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
  }

  :where(html.cx-motion) .cx-assistant .cx-assistant__card:hover {
    transform: translateY(-2px);
  }

  :where(html.cx-motion) .cx-assistant .cx-assistant__chip {
    transition: background-color 0.2s;
  }

  :where(html.cx-motion) .cx-assistant .cx-assistant__msg {
    animation: cx-assistant-in 0.3s ease both;
  }

  /* The typing dots live 0.7-1.6 s (cx-assistant.js: 700 + min(900, 12 x the question's length) ms), so two hops
   * (2.2 s, 2.5 s with the last dot's delay) cover the whole wait and nothing can hop for ever (owner 2026-11-09,
   * «Quitar y parar solas», MKT-WP-MOTION-NO-AUTOPLAY-NO-PAUSE-BUTTONS). */
  :where(html.cx-motion) .cx-assistant .cx-assistant__msg--typing i {
    animation: cx-assistant-dot 1.1s 2;
  }

  :where(html.cx-motion) .cx-assistant .cx-assistant__msg--typing i:nth-child(2) {
    animation-delay: 0.15s;
  }

  :where(html.cx-motion) .cx-assistant .cx-assistant__msg--typing i:nth-child(3) {
    animation-delay: 0.3s;
  }

  @keyframes cx-assistant-in {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
  }

  @keyframes cx-assistant-dot {
    50% {
      opacity: 0.5;
      transform: translateY(-3px);
    }
  }
}
