body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f4f4;
}

header {
  background: #ff8800;
  color: white;
  padding: 20px;
  text-align: center;
}

.headerChat {
  color: white;
  text-align: center;
  padding: 0px 0;
}

.chatbot-widget {
  position: fixed;
  bottom: 20px;
  right: 15px;
  z-index: 1000;
  visibility: hidden;
}

.chatbot-button {
  height: 35px;
  border-radius: 24px;
  background: #ff8800;
  border: none;
  color: white;
  font-size: 17px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  font-family: 'Gill Sans', 'Gill Sans MT', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  position: relative;
  padding-left: 13px;
}

.chatbot-button:hover {
  background: #e67600;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
  transform: scale(1.05);
}

.chatbot-button img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

.chatbot-button .icono-chat {
  width: 20px;
  height: 20px;
}

.chatbot-button .btn-content {
  padding-right: 20px;
}

.chatbot-popup {
  position: absolute;
  bottom: 56px;
  right: 8px;
  width: 380px;
  height: 600px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(100%);
  display: flex;
  flex-direction: column;
}

.chatbot-popup.animar-abrir {
  animation: subir 0.4s forwards ease;
  visibility: visible;
  pointer-events: auto;
}

.chatbot-popup.animar-cerrar {
  animation: bajar 0.4s forwards ease;
  visibility: visible;
  pointer-events: none;
}

.chatbot-header {
  background: #ff8800;
  color: white;
  padding: 15px;
  text-align: center;
  font-size: 18px;
  font-family: 'Gill Sans', 'Gill Sans MT', sans-serif;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.chatbot-body {
  background: white;
  padding: 20px;
  text-align: center;
}

.logo-principal {
  height: 60px;
  margin-bottom: 10px;
  object-fit: contain;
  object-position: center;
}

.titulo {
  font-size: 22px;
  margin: 10px 0 20px;
  font-weight: bold;
  color: #222;
}

.btn-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icono-chat {
  width: 20px;
  height: 20px;
  transition: opacity 0.3s ease;
  vertical-align: middle;
}

.chatbot {
  width: 100%;
  height: 100%;
  background: white;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.chatbot-scroll {
  position: relative; 
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 6px;
  min-height: 0;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chatbot-scroll::before {
  content: '';
  position: absolute;
  top: 84px;
  left: 0;
  width: 100%;
  height: 22px;
  background: linear-gradient(to bottom, white 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 15px;
}

.logo-principal {
  width: 40px;
  height: 40px;
  margin-bottom: 5px;
}

.titulo {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  text-align: center;
  margin: 5px 0;
}

.chatbox {
   display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 400px;
  padding: 10px;
}

.chatbox::-webkit-scrollbar {
  display: none;
}

.message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  max-width: 90%;
}

.message.bot {
  display: flex;
  align-items: flex-start;
  margin-bottom: 10px;
}

.message.bot .avatar {
  width: 36px;
  height: 36px;
  margin-right: 5px;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
}

.message.bot > div {
  background-color: #eee;
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 70%;
  word-wrap: break-word;
}

.message.user {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
  background-color: #ff8800c3;
  color: white;
  align-self: flex-end;
  max-width: 60%;
  padding: 10px 14px;
  border-radius: 12px;
  vertical-align: top;
}

.message img.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.option-buttons {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: 4px;
  align-self: flex-start;
  flex-wrap: wrap;
}

.option-buttons button {
  background-color: #f8eee1;
  color: #fd9c00;
  border: none;
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
  align-self: flex-start;
  text-align: left;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.1);
  display: inline-block;
  white-space: normal;
  word-break: break-word;
}

.option-buttons button:hover {
  background-color: #ffcc99;
}

.chatbot-header {
  background: #ff8800;
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-family: 'Gill Sans', 'Gill Sans MT', sans-serif;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.reset-button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.reset-button img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

.bubble a {
  color: #ff8800;
  text-decoration: underline;
}
.bubble a:hover {
  color: #e67600;
}

.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 10px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background-color: #aaa;
  border-radius: 50%;
  animation: blink 3s infinite alternate;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.4s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.7s;
}

@keyframes blink {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

@keyframes subir {
  0% {
    opacity: 0;
    transform: translateY(100%);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bajar{
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(100%);
  }
}

.drag-handle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  cursor: grab;
  z-index: 1001;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: invert(1);
}


