/* Asistente RMAQ · botón flotante y panel de conversación */
.rmaq-chat-launcher,
.rmaq-chat-panel { font-family: "Space Grotesk", "Segoe UI", sans-serif; }

.rmaq-chat-launcher {
  position: fixed;
  right: clamp(14px, 2.2vw, 28px);
  bottom: clamp(14px, 2.2vw, 28px);
  z-index: 70;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #FFD600;
  color: #101010;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(16, 16, 16, .32);
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s;
}
.rmaq-chat-launcher:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(16, 16, 16, .4); }
.rmaq-chat-launcher:focus-visible { outline: 3px solid #101010; outline-offset: 3px; }
.rmaq-chat-launcher svg { width: 30px; height: 30px; }
.rmaq-chat-launcher[hidden] { display: none; }

.rmaq-chat-panel {
  position: fixed;
  right: clamp(14px, 2.2vw, 28px);
  bottom: clamp(14px, 2.2vw, 28px);
  z-index: 71;
  width: min(380px, calc(100vw - 28px));
  max-height: min(620px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  background: #101010;
  color: #f4f4f1;
  border: 1px solid #2a2a28;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  opacity: 0;
  transform: translateY(14px) scale(.98);
  transition: opacity .22s ease, transform .22s cubic-bezier(.2, .7, .2, 1);
}
.rmaq-chat-panel[hidden] { display: none; }
.rmaq-chat-panel.is-open { opacity: 1; transform: none; }

.rmaq-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid #2a2a28;
  background: #141413;
}
.rmaq-chat-badge {
  width: 36px; height: 36px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #FFD600; color: #101010;
}
.rmaq-chat-badge svg { width: 20px; height: 20px; }
.rmaq-chat-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rmaq-chat-title strong {
  font-family: "Oswald", Impact, sans-serif;
  font-weight: 600; font-size: 16px; letter-spacing: .02em; text-transform: uppercase;
}
.rmaq-chat-title span { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #FFD600; font-weight: 700; }
.rmaq-chat-close {
  margin-left: auto; width: 34px; height: 34px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid #343431; color: #f4f4f1; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.rmaq-chat-close:hover { background: #FFD600; color: #101010; border-color: #FFD600; }
.rmaq-chat-close svg { width: 16px; height: 16px; }

.rmaq-chat-log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
}
.rmaq-chat-msg {
  max-width: 88%;
  padding: 11px 13px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.rmaq-chat-msg.de-asistente { background: #1b1b19; border-left: 2px solid #FFD600; align-self: flex-start; }
.rmaq-chat-msg.de-visitante { background: #FFD600; color: #101010; align-self: flex-end; font-weight: 500; }
.rmaq-chat-msg.es-error { background: #2a1616; border-left: 2px solid #e05252; align-self: flex-start; color: #ffd9d9; }

.rmaq-chat-suggestions { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px 12px; }
.rmaq-chat-suggestions button {
  border: 1px solid #343431; background: transparent; color: #cfcfc9;
  font-size: 11px; line-height: 1.3; padding: 8px 10px; cursor: pointer; text-align: left;
  transition: border-color .2s, color .2s, background .2s;
}
.rmaq-chat-suggestions button:hover { border-color: #FFD600; color: #FFD600; }

.rmaq-chat-typing { display: flex; gap: 5px; align-self: flex-start; padding: 12px 13px; background: #1b1b19; border-left: 2px solid #FFD600; }
.rmaq-chat-typing i { width: 6px; height: 6px; border-radius: 50%; background: #FFD600; opacity: .4; animation: rmaq-chat-dot 1.1s infinite ease-in-out; }
.rmaq-chat-typing i:nth-child(2) { animation-delay: .15s; }
.rmaq-chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes rmaq-chat-dot { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.rmaq-chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #2a2a28; background: #141413; }
.rmaq-chat-form textarea {
  flex: 1 1 auto; min-height: 44px; max-height: 110px; resize: none;
  background: #101010; border: 1px solid #343431; color: #f4f4f1;
  padding: 12px; font: inherit; font-size: 13px; line-height: 1.4; outline: 0;
  transition: border-color .2s;
}
.rmaq-chat-form textarea:focus { border-color: #FFD600; }
.rmaq-chat-form button {
  flex: none; width: 46px; display: flex; align-items: center; justify-content: center;
  background: #FFD600; color: #101010; border: 0; cursor: pointer; transition: opacity .2s, transform .2s;
}
.rmaq-chat-form button:disabled { opacity: .45; cursor: not-allowed; }
.rmaq-chat-form button:not(:disabled):hover { transform: translateY(-2px); }
.rmaq-chat-form button svg { width: 18px; height: 18px; }

.rmaq-chat-legal { padding: 0 12px 12px; font-size: 10px; line-height: 1.45; color: #7d7d77; background: #141413; }
.rmaq-chat-legal a { color: #FFD600; }

@media (max-width: 420px) {
  .rmaq-chat-panel { right: 8px; left: 8px; bottom: 8px; width: auto; max-height: calc(100dvh - 16px); }
  .rmaq-chat-launcher { width: 54px; height: 54px; right: 12px; bottom: 12px; }
  .rmaq-chat-launcher svg { width: 26px; height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .rmaq-chat-panel, .rmaq-chat-launcher, .rmaq-chat-form button { transition: none; }
  .rmaq-chat-typing i { animation: none; }
}
