/* Chatbot CSS */
.chatbot-toggler {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--gold);
  color: #000;
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  z-index: 9999;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chatbot-toggler:hover {
  transform: scale(1.1);
}
.chatbot-toggler i.fa-times {
  display: none;
}
.show-chatbot .chatbot-toggler i.fa-comment-dots {
  display: none;
}
.show-chatbot .chatbot-toggler i.fa-times {
  display: block;
}

.chatbot-window {
  position: fixed;
  right: 28px;
  bottom: 95px;
  width: 350px;
  background: var(--green-primary);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 9998;
  display: flex;
  flex-direction: column;
}
.show-chatbot .chatbot-window {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.chat-header {
  background: var(--green-mid);
  padding: 16px;
  border-bottom: 1px solid rgba(212,175,55,0.2);
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-header .bot-avatar {
  width: 40px;
  height: 40px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 1.2rem;
}
.chat-header .header-info h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--gold);
  font-family: var(--font-serif);
}
.chat-header .header-info p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-light);
}
.chat-header .close-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 1.2rem;
}

.chat-box {
  height: 350px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) var(--green-mid);
}
.chat-box::-webkit-scrollbar { width: 6px; }
.chat-box::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 4px; }

.chat-msg {
  display: flex;
  gap: 10px;
  max-width: 85%;
}
.chat-msg.bot {
  align-self: flex-start;
}
.chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg .msg-content {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
}
.chat-msg.bot .msg-content {
  background: var(--green-light);
  color: rgba(255,255,255,0.9);
  border-bottom-left-radius: 0;
}
.chat-msg.user .msg-content {
  background: var(--gold);
  color: #000;
  border-bottom-right-radius: 0;
}

.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.chat-action-btn {
  background: rgba(212,175,55,0.1);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.chat-action-btn:hover {
  background: var(--gold);
  color: #000;
}
.chat-action-btn.primary {
  background: var(--gold);
  color: #000;
  font-weight: bold;
}
.chat-action-btn.whatsapp {
  background: var(--whatsapp);
  border-color: var(--whatsapp);
  color: #fff;
}

.chat-input-area {
  padding: 12px 16px;
  background: var(--green-mid);
  border-top: 1px solid rgba(212,175,55,0.2);
  display: flex;
  gap: 10px;
  align-items: center;
}
.chat-input-area input {
  flex: 1;
  background: var(--green-light);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  padding: 10px 14px;
  border-radius: 20px;
  outline: none;
  font-size: 0.9rem;
}
.chat-input-area input:focus {
  border-color: var(--gold);
}
.chat-input-area button {
  background: var(--gold);
  color: #000;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.typing-indicator {
  display: none;
  align-self: flex-start;
  background: var(--green-light);
  padding: 10px 14px;
  border-radius: 12px;
  border-bottom-left-radius: 0;
  margin-bottom: 12px;
}
.typing-indicator span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  margin: 0 2px;
  animation: typing 1s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@media(max-width: 768px) {
  .chatbot-window {
    width: 90vw;
    max-width: 350px;
    height: 70vh;
    left: 50%;
    right: auto;
    bottom: 95px;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    flex-direction: column;
  }
  .show-chatbot .chatbot-window {
    transform: translateX(-50%) translateY(0);
  }
  .chat-header {
    padding: 12px;
  }
  .chat-header .bot-avatar {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .chat-header .header-info h3 {
    font-size: 0.9rem;
  }
  .chat-header .header-info p {
    font-size: 0.7rem;
  }
  .chat-box {
    height: auto;
    flex: 1;
    padding: 12px;
  }
  .chat-msg .msg-content {
    font-size: 0.85rem;
  }
  .chat-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .chat-action-btn {
    width: 100%;
    text-align: center;
    padding: 10px;
  }
  .chat-input-area {
    padding: 10px 12px;
    position: sticky;
    bottom: 0;
    width: 100%;
    box-sizing: border-box;
  }
}

/* Chat Teaser */
.chatbot-teaser {
  position: fixed;
  bottom: 100px;
  right: 28px;
  background: #ffffff;
  color: #000000;
  padding: 10px 16px;
  border-radius: 20px;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  font-size: 0.9rem;
  font-weight: bold;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 9998;
  border: 1px solid var(--gold);
  cursor: pointer;
}
.chatbot-teaser.show-teaser {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.show-chatbot .chatbot-teaser {
  display: none !important;
}

@media(max-width: 768px) {
  .chatbot-teaser {
    bottom: 100px;
  }
}
