/* AXELIA — Asistente (chatbot) */
.chatbot-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9990;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), background var(--transition);
}

.chatbot-fab:hover {
  background: var(--accent-hover);
  transform: scale(1.04);
}

.chatbot-fab:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.chatbot-fab svg {
  width: 26px;
  height: 26px;
}

.chatbot-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.5rem;
  z-index: 9989;
  width: min(380px, calc(100vw - 2rem));
  max-height: min(520px, calc(100vh - 7rem));
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.98);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

.chatbot-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chatbot-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.125rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.chatbot-panel__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.chatbot-panel__subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chatbot-panel__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.chatbot-panel__close:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.chatbot-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chatbot-msg {
  max-width: 92%;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.5;
}

.chatbot-msg--bot {
  align-self: flex-start;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
}

.chatbot-msg--user {
  align-self: flex-end;
  background: var(--accent-muted);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.chatbot-msg a {
  color: var(--accent);
  font-weight: 500;
}

.chatbot-panel__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem 1rem;
}

.chatbot-chip {
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.chatbot-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chatbot-panel__input {
  display: flex;
  gap: 0.5rem;
  padding: 0.875rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.chatbot-panel__input input {
  flex: 1;
  min-width: 0;
  padding: 0.625rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.chatbot-panel__input input:focus {
  outline: none;
  border-color: var(--accent);
}

.chatbot-panel__input button {
  padding: 0.625rem 0.875rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

.chatbot-panel__input button:hover {
  background: var(--accent-hover);
}

@media (max-width: 480px) {
  .chatbot-fab {
    right: 1rem;
    bottom: 1rem;
  }

  .chatbot-panel {
    right: 1rem;
    bottom: 5rem;
    width: calc(100vw - 2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chatbot-panel,
  .chatbot-fab {
    transition: none;
  }
}
