/* Chat flotante de Volta: usa la paleta de styles.css */
.chat-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  min-height: 52px;
  padding: 0 1.25rem;
  border: 2px solid var(--navy);
  border-radius: 999px;
  background: var(--amber);
  color: var(--navy);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(14, 40, 65, 0.25);
}
.chat-fab:hover { background: var(--amber-hover); }
.chat-fab[hidden] { display: none; }

.chat-panel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 91;
  display: none;
  flex-direction: column;
  width: 24rem;
  height: min(36rem, calc(100dvh - 2rem));
  padding: 0;
  background: var(--bg);
  color: var(--navy);
  font-family: var(--font);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(14, 40, 65, 0.25);
  overflow: hidden;
}
.chat-panel.open { display: flex; }

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.75rem 0.75rem 1rem;
  background: var(--navy);
  color: #fff;
}
.chat-title { display: flex; flex-direction: column; line-height: 1.25; }
.chat-title strong { font-family: var(--display); font-size: 1.0625rem; }
.chat-title span { font-size: 0.875rem; }
.chat-close { width: 44px; height: 44px; border: 0; background: none; color: #fff; font-size: 1.6rem; cursor: pointer; }

.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.625rem; background: var(--bg); }

.chat-msg {
  max-width: 88%;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  font-size: 1rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-msg.bot { align-self: flex-start; background: var(--alt); border: 1px solid var(--line); }
.chat-msg.me { align-self: flex-end; background: var(--navy); color: #fff; }
.chat-msg.typing { color: var(--muted); }
.chat-msg a { color: var(--blue); font-weight: 700; }
.chat-action { display: grid; gap: 0.5rem; white-space: normal; }
.chat-action .btn { width: 100%; text-decoration: none; color: var(--navy); }
.chat-action small { color: var(--muted); font-size: 0.875rem; }

.chat-sugs { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.chat-sug {
  min-height: 44px;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--blue);
  border-radius: 999px;
  background: var(--bg);
  color: var(--blue);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.chat-sug:hover { background: var(--alt); }

.chat-form { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--line); }
.chat-input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 0.75rem;
  border: 1px solid #8A9AAE;
  border-radius: 8px;
  background: var(--bg);
  color: var(--navy);
  font-family: var(--font);
  font-size: 1rem; /* 16px evita el zoom en iPhone */
}
.chat-send {
  min-height: 48px;
  padding: 0 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--amber);
  color: var(--navy);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.chat-send:disabled { opacity: 0.55; cursor: default; }

/* Celular: el chat ocupa toda la pantalla */
@media (max-width: 30rem) {
  .chat-panel { inset: 0; width: 100%; height: 100dvh; border-radius: 0; border: 0; }
}
