/**
 * AXXEL — widget de chat (tema ILERCO)
 */
#axxel-widget-root {
  --axxel-font: var(--body-font, Poppins, "Segoe UI", system-ui, sans-serif);
  --axxel-primary: #3f4f3c;
  --axxel-secondary: #8fa63a;
  --axxel-secondary-dark: #7a9232;
}

#axxel-widget-root .chatbot-toggle {
  position: fixed;
  width: auto;
  min-width: 140px;
  height: 60px;
  bottom: 96px;
  right: 24px;
  background: linear-gradient(135deg, var(--axxel-primary), var(--axxel-secondary-dark));
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 0 15px;
  box-shadow: 0 4px 16px rgba(63, 79, 60, 0.35);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: axxel-pulse 2s infinite;
  font-family: var(--axxel-font);
}

#axxel-widget-root .chatbot-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 22px rgba(143, 166, 58, 0.45);
}

#axxel-widget-root .chatbot-toggle-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: #fff;
  padding: 3px;
}

#axxel-widget-root .chatbot-toggle-text {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  font-family: var(--axxel-font);
}

#axxel-widget-root .ai-chatbot {
  position: fixed;
  bottom: 168px;
  right: 24px;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 200px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
  z-index: 10000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: axxel-slide-up 0.3s ease;
  font-family: var(--axxel-font);
}

#axxel-widget-root .ai-chatbot.active {
  display: flex;
}

@keyframes axxel-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes axxel-pulse {
  0%,
  100% {
    box-shadow: 0 4px 16px rgba(63, 79, 60, 0.35);
  }
  50% {
    box-shadow: 0 6px 22px rgba(143, 166, 58, 0.5);
  }
}

#axxel-widget-root .chatbot-header {
  background: linear-gradient(135deg, var(--axxel-primary), var(--axxel-secondary-dark));
  color: #fff;
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#axxel-widget-root .chatbot-header-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#axxel-widget-root .chatbot-avatar {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
}

#axxel-widget-root .axxel-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  padding: 4px;
}

#axxel-widget-root .chatbot-info h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

#axxel-widget-root .chatbot-info p {
  margin: 0;
  font-size: 0.75rem;
  opacity: 0.9;
}

#axxel-widget-root .chatbot-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s ease;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#axxel-widget-root .chatbot-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

#axxel-widget-root .chatbot-close svg {
  width: 18px;
  height: 18px;
  display: block;
}

#axxel-widget-root .chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: #f6f4ef;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#axxel-widget-root .chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

#axxel-widget-root .chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

#axxel-widget-root .chatbot-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

#axxel-widget-root .message {
  display: flex;
  gap: 0.75rem;
  animation: axxel-fade-in 0.3s ease;
}

@keyframes axxel-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#axxel-widget-root .bot-message {
  justify-content: flex-start;
}

#axxel-widget-root .user-message {
  justify-content: flex-end;
}

#axxel-widget-root .message-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  overflow: hidden;
}

#axxel-widget-root .bot-message .message-avatar {
  background: transparent;
  color: #fff;
  padding: 0;
}

#axxel-widget-root .bot-message .message-avatar .axxel-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  padding: 2px;
}

#axxel-widget-root .user-message .message-avatar {
  background: #e2e8f0;
  color: #475569;
}

#axxel-widget-root .user-message .message-avatar svg {
  width: 18px;
  height: 18px;
}

#axxel-widget-root .message-content {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  line-height: 1.5;
}

#axxel-widget-root .bot-message .message-content {
  background: #fff;
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-top-left-radius: 4px;
}

#axxel-widget-root .user-message .message-content {
  background: linear-gradient(135deg, var(--axxel-primary), var(--axxel-secondary-dark));
  color: #fff;
  border-top-right-radius: 4px;
}

#axxel-widget-root .message-content p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

#axxel-widget-root .message-content p:first-child {
  margin-top: 0;
}

#axxel-widget-root .message-content p:last-child {
  margin-bottom: 0;
}

#axxel-widget-root .recommendation-card {
  background: linear-gradient(135deg, rgba(143, 166, 58, 0.12), rgba(63, 79, 60, 0.06));
  border: 2px solid var(--axxel-secondary);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 0.5rem;
}

#axxel-widget-root .recommendation-card h4 {
  margin: 0 0 0.5rem 0;
  color: var(--axxel-primary);
  font-size: 1rem;
  font-weight: 700;
}

#axxel-widget-root .recommendation-card .price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--axxel-secondary-dark);
  margin: 0.5rem 0;
}

#axxel-widget-root .recommendation-card .period {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.5rem;
}

#axxel-widget-root .whatsapp-link {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

#axxel-widget-root .whatsapp-link:hover {
  background: #128c7e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

#axxel-widget-root .whatsapp-link svg {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-right: 6px;
}

#axxel-widget-root .chatbot-input-container {
  padding: 1rem;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

#axxel-widget-root .chatbot-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s ease;
  font-family: var(--axxel-font);
}

#axxel-widget-root .chatbot-input:focus {
  border-color: var(--axxel-secondary);
  box-shadow: 0 0 0 3px rgba(143, 166, 58, 0.15);
}

#axxel-widget-root .chatbot-send {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, var(--axxel-primary), var(--axxel-secondary-dark));
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

#axxel-widget-root .chatbot-send svg {
  width: 20px;
  height: 20px;
}

#axxel-widget-root .chatbot-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(143, 166, 58, 0.35);
}

#axxel-widget-root .chatbot-send:active {
  transform: scale(0.95);
}

@media (max-width: 768px) {
  #axxel-widget-root .chatbot-toggle {
    min-width: 120px;
    height: 55px;
    bottom: 86px;
    right: 18px;
    padding: 0 12px;
    gap: 8px;
  }

  #axxel-widget-root .chatbot-toggle-img {
    width: 35px;
    height: 35px;
  }

  #axxel-widget-root .chatbot-toggle-text {
    font-size: 12px;
  }

  #axxel-widget-root .ai-chatbot {
    width: calc(100% - 36px);
    height: calc(100vh - 150px);
    bottom: 150px;
    right: 18px;
    left: 18px;
    max-width: 380px;
    margin: 0 auto;
  }
}
