/* Botón flotante chatbot */
.chat-bot-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 112px;
  height: 112px;
  padding: 0;
  border: none;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.3s;
}

.chat-bot-button:hover {
  transform: translateY(-5px);
}

.chat-bot-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.chat-popup {
  position: fixed;
  bottom: 100px;
  right: -350px;
  width: 340px;
  max-width: calc(100vw - 40px);
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  padding: 0;
  z-index: 999;
  overflow: hidden;
  font-family: var(--font-family);
  transition: right 1.5s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(22, 163, 74, 0.12);
}

.chat-popup.visible {
  right: 30px;
}

.chat-header {
  background-color: var(--color-primary);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header h3 {
  margin: 0;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
}

.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.close-btn:hover {
  opacity: 1;
}

.chat-body {
  padding: 25px;
  text-align: center;
  background-color: #fafafa;
}

.chat-message {
  background-color: #fff;
  padding: 18px;
  border-radius: 12px;
  text-align: left;
  margin-bottom: 25px;
  font-size: 15px;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
  line-height: 1.5;
}

.start-chat-btn {
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  padding: 14px 24px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 15px;
  transition: background-color 0.3s, transform 0.2s;
  width: 100%;
  font-size: 15px;
  letter-spacing: 0.3px;
  box-shadow: 0 3px 10px rgba(22, 163, 74, 0.25);
  font-family: inherit;
}

.start-chat-btn:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
}

.start-chat-btn:active {
  transform: translateY(0);
}

.bank-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  font-size: 13px;
  color: #555;
}

.bank-secure svg {
  width: 16px;
  height: 16px;
  fill: var(--color-primary-dark);
  margin-right: 6px;
  opacity: 0.85;
}

@keyframes chat-vibrate {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(2px, -2px); }
  60% { transform: translate(-2px, -2px); }
  80% { transform: translate(2px, 2px); }
  100% { transform: translate(0); }
}

.chat-bot-button.vibrate {
  animation: chat-vibrate 0.6s ease-in-out;
}

@keyframes chat-gentle-pulse {
  0% { transform: scale(1); }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.chat-bot-button.pulse {
  animation: chat-gentle-pulse 2s infinite;
}

@media (max-width: 768px) {
  .chat-bot-button {
    bottom: 20px;
    right: 20px;
    width: 88px;
    height: 88px;
  }

  .chat-popup {
    bottom: 110px;
    width: min(340px, calc(100vw - 40px));
  }

  .chat-popup.visible {
    right: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-bot-button.pulse,
  .chat-bot-button.vibrate {
    animation: none !important;
  }

  .chat-popup {
    transition: right 0.4s ease;
  }
}
