/**
 * Componente: Botões Flutuantes
 * Segue o Design System "Violeta Visionária"
 * Usa tokens CSS para consistência visual
 */

/* ===== BASE: Botão Flutuante ===== */
.floating-btn {
  position: fixed;
  left: 20px;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--radius, 12px);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-strong);
  outline: none;
}

/* Foco acessível */
.floating-btn.focus-ring:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* ===== VARIANTES POR TIPO ===== */

/* WhatsApp - mantém cor oficial */
.floating-btn--whatsapp {
  bottom: 20px;
  background-color: #25D366;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.floating-btn--whatsapp:hover {
  background-color: #1DA851;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
}

.floating-btn--whatsapp img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Categorias - usa foreground do design system */
.floating-btn--categories {
  bottom: 90px;
  background-color: var(--foreground);
  color: var(--background);
  padding: 12px 16px;
  box-shadow: var(--shadow-strong);
}

.floating-btn--categories:hover {
  background-color: var(--muted);
  color: var(--foreground);
  transform: translateY(-2px);
}

/* Ofertas - usa destructive para promoções */
.floating-btn--offers {
  bottom: 160px;
  background-color: var(--destructive);
  color: var(--destructive-foreground);
  padding: 12px 16px;
  box-shadow: var(--glow);
}

.floating-btn--offers:hover {
  filter: brightness(0.95);
  transform: translateY(-2px);
  box-shadow: var(--glow-strong);
}

/* Carrinho - usa secondary (Lime Burst) */
.floating-btn--cart {
  bottom: 230px;
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  padding: 12px 16px;
  gap: 8px;
  box-shadow: var(--shadow-strong);
}

.floating-btn--cart:hover {
  filter: brightness(0.95);
  transform: translateY(-2px);
}

/* Checkout - usa primary (Violet Core) */
.floating-btn--checkout {
  bottom: 300px;
  background-color: var(--primary);
  color: var(--primary-foreground);
  padding: 12px 16px;
  gap: 8px;
  box-shadow: var(--glow);
}

.floating-btn--checkout:hover {
  filter: brightness(0.95);
  transform: translateY(-2px);
  box-shadow: var(--glow-strong);
}

/* ===== RESPONSIVO ===== */
@media (max-width: 576px) {
  .floating-btn {
    left: 10px;
  }

  .floating-btn--whatsapp {
    bottom: 20px;
  }

  .floating-btn--categories {
    bottom: 90px;
  }

  .floating-btn--offers {
    bottom: 160px;
  }

  .floating-btn--cart {
    bottom: 230px;
  }

  .floating-btn--checkout {
    bottom: 300px;
  }
}

/* ===== CARD CATEGORIAS ===== */
.floating-categories-card {
  position: fixed;
  top: 100px;
  left: 20px;
  z-index: 9999;
  width: 220px;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-strong);
  padding: 1rem;
  display: none;
  cursor: move;
  user-select: none;
  touch-action: none;
}

.floating-categories-card__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--foreground);
}

.floating-categories-card__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.floating-categories-card__item {
  margin: 0.5rem 0;
}

.floating-categories-card__link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.floating-categories-card__link:hover {
  color: var(--primary-dark, var(--primary));
  text-decoration: underline;
}

.floating-categories-card__close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.floating-categories-card__close:hover {
  color: var(--foreground);
}

/* ===== UTILITÁRIOS ===== */
.floating-btn__icon {
  margin-right: 0.5rem;
}

.floating-btn__badge {
  margin-left: 0.5rem;
  font-size: 0.875rem;
  opacity: 0.9;
}

/* Estados especiais */
.floating-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.floating-btn:disabled:hover {
  transform: none;
  filter: none;
}

/* Animação de entrada suave */
.floating-btn {
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}