* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.chat-icon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #3f3d56;
  padding: 5px;
  /* color: white; */
  border: none;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  font-size: 36px;
  cursor: pointer;
  z-index: 999;
  transition: all ease-in-out 2s;

}

.chat-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  /* margin: 0 auto ;
  padding: 15px 5px 0px 5px; */
  background-color: #ffffff;


  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);


}

.chat-container {
  /* display: none; */
  font-size: 14px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.6, 0.05, 0.3, 1), visibility 0.6s;


  position: fixed;
  bottom: 110px;
  right: 20px;
  width: 400px;
  max-width: 90vw;
  height: 70vh;
  background: white;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  z-index: 998;
  overflow: hidden;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

/* ➡️ Solo se aplicará el estilo si el elemento tiene las dos clases simultáneamente container y visible*/
.chat-container.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}


.chat-container__listado-de-mensajes {
  height: 80%;
  overflow-y: auto;
  padding: 1%;
  display: flex;
  flex-direction: column;
  background-color: rgb(240, 233, 210);
  flex-grow: 5;


}

.chat-container__input-area {
  margin-top: 2%;
  display: flex;
  height: 10%;
  padding: 1% 0px;
  gap: 2%;
  flex-grow: 1;

  /* border-top: 1px solid #ccc; */
}

.chat-container__input {
  flex: 1;
  padding: 8px;
  border-style: solid;
  border-radius: 16px;
  border-color: #a4a3a3;
  border-width: 2px;
}

.chat-container__button {
  padding: 8px;
  border-style: solid;
  border-width: 2px;
  background-color: #f8f8f9;
  border-color: #a4a3a3;
  border-radius: 16px;
}

.chat-container__button:hover {


  background-color: #f2eee1;


}

.chat-container__button:active {


  background-color: #d2d0ca;


}

/* .chat-container__listado-de-mensajes__mensaje {
  margin: 10px 0 20px 0;
} */

.chat-container__listado-de-mensajes__mensaje {

  max-width: 80%;
  margin: 6px;
  /*   padding: 10px 14px;
  border-radius: 12px; */
  color: #1f1f27;
  font-family: sans-serif;
  line-height: 1.3;
  font-size: 14px;
  letter-spacing: 0px;
  word-spacing: 0px;
  display: flex;
}

.mensaje--usuario {

  align-self: flex-end;
  text-align: right;
  flex-direction: row-reverse;
}

.mensaje--bot {

  align-self: flex-start;
  text-align: left;

}

.vineta-texto-usuario {
  margin-top: 15px;
  margin-right: 5px;
  padding: 8px 11px 10px 11px;
  border-radius: 13px;
  /* verde claro tipo WhatsApp */
  background-color: #dcf8c6;
  border-top-right-radius: 0;
}

.vineta-texto-robot {
  margin-top: 15px;
  margin-left: 5px;
  padding: 8px 11px 10px 11px;
  border-radius: 13px;
  background-color: #f5f5f5;
  border-top-left-radius: 0;
}

.vineta-icono-usuario {
  font-size: 24px;
}

.vineta-icono-robot {
  font-size: 24px;
}

.vineta-texto-robot br {
  margin-bottom: 0.5em;
  display: block;
}




/* .chat-icon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 24px;
  cursor: pointer;
  z-index: 999;
  overflow: visible;
} */

/* Ondas envolventes */
.chat-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  border: 2px solid rgba(0, 123, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  animation: pulse 1.2s ease-out 1s 30;
  opacity: 0;
  pointer-events: none;
}

/* Burbuja de 💬 arriba */
.chat-icon::after {
  content: "💬";
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  font-size: 40px;
  transition: all ease-in-out 2s;
  /* nimation: float-up 1.2s ease-out 1s 2; */
  /* animation: float-up 1s ease-in-out infinite; */
  pointer-events: none;
}

/* Animaciones al hover */
.chat-icon:hover::before {
  /* "PULSO" */
  animation: pulse 1.2s ease-out 80 forwards;
}

.chat-icon:hover::after {
  /* "💬" */
  transition: all ease-in-out 2s;
  animation: float-up 1s ease-in-out 10 forwards;

}


.chat-icon.opened::after {
  /* "💬" */
  opacity: 0;
  transition: all ease-in-out 0.5s;
}

.chat-icon.opened:hover::before,
.chat-icon.opened:hover::after {

  opacity: 0;
}

/* Keyframes */
@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }

  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

@keyframes float-up {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(-5px);
  }
}


/* Inicio de pelotitas Escribiendo... */
.pelotitas-rebotando {
  display: flex;
  gap: 5px;
  align-items: flex-end;
  padding-bottom: 3px;
  height: 20px;
}

.pelotita {
  width: 6px;
  height: 6px;
  background-color: #999;
  border-radius: 50%;
  animation: rebote 0.6s infinite ease-in-out;
}

.pelotita:nth-child(1) {
  animation-delay: 0s;
}

.pelotita:nth-child(2) {
  animation-delay: 0.2s;
}

.pelotita:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes rebote {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

/* Fin de pelotitas Escribiendo... */