/* ============================================
   CHATBOT ESTÁTICO — MrSushi
   ============================================ */

/* --- Botón flotante --- */
.chatbot-toggle {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e04444;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(224, 68, 68, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  line-height: 1;
}

.chatbot-toggle:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(224, 68, 68, 0.55);
}

/* --- Panel --- */
.chatbot-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 9998;
  width: 380px;
  height: 540px;
  max-height: calc(100vh - 110px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
  transform-origin: bottom right;
}

.chatbot-panel.abierto {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* --- Header --- */
.chatbot-header {
  background: #1a1a1a;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot-avatar {
  width: 38px;
  height: 38px;
  background: #e04444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.chatbot-header-text h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
}

.chatbot-header-text p {
  margin: 0;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
  margin-top: 2px;
}

.estado-dot {
  width: 7px;
  height: 7px;
  background: #25d366;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.chatbot-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 6px;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-close:hover {
  color: #fff;
}

/* --- Área de mensajes --- */
.chatbot-mensajes {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fdf8f0;
  scroll-behavior: smooth;
}

.chatbot-mensajes::-webkit-scrollbar {
  width: 4px;
}

.chatbot-mensajes::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 4px;
}

/* Burbujas */
.msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.5;
  word-break: break-word;
}

.msg-bot {
  align-self: flex-start;
  background: #fff;
  color: #222;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.msg-user {
  align-self: flex-end;
  background: #e04444;
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* --- Chips / botones --- */
.chatbot-chips {
  padding: 0 14px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  background: #fdf8f0;
}

.chip {
  border: 1.5px solid #e04444;
  background: #fff;
  color: #e04444;
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  font-family: inherit;
  font-weight: 500;
}

.chip:hover {
  background: #e04444;
  color: #fff;
}

.chip-wsp {
  border-color: #25d366;
  color: #25d366;
  background: #fff;
}

.chip-wsp:hover {
  background: #25d366;
  color: #fff;
}

.chip-volver {
  border-color: #999;
  color: #666;
  background: #fff;
}

.chip-volver:hover {
  background: #666;
  color: #fff;
}

/* --- Dark mode --- */
body.dark-mode .chatbot-panel {
  background: #1e1e1e;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

body.dark-mode .chatbot-mensajes {
  background: #161616;
}

body.dark-mode .msg-bot {
  background: #2a2a2a;
  color: #f0f0f0;
}

body.dark-mode .chatbot-chips {
  background: #161616;
}

body.dark-mode .chip {
  background: #2a2a2a;
  color: #e04444;
}

body.dark-mode .chip:hover {
  background: #e04444;
  color: #fff;
}

body.dark-mode .chip-wsp {
  background: #2a2a2a;
  color: #25d366;
}

body.dark-mode .chip-wsp:hover {
  background: #25d366;
  color: #fff;
}

body.dark-mode .chip-volver {
  background: #2a2a2a;
  color: #aaa;
  border-color: #555;
}

body.dark-mode .chip-volver:hover {
  background: #555;
  color: #fff;
}

/* --- Mobile: pantalla completa --- */
@media (max-width: 480px) {
  .chatbot-panel {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    transform-origin: bottom center;
  }

  .chatbot-toggle {
    bottom: 90px;
    right: 16px;
  }
}
