#custom-chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  cursor: pointer;
  z-index: 9999;
  background-color: transparent; /* Verde oscuro */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: background-color 0.3s ease;
  overflow: hidden;
  /* nueva línea para la burbuja */
  pointer-events: auto;
}

#custom-chat-button .button-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

#chat-notification-bubble {
  position: absolute;
  top: -6px;
  right: -6px;
  background: red;
  color: white;
  font-weight: bold;
  font-size: 14px;
  border-radius: 50%;
  padding: 3px 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  z-index: 10; /* solo necesita estar sobre la imagen dentro del botón */
}


#custom-chat-button:hover {
  background-color: #81C784; /* Verde claro */
}

#custom-chat-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}

#custom-chat-box {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 570px;
  height: 400px;
  background-color: #FFFFFF; /* Fondo blanco */
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  border: 1px transparent; /* Borde verde claro */
}

#custom-chat-box.visible {
  display: flex;
}

.chat-header {
  background-color: #2E7D32; /* Verde oscuro */
  color: #FFFFFF;
  padding: 8px;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  font-size: 14px;
  color: #ffffff; /* Texto oscuro */
  background-color: #F9F9F9; /* Fondo claro para mensajes */
}

.chat-input {
  display: flex;
  border-top: 1px solid #E0E0E0;
  background-color: #FFFFFF;
}

.chat-input input {
  flex: 1;
  border: none;
  padding: 10px;
  font-size: 14px;
  color: #212121;
}

.chat-input input::placeholder {
  color: #9E9E9E;
}

.chat-input button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 10px;
  color: #FFB300; /* Naranja */
  font-size: 18px;
  transition: color 0.3s ease;
}

.chat-input button:hover {
  color: #FFA000; /* Naranja más oscuro */
}

.chat-close {
  cursor: pointer;
  transition: transform 0.3s ease;
}

.chat-close:hover {
  transform: rotate(360deg);
}

.chat-reset {
  cursor: pointer;
  transition: transform 0.3s ease;
  margin-left: 4px; /* Reduce el espacio entre la X y ↻ */
}

.chat-reset:hover {
  transform: rotate(360deg);
}

.chat-header .chat-title {
  flex-grow: 1;
  font-weight: bold;
}

.chat-header .chat-reset,
.chat-header .chat-close {
  font-size: 18px;
  margin-left: 8px;
}


.chat-footer {
  text-align: left;
  padding: 5px 10px;
  font-size: 10px;
  color: #555;
  background: transparent;
}

#chat-send-button {
  background-color: #000; /* fondo negro */
  border: none;
  color: #ccc; /* gris claro */
  font-size: 14px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px; /* espacio entre ícono y texto */
  transition: color 0.3s ease;
}

#chat-send-button:hover {
  color: #fff; /* texto blanco al pasar el mouse */
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media screen and (max-width: 480px) {
  #custom-chat-box {
    width: 100%;
    bottom: 0;
    right: 0;
    left: 0;
    margin-top: 45px;
    top: 50px;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }
  
  .chat-header {
    font-size: 16px;
    padding: 10px;
  }

  .chat-input input {
    font-size: 14px;
  }

  .chat-input button {
    font-size: 14px;
  }

  .chat-messages {
    padding: 10px;
    max-height: 50vh;
    overflow-y: auto;
  }
}

.typing-indicator {
  margin-top: 16px;
  margin-bottom: 0;
  padding: 16px;
  border-radius: 8px;
  background-color: #2a2a2a;
  color: #ffffff;
  border-left: 4px solid #d2b04c;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.5;
  max-width: 90%;
}
