/* ====== FLOATING ACTION BUTTONS (Bottom Right) ====== */
.floating-widgets {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  z-index: 9999;
}

/* ====== WHATSAPP BUTTON ====== */
.whatsapp-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
}
.whatsapp-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.55);
}
.whatsapp-btn svg {
  width: 30px;
  height: 30px;
  fill: #fff;
}

/* Tooltip */
.whatsapp-btn::before {
  content: "Chat on WhatsApp";
  position: absolute;
  right: 68px;
  background: #333;
  color: #fff;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  font-family: 'Lato', sans-serif;
}
.whatsapp-btn:hover::before {
  opacity: 1;
}

/* ====== CHATBOT TOGGLE BUTTON ====== */
.chatbot-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d4a32, #3d6b44);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(45, 74, 50, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}
.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(45, 74, 50, 0.55);
}
.chatbot-toggle svg {
  width: 28px;
  height: 28px;
  fill: #fff;
  transition: transform 0.3s;
}
.chatbot-toggle.active svg.icon-chat { display: none; }
.chatbot-toggle.active svg.icon-close { display: block; }
.chatbot-toggle svg.icon-close { display: none; }

/* Notification pulse */
.chatbot-toggle::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: #b8963a;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: pulse-dot 2s infinite;
}
.chatbot-toggle.active::after { display: none; }

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* ====== CHATBOT WINDOW ====== */
.chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.chatbot-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.chatbot-header {
  background: linear-gradient(135deg, #2d4a32, #3d6b44);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.chatbot-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chatbot-header-avatar svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}
.chatbot-header-info h3 {
  margin: 0;
  font-size: 15px;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}
.chatbot-header-info p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.85;
  font-family: 'Lato', sans-serif;
}

/* Messages area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f7f3eb;
  max-height: 320px;
}
.chatbot-messages::-webkit-scrollbar { width: 5px; }
.chatbot-messages::-webkit-scrollbar-track { background: transparent; }
.chatbot-messages::-webkit-scrollbar-thumb { background: #c4b99a; border-radius: 10px; }

/* Message bubbles */
.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  font-family: 'Lato', sans-serif;
  animation: fadeInMsg 0.3s ease;
}
@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg.bot {
  background: #fff;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.chat-msg.user {
  background: linear-gradient(135deg, #2d4a32, #3d6b44);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Quick reply chips */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.quick-reply-btn {
  background: #eee8d9;
  border: 1px solid #d4c9a8;
  color: #2d4a32;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12.5px;
  font-family: 'Lato', sans-serif;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.quick-reply-btn:hover {
  background: #2d4a32;
  color: #fff;
  border-color: #2d4a32;
}

/* Input area */
.chatbot-input {
  display: flex;
  align-items: center;
  border-top: 1px solid #e8e0d0;
  padding: 10px 14px;
  background: #fff;
  gap: 8px;
}
.chatbot-input input {
  flex: 1;
  border: 1px solid #d4c9a8;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-family: 'Lato', sans-serif;
  outline: none;
  background: #faf8f3;
  transition: border-color 0.2s;
}
.chatbot-input input:focus {
  border-color: #2d4a32;
}
.chatbot-input input::placeholder {
  color: #a09880;
}
.chatbot-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d4a32, #3d6b44);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.chatbot-send:hover { transform: scale(1.08); }
.chatbot-send svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-self: flex-start;
}
.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #a09880;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ====== MOBILE RESPONSIVE ====== */
@media (max-width: 480px) {
  .chatbot-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 90px;
    max-height: 70vh;
  }
  .floating-widgets {
    bottom: 16px;
    right: 16px;
    gap: 12px;
  }
  .chatbot-toggle, .whatsapp-btn {
    width: 52px;
    height: 52px;
  }
}
