/* ==========================================================================
   Motion design « La levée »
   Les blocs montent doucement en gonflant légèrement, comme une pâte qui lève.
   Tout est désactivé si le visiteur a demandé moins d'animations (système).
   ========================================================================== */
:root {
  --ease-rise: cubic-bezier(.22, 1, .36, 1);   /* départ vif, arrivée très douce */
  --ease-press: cubic-bezier(.34, 1.56, .64, 1); /* léger rebond */
}

/* --- Boutons du carrousel : une icône par état (pause / lecture, son) --- */
[data-pause] .i-off, [data-pause].is-off .i-on,
[data-sound] .i-on, [data-sound].is-on .i-off { display: none; }
[data-pause].is-off .i-off, [data-sound].is-on .i-on { display: inline-block; }
.car-btn, .ig-arrow { display: inline-flex; align-items: center; justify-content: center; }

@media (prefers-reduced-motion: no-preference) {

  /* 1. Apparition au scroll : la « levée » (classes posées par motion.js) */
  .motion .rv {
    opacity: 0;
    transform: translateY(28px) scale(.965);
    filter: blur(3px);
    transition: opacity .8s ease, transform 1.1s var(--ease-rise), filter .8s ease;
    transition-delay: calc(var(--i, 0) * 90ms);
  }
  .motion .rv.is-in { opacity: 1; transform: none; filter: none; }

  /* 2. Carrousel : le texte de la diapositive active monte ligne par ligne */
  .slide.is-active .inner > * { animation: rise 1s var(--ease-rise) both; }
  .slide.is-active .inner > :nth-child(2) { animation-delay: .12s; }
  .slide.is-active .inner > :nth-child(3) { animation-delay: .24s; }
  .slide.is-active .inner > :nth-child(4) { animation-delay: .36s; }

  /* 3. Boutons : appui « moelleux » et flèche qui avance */
  .btn, .car-btn, .ig-arrow { transition: transform .35s var(--ease-press), background .2s, color .2s, box-shadow .3s; }
  .btn:active, .car-btn:active, .ig-arrow:active { transform: scale(.96); }
  .btn .icon, a .icon, .car-btn .icon, .ig-arrow .icon { transition: transform .35s var(--ease-press); }
  .btn:hover .icon, a:hover > .icon, .car-btn[data-next]:hover .icon, .ig-arrow[data-ig-next]:hover .icon { transform: translateX(3px); }
  a:hover > .icon-back, .car-btn[data-prev]:hover .icon, .ig-arrow[data-ig-prev]:hover .icon { transform: translateX(-3px); }

  /* 4. Cartes produits et grandes tuiles : elles se soulèvent au survol */
  .product-card .thumb { transition: transform .5s var(--ease-rise), box-shadow .5s var(--ease-rise); }
  .product-card:hover .thumb { transform: translateY(-6px); box-shadow: 0 18px 36px -18px rgba(28, 22, 17, .35); }
  .tile .tile-body { transition: transform .5s var(--ease-rise), box-shadow .5s var(--ease-rise); }
  .tile:hover .tile-body { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(0, 0, 0, .14); }
  .offer { transition: transform .5s var(--ease-rise); }
  .offer:hover { transform: translateY(-4px); }

  /* 5. Icônes des avantages et des garanties : petit saut au survol */
  .value-grid .v-icon { transition: transform .5s var(--ease-press), background .3s; }
  .value-grid > div:hover .v-icon { transform: translateY(-5px) rotate(-8deg) scale(1.08); }
  .trust div { transition: transform .5s var(--ease-rise), box-shadow .5s var(--ease-rise); }
  .trust div:hover { transform: translateY(-4px); box-shadow: 0 14px 30px -16px rgba(28, 22, 17, .3); }
  .trust div:hover span .icon { animation: pop .6s var(--ease-press); }

  /* 6. En-tête : une ombre douce apparaît dès qu'on descend */
  .header { transition: box-shadow .35s ease; }
  .header.is-scrolled { box-shadow: 0 6px 24px -12px rgba(28, 22, 17, .25); }

  /* 7. Transition douce entre les pages (navigateurs compatibles) */
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: .25s ease both fade-out; }
  ::view-transition-new(root) { animation: .45s var(--ease-rise) both rise-page; }
}

@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rise-page { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.25) rotate(-6deg); } 100% { transform: scale(1); } }

/* À l'impression, tout est visible immédiatement */
@media print { .motion .rv { opacity: 1 !important; transform: none !important; filter: none !important; } }
