/* WhatsApp Floating Button */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
  transition: all 0.3s ease;
  text-decoration: none;
}
.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45);
}
.whatsapp-float svg {
  display: block;
}

/* Chatbot Widget */
.chatbot-widget {
  position: fixed;
  bottom: 92px;
  right: 24px;
  z-index: 999;
}
.chatbot-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1F3B2C;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(31, 59, 44, 0.3);
  transition: all 0.3s ease;
  font-size: 1.6rem;
  line-height: 1;
}
.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(31, 59, 44, 0.4);
}
.chatbot-toggle.open {
  opacity: 0;
  pointer-events: none;
}

.chatbot-panel {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 360px;
  height: 460px;
  background: var(--card-bg, #fff);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: bottom right;
}
.chatbot-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chatbot-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: linear-gradient(135deg, #1F3B2C 0%, #2a5a3e 100%);
  color: #fff;
  flex-shrink: 0;
  min-height: 48px;
}
.chatbot-avatar {
  font-size: 1.2rem;
  line-height: 1;
}
.chatbot-header-info {
  flex: 1;
  min-width: 0;
}
.chatbot-header-info strong {
  font-size: 0.85rem;
  display: block;
  line-height: 1.2;
}
.chatbot-status {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.7);
}
.chatbot-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.chatbot-minimize,
.chatbot-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 1.1rem;
  border-radius: 6px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-weight: 700;
}
.chatbot-minimize:hover,
.chatbot-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.25);
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--ivory, #F5F0E6);
}
.chatbot-msg {
  max-width: 88%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.45;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chatbot-msg-bot {
  align-self: flex-start;
  background: var(--card-bg, #fff);
  color: var(--black, #1a1814);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.chatbot-msg-user {
  align-self: flex-end;
  background: #1F3B2C;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chatbot-msg p {
  margin: 0;
}
.chatbot-typing p {
  color: var(--gray-400, #8a8174);
  font-style: italic;
  font-size: 0.8rem;
}

.chatbot-wa-link {
  display: inline-block;
  margin-top: 6px;
  padding: 7px 14px;
  background: #25D366;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.chatbot-wa-link:hover {
  background: #1da851;
  transform: translateY(-1px);
}

.chatbot-input-area {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-top: 1px solid var(--gray-200, #e0d8c8);
  background: var(--card-bg, #fff);
  flex-shrink: 0;
}
.chatbot-input {
  flex: 1;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--gray-200, #e0d8c8);
  border-radius: 100px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--input-bg, #F5F0E6);
  color: var(--black, #1a1814);
  outline: none;
  transition: border-color 0.2s;
}
.chatbot-input:focus {
  border-color: #C8A24A;
}
.chatbot-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #C8A24A;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.chatbot-send:hover {
  background: #d4b05a;
  transform: scale(1.05);
}

/* Responsive chatbot */
@media (max-width: 480px) {
  .chatbot-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 75vh;
    border-radius: 16px 16px 0 0;
  }
  .whatsapp-float {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }
  .chatbot-widget {
    bottom: 76px;
    right: 16px;
  }
  .chatbot-toggle {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chatbot-panel,
  .chatbot-toggle,
  .whatsapp-float,
  .chatbot-msg {
    animation: none;
    transition: none;
  }
}
