/* ═══════════════════════════════════════════════════════════════════
   Copango — Visual Polish
   Effets : hero animé, boutons lustrés au survol, entrée en cascade,
   shimmer, glassmorphism, focus rings, scroll-reveal
   ═══════════════════════════════════════════════════════════════════ */

/* ── Hero animé (gradient qui respire + blobs flottants) ──────── */
.hero {
  background: linear-gradient(135deg, var(--color-primary-600, #16a34a) 0%, var(--color-primary-800, #166534) 55%, var(--color-solidarity-700, #1d4ed8) 140%);
  background-size: 200% 200%;
  animation: hero-gradient-shift 14s ease infinite;
}
@keyframes hero-gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero::before,
.hero::after {
  animation: blob-float 12s ease-in-out infinite;
}
.hero::after { animation-delay: -6s; }
@keyframes blob-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-30px) scale(1.08); }
}

/* Entrée du contenu hero */
.hero .container > * { animation: fade-in-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) both; }
.hero .container > *:nth-child(1) { animation-delay: 0.05s; }
.hero .container > *:nth-child(2) { animation-delay: 0.15s; }
.hero .container > *:nth-child(3) { animation-delay: 0.25s; }
.hero .container > *:nth-child(4) { animation-delay: 0.35s; }

/* ── Boutons : lift + shine au survol ────────────────────────── */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(22, 163, 74, 0.45); }
/* Shine */
.btn::after {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.btn:hover::after { left: 130%; }
.btn-primary,
.btn-solidarity { color: #fff; }

/* ── Entrée en cascade des cartes produit ───────────────────── */
.products-grid > .product-card,
.showcase-grid > .product-card {
  animation: card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* Stagger généré par --i défini inline (style="--i:0..n") */
.products-grid > .product-card:nth-child(odd),
.showcase-grid > .product-card:nth-child(odd) { animation-delay: calc(var(--i, 0) * 60ms); }
.products-grid > .product-card:nth-child(even),
.showcase-grid > .product-card:nth-child(even) { animation-delay: calc(var(--i, 0) * 60ms + 30ms); }

/* ── Glassmorphism navbar au scroll ──────────────────────────── */
.navbar {
  backdrop-filter: saturate(180%) blur(10px);
  transition: box-shadow var(--transition-base), background var(--transition-base);
}
.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

/* ── Focus ring moderne ─────────────────────────────────────── */
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
.card-link:focus-visible {
  outline: 2px solid var(--color-primary-500, #22c55e);
  outline-offset: 3px;
}

/* ── Section titles : soulignement animé ────────────────────── */
.section-title {
  position: relative;
  display: inline-block;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: var(--space-2);
}
.section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--color-primary-500, #22c55e), var(--color-solidarity-500, #3b82f6));
  transform: translateX(-50%);
  transition: width var(--transition-base);
}
.section-title:hover::after { width: 96px; }

/* ── Badge panier pulse quand > 0 ───────────────────────────── */
@keyframes cart-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.navbar-actions a[aria-label="Panier"] span {
  animation: cart-pulse 1.6s ease-in-out infinite;
}

/* ── Shimmer placeholder (images manquantes) ─────────────────── */
.product-card__placeholder {
  background: linear-gradient(100deg, #f1f5f9 30%, #e2e8f0 50%, #f1f5f9 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  opacity: 0.5;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── Scroll reveal (ajouté via JS IntersectionObserver) ──────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Stat counter glow ──────────────────────────────────────── */
.stat-value {
  background: linear-gradient(135deg, #fff, #dbeafe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: var(--text-4xl);
  font-weight: var(--weight-extrabold);
}

/* ── Réduction motion (accessibilité) ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
