/* ══════════════════════════════════════════════════
   WINNART IMPRIMERIE — Animation System
   Skills used: animation-design, css-animations, ui-animations
   ══════════════════════════════════════════════════ */

/* ── Motion Tokens (animation-design: §6) ── */
:root {
  --duration-instant: 120ms;
  --duration-fast:   200ms;
  --duration-std:    300ms;
  --duration-slow:   500ms;
  --ease-enter:      cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-exit:       cubic-bezier(0.4, 0.0, 1, 1);
  --ease-standard:   cubic-bezier(0.4, 0.0, 0.2, 1);
  --ease-spring:     cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-bounce:     cubic-bezier(0.68, -0.55, 0.27, 1.55);
  --stagger-offset:  40ms;
  --stagger-max:     400ms;
}

/* ── prefers-reduced-motion (animation-design: §7, css-animations: §9) ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    animation-delay: 0ms !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .animate-reveal { opacity: 1 !important; transform: none !important; }
}

/* ═══ 1. REVEAL ON SCROLL (css-animations: §6) ═══ */

.animate-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-std) var(--ease-enter),
              transform var(--duration-std) var(--ease-enter);
}
.animate-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.animate-reveal-left {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity var(--duration-std) var(--ease-enter),
              transform var(--duration-std) var(--ease-enter);
}
.animate-reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}
.animate-reveal-right {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity var(--duration-std) var(--ease-enter),
              transform var(--duration-std) var(--ease-enter);
}
.animate-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}
.animate-reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity var(--duration-std) var(--ease-enter),
              transform var(--duration-std) var(--ease-enter);
}
.animate-reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* ── Stagger helpers (applied via JS or inline style) ── */
.stagger-1  { transition-delay: 0ms; }
.stagger-2  { transition-delay: calc(var(--stagger-offset) * 1); }
.stagger-3  { transition-delay: calc(var(--stagger-offset) * 2); }
.stagger-4  { transition-delay: calc(var(--stagger-offset) * 3); }
.stagger-5  { transition-delay: calc(var(--stagger-offset) * 4); }
.stagger-6  { transition-delay: calc(var(--stagger-offset) * 5); }
.stagger-7  { transition-delay: calc(var(--stagger-offset) * 6); }
.stagger-8  { transition-delay: calc(var(--stagger-offset) * 7); }
.stagger-9  { transition-delay: calc(var(--stagger-offset) * 8); }
.stagger-10 { transition-delay: calc(var(--stagger-offset) * 9); }

/* ═══ 2. MICRO-INTERACTIONS (ui-animations: §2) ═══ */

/* ── Button press ── */
.btn-press:active {
  transform: scale(0.96) !important;
  transition: transform var(--duration-instant) var(--ease-exit);
}
.btn-press {
  transition: transform var(--duration-fast) var(--ease-spring);
}

/* ── Card hover lift ── */
.card-lift, .product-card, .pack-card, .service-card, .blog-card, .testimonial-card {
  transition: transform var(--duration-fast) var(--ease-enter),
              box-shadow var(--duration-fast) var(--ease-enter);
}
.card-lift:hover, .product-card:hover, .pack-card:hover, .service-card:hover, .blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}
/* Touch devices: no hover lift */
@media (hover: none) {
  .product-card:hover, .pack-card:hover, .service-card:hover, .blog-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }
}
/* Active tap feedback */
.product-card:active, .pack-card:active, .btn:active {
  transform: scale(0.98);
}

/* ── Image zoom on hover ── */
.img-zoom {
  overflow: hidden;
}
.img-zoom img {
  transition: transform var(--duration-std) var(--ease-enter);
}
.img-zoom:hover img {
  transform: scale(1.05);
}

/* ── Link underline animation ── */
.link-underline {
  position: relative;
  text-decoration: none;
}
.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width var(--duration-fast) var(--ease-standard);
}
.link-underline:hover::after {
  width: 100%;
}

/* ── Skeleton loading (ui-animations: §3) ── */
.skeleton {
  background: linear-gradient(90deg, #e8eaee 25%, #f0f2f5 50%, #e8eaee 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text { height: 14px; margin-bottom: 8px; width: 80%; }
.skeleton-title { height: 24px; margin-bottom: 12px; width: 60%; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-card { height: 200px; }

/* ═══ 3. ENTRY / EXIT ANIMATIONS (css-animations: §5) ═══ */

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  0% { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes fadeInLeft {
  0% { opacity: 0; transform: translateX(-20px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  0% { opacity: 0; transform: translateX(20px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes slideDown {
  0% { opacity: 0; transform: translateY(-12px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes drawIn {
  0% { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}

/* Utility classes */
.anim-fade-in-up  { animation: fadeInUp var(--duration-std) var(--ease-enter) both; }
.anim-fade-in-scale { animation: fadeInScale var(--duration-std) var(--ease-enter) both; }
.anim-fade-in-left  { animation: fadeInLeft var(--duration-std) var(--ease-enter) both; }
.anim-fade-in-right { animation: fadeInRight var(--duration-std) var(--ease-enter) both; }
.anim-slide-down    { animation: slideDown var(--duration-fast) var(--ease-enter) both; }

/* ═══ 4. LOADING STATES (ui-animations: §3) ═══ */

/* Pulse dot loader */
.loader-dots {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.loader-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary, #1a2b6d);
  animation: dotPulse 1.2s var(--ease-standard) infinite both;
}
.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Spinner */
.loader-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color, #e2e4ea);
  border-top-color: var(--primary, #1a2b6d);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ═══ 5. TOAST / NOTIFICATION (ui-animations: §6) ═══ */
@keyframes toastIn {
  0% { opacity: 0; transform: translateY(16px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-8px) scale(0.95); }
}
.toast {
  animation: toastIn var(--duration-fast) var(--ease-spring);
  transition: opacity var(--duration-fast) var(--ease-exit),
              transform var(--duration-fast) var(--ease-exit);
}
.toast.toast-exit {
  animation: toastOut var(--duration-fast) var(--ease-exit) both;
}

/* ═══ 6. COUNTER / BADGE POP (ui-animations: §2) ═══ */
@keyframes countPop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.count-pop {
  animation: countPop var(--duration-fast) var(--ease-spring);
}

/* ═══ 7. SCROLLBAR STYLING (cross-platform) ═══ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-body, #f7f8fc);
}
::-webkit-scrollbar-thumb {
  background: var(--gray, #ccc);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary, #1a2b6d);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--gray, #ccc) var(--bg-body, #f7f8fc);
}

/* ═══ 8. RESPONSIVE ENHANCEMENTS ═══ */

/* ── Large screens (1400px+) ── */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

/* ── Tablets (769px–1024px) ── */
@media (min-width: 769px) and (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .hero {
    padding: 100px 24px 60px !important;
  }
  .hero h1 {
    font-size: 2.2rem !important;
  }
}

/* ── Small tablets / large phones (481px–768px) ── */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .hero {
    padding: 80px 16px 50px !important;
  }
  .hero h1 {
    font-size: 1.6rem !important;
  }
  .hero p {
    font-size: 0.9rem !important;
  }
  .header-container {
    padding: 10px 16px !important;
  }
  .logo-text {
    font-size: 1.1rem !important;
  }
  .logo-img {
    width: 40px !important;
    height: 40px !important;
  }
  .testimonials-track {
    gap: 16px !important;
  }
  .testimonial-card {
    min-width: 280px !important;
    padding: 20px !important;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
  }
}

/* ── Small phones (≤480px) ── */
@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr !important;
  }
  .hero h1 {
    font-size: 1.3rem !important;
  }
  .hero p {
    font-size: 0.82rem !important;
  }
  .header-container {
    padding: 8px 12px !important;
  }
  .logo-text {
    font-size: 1rem !important;
  }
  .logo-img {
    width: 36px !important;
    height: 36px !important;
  }
  .footer-grid {
    grid-template-columns: 1fr !important;
    text-align: center !important;
  }
  .testimonial-card {
    min-width: 260px !important;
    padding: 16px !important;
  }
  .cta-buttons {
    flex-direction: column !important;
    gap: 10px !important;
  }
  .cta-buttons .btn {
    width: 100% !important;
    text-align: center !important;
  }
  .modal-content {
    padding: 20px 16px !important;
    margin: 10px !important;
  }
  .product-card {
    margin: 0 4px !important;
  }
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── Touch-friendly targets ── */
@media (hover: none) and (pointer: coarse) {
  .btn, button, a, input, select, textarea {
    min-height: 44px;
  }
  .card-lift:hover {
    transform: none !important;
  }
  .product-card:hover {
    transform: none !important;
  }
}

/* ═══ 9. HERO SPECIAL ANIMATIONS (main page only) ═══ */

/* ── Gradient sweep background ── */
.hero-gradient-sweep {
  background-size: 200% 200% !important;
  animation: heroGradient 8s ease-in-out infinite;
}
@keyframes heroGradient {
  0%, 100% { background-position: 0% 50%; }
  33% { background-position: 100% 50%; }
  66% { background-position: 50% 100%; }
}

/* ── Floating geometric particles ── */
.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.hero-particle {
  position: absolute;
  width: var(--p-size, 6px);
  height: var(--p-size, 6px);
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  top: var(--p-y, 20%);
  left: var(--p-x, 20%);
  animation: particleFloat var(--p-dur, 8s) ease-in-out infinite;
  animation-delay: var(--p-delay, 0s);
}
.hero-particle:nth-child(1) { --p-x: 10%; --p-y: 20%; --p-size: 8px; --p-dur: 7s; --p-delay: 0s; }
.hero-particle:nth-child(2) { --p-x: 25%; --p-y: 60%; --p-size: 12px; --p-dur: 9s; --p-delay: 1.2s; }
.hero-particle:nth-child(3) { --p-x: 45%; --p-y: 15%; --p-size: 6px; --p-dur: 6s; --p-delay: 0.5s; }
.hero-particle:nth-child(4) { --p-x: 60%; --p-y: 70%; --p-size: 10px; --p-dur: 10s; --p-delay: 2s; }
.hero-particle:nth-child(5) { --p-x: 80%; --p-y: 30%; --p-size: 7px; --p-dur: 8s; --p-delay: 1s; }
.hero-particle:nth-child(6) { --p-x: 90%; --p-y: 80%; --p-size: 14px; --p-dur: 11s; --p-delay: 0.3s; }
.hero-particle:nth-child(7) { --p-x: 35%; --p-y: 85%; --p-size: 5px; --p-dur: 7.5s; --p-delay: 1.8s; }
.hero-particle:nth-child(8) { --p-x: 70%; --p-y: 10%; --p-size: 9px; --p-dur: 9.5s; --p-delay: 0.8s; }
.hero-particle:nth-child(9) { --p-x: 15%; --p-y: 45%; --p-size: 11px; --p-dur: 6.5s; --p-delay: 2.5s; }
.hero-particle:nth-child(10) { --p-x: 55%; --p-y: 50%; --p-size: 7px; --p-dur: 8.5s; --p-delay: 1.5s; }

@keyframes particleFloat {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
  25% { transform: translate(15px, -20px) scale(1.2); opacity: 0.7; }
  50% { transform: translate(-10px, -35px) scale(0.9); opacity: 0.3; }
  75% { transform: translate(20px, -10px) scale(1.1); opacity: 0.6; }
}
/* Square particles (alternate shape) */
.hero-particle.square { border-radius: 2px; transform: rotate(45deg); }
.hero-particle.square:nth-child(2) { border-radius: 2px; }
.hero-particle.square:nth-child(5) { border-radius: 2px; }
.hero-particle.square:nth-child(8) { border-radius: 2px; }

/* ── Hero content staggered entrance ── */
.hero-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  animation: heroStaggerIn 0.5s var(--ease-enter) forwards;
}
.hero-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.hero-stagger > *:nth-child(2) { animation-delay: 0.25s; }
.hero-stagger > *:nth-child(3) { animation-delay: 0.4s; }
.hero-stagger > *:nth-child(4) { animation-delay: 0.55s; }
.hero-stagger > *:nth-child(5) { animation-delay: 0.7s; }

@keyframes heroStaggerIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Hero badge glow pulse ── */
.hero-badge-pulse {
  animation: badgeGlow 2s ease-in-out infinite;
}
@keyframes badgeGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(232,119,34,0.2); }
  50% { box-shadow: 0 0 20px rgba(232,119,34,0.5), 0 0 40px rgba(232,119,34,0.1); }
}

/* ── Hero image float ── */
.hero-image-float {
  animation: heroImageFloat 4s ease-in-out infinite;
}
@keyframes heroImageFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ── CTA button pulse ring ── */
.hero-cta-pulse {
  position: relative;
}
.hero-cta-pulse::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid var(--secondary);
  opacity: 0;
  animation: ctaPulseRing 2s ease-out infinite;
}
@keyframes ctaPulseRing {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 0; }
}

/* ═══ 10. SCROLL-DRIVEN ANIMATIONS (progressive enhancement) ═══ */

/* Standard reveal fallback uses IntersectionObserver (already in app.js).
   When scroll-driven animations are supported, override with native version. */
@supports (animation-timeline: view()) {
  /* Override the IntersectionObserver-triggered reveal with native scroll-driven */
  .animate-reveal,
  .animate-reveal-left,
  .animate-reveal-right,
  .animate-reveal-scale {
    opacity: 0;
    transform: none; /* reset JS-set transforms */
    animation: revealScrollUp linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 25%;
  }
  .animate-reveal-left {
    animation-name: revealScrollLeft;
  }
  .animate-reveal-right {
    animation-name: revealScrollRight;
  }
  .animate-reveal-scale {
    animation-name: revealScrollScale;
  }
  @keyframes revealScrollUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
  }
  @keyframes revealScrollLeft {
    0% { opacity: 0; transform: translateX(-30px); }
    100% { opacity: 1; transform: translateX(0); }
  }
  @keyframes revealScrollRight {
    0% { opacity: 0; transform: translateX(30px); }
    100% { opacity: 1; transform: translateX(0); }
  }
  @keyframes revealScrollScale {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
  }
  /* Prevent double-animation when both IntersectionObserver and scroll-driven fire */
  .animate-reveal.revealed,
  .animate-reveal-left.revealed,
  .animate-reveal-right.revealed,
  .animate-reveal-scale.revealed {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ═══ 11. VIEW TRANSITIONS API (cross-document MPA) ═══ */

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: vtFadeOut 200ms var(--ease-exit) both;
}
::view-transition-new(root) {
  animation: vtFadeIn 300ms var(--ease-enter) both;
}

@keyframes vtFadeOut {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.96); }
}
@keyframes vtFadeIn {
  0% { opacity: 0; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

/* Shared element transitions for product cards */
.product-card { view-transition-name: auto; }

/* Respect reduced motion for view transitions */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.01ms !important;
  }
}

/* ═══ 12. HERO SLIDER ENHANCED TRANSITIONS ═══ */

.hero-slide {
  transition: opacity 0.6s var(--ease-enter),
              transform 0.6s var(--ease-enter),
              filter 0.6s var(--ease-enter);
}
.hero-slide:not(.active) {
  transform: scale(1.02);
  filter: blur(2px);
}
.hero-slide.active {
  transform: scale(1);
  filter: blur(0);
}

/* ── Dot active animation ── */
.hero-dots .dot {
  transition: transform 0.3s var(--ease-spring),
              background 0.3s var(--ease-enter),
              border-color 0.3s var(--ease-enter);
}
.hero-dots .dot.active {
  transform: scale(1.3);
  border-color: #fff;
}

/* ═══ 13. STAT COUNTER ANIMATION ═══ */
@keyframes statCountIn {
  0% { opacity: 0; transform: translateY(10px) scale(0.8); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.stat-number {
  display: inline-block;
  animation: statCountIn 0.4s var(--ease-spring) both;
}
.stat-number:nth-child(1) { animation-delay: 0.1s; }
.stat-number:nth-child(2) { animation-delay: 0.2s; }
.stat-number:nth-child(3) { animation-delay: 0.3s; }
.stat-number:nth-child(4) { animation-delay: 0.4s; }

/* ═══ 14. CROSS-OS TEXT RENDERING ═══ */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ═══ 10. PRINT STYLES ═══ */
@media print {
  header, footer, .chat-bubble, .whatsapp-float, .modal-overlay,
  .scroll-indicator, .back-to-top, #cookieConsent {
    display: none !important;
  }
  body {
    padding-top: 0 !important;
    background: white !important;
    color: black !important;
  }
  .hero {
    padding: 20px 0 !important;
    background: white !important;
    color: black !important;
  }
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* ═══ 11. SAFARI / IOS FIXES ═══ */
@supports (-webkit-touch-callout: none) {
  body {
    -webkit-font-smoothing: antialiased;
  }
  input, textarea, select {
    font-size: 16px !important;
  }
}

/* ═══ 12. KEYBOARD FOCUS VISIBLE ═══ */
:focus-visible {
  outline: 2px solid var(--secondary, #e87722);
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}
/* ============================================
   WINNART — LAYOUT 3 COLONNES (10/80/10)
   Style : Flashscore-like, responsive
   ============================================ */

/* === VARIABLES === */
:root {
  --sidebar-width: clamp(100px, 10vw, 180px);
  --sidebar-gap: clamp(12px, 1.5vw, 24px);
  --content-max: 1200px;
  --banner-transition: opacity 0.5s ease;
  --sidebar-bg: transparent;
  --sidebar-sticky-top: 100px;
  --mobile-nav-speed: 0.3s;
}

/* === FLUIDITÉ GLOBALE (anti flash blanc, GPU acceleration) === */
* {
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-body, #f5f5f5);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, iframe, .banner-img {
  aspect-ratio: auto;
  content-visibility: auto;
  contain-intrinsic-size: 1px 500px;
}

/* === GRILLE PRINCIPALE 3 COLONNES === */
.page-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
  gap: var(--sidebar-gap);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(8px, 2vw, 24px);
  min-height: 60vh;
  position: relative;
}

/* Colonne centrale */
.content-center {
  min-width: 0; /* évite le débordement Grid */
  width: 100%;
}

.content-center > * {
  max-width: 100%;
}

/* === SIDEBARS === */
.sidebar-left,
.sidebar-right {
  position: sticky;
  top: var(--sidebar-sticky-top);
  height: fit-content;
  max-height: calc(100vh - var(--sidebar-sticky-top) - 20px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(26,43,109,0.15) transparent;
  padding: 8px 0;
  /* GPU acceleration — évite les reflows et flashs blancs */
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* Contient le layout de chaque widget */
  contain: layout style;
}

.sidebar-left::-webkit-scrollbar,
.sidebar-right::-webkit-scrollbar {
  width: 3px;
}

.sidebar-left::-webkit-scrollbar-thumb,
.sidebar-right::-webkit-scrollbar-thumb {
  background: rgba(26,43,109,0.15);
  border-radius: 4px;
}

/* === WIDGETS SIDEBAR — Système unifié === */
.sidebar-left,
.sidebar-right {
  z-index: 10;
}

/* Widget = bloc cohérent dans la sidebar */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 8px;
  margin-bottom: 10px;
  transition: box-shadow 0.2s ease;
}

.sidebar-widget:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

/* Titre de widget */
.sidebar-widget-title {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gray);
  text-align: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

/* Contenu du widget */
.sidebar-widget-content {
  font-size: 0.65rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Conteneur bannières */
.banner-rotator {
  width: 100%;
  max-width: 120px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  position: relative;
}

.banner-rotator-wrapper {
  position: relative;
  width: 100%;
  line-height: 0;
}

.banner-rotator-wrapper a {
  display: block;
  width: 100%;
  height: 100%;
}

.banner-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

.banner-link {
  display: block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 10px;
  overflow: hidden;
}

.banner-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
}

.banner-link:active {
  transform: translateY(0);
}

/* Indicateur de défilement (dots) */
.banner-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 6px 0 0;
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  z-index: 2;
}

.banner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: background 0.3s ease, transform 0.3s ease;
  cursor: default;
}

.banner-dot.active {
  background: #fff;
  transform: scale(1.3);
}

/* === SIDEBAR GAUCHE : Widgets spécifiques === */

/* Milena card (sans bordure, fond dégradé) */
.milena-sidebar-card {
  background: linear-gradient(135deg, var(--primary), #0f1a45);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}

.milena-sidebar-card::before {
  content: '✦';
  position: absolute;
  top: -8px;
  right: -4px;
  font-size: 3rem;
  color: rgba(232,119,34,0.1);
  transform: rotate(15deg);
}

.milena-sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 auto 8px;
  display: block;
  border: 2px solid var(--secondary);
  object-fit: cover;
}

.milena-sidebar-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
}

.milena-sidebar-role {
  font-size: 0.55rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 8px;
}

.milena-sidebar-btn {
  display: inline-block;
  padding: 5px 16px;
  background: var(--secondary);
  color: #fff;
  border-radius: 20px;
  font-size: 0.6rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}

.milena-sidebar-btn:hover {
  background: #d4691e;
}

/* Micro stats */
.sidebar-micro-stats {
  text-align: center;
}

.sidebar-micro-stats .stat-row {
  display: flex;
  justify-content: space-around;
  gap: 4px;
}

.sidebar-micro-stats .stat-item {
  flex: 1;
  padding: 4px;
}

.sidebar-micro-stats .stat-value {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.sidebar-micro-stats .stat-label {
  font-size: 0.5rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Réseaux sociaux */
.sidebar-social {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.sidebar-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--light);
  color: var(--primary);
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-social a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

/* === SIDEBAR DROITE : Widgets spécifiques === */

/* Bannières partenaires (fallback si pas AdSense) */
.partner-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  margin-bottom: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.partner-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.partner-icon {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.partner-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.partner-desc {
  font-size: 0.6rem;
  color: var(--gray);
  line-height: 1.3;
}

.partner-cta {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 14px;
  background: var(--secondary);
  color: #fff;
  border-radius: 20px;
  font-size: 0.6rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}

.partner-cta:hover {
  background: var(--primary);
}

.partner-methods {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 6px;
}

.partner-methods span {
  display: inline-block;
  padding: 2px 6px;
  background: var(--light);
  border-radius: 4px;
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--primary);
}

/* Bloc partenaire (location) */
.partner-spot {
  background: linear-gradient(135deg, var(--bg-card), #fef5ee);
  border: 2px solid var(--secondary);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  margin-top: 12px;
  position: relative;
  box-shadow: 0 4px 16px rgba(232,119,34,0.12);
}

.partner-spot-badge {
  display: inline-block;
  background: var(--secondary);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.partner-spot-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.partner-spot-offer {
  font-size: 1rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 4px;
}

.partner-spot-desc {
  font-size: 0.6rem;
  color: var(--gray);
  line-height: 1.5;
  margin-bottom: 8px;
}

.partner-spot-features {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
}

.partner-spot-features span {
  font-size: 0.55rem;
  color: var(--dark);
  opacity: 0.8;
}

.partner-spot-cta {
  display: inline-block;
  padding: 7px 18px;
  background: #25D366;
  color: #fff;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.partner-spot-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,211,102,0.3);
}

.partner-spot-foot {
  font-size: 0.5rem;
  color: var(--gray);
  margin-top: 8px;
}

.partner-spot-foot a {
  color: var(--primary);
  text-decoration: none;
}

/* === GOOGLE ADSENSE PLACEHOLDER === */
.adsense-container {
  width: 100%;
  min-height: 100px;
  margin: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.adsense-container ins {
  display: block;
}

.adsense-placeholder {
  text-align: center;
  padding: 12px 8px;
  color: var(--gray);
  font-size: 0.6rem;
  line-height: 1.5;
}

.adsense-placeholder strong {
  display: block;
  color: var(--primary);
  font-size: 0.7rem;
}

.adsense-label {
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray);
  text-align: center;
  margin: 8px 0 4px;
  opacity: 0.6;
}



/* === RESPONSIVE — TABLETTE (768-1024px) === */
@media (max-width: 1100px) {
  .page-layout {
    grid-template-columns: 100px 1fr 100px;
    gap: 10px;
  }

  .banner-rotator {
    max-width: 90px;
  }
}

@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 80px 1fr 80px;
    gap: 6px;
  }

  .banner-rotator {
    max-width: 70px;
  }
}

/* === RESPONSIVE — MOBILE (< 768px) === */
@media (max-width: 767px) {
  :root {
    --sidebar-sticky-top: 80px;
  }

  .page-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    /* Stabilise le layout pendant le scroll */
    content-visibility: auto;
    contain-intrinsic-size: 1px 5000px;
  }

  .sidebar-left,
  .sidebar-right {
    position: relative !important;
    top: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 16px 16px;
    margin-bottom: 0;
    /* GPU layer iOS */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .sidebar-left {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
  }

  .sidebar-left .sidebar-widget { margin-bottom: 0; }

  .sidebar-left .sidebar-widget:first-child { display: none; } /* Milena en bubble */

  .sidebar-left .banner-rotator { max-width: none; width: 100%; }

  .sidebar-left .banner-rotator { border-radius: 6px; }

  .sidebar-right {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px 12px;
    background: var(--light);
    border-top: 1px solid var(--border-color);
  }

  .sidebar-right .sidebar-widget { margin-bottom: 0; }

  .sidebar-right .sidebar-widget:last-child { grid-column: 1 / -1; } /* Partner spot full width */

  .sidebar-right .adsense-container { min-height: 80px; }

  /* Bannières horizontales sur mobile */
  .banner-img {
    width: 100%;
    height: auto;
  }

  .banner-rotator {
    border-radius: 6px;
  }

  /* Hero padding fix on mobile */
  .content-center .hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  .content-center .products {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* === RESPONSIVE — PETIT MOBILE (< 480px) === */
@media (max-width: 480px) {
  .sidebar-left {
    grid-template-columns: repeat(2, 1fr);
    padding: 8px 10px;
    gap: 6px;
  }

  .sidebar-left .sidebar-widget { padding: 8px 6px; }

  .sidebar-right {
    grid-template-columns: 1fr 1fr;
    padding: 8px 10px;
    gap: 6px;
  }

  .sidebar-right .sidebar-widget { padding: 8px 6px; }

  .sidebar-left .banner-rotator { max-width: none; }
}

/* === PRINT === */
@media print {
  .sidebar-left,
  .sidebar-right {
    display: none !important;
  }

  .page-layout {
    grid-template-columns: 1fr;
  }
}

/* === ACCESSIBILITÉ (prefers-reduced-motion) === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .banner-rotator-wrapper,
  .banner-link,
  .partner-banner {
    transition: none !important;
  }

  .banner-rotator-wrapper {
    opacity: 1 !important;
  }

  .reveal-on-scroll {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .skeleton {
    animation: none !important;
    background: var(--light) !important;
  }

  .reading-progress {
    animation: none !important;
    scale: none !important;
    display: none !important;
  }
}

/* === ANIMATIONS === */
@keyframes bannerFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.banner-rotator-wrapper {
  animation: bannerFadeIn 0.4s ease;
}

/* === BARRE DE PROGRESSION DE LECTURE (scroll-driven) === */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  z-index: 9999;
  transform-origin: left center;
  scale: 0 1;
  animation: progress-grow linear;
  animation-timeline: scroll(root block);
}

@keyframes progress-grow {
  from { scale: 0 1; }
  to { scale: 1 1; }
}

/* === RÉVÉLATION AU SCROLL (view timeline) === */
.reveal-on-scroll {
  animation: fade-up linear both;
  animation-timeline: view();
  animation-range: entry 0% cover 30%;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === ENTRÉE DES ÉLÉMENTS (@starting-style) === */
.toast {
  transition: opacity 300ms, transform 300ms, display 300ms allow-discrete;
}

@starting-style {
  .toast {
    opacity: 0;
    transform: translateY(-12px);
  }
}

.toast.hidden { display: none; }

/* === MICRO-INTERACTIONS BOUTONS (ui-animations skill) === */
.btn:active,
button:active,
.cta-button:active {
  transform: scale(0.96);
  transition: transform 100ms ease-out;
}

.btn, button, .cta-button {
  transition: transform 150ms ease-out, background-color 150ms ease-out, box-shadow 150ms ease-out;
}

/* === SQUELETTE CHARGEMENT === */
.skeleton {
  background: linear-gradient(90deg, var(--light) 25%, #e8ecf4 50%, var(--light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.skeleton-card {
  height: 280px;
  border-radius: 16px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 80%;
}

.skeleton-text:last-child { width: 60%; }

/* === VIEW TRANSITIONS API (transitions entre pages) === */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 300ms;
  animation-timing-function: ease-out;
}

::view-transition-old(root) {
  animation-name: fade-out;
}

::view-transition-new(root) {
  animation-name: fade-in;
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.01ms !important;
  }
}

/* === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
  .sidebar-left,
  .sidebar-right {
    --sidebar-bg: rgba(26,43,109,0.05);
  }

  .partner-banner {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.06);
  }

  .adsense-container {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.06);
  }

  .sidebar-micro-stats {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.06);
  }
}
body.dark-mode{--bg-body:#0f1428;--bg-card:#1a1f36;--bg-header:rgba(15,20,40,.95);--text-primary:#e8ecf4;--text-secondary:#9ca3af;--border-color:rgba(232,119,34,.15)}
body.dark-mode header{border-bottom-color:var(--border-color)}
body.dark-mode .logo-text{color:var(--white)}
body.dark-mode .nav-links a{color:var(--text-primary)}
body.dark-mode .nav-links a:hover{color:var(--secondary)}
body.dark-mode .btn-primary{background:var(--secondary);color:var(--white)}
body.dark-mode .btn-primary:hover{background:var(--secondary-light)}
body.dark-mode .btn-secondary{background:var(--primary);color:var(--white)}
body.dark-mode .btn-secondary:hover{background:var(--primary-dark)}
body.dark-mode .search-section{background:var(--bg-card);border-color:var(--border-color)}
body.dark-mode .search-section:focus-within{border-color:var(--secondary)}
body.dark-mode .search-section input{color:var(--text-primary)}
body.dark-mode .search-section input::placeholder{color:var(--text-secondary)}
body.dark-mode .cart-btn-header{background:var(--bg-card);color:var(--text-primary);border-color:var(--border-color)}
body.dark-mode .cart-btn-header:hover{background:var(--primary);color:var(--white)}
body.dark-mode .dropdown-menu{background:var(--bg-card);border-color:var(--border-color)}
body.dark-mode .dropdown-menu a{color:var(--text-primary)}
body.dark-mode .dropdown-menu a:hover{background:var(--primary);color:var(--white)}
body.dark-mode .cart-modal-content{background:var(--bg-card);color:var(--text-primary)}
body.dark-mode .cart-header{background:var(--primary)}
body.dark-mode .cart-item{border-color:var(--border-color)}
body.dark-mode .cart-item-name{color:var(--text-primary)}
body.dark-mode .cart-item-detail{color:var(--text-secondary)}
body.dark-mode .cart-item-qty button{background:var(--bg-body);border-color:var(--border-color);color:var(--text-primary)}
body.dark-mode .cart-item-qty button:hover{background:var(--secondary);border-color:var(--secondary);color:var(--white)}
body.dark-mode .cart-total{border-color:var(--primary)}
body.dark-mode .cfg{background:var(--bg-card);border-color:var(--border-color)}
body.dark-mode .cfg-card{background:var(--bg-body);border-color:var(--border-color)}
body.dark-mode .cfg-card:hover{border-color:var(--secondary)}
body.dark-mode .cfg-card.active{background:rgba(232,119,34,.15)}
body.dark-mode .cfg-card h4{color:var(--text-primary)}
body.dark-mode .cfg-card p{color:var(--text-secondary)}
body.dark-mode .cfg-row{border-color:var(--border-color)}
body.dark-mode .cfg-row label{color:var(--text-primary)}
body.dark-mode .cfg-total{border-color:var(--secondary)}
body.dark-mode .cfg-upload{background:var(--bg-body);border-color:var(--border-color)}
body.dark-mode .cfg-upload:hover{border-color:var(--secondary)}
body.dark-mode .sticky-bar{background:var(--bg-card);border-color:var(--secondary)}
body.dark-mode .order-section{background:linear-gradient(135deg,var(--primary),var(--primary-dark))}
body.dark-mode .trust-section{background:var(--bg-card)!important}
body.dark-mode .trust-card{background:var(--bg-body);border-color:var(--border-color)}
body.dark-mode .trust-card strong{color:var(--text-primary)}
body.dark-mode .trust-card span{color:var(--text-secondary)}
body.dark-mode .related-grid a{background:var(--bg-card);color:var(--primary);border-color:var(--border-color)}
body.dark-mode .related-grid a:hover{background:var(--primary);color:var(--white)}
body.dark-mode footer{background:var(--primary-dark)}
body.dark-mode .page-banner{background:linear-gradient(135deg,var(--primary),var(--primary-dark))}
body.dark-mode .packs-section{background:var(--bg-body)}
body.dark-mode .pack-card{background:var(--bg-card);border-color:var(--border-color)}
body.dark-mode .pack-card:hover{border-color:var(--primary)}
body.dark-mode .pack-card.featured{border-color:var(--secondary)}
body.dark-mode .pack-card h3{color:var(--primary)}
body.dark-mode .pack-card ul li{color:var(--text-primary)}
body.dark-mode .pack-card .price{color:var(--secondary)}
body.dark-mode .sol-card{background:var(--bg-card);border-color:var(--border-color)}
body.dark-mode .sol-card:hover{border-color:var(--primary)}
body.dark-mode .sol-card h3{color:var(--text-primary)}
body.dark-mode .sol-card p{color:var(--text-secondary)}
body.dark-mode .sol-card .tags span{background:var(--bg-body);color:var(--text-secondary)}
body.dark-mode .sol-card .sol-btn{background:var(--secondary)}
body.dark-mode .sol-card .sol-btn:hover{background:var(--secondary-light)}
body.dark-mode .splash-overlay{background:var(--primary)}
body.dark-mode .splash-card{background:var(--bg-card);border-color:var(--border-color)}
body.dark-mode .splash-card-title{color:var(--text-primary)}
body.dark-mode .splash-btn{background:var(--secondary)}
body.dark-mode .splash-skip{color:var(--text-secondary)}
body.dark-mode .page-loader{background:var(--primary)}
body.dark-mode .loader-content p{color:var(--text-primary)}
body.dark-mode .whisper-btn{background:var(--secondary)}
body.dark-mode .toast{background:var(--bg-card);color:var(--text-primary);border-color:var(--border-color)}
#darkModeToggle{background:none;border:none;cursor:pointer;padding:8px;border-radius:8px;display:flex;align-items:center;justify-content:center;transition:all .3s;color:var(--text-primary)}
#darkModeToggle:hover{background:var(--primary);color:var(--white)}
#darkModeToggle svg{width:20px;height:20px}
