/* ═══════════════════════════════════════════════════════════════════
   Renard — estilos (todo con prefijo .rnd- para no chocar con la web)
   ═══════════════════════════════════════════════════════════════════ */
.rnd-root {
  --rnd-navy: #111a3a;
  --rnd-navy-2: #1b2750;
  --rnd-orange: #e8742a;
  --rnd-gold: #c9a24a;
  --rnd-cream: #fbf7ef;
  --rnd-ink: #1c1917;
  --rnd-muted: #6b6258;
  --rnd-line: #ece3d3;
  position: fixed;
  bottom: var(--rnd-bottom, 20px);
  z-index: 9000; /* por debajo del splash y del aviso de salida (99999) */
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", "Outfit", Roboto, sans-serif;
  color: var(--rnd-ink);
  -webkit-font-smoothing: antialiased;
}
.rnd-root[hidden] { display: none !important; }
.rnd-right { right: 20px; }
.rnd-left { left: 20px; }
.rnd-root *, .rnd-root *::before, .rnd-root *::after { box-sizing: border-box; }

/* ── Botón flotante ── */
.rnd-launch {
  position: relative; width: 68px; height: 68px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 3px solid var(--rnd-gold);
  background: radial-gradient(circle at 50% 35%, #f6d9b8, #e9a877 70%, #c9743d);
  box-shadow: 0 8px 24px rgba(17, 26, 58, .35), 0 0 0 4px rgba(201, 162, 74, .18);
  transition: transform .2s ease, box-shadow .2s ease;
  overflow: visible; display: block; margin-left: auto;
  animation: rnd-pop .5s cubic-bezier(.34, 1.56, .64, 1) both;
}
.rnd-launch:hover { transform: translateY(-2px) scale(1.04); }
.rnd-launch:focus-visible { outline: 3px solid var(--rnd-orange); outline-offset: 3px; }
.rnd-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; transition: opacity .35s ease; }
/* Acción dentro del círculo */
.rnd-launch-clip { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .35s ease; }
.rnd-launch-clip .rnd-clip {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover;
  transform-origin: var(--fx, 50%) var(--fy, 0%); transform: scale(var(--fs, 1.9));
}
.rnd-launch.rnd-playing .rnd-avatar { opacity: 0; }
.rnd-launch.rnd-playing .rnd-launch-clip { opacity: 1; }
.rnd-dot {
  position: absolute; right: 2px; bottom: 4px; width: 14px; height: 14px; border-radius: 50%;
  background: #22c55e; border: 2px solid #fff;
}
.rnd-open .rnd-launch { transform: scale(.92); }
@keyframes rnd-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Burbuja "¿Te ayudo?" ── */
.rnd-teaser {
  position: absolute; bottom: 80px; right: 0; white-space: nowrap;
  background: #fff; color: var(--rnd-navy); font-weight: 600; padding: 10px 34px 10px 14px;
  border-radius: 16px 16px 4px 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); cursor: pointer;
  animation: rnd-rise .35s ease both;
}
.rnd-left .rnd-teaser { right: auto; left: 0; border-radius: 16px 16px 16px 4px; }
.rnd-teaser[hidden] { display: none; }
.rnd-teaser-x {
  position: absolute; top: 4px; right: 6px; border: 0; background: none; font-size: 18px; line-height: 1;
  color: var(--rnd-muted); cursor: pointer; padding: 4px;
}
@keyframes rnd-rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Panel ── */
.rnd-panel {
  position: absolute; bottom: 84px; right: 0; width: 360px; max-height: min(620px, calc(100vh - 120px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--rnd-cream); border-radius: 22px;
  box-shadow: 0 24px 60px rgba(17, 26, 58, .35), 0 0 0 1px rgba(201, 162, 74, .35);
  animation: rnd-rise .28s ease both; transform-origin: bottom right;
}
.rnd-left .rnd-panel { right: auto; left: 0; }
.rnd-panel[hidden] { display: none; }

.rnd-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px;
  background: linear-gradient(135deg, var(--rnd-navy), var(--rnd-navy-2)); color: #fff;
  border-bottom: 2px solid var(--rnd-gold);
}
.rnd-head-av { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--rnd-gold); object-fit: cover; }
.rnd-head-txt { display: flex; flex-direction: column; line-height: 1.2; flex: 1; }
.rnd-head-txt strong { font-size: 16px; letter-spacing: .3px; }
.rnd-head-txt span { font-size: 12px; color: #e6d6b0; }
.rnd-x {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; font-size: 22px; line-height: 1;
  background: rgba(255, 255, 255, .12); color: #fff;
}
.rnd-x:hover { background: rgba(255, 255, 255, .22); }
.rnd-x:focus-visible, .rnd-chip:focus-visible, .rnd-act:focus-visible { outline: 3px solid var(--rnd-orange); outline-offset: 2px; }

/* Escenario con la pose */
.rnd-stage {
  height: 190px; display: flex; align-items: flex-end; justify-content: center; flex: none;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(201, 162, 74, .28), transparent 60%),
    linear-gradient(180deg, #f3e9d8, var(--rnd-cream));
  border-bottom: 1px solid var(--rnd-line); overflow: hidden;
}
.rnd-fig { position: relative; height: 100%; display: inline-block; }
.rnd-pose { height: 100%; width: auto; display: block; animation: rnd-rise .3s ease both; }
.rnd-anim .rnd-fig { height: 118%; margin-bottom: -8%; }
/* Texto sobre la pizarra de la pose "tienda-bolsa" */
.rnd-easel {
  position: absolute; left: 79%; top: 72%; width: 19%; height: 19%;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font: 800 15px/1 Georgia, "Times New Roman", serif; color: var(--rnd-orange);
}
.rnd-easel[hidden] { display: none; }

/* Conversación */
.rnd-scroll { flex: 1; overflow-y: auto; padding: 12px 12px 4px; overscroll-behavior: contain; }
.rnd-msgs { display: flex; flex-direction: column; gap: 8px; }
.rnd-msg { max-width: 88%; padding: 9px 12px; border-radius: 16px; white-space: pre-line; animation: rnd-rise .25s ease both; }
.rnd-bot { align-self: flex-start; background: #fff; border: 1px solid var(--rnd-line); border-bottom-left-radius: 4px; }
.rnd-user { align-self: flex-end; background: var(--rnd-navy); color: #fff; border-bottom-right-radius: 4px; }

.rnd-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 8px; }
.rnd-chip {
  font: inherit; font-size: 13px; text-decoration: none; cursor: pointer;
  padding: 7px 12px; border-radius: 99px; border: 1.5px solid var(--rnd-gold);
  background: #fff; color: var(--rnd-navy); transition: background .15s, color .15s;
}
.rnd-chip:hover { background: var(--rnd-navy); color: #fff; border-color: var(--rnd-navy); }
.rnd-chip-cta { background: var(--rnd-orange); border-color: var(--rnd-orange); color: #fff; font-weight: 600; }
.rnd-chip-cta:hover { background: #cf5f18; border-color: #cf5f18; }
.rnd-chip-promo { border-style: dashed; }
.rnd-chip-back { border-color: var(--rnd-line); color: var(--rnd-muted); }

.rnd-foot { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--rnd-line); background: #fff; flex: none; }
.rnd-act {
  flex: 1; text-align: center; text-decoration: none; font-weight: 600; font-size: 13px;
  padding: 10px 8px; border-radius: 12px;
}
.rnd-wa { background: #25d366; color: #073b1c; }
.rnd-wa:hover { background: #1fbe5b; }
.rnd-call { background: var(--rnd-navy); color: #fff; flex: 0 0 auto; padding-inline: 16px; }

/* ── Videos de acción ── */
.rnd-clip { display: block; }
.rnd-stage > .rnd-clip { height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.rnd-fig[hidden] { display: none; }

/* Modo mascota (escritorio, panel cerrado) */
.rnd-mascot {
  position: absolute; bottom: 74px; right: -18px; width: 220px; height: 220px; cursor: pointer;
  animation: rnd-rise .45s cubic-bezier(.34, 1.4, .64, 1) both; transition: opacity .35s, transform .35s;
}
.rnd-left .rnd-mascot { right: auto; left: -18px; }
.rnd-mascot .rnd-clip { width: 100%; height: 100%; object-fit: contain;
  -webkit-mask-image: linear-gradient(#000 88%, transparent); mask-image: linear-gradient(#000 88%, transparent); }
.rnd-mascot.rnd-out { animation: none; opacity: 0; transform: translateY(14px) scale(.96); }
.rnd-mascot-x {
  position: absolute; top: 8px; right: 22px; width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: rgba(17, 26, 58, .8); color: #fff; font-size: 16px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .2s;
}
.rnd-mascot:hover .rnd-mascot-x, .rnd-mascot-x:focus-visible { opacity: 1; }

/* Celular: el círculo se esconde y Renard sale de cuerpo entero en su lugar */
.rnd-launch.rnd-swap {
  animation: none; transform: scale(0) rotate(-20deg); opacity: 0; pointer-events: none;
  transition: transform .3s ease, opacity .3s ease;
}
.rnd-mascot.rnd-mascot-m {
  right: -30px; bottom: -14px; width: 158px; height: 158px;
  animation: rnd-spring .5s cubic-bezier(.34, 1.56, .64, 1) both;
}
.rnd-left .rnd-mascot.rnd-mascot-m { right: auto; left: -30px; }
.rnd-mascot-m .rnd-mascot-x { opacity: .9; top: 2px; right: 26px; width: 24px; height: 24px; font-size: 15px; }
@keyframes rnd-spring { from { transform: translateY(40px) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Celebración ── */
.rnd-celebrate {
  position: absolute; bottom: 84px; right: 0; width: 260px; text-align: center;
  background: var(--rnd-cream); border-radius: 20px; padding: 10px 14px 14px;
  box-shadow: 0 20px 50px rgba(17, 26, 58, .35), 0 0 0 1px rgba(201, 162, 74, .4);
  animation: rnd-rise .35s ease both; transition: opacity .5s, transform .5s;
}
.rnd-left .rnd-celebrate { right: auto; left: 0; }
.rnd-celebrate img, .rnd-celebrate .rnd-clip { width: 200px; height: 200px; object-fit: contain; margin: 0 auto; }
.rnd-celebrate p { margin: 4px 0 0; font-weight: 700; color: var(--rnd-navy); }
.rnd-celebrate.rnd-out { opacity: 0; transform: translateY(10px); }

/* ── Celular: panel tipo "hoja" desde abajo ── */
@media (max-width: 520px) {
  .rnd-right { right: 12px; } .rnd-left { left: 12px; }
  .rnd-launch { width: 58px; height: 58px; }
  .rnd-panel {
    position: fixed; left: 8px; right: 8px; bottom: calc(var(--rnd-bottom, 20px) + 70px);
    width: auto; max-height: calc(100vh - var(--rnd-bottom, 20px) - 96px); border-radius: 20px;
  }
  .rnd-stage { height: 132px; }
  .rnd-teaser { bottom: 70px; }
  .rnd-celebrate { position: fixed; left: 50%; right: auto; transform: translateX(-50%); bottom: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  .rnd-root *, .rnd-launch { animation: none !important; transition: none !important; }
}
