#tfg-chatbot-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: auto;
  z-index: 999999;
  font-family: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#tfg-chatbot-toggle {
  width: auto;
  min-width: 66px;
  height: 66px;
  border: 0;
  border-radius: 999px;
  background: #44B121;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 18px 0 14px;
  box-shadow: 0 16px 38px rgba(68,177,33,.32), 0 6px 16px rgba(0,0,0,.12);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, width .28s ease, background .25s ease;
  overflow: hidden;
  white-space: nowrap;
}

#tfg-chatbot-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 46px rgba(68,177,33,.36), 0 8px 18px rgba(0,0,0,.14);
  background: #3da61f;
}

.tfg-chatbot-toggle-label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  transition: max-width .28s ease, opacity .2s ease, margin .28s ease;
}

#tfg-chatbot-toggle:hover .tfg-chatbot-toggle-label {
  max-width: 180px;
  opacity: 1;
  margin-right: 2px;
}

.tfg-chatbot-toggle-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
}

#tfg-chatbot-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 380px;
  height: 680px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,.18);
  overflow: hidden;
  display: none;
  flex-direction: column;
  transform-origin: bottom right;
  animation: tfgFadeUp .22s ease;
  touch-action: pan-y;
}

@keyframes tfgFadeUp {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tfg-chatbot-header {
  padding: 18px 18px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.75);
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.tfg-chatbot-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tfg-chatbot-dot {
  width: 10px;
  height: 10px;
  background: #44B121;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(68,177,33,.12);
}

.tfg-chatbot-title {
  font-size: 15px;
  line-height: 1.1;
  font-weight: 700;
  color: #111;
}

.tfg-chatbot-subtitle {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

#tfg-chatbot-close {
  border: 0;
  background: #f2f2f7;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
  color: #333;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-align: center;
}

#tfg-chatbot-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px;
  background: linear-gradient(180deg, rgba(250,250,252,1) 0%, rgba(255,255,255,1) 100%);
  touch-action: pan-y;
}

.tfg-msg {
  max-width: 86%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
}

.tfg-msg-bot {
  background: #f2f2f7;
  color: #111;
  border-bottom-left-radius: 8px;
  margin-left: 8px;
}

.tfg-msg-user {
  background: #111;
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 8px;
}

.tfg-form,
.tfg-topic-grid,
.tfg-composer,
.tfg-products,
.tfg-actions {
  margin-top: 14px;
}

.tfg-form input[type="text"],
.tfg-form input[type="email"],
.tfg-composer textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e5e5ea;
  background: #fff;
  border-radius: 16px;
  padding: 14px 15px;
  font-size: 14px;
  outline: none;
  margin-bottom: 10px;
  font-family: inherit;
}

.tfg-form label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #555;
  margin: 6px 0 12px;
}

.tfg-form a {
  color: #111;
  text-decoration: underline;
}

.tfg-btn,
.tfg-topic-btn,
.tfg-send-btn,
.tfg-product-link,
.tfg-secondary-btn {
  appearance: none;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease;
  font-family: inherit;
}

.tfg-btn,
.tfg-send-btn {
  width: 100%;
  padding: 14px 16px;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}

.tfg-secondary-btn {
  width: 100%;
  padding: 12px 14px;
  background: #f2f2f7;
  color: #111;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tfg-btn:hover,
.tfg-send-btn:hover,
.tfg-topic-btn:hover,
.tfg-product-link:hover,
.tfg-secondary-btn:hover {
  transform: translateY(-1px);
}

.tfg-topic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tfg-topic-btn {
  text-align: left;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #f28c28 !important;
  color: #f28c28 !important;
  font-size: 0.8em !important;
  font-weight: normal !important;
  min-height: 42px !important;
  border-radius: 14px;
  line-height: 1.25;
}

.tfg-topic-btn:hover {
  background: #f2f2f7 !important;
  border-color: #d9d9df !important;
  color: #555 !important;
}

.tfg-composer textarea {
  min-height: 96px;
  resize: vertical;
  margin-bottom: 8px;
}

.tfg-products {
  display: grid;
  gap: 10px;
}

.tfg-product-card {
  background: #fff;
  border: 1px solid #ececf1;
  border-radius: 18px;
  padding: 14px;
}

.tfg-product-title {
  font-size: 14px;
  font-weight: 700;
  color: #111;
  margin-bottom: 6px;
}

.tfg-product-desc {
  font-size: 13px;
  color: #555;
  line-height: 1.45;
  margin-bottom: 10px;
}

.tfg-product-link {
  display: inline-block;
  padding: 10px 14px;
  background: #44B121;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

#tfg-chatbot-footer {
  border-top: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.78);
  padding: 12px 18px;
}

.tfg-chatbot-legal {
  font-size: 11px;
  line-height: 1.4;
  color: #6b6b73;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.tfg-chatbot-legal-icon {
  color: #44B121;
  min-width: 16px;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tfg-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.tfg-typing span {
  width: 6px;
  height: 6px;
  background: #999;
  border-radius: 50%;
  display: inline-block;
  animation: tfgTyping 1.2s infinite ease-in-out;
}

.tfg-typing span:nth-child(2) { animation-delay: .15s; }
.tfg-typing span:nth-child(3) { animation-delay: .3s; }

@keyframes tfgTyping {
  0%, 80%, 100% { transform: scale(.7); opacity: .5; }
  40% { transform: scale(1); opacity: 1; }
}

@media (max-width: 767px) {
  #tfg-chatbot-root {
    right: 12px;
    bottom: 12px;
    left: auto;
  }

  #tfg-chatbot-toggle {
    width: 66px;
    min-width: 66px;
    height: 66px;
    padding: 0;
    justify-content: center;
  }

  .tfg-chatbot-toggle-label {
    display: none;
  }

  #tfg-chatbot-panel {
    width: calc(100vw - 24px);
    height: min(78vh, 700px);
    right: 0;
    bottom: 78px;
  }

  #tfg-chatbot-body {
    padding: 18px 16px 16px;
  }

  .tfg-msg {
    max-width: 90%;
  }

  .tfg-msg-bot {
    margin-left: 10px;
  }
}