:root {
  --bot-navy: #0B1E3B;
  --bot-navy-deep: #061224;
  --bot-cobalt: #0056D2;
  --bot-cyan-tint: #EBF4FF;
  --bot-slate: #1E293B;
  --bot-white: #FFFFFF;
  --bot-border: #E2E8F0;
  --bot-whatsapp: #16A34A;
}

.ingelimp-mascot-dock {
  position: fixed;
  bottom: 16px;
  right: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.speech-bubble {
  background: linear-gradient(135deg, var(--bot-navy) 0%, var(--bot-cobalt) 100%);
  color: var(--bot-white);
  padding: 0.52rem 1.05rem;
  border-radius: 16px 16px 4px 16px;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  box-shadow: 0 10px 24px rgba(0, 86, 210, 0.38);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  animation: floatBubble 2.6s ease-in-out infinite;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.speech-bubble .pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.35);
}

@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Botón transparente para que el robot flote grande y limpio */
.mascot-trigger {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  filter: drop-shadow(0 12px 18px rgba(11, 30, 59, 0.28));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.mascot-trigger:hover {
  transform: translateY(-6px) scale(1.05);
  filter: drop-shadow(0 18px 24px rgba(0, 86, 210, 0.38));
}

.robot-svg {
  display: block;
  width: 175px;
  height: auto;
}

/* El chat se abre junto al robot en escritorio para no cortarse arriba */
.ingelimp-chat-box {
  position: fixed;
  bottom: 24px;
  right: 205px;
  width: 390px;
  max-width: calc(100vw - 28px);
  background: var(--bot-white);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(6, 18, 36, 0.32);
  border: 1px solid var(--bot-border);
  z-index: 10000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-head {
  background: linear-gradient(135deg, var(--bot-navy-deep) 0%, var(--bot-navy) 55%, var(--bot-cobalt) 100%);
  color: var(--bot-white);
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.chat-head-info {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.chat-avatar-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.chat-head-title {
  font-family: 'Exo 2', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.15;
}

.chat-head-sub {
  font-size: 0.75rem;
  color: #93C5FD;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2px;
}

.chat-head-sub::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ADE80;
}

.chat-controls {
  display: flex;
  gap: 0.4rem;
}

.chat-icon-btn {
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: var(--bot-white);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-icon-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.chat-body {
  height: 340px;
  overflow-y: auto;
  padding: 1rem;
  background: #F8FAFC;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bubble {
  max-width: 86%;
  padding: 0.75rem 0.95rem;
  font-size: 0.88rem;
  line-height: 1.48;
  border-radius: 14px;
  word-wrap: break-word;
}

.bubble.bot {
  background: var(--bot-white);
  color: var(--bot-slate);
  border: 1px solid var(--bot-border);
  border-bottom-left-radius: 3px;
  box-shadow: 0 2px 8px rgba(11, 30, 59, 0.04);
}

.bubble.bot strong { color: var(--bot-navy); }

.bubble.user {
  background: var(--bot-cobalt);
  color: var(--bot-white);
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}

.lead-summary-card {
  background: var(--bot-cyan-tint);
  border: 1px solid rgba(0, 86, 210, 0.25);
  border-radius: 12px;
  padding: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--bot-navy);
}

.lead-summary-card div { margin-bottom: 0.25rem; }

.typing {
  display: inline-flex;
  gap: 4px;
  padding: 0.65rem 0.9rem;
  background: var(--bot-white);
  border: 1px solid var(--bot-border);
  border-radius: 14px;
  width: fit-content;
}

.typing span {
  width: 7px;
  height: 7px;
  background: var(--bot-cobalt);
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

.quick-chips {
  padding: 0.65rem 0.85rem;
  background: var(--bot-white);
  border-top: 1px solid var(--bot-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-height: 105px;
  overflow-y: auto;
}

.chip-btn {
  background: var(--bot-cyan-tint);
  color: var(--bot-cobalt);
  border: 1px solid rgba(0, 86, 210, 0.22);
  border-radius: 999px;
  padding: 0.38rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}

.chip-btn:hover {
  background: var(--bot-cobalt);
  color: var(--bot-white);
}

.chip-btn.wa {
  background: #DCFCE7;
  color: #15803D;
  border-color: rgba(22, 163, 74, 0.3);
}

.chip-btn.wa:hover {
  background: var(--bot-whatsapp);
  color: var(--bot-white);
}

.chat-footer {
  display: flex;
  border-top: 1px solid var(--bot-border);
  background: var(--bot-white);
}

.chat-footer input {
  flex: 1;
  border: none;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  color: var(--bot-navy);
}

.chat-footer button {
  background: var(--bot-cobalt);
  color: var(--bot-white);
  border: none;
  padding: 0 1.15rem;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-footer button:hover {
  background: var(--bot-navy);
}

/* Ajuste responsivo para celulares */
@media (max-width: 640px) {
  .robot-svg {
    width: 120px;
    height: auto;
  }
  .ingelimp-chat-box {
    right: 14px;
    bottom: 175px;
  }
}