/* TRUST GTC enquiry chatbot + WhatsApp handoff */
.tg-chat {
  --tg-chat-primary: #3d4470;
  --tg-chat-primary-dark: #2d3254;
  --tg-chat-accent: #4caf50;
  --tg-chat-accent-dark: #388e3c;
  --tg-chat-wa: #25d366;
  --tg-chat-wa-dark: #1ebe57;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  font-family: 'Poppins', 'Roboto', sans-serif;
}

.tg-chat-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--tg-chat-primary), var(--tg-chat-primary-dark));
  padding: 14px 22px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 10px 28px rgba(61, 68, 112, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tg-chat-launcher i {
  font-size: 1.25rem;
  line-height: 1;
}

.tg-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(61, 68, 112, 0.45);
}

.tg-chat-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 12px;
  height: 12px;
  background: var(--tg-chat-accent);
  border: 2px solid #fff;
  border-radius: 50%;
}

.tg-chat-panel {
  width: min(360px, calc(100vw - 32px));
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(61, 68, 112, 0.2);
  display: flex;
  flex-direction: column;
  max-height: min(560px, calc(100vh - 120px));
  animation: tgChatIn 0.28s ease;
}

.tg-chat-panel[hidden] {
  display: none !important;
}

@keyframes tgChatIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tg-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--tg-chat-primary), var(--tg-chat-primary-dark));
  color: #fff;
  flex-shrink: 0;
}

.tg-chat-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tg-chat-avatar {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tg-chat-avatar img {
  width: 86%;
  height: 86%;
  object-fit: contain;
}

.tg-chat-online {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 11px;
  height: 11px;
  background: var(--tg-chat-accent);
  border: 2px solid #fff;
  border-radius: 50%;
}

.tg-chat-name {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.tg-chat-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.9;
}

.tg-chat-close:hover {
  opacity: 1;
}

.tg-chat-messages {
  padding: 16px;
  background: #f5f6fa;
  overflow-y: auto;
  flex: 1;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tg-chat-bubble {
  max-width: 88%;
  padding: 11px 13px;
  font-size: 0.9rem;
  line-height: 1.45;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tg-chat-bubble--bot {
  align-self: flex-start;
  background: #fff;
  color: #2d3254;
  border-radius: 4px 14px 14px 14px;
  border: 1px solid rgba(61, 68, 112, 0.15);
}

.tg-chat-bubble--user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--tg-chat-primary), var(--tg-chat-primary-dark));
  color: #fff;
  border-radius: 14px 4px 14px 14px;
}

.tg-chat-typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 14px 16px;
}

.tg-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tg-chat-primary);
  opacity: 0.55;
  animation: tgTyping 1s infinite ease-in-out;
}

.tg-chat-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.tg-chat-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes tgTyping {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.tg-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 10px;
  background: #f5f6fa;
  flex-shrink: 0;
}

.tg-chat-suggestions button {
  border: 1px solid rgba(61, 68, 112, 0.35);
  background: #fff;
  color: var(--tg-chat-primary-dark);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tg-chat-suggestions button:hover {
  background: var(--tg-chat-primary);
  color: #fff;
  border-color: var(--tg-chat-primary);
}

.tg-chat-composer {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.tg-chat-composer input {
  flex: 1;
  border: 1px solid rgba(61, 68, 112, 0.3);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  outline: none;
  min-width: 0;
}

.tg-chat-composer input:focus {
  border-color: var(--tg-chat-primary);
  box-shadow: 0 0 0 3px rgba(61, 68, 112, 0.15);
}

.tg-chat-send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--tg-chat-primary), var(--tg-chat-primary-dark));
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.tg-chat-send:hover {
  transform: translateY(-1px);
}

.tg-chat-footer {
  padding: 0 14px 14px;
  background: #fff;
  flex-shrink: 0;
}

.tg-chat-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--tg-chat-wa), var(--tg-chat-wa-dark));
  color: #fff !important;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid var(--tg-chat-wa-dark);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tg-chat-wa:hover {
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
}

.tg-chat-wa i {
  font-size: 1.2rem;
}

/* Keep scroll-to-top above the Ask Us launcher */
.scroll-top {
  bottom: 96px !important;
  right: 30px;
}

html[dir="rtl"] .tg-chat {
  right: auto;
  left: 24px;
  align-items: flex-start;
}

html[dir="rtl"] .scroll-top {
  right: auto;
  left: 30px;
}

html[dir="rtl"] .tg-chat-bubble--bot {
  border-radius: 14px 4px 14px 14px;
  text-align: right;
}

html[dir="rtl"] .tg-chat-bubble--user {
  border-radius: 4px 14px 14px 14px;
  text-align: right;
}

@media (max-width: 575px) {
  .tg-chat {
    right: 16px;
    bottom: 16px;
  }

  .tg-chat-launcher span:not(.tg-chat-badge) {
    display: none;
  }

  .tg-chat-launcher {
    width: 56px;
    height: 56px;
    padding: 0;
    justify-content: center;
    border-radius: 14px;
  }

  .scroll-top {
    bottom: 88px !important;
    right: 18px;
    width: 44px;
    height: 44px;
  }

  html[dir="rtl"] .tg-chat {
    left: 16px;
  }

  html[dir="rtl"] .scroll-top {
    left: 18px;
  }
}
