/* Botón flotante del asistente */
.chat-button {
  position: fixed !important;
  bottom: 10px !important;
  right: 20px !important;  
  min-width: 65px !important;
  height: 55px !important;
  padding: 0 20px !important;
  background: linear-gradient(135deg, #006176, #0087a5);
  border-radius: 20px !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 8px 25px rgba(11, 34, 39, 1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  transition: all 0.3s ease !important;
  z-index: 99999 !important;
  color: white !important;
  font-size: 16px !important;
  font-weight: 600 !important;
}

.chat-button:hover {
  background: linear-gradient(135deg, #0087a5, #00a9cc);
  transform: translateX(-5%) scale(1.05) !important;
  box-shadow: 0 8px 25px rgba(11, 34, 39, 0.75);
}

.chat-button i {
  font-size: 24px !important;
  color: white !important;
}

.chat-button-avatar {
  width: 40px !important;
  height: 40px !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18) !important;
}

.chat-button.active {
  background: linear-gradient(135deg, #2a9aa8 0%, #3db3c5 100%) !important;
}

/* Ventana del chat */
.chat-window {
  position: fixed !important;
  bottom: 70px !important;
  right: 25px !important;  
  width: 380px !important;
  height: 550px !important;
  background: white !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
  display: none !important;
  flex-direction: column !important;
  overflow: hidden !important;
  z-index: 99998 !important;
  
}

.chat-window.active {
  display: flex !important;
}

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

.chat-header {
  color: white !important;
  padding: 5px 10px !important; /* Cambiado de 10px a 5px arriba/abajo */
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.chat-header-avatar {
  width: 40px !important;
  height: 40px !important; 
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 30px !important;
  transform-origin: 70% 70% !important;
}

.chat-header-avatar.is-waving {
  animation: assistantWave 0.9s ease-in-out 2 !important;
}

@keyframes assistantWave {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  15% {
    transform: rotate(18deg) scale(1.08);
  }
  30% {
    transform: rotate(-12deg) scale(1.04);
  }
  45% {
    transform: rotate(16deg) scale(1.08);
  }
  60% {
    transform: rotate(-8deg) scale(1.02);
  }
  75% {
    transform: rotate(10deg) scale(1.05);
  }
}

.chat-header-info h1 {
  font-size: 35px !important;
  margin-top: 15px !important; /* Reducido de 10px a 5px */
  margin-bottom: 2px !important; /* Reducido de 3px a 2px */
  margin-left: 5px !important;
  color: #006176 !important;
}

/* Cuerpo del chat */
.chat-body {
  flex: 1 !important;
  padding: 10px !important;
  overflow-y: auto !important;
  background: #ffffff !important;
  scroll-behavior: smooth !important;
}

/* Contenedor de mensajes */
.chat-messages {
  display: flex !important;
  flex-direction: column !important;
  gap: 15px !important;
}

/* Estructura de cada mensaje */
.message {
  display: flex !important;
  gap: 10px !important;
  align-items: flex-start !important;
  animation: fadeIn 0.3s ease !important;
}

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

.message.user {
  flex-direction: row-reverse !important;
}

.message.assistant {
  justify-content: flex-start !important;
  flex-direction: row !important;
}

/* Avatar del mensaje */
.message-avatar {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  flex-shrink: 0 !important;
  background: #3db3c5 !important;
  color: white !important;
}

.message.user .message-avatar {
  background: #eaabf5 !important;
}

.message.assistant .message-avatar {
  background: #3db3c5 !important;
}

/* Contenido del mensaje */
.message-content {
  max-width: 70% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
}

/* Burbuja del mensaje */
.message-bubble {
  padding: 12px 16px !important;
  border-radius: 18px !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  word-wrap: break-word !important;
  background-color: white !important;
}

.message.assistant .message-bubble {
  background: white !important;
  color: #333 !important;
  border-bottom-left-radius: 4px !important;
}

.message.user .message-bubble {
  background: linear-gradient(135deg, #3db3c5 0%, #5fc9d6 100%) !important;
  color: white !important;
  border-bottom-right-radius: 4px !important;
}

/* Tiempo del mensaje */
.message-time {
  font-size: 11px !important;
  color: #727171 !important;
  padding: 0 5px !important;
}

.message.user .message-time {
  text-align: right !important;
}

/* Pie del chat */
.chat-footer {
  padding: 8px !important;
  background: white !important;
  border-top: 1px solid #eee !important;
  display: flex !important;
  gap: 5px !important;
  align-items: center !important;
}

.chat-input {
  flex: 1 !important;
  padding: 10px 16px !important;
  border: 1px solid #ddd !important;
  border-radius: 15px !important;
  font-size: 14px !important;
  outline: none !important;
  transition: border-color 0.2s ease !important;
}

.chat-input:focus {
  border-color: #3db3c5 !important;
}

.send-button {
  width: 45px !important;
  height: 45px !important;
  background: linear-gradient(135deg, #3db3c5 0%, #5fc9d6 100%) !important;
  border: none !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.2s ease !important;
  flex-shrink: 0 !important;
  color: white !important;
}

.send-button:hover {
  transform: scale(1.05) !important;
}

.send-button i {
  font-size: 18px !important;
  color: white !important;
}

.clear-button {
  width: 45px !important;
  height: 45px !important;
  background: #f44336 !important;
  border: none !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
  color: white !important;
}

.clear-button:hover {
  transform: scale(1.05) !important;
  background: #d32f2f !important;
}

.clear-button i {
  font-size: 18px !important;
  color: white !important;
}

/* Indicador de escritura */
.typing-indicator {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 12px 16px !important;
  background: white !important;
  border-radius: 18px !important;
  width: fit-content !important;
}

.typing-indicator span {
  display: block !important;
  width: 8px !important;
  height: 8px !important;
  background: #3db3c5 !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
  animation: typing 1.4s infinite !important;
}

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

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

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

/* Mensaje de bienvenida */
.welcome-message {
  display: flex !important;
  gap: 10px !important;
  align-items: flex-start !important;
  justify-content: center !important;
  width: 100% !important;
}

.welcome-message .message-avatar {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: #3db3c5 !important;
  color: white !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  flex-shrink: 0 !important;
}

.welcome-message .message-content {
  background: white !important;
  padding: 12px 16px !important;
  border-radius: 18px !important;
  border-bottom-left-radius: 4px !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: #333 !important;
  max-width: 70% !important;
}

/* Responsive */
@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 20px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    height: calc(100vh - 250px) !important;
  }

  .message-content {
    max-width: 75% !important;
  }
}

#buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: min(100%, 320px);
  margin: 0 auto;
}

#buttons-grid .btn {
  display: flex;
  flex-direction: row;  
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  text-decoration: none;
  border: 2px solid;
  text-align: left;
  cursor: pointer;
}


#btn-whatsapp {
  background: #fff;
  color: #1e7d3a;
  border-color: #25d366;
}

/* Botón Teléfono */
#btn-phone {
  background: #fff;
  color: #1f4fa3;
  border-color: #3b82f6;
}

/* Botón Ubicación */
#btn-location {
  background: #fff;
  color: #d32f2f;
  border-color: #ef5350;
}


.btn-Chat {
  background: linear-gradient(135deg, #ffffff, #f2fbfc);
  color: #1a7a8a;
  border: 2px solid #d8eef2;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: 'Open Sans', sans-serif;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(26, 122, 138, 0.12);
}

.btn-Chat .icon,
.btn-Chat .text {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-Chat:hover {
  background: linear-gradient(135deg, #f2fbfc, #e0f7fa);
  border-color: #8fd6df;
  color: #0f6675;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(26, 122, 138, 0.2);
}

.redirect-btn {
  background: linear-gradient(135deg, #2a8a9a, #43b6c9);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 10px 28px;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: 'Open Sans', sans-serif;
  cursor: pointer;
  display: inline-block;
  width: 100%;
  transition: all 0.3s ease;
  box-shadow: 0 8px 17px rgba(11, 34, 39, 0.7);
}

.redirect-btn:hover {
  background: linear-gradient(135deg, #43b6c9, #5fd3e6);
  transform: translateY(-2px);
  box-shadow: 0 8px 17px rgba(18, 57, 65, 0.53);
}
