/* Chat de Wamy. (Se quitaron las reglas globales de * y body: afectaban a toda la web.) */

/* Botón flotante */
.chat-toggle {
  position: fixed;
  bottom: 110px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #8b5cf6 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  z-index: 1000;
}

.chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.chat-icon {
  font-size: 24px;
  color: white;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff4757;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

/* Contenedor del chat */
.chat-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 350px;
  height: 500px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  z-index: 1001;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

.chat-container.active {
  display: flex;
}

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

/* Header del chat */
.chat-header {
  background: linear-gradient(135deg, #8b5cf6 0%, #764ba2 100%);
  color: white;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-avatar {
  font-size: 24px;
}

.bot-info h3 {
  font-size: 16px;
  margin-bottom: 2px;
}

.status {
  font-size: 12px;
  opacity: 0.8;
}

.close-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background 0.2s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Mensajes */
.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: 80%;
  animation: fadeIn 0.3s ease;
}

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

.bot-message {
  align-self: flex-start;
}

.user-message {
  align-self: flex-end;
}

.message-content {
  padding: 10px 15px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
}

.bot-message .message-content {
  background: #f1f3f5;
  color: #333;
}

.user-message .message-content {
  background: linear-gradient(135deg, #8b5cf6 0%, #764ba2 100%);
  color: white;
}

.message-time {
  font-size: 11px;
  color: #999;
  margin-top: 5px;
  text-align: right;
}

.bot-message .message-time {
  text-align: left;
}

/* Indicador de escritura */
.typing-indicator {
  padding: 10px 15px;
  display: none;
  align-items: center;
  gap: 10px;
  background: #f8f9fa;
  margin: 0 15px;
  border-radius: 15px;
}

.typing-indicator.active {
  display: flex;
}

.typing-dots {
  display: flex;
  gap: 3px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: #8b5cf6;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

.typing-text {
  font-size: 12px;
  color: #666;
}

/* Botones rápidos */
.quick-options {
  padding: 10px 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-btn {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.quick-btn:hover {
  background: #8b5cf6;
  color: white;
  border-color: #8b5cf6;
}

/* Input del chat */
.input-wrapper {
  display: flex;
  padding: 15px;
  gap: 10px;
  border-top: 1px solid #e9ecef;
}

#messageInput {
  flex: 1;
  border: 1px solid #e9ecef;
  border-radius: 20px;
  padding: 10px 15px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#messageInput:focus {
  border-color: #8b5cf6;
}

#sendBtn {
  background: linear-gradient(135deg, #8b5cf6 0%, #764ba2 100%);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: white;
  cursor: pointer;
  transition: transform 0.2s;
}

#sendBtn:hover {
  transform: scale(1.1);
}

/* Botón de WhatsApp */
.whatsapp-btn {
  background: #25d366;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 15px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  margin: 10px 0;
}

.whatsapp-btn:hover {
  background: #128c7e;
  transform: translateY(-2px);
}

/* Botón de Email */
.email-btn {
  background: #ea4335;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 15px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  margin: 5px 5px 5px 0;
}

.email-btn:hover {
  background: #d33b2c;
  transform: translateY(-2px);
}

/* Contenedor para botones de contacto */
.whatsapp-btn,
.email-btn {
  display: inline-flex;
  margin-right: 10px;
}

/* Responsive */
@media (max-width: 480px) {
  .chat-container {
    width: calc(100vw - 20px);
    height: calc(100vh - 40px);
    bottom: 10px;
    right: 10px;
    left: 10px;
    border-radius: 10px;
  }

  .chat-toggle {
    bottom: 15px;
    right: 15px;
  }

  .quick-options {
    flex-direction: column;
  }

  .quick-btn {
    width: 100%;
    text-align: center;
  }
}

/* Scrollbar personalizada */
.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
