.chatbot-widget-container {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 9999;
  font-family: 'Inter', sans-serif;
}

.chatbot-widget-container i {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", sans-serif;
  font-weight: 900;
}

.chatbot-toggle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-toggle-btn:hover {
  transform: scale(1.1);
}

.chatbot-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 500px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.3s ease;
  border: 1px solid #eaeaea;
}

.chatbot-window.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.chatbot-header {
  background: #0f172a;
  color: white;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot-avatar {
  width: 35px;
  height: 35px;
  background-color: #0f172a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.chatbot-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.chatbot-status {
  font-size: 0.8rem;
  color: #ccc;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chatbot-status::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background-color: #4CAF50;
  border-radius: 50%;
}

.chatbot-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.chatbot-close-btn:hover {
  opacity: 1;
}

.chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background-color: #f9f9f9;
}

.chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-msg.bot {
  background-color: #fff;
  border: 1px solid #eee;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chat-msg.user {
  background-color: #0f172a;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-msg p {
  margin: 0 0 10px 0;
}

.chat-msg p:last-child {
  margin: 0;
}

/* markdown styles inside chat */
.chat-msg strong {
  font-weight: bold;
}
.chat-msg ul {
  margin: 0;
  padding-left: 20px;
}

.chatbot-input-area {
  padding: 15px;
  background-color: white;
  border-top: 1px solid #eaeaea;
  display: flex;
  gap: 10px;
}

.chatbot-input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 20px;
  outline: none;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.chatbot-input:focus {
  border-color: #0f172a;
}

.chatbot-send-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background-color: #0f172a;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background-color 0.2s;
}

.chatbot-send-btn:hover {
  background-color: var(--c-brand-dark, #0056b3);
}

.chatbot-send-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 15px;
  background-color: #fff;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  border: 1px solid #eee;
  width: fit-content;
  align-items: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  align-self: flex-start;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: #aaa;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ─── Quick Reply Chips ──────────────────────────────────── */
.quick-reply-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
  align-self: flex-start;
}

.quick-reply-chip {
  background: #fff;
  border: 1.5px solid var(--color-primary, #0052cc);
  color: var(--color-primary, #0052cc);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.quick-reply-chip:hover {
  background: var(--color-primary, #0052cc);
  color: #fff;
  transform: translateY(-1px);
}

/* ─── Single Product Card ───────────────────────────────── */
.chat-product-card {
  align-self: flex-start;
  width: 100%;
  max-width: 260px;
  border-radius: 12px;
  border: 1px solid #e8edf3;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  transition: transform 0.2s, box-shadow 0.2s;
  background: #fff;
}
.chat-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,82,204,0.13);
}
.chat-product-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.chat-product-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}
.chat-product-img-placeholder {
  width: 100%;
  height: 140px;
  background: #f0f4f8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #b0bec5;
}
.chat-product-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.chat-product-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}
.chat-product-price {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-primary, #0052cc);
}
.chat-product-cta {
  font-size: 0.78rem;
  color: var(--c-accent, #ff6200);
  font-weight: 600;
  margin-top: 2px;
}

/* ─── Multi-Product Results Grid ────────────────────────── */
.chat-product-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: flex-start;
  width: 100%;
}
.chat-product-card-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 10px;
  padding: 8px 10px;
  transition: all 0.18s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.chat-product-card-mini:hover {
  border-color: var(--color-primary, #0052cc);
  box-shadow: 0 3px 12px rgba(0,82,204,0.1);
  transform: translateX(2px);
}
.chat-product-card-mini img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.mini-placeholder {
  width: 50px;
  height: 50px;
  background: #f0f4f8;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #b0bec5;
  flex-shrink: 0;
}
.chat-product-card-mini div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-product-card-mini strong {
  font-size: 0.87rem;
  color: #1e293b;
  line-height: 1.3;
}
.chat-product-card-mini span {
  font-size: 0.82rem;
  color: var(--color-primary, #0052cc);
  font-weight: 600;
}

@media (max-width: 600px) {
  .chatbot-window {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: 82dvh;
    max-height: 580px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.25);
    z-index: 100005;
  }
}
@media (max-width: 768px) {
  .chatbot-widget-container {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 14px;
    z-index: 1001;
  }
  .chatbot-toggle-btn {
    width: 50px;
    height: 50px;
    font-size: 1.45rem;
  }
}
