.chat {
  display: flex;
  flex-direction: column;
  width: 350px;
  height: 550px;
  flex-direction: column;
  overflow: hidden;
  background: #1c1111;
  border: 1px solid #3d2424;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  gap: 20px;
  top: 60px;

}

/* HEADER */

.chat-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: #291515;
  border-bottom: 1px solid #3d2424;
}

.logo {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  font-size: 25px;
  background: #4a2020;
  border-radius: 50%;
}

.chat-header h1 {
  font-size: 1.2rem;
}

.chat-header span {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: #c7a8a8;
}

/* MENSAGENS */

.chat-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px;
  overflow-y: auto;
}

/* MENSAGEM */

.message {
  max-width: 80%;
  padding: 12px 15px;
  border-radius: 15px;
  line-height: 1.4;
}

.message.ia {
  align-self: flex-start;
  background: #302020;
}

.message.cliente {
  align-self: flex-end;
  background: #7b3030;
}

/* INPUT */

.chat-input {
  display: flex;
  gap: 5px;
  padding: 15px;
  background: #291515;
  border-top: 1px solid #3d2424;
}

.chat-input input {
  flex: 1;
  padding: 8px 10px;
  border: none;
  outline: none;
  border-radius: 10px;
  background: #160b0b;
  color: #fff;
  font-size: 1rem;
}

.chat-input input::placeholder {
  color: #8f7777;
}

.chat-input button {
  padding: 0 20px;
  border: none;
  border-radius: 10px;
  background: #b85c3a;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
}

.chat-input button:hover {
  background: #d36d47;
}

.menu-button {
  display: none;
  background: none;
  font-size: 2rem;
  color: white;
  cursor: pointer;

}

.chat-container {
  position: fixed;
  right: 0px;
  bottom: 195px;
  width: 350px;
  height: 400px;
  z-index: 800;
  opacity: 1;
  visibility: hidden;
  transform: translateY(40px) scale(0.3);
  transform-origin: bottom right;

  transition:
    opacity 0.3s ease,
    transform 0.4s ease,
    visibility 0.4s;
}


.chat-button {
  position: fixed;
  right: 25px;
  bottom: 25px;
  width: 80px;
  height: 80px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 802;

  animation: pulse 2s infinite;
}

.chat-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;

  pointer-events: none;
}

/* X começa escondido */
.close-icon {
  display: none;
  font-size: 45px;
  line-height: 1;
  font-weight: 300;
  pointer-events: none;
}

/* estado se active */

.chat-button.active {
  animation: pulse 1.5s infinite;
  scale: 1.1;
  right: 345px;
}


.chat-button.active .chat-icon {
  display: none;
}

.chat-button.active .close-icon {
  display: block;
  color: #c58f52;
  font-weight: bold;

}

.chat-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;

}

.chat-container.active {
  opacity: 1;
  visibility: visible;

  transform: translateY(0) scale(1);
}
