/* CSS for chat styling */
/* Botón flotante */
#rentarturismo-chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #799E36;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 28px;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Contenedor general del chat */
#rentarturismo-chat-container {
@media (max-width: 768px) {
  #rentarturismo-chat-container {
    width: 95vw;
    right: 2.5vw;
    max-height: 90vh;
  }
  .chat-window {
    height: auto;
    max-height: 85vh;
  }
}
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 350px;
  max-height: 80vh;
  z-index: 9999;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

#rentarturismo-chat-container.hidden {
  display: none;
}

/* Ventana principal */
.chat-window {
  background-color: #fff;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Cabecera del chat */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  padding: 10px 15px;
  font-weight: bold;
  font-size: 15px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.chat-header img.chat-logo {
  height: 30px;
  max-height: 40px;
  width: auto;
  margin-right: 10px;
  object-fit: contain;
}

.chat-header button {
  background: transparent;
  border: none;
  color: white;
  font-size: 18px;
  margin-left: 8px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.chat-header button:hover {
  opacity: 1;
}

/* Cuerpo del chat */
.chat-body {
  max-height: 50vh; /* NUEVO: asegura scroll en móviles */
  overscroll-behavior: contain; /* NUEVO: evita scroll del body en móviles */
  -webkit-overflow-scrolling: touch; /* NUEVO: mejora scroll en iOS */

  padding: 12px;
  overflow-y: auto;
  flex-grow: 1;
  background-color: #f9f9f9;
  scroll-behavior: smooth;
}

/* Mensajes */
.chat-message {
  margin: 6px 0;
  padding: 10px 15px;
  border-radius: 18px;
  max-width: 85%;
  line-height: 1.4;
  font-size: 14px;
  word-wrap: break-word;
}

.chat-message.usuario {
  align-self: flex-end;
  color: #fff;
  text-align: right;
  background-color: var(--user-color, #fc7e08); /* por si se quiere con CSS vars también */
}

.chat-message.asistente {
  align-self: flex-start;
  background-color: #e0e0e0;
  color: #333;
  text-align: left;
}

/* Input y botones */
.chat-input {
  padding: 10px;
  border-top: 1px solid #ddd;
  background-color: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-input input[type="text"],
.chat-input input[type="email"] {
  flex: 1 1 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.chat-input button {
  padding: 8px 15px;
  background-color: #799E36;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

/* Responsive para móviles */
@media screen and (max-width: 500px) {
  #rentarturismo-chat-container {
@media (max-width: 768px) {
  #rentarturismo-chat-container {
    width: 95vw;
    right: 2.5vw;
    max-height: 90vh;
  }
  .chat-window {
    height: auto;
    max-height: 85vh;
  }
}
    width: 95vw;
    right: 2.5vw;
    bottom: 85px;
  }

  .chat-message {
    max-width: 95%;
  }

  .chat-header span {
    font-size: 14px;
  }
}