html,
body {
  -webkit-font-smoothing: antialiased;
  -moz-font-smoothing: antialiased;
  -ms-font-smoothing: antialiased;
  -font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  margin: 0;
  padding: 0;
  height: 100%; 
}

body {
  font: 16px/1.6 'Raleway', Arial, Helvetica, sans-serif;
  text-align: center;
  background: #222;
  opacity: 0.8;
  background: #222;
  background: -moz-linear-gradient(top, #e8e4f5 0%, #e2dbfc 50%, #cec2f7 70%, #f3b7ee 100%);
  background: -webkit-linear-gradient(top, #e8e4f5 0%, #e2dbfc 50%, #cec2f7 70%, #f3b7ee 100%);
  background: linear-gradient(to bottom, #e8e4f5 0%, #e2dbfc 50%, #cec2f7 70%, #f3b7ee 100%);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e8e4f5', endColorstr='#f3b7ee',GradientType=0);
  min-height: 100%;
  overflow-y: auto; /* Añade scroll vertical cuando sea necesario */
}

.chats-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

.chat-container {
  background-color: #ece5dd;
  border-radius: 10px;
  padding: 20px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  margin: 20px 0;
  box-shadow: rgba(138, 43, 226, 0.8) 4px 4px 25px 1px;
}

.chat-container h4 {
  margin-top: 0;
  /* margin-bottom: 15px; */
  font-size: 24px;
  color: #333;
  text-align: center;
}

.chat {
  height: 300px;
  background-color: #fff;
  border: 1px solid #ddd;
  margin-bottom: 15px;
  overflow-y: auto;
  padding: 5px;
  border-radius: 5px;
  text-align: left;
  color: #333;
}

.chat-container input[type="text"] {
  width: 70%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #bbb;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 16px;
}

.btn-chatbot {
  margin: 20px 0;
  background: rgb(22, 199, 90);
  color: whitesmoke;
  text-align: center;
  line-height: 15px;
  padding: 16px 25px !important;
  border-radius: 8px;
  /* border: solid 1px rgba(138, 43, 226, 0.8); */
  text-transform: uppercase;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
  border: none;
}

.btn-chatbot:hover, .btn-chatbot:focus {
  color: whitesmoke;
  /* border: 2px dotted fuchsia; */
  /* box-shadow: rgba(68, 67, 68, 0.8) 4px 4px 25px 1px;   */
  background: rgb(18, 145, 67);
}

.btn-chatbot:focus {
  box-shadow: none;
  outline: none;
}

/* Contenedor principal de mensajes */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  height: 500px;
  overflow-y: auto;
  background-color: #fff;
}


/* Efectos de hover para mensajes */
.chat-message:hover {
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

/* Estilo para el primer mensaje del bot */
.chat-message.bot:first-child {
  margin-top: auto; /* Lo coloca al final del contenedor */
}

.chat-message.error {
  color: #d9534f;
  font-style: italic;
}

.chat-container > div {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-container input[type="text"] {
  width: 100%; /* se adapta al espacio disponible */
  margin-bottom: 0; /* elimina el espacio vertical */
}

.btn-chatbot {
  width: auto; /* para que no ocupe todo el ancho */
  padding: 12px 20px;
}

.chat-title {
  font-size: 18px;
  width: 100%;
  color: whitesmoke !important;
  margin-bottom: 0 !important;
  margin-top: 15px !important;
  border-radius: 8px  8px 0 0;
  text-transform: capitalize !important;
  font-weight: 500 !important;
  text-align: left !important;
  background-color:rgb(9, 139, 59);
  padding: 15px 0 15px 10px !important;
  display: inline-flex;
  align-items: center;
  gap: 15px;
  position: relative;
  z-index: 2;
}


.chat-avatar-inline {
  width: 50px;
  height: 50px;
  left: -20px !important;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* CONTENEDOR PRINCIPAL DEL CHAT - RESET COMPLETO */
 
#chat {
  display: block;
  flex: 1;
  padding: 15px;
  height: 350px !important;
  overflow-y: auto;
  background-color: #f5f5f5;
  box-sizing: border-box;
}

/* Estilos de los mensajes */
.message {
  margin-bottom: 10px;
  padding: 10px 15px;
  border-radius: 18px; 
  width: auto !important;/*  Se adapta al contenido */  
  min-width: 40px; /* Para mensajes muy cortos */  
  max-width: 70%;
  word-wrap: break-word; 
  line-height: 1.4;
  font-size: 16px;
}

.message.user {
  background-color: #888686;
  color: white;
  margin-left: auto !important;
  margin-right: 0 !important;
  border-bottom-right-radius: 5px;
  text-align: right; /* Alineación del texto a la derecha */
  align-self: flex-end; /* Fuerza alineación derecha */
}

.message.bot {
  background-color: #e0e0e0;
  color: #333;
  margin-right: auto;
  border-bottom-left-radius: 5px;
}


/* Arregla el espacio vacío en chatbot-ventas.html */
.section-inner {
  display: flex;
  justify-content: center;
  align-items: flex-start; /* importante: alinea arriba */
  min-height: 100vh;
  padding-top: 80px; /* controla el "bolsillo" superior */
  padding-bottom: 0; /* elimina espacio debajo */
}

#fullpage {
  height: 100vh !important;
  
}


/* Media query para móviles (ancho máximo 768px) */
@media screen and (max-width: 768px) {
  .chat-container {
    width: 100%; /* Ocupa todo el ancho disponible */
    max-width: 100%; /* Elimina el límite máximo */
    margin: 10px 0;
  }

  #chat {
    height: 200px !important; /* Reduce la altura para que sea más corta */
    width: 100%; /* Asegura que ocupe todo el ancho */
    box-sizing: border-box;
    display: block;
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    /* background-color: #f5f5f5; */
  }

  .chat-container input[type="text"] {
    width: 100%; /* Asegura que el input ocupe todo el ancho */
  }

  .btn-chatbot {
    width: 100%; /* Asegura que el botón ocupe todo el ancho */
    padding: 10px;
  }

  .chat-title {
    font-size: 18px !important;
    width: 100%;
    color: whitesmoke !important;
    margin-bottom: 0 !important;
    margin-top: 15px !important;
    border-radius: 8px  8px 0 0;
    text-transform: capitalize !important;
    font-weight: 500 !important;
    text-align: left !important;
    background-color:rgb(9, 139, 59);
    padding: 15px 0 15px 10px !important;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 2;
  }
  .chat-avatar-inline {
    width: 40px;
    height: 40px;
    left: -20px !important;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
  }
  /* Estilos de los mensajes */
  .message {
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 18px; 
    width: auto !important;/*  Se adapta al contenido */  
    min-width: 40px; /* Para mensajes muy cortos */  
    max-width: 60%;
    word-wrap: break-word; 
    line-height: 1.4;
    font-size: 14px;
  }
}
