/* ==========================================================
   ROBOCHAMBA — chat de la página (usa los colores de styles.css)
   ========================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Con chat, el botón verde de WhatsApp queda dentro del chat */
.has-chat .wa-float { display: none; }

.rcchat { --rc-w: 380px; font-family: var(--sans); }

/* Botón flotante */
.rcchat__launcher {
  position: fixed; right: 18px; bottom: 18px; z-index: 70;
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 12px 34px -10px rgba(200, 255, 62, .55), 0 0 0 1px rgba(0, 0, 0, .2);
  transition: transform .25s var(--ease);
}
.rcchat__launcher img { width: 46px; height: 46px; object-fit: contain; border-radius: 50%; }
@media (hover: hover) { .rcchat__launcher:hover { transform: scale(1.06); } }
.rcchat__dot {
  position: absolute; right: 4px; top: 4px; width: 13px; height: 13px; border-radius: 50%;
  background: #25d366; border: 2px solid var(--bg);
}
.rcchat.is-open .rcchat__launcher { transform: scale(.9); }

/* Aviso "¿Dudas?" */
.rcchat__hint {
  position: fixed; right: 92px; bottom: 30px; z-index: 70;
  display: flex; align-items: center; gap: 6px;
  max-width: calc(100vw - 120px);
  padding: 10px 14px 10px 8px; border-radius: 14px 14px 4px 14px;
  background: var(--ink); color: var(--bg); font-size: .9rem; font-weight: 500;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6);
  animation: rcchat-in .4s var(--ease) both;
}
.rcchat__hint[hidden] { display: none; }
.rcchat__hint span { cursor: pointer; }
.rcchat__hint-close { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: inherit; opacity: .55; }
.rcchat__hint-close:hover { opacity: 1; }
.rcchat__hint-close svg { width: 14px; height: 14px; }

/* Panel */
.rcchat__panel {
  position: fixed; right: 18px; bottom: 92px; z-index: 70;
  width: var(--rc-w); max-width: calc(100vw - 32px);
  height: min(620px, calc(100vh - 120px)); height: min(620px, calc(100dvh - 120px));
  display: flex; flex-direction: column; padding: 0; margin: 0;   /* la página da padding a todos los <section> */
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .75);
  overflow: hidden;
  animation: rcchat-in .32s var(--ease) both;
}
.rcchat__panel[hidden] { display: none; }
@keyframes rcchat-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.rcchat__head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 12px 12px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(109, 40, 217, .22), rgba(37, 99, 235, .12) 60%, transparent);
}
.rcchat__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-3); object-fit: contain; flex: none; }
.rcchat__title { display: grid; line-height: 1.25; min-width: 0; flex: 1; }
.rcchat__title strong { font-weight: 600; font-size: .98rem; }
.rcchat__title span { color: var(--mute); font-size: .78rem; display: flex; align-items: center; gap: 6px; }
.rcchat__title i { width: 7px; height: 7px; border-radius: 50%; background: #25d366; flex: none; }
.rcchat__wa, .rcchat__close {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  transition: background .2s;
}
.rcchat__wa { background: #25d366; color: #fff; }
.rcchat__wa svg { width: 19px; height: 19px; }
.rcchat__close { color: var(--mute); }
.rcchat__close:hover { background: var(--bg-3); color: var(--ink); }
.rcchat__close svg { width: 18px; height: 18px; }

/* Conversación */
.rcchat__list {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.rcchat__msg {
  max-width: 86%; padding: 9px 13px; border-radius: 16px;
  font-size: .93rem; line-height: 1.45; overflow-wrap: anywhere;
}
.rcchat__msg--bot { align-self: flex-start; background: var(--bg-3); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.rcchat__msg--yo { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; }
.rcchat__msg a { text-decoration: underline; text-underline-offset: 2px; }
.rcchat__msg--bot a { color: var(--accent); }
.rcchat__msg strong { font-weight: 600; }

.rcchat__cta {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px; background: #25d366; color: #fff;
  font-size: .88rem; font-weight: 600;
}
.rcchat__cta svg { width: 17px; height: 17px; }

.rcchat__typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.rcchat__typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--mute); animation: rcchat-dot 1.2s infinite ease-in-out; }
.rcchat__typing i:nth-child(2) { animation-delay: .15s; }
.rcchat__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes rcchat-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* Sugerencias */
.rcchat__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 10px; }
.rcchat__chips[hidden] { display: none; }
.rcchat__chip {
  padding: 7px 12px; border-radius: 999px; font-size: .84rem;
  border: 1px solid var(--line-2); color: var(--ink); background: transparent;
  transition: border-color .2s, background .2s;
}
.rcchat__chip:hover { border-color: var(--accent); background: rgba(200, 255, 62, .08); }

/* Escribir */
.rcchat__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.rcchat__form textarea {
  flex: 1; resize: none; min-height: 42px; max-height: 120px;
  padding: 10px 14px; border-radius: 21px;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line-2);
  font: inherit; font-size: 16px; line-height: 1.35; overflow-y: hidden;   /* 16px: el iPhone no hace zoom */
}
.rcchat__form textarea:focus { outline: none; border-color: var(--accent); }
.rcchat__send {
  width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); transition: opacity .2s;
}
.rcchat__send svg { width: 19px; height: 19px; }
.rcchat__form.is-busy .rcchat__send { opacity: .4; pointer-events: none; }
.rcchat__legal { padding: 0 14px 10px; color: var(--mute); font-size: .7rem; line-height: 1.4; }
.rcchat__legal a { text-decoration: underline; }

/* Celular: el chat ocupa toda la pantalla */
@media (max-width: 560px) {
  .rcchat__panel {
    inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh;
    border-radius: 0; border: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .rcchat.is-open .rcchat__launcher { display: none; }
  .rcchat__hint { right: 88px; bottom: 28px; }
  html.rcchat-lock, html.rcchat-lock body { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .rcchat__panel, .rcchat__hint { animation: none; }
  .rcchat__typing i { animation: none; opacity: .6; }
}
