/* Navigation fluide entre les pages (View Transitions natives, sans JavaScript).
   Navigateurs récents : fondu enchaîné doux, menu immobile, le pin d'une carte « vole » jusqu'à sa fiche.
   Les autres navigateurs naviguent normalement. */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: hdc-page-out .2s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: hdc-page-in .38s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes hdc-page-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes hdc-page-in { from { opacity: 0; transform: translateY(14px); } }

/* Le menu reste en place pendant que le contenu change. */
#mainNav { view-transition-name: hdc-nav; }
::view-transition-group(hdc-nav) { animation: none; }
::view-transition-old(hdc-nav), ::view-transition-new(hdc-nav) { animation: none; }

/* Pin de la grille → image de la fiche produit : morphing de position et de taille. */
::view-transition-group(*.hdc-pin) { animation-duration: .5s; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
