/* Chatbot Widget */
#chatbot-widget { position: fixed; bottom: 24px; right: 24px; z-index: 9998; font-family: 'Inter', sans-serif; }

#chat-bubble {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #1a3a2a, #2d5a3f);
  color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 20px rgba(26,58,42,0.4);
  font-size: 1.4rem; transition: transform 0.3s; position: relative;
}
#chat-bubble:hover { transform: scale(1.1); }
.chat-pulse {
  position: absolute; width: 100%; height: 100%; border-radius: 50%;
  border: 2px solid #c8a96e; animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

#chat-window {
  display: none; flex-direction: column; width: 380px; height: 520px;
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2); transition: transform 0.3s, opacity 0.3s;
  transform: translateY(20px) scale(0.95); opacity: 0;
}
#chat-window.open { transform: translateY(0) scale(1); opacity: 1; }

.chat-header {
  background: linear-gradient(135deg, #1a3a2a, #2d5a3f);
  color: #fff; padding: 16px 20px; display: flex;
  justify-content: space-between; align-items: center; cursor: pointer;
}
.chat-header-info { display: flex; align-items: center; gap: 12px; }
.chat-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(200,169,110,0.3); display: flex;
  align-items: center; justify-content: center; font-size: 1.1rem;
}
.chat-title { font-weight: 600; font-size: 0.95rem; }
.chat-status { font-size: 0.75rem; opacity: 0.8; display: flex; align-items: center; gap: 6px; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #4caf50;
  display: inline-block; animation: statusPulse 2s infinite;
}
@keyframes statusPulse { 50% { opacity: 0.5; } }
.chat-close { background: none; border: none; color: #fff; font-size: 1.1rem; cursor: pointer; opacity: 0.8; }
.chat-close:hover { opacity: 1; }

#chat-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex;
  flex-direction: column; gap: 12px; background: #f7f7f7;
}
#chat-messages::-webkit-scrollbar { width: 4px; }
#chat-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.chat-msg { display: flex; gap: 8px; max-width: 90%; animation: fadeInUp 0.3s; }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg .msg-avatar {
  width: 30px; height: 30px; min-width: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #1a3a2a, #2d5a3f);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
}
.chat-msg .msg-bubble {
  padding: 10px 14px; border-radius: 12px; font-size: 0.85rem; line-height: 1.5;
}
.chat-msg.bot .msg-bubble { background: #fff; color: #333; box-shadow: 0 1px 4px rgba(0,0,0,0.08); border-bottom-left-radius: 4px; }
.chat-msg.user .msg-bubble { background: #1a3a2a; color: #fff; border-bottom-right-radius: 4px; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.typing-indicator .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #999; margin: 0 2px; animation: typingBounce 1.2s infinite;
}
.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

.chat-products { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.chat-product {
  display: flex; align-items: center; gap: 10px; padding: 8px;
  background: #f8f8f8; border-radius: 8px; text-decoration: none;
  transition: background 0.2s; border: 1px solid #eee;
}
.chat-product:hover { background: #f0ede8; }
.chat-product img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; }
.chat-product-placeholder {
  width: 48px; height: 48px; border-radius: 6px; background: #e0dcd5;
  display: flex; align-items: center; justify-content: center; color: #aaa;
}
.chat-product-name { font-size: 0.8rem; font-weight: 500; color: #333; }
.chat-product-price { font-size: 0.8rem; font-weight: 700; color: #c8a96e; }

.chat-suggestions {
  padding: 8px 16px; display: flex; flex-wrap: wrap; gap: 6px;
  background: #fff; border-top: 1px solid #eee;
}
.suggestion-btn {
  background: #f0ede8; border: 1px solid #e0dcd5; border-radius: 20px;
  padding: 6px 14px; font-size: 0.75rem; cursor: pointer;
  color: #1a3a2a; transition: all 0.2s;
}
.suggestion-btn:hover { background: #1a3a2a; color: #fff; }

.chat-input {
  display: flex; padding: 12px 16px; background: #fff;
  border-top: 1px solid #eee; gap: 8px;
}
.chat-input input {
  flex: 1; border: 1px solid #e0dcd5; border-radius: 24px;
  padding: 10px 16px; font-size: 0.85rem; outline: none;
  transition: border-color 0.2s;
}
.chat-input input:focus { border-color: #c8a96e; }
.chat-input button {
  background: #1a3a2a; border: none; color: #fff; width: 40px;
  height: 40px; border-radius: 50%; cursor: pointer; transition: background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.chat-input button:hover { background: #c8a96e; }

@media (max-width: 480px) {
  #chat-window { width: calc(100vw - 20px); height: calc(100vh - 100px); right: 0; bottom: 0; border-radius: 16px 16px 0 0; }
  #chatbot-widget { bottom: 16px; right: 10px; }
}
