/* ==========================================================================
   LE PARCOURS D'ACHAT (5 nov. 2026) - inc/parcours.php, assets/parcours.js
   Palette de Léa seulement : blanc, pervenche #7B8CF6 et ses éclaircissements, encre #2D2F52 pour texte et traits.
   ========================================================================== */

:root {
	--pa-encre: #2D2F52;
	--pa-peri: #7B8CF6;
	--pa-trait: rgba(45, 47, 82, .14);
	--pa-doux: color-mix(in srgb, #7B8CF6 12%, #FFFFFF);
	--pa-lent: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- 1. La barre de retour de la fiche ---------- */
.fl-parcours {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	margin: 0 0 1.1rem;
	min-height: 48px;
}
body.fl-parcours-on .single-product .woocommerce-breadcrumb,
body.fl-parcours-on.single-product .woocommerce-breadcrumb { display: none !important; }

.fl-parcours__retour {
	display: inline-flex;
	align-items: center;
	gap: .55rem;
	min-height: 48px;
	padding: .35rem 1.15rem .35rem .55rem;
	border-radius: 999px;
	background: #FFFFFF;
	border: 1px solid var(--pa-trait);
	box-shadow: 0 6px 20px rgba(45, 47, 82, .06);
	color: var(--pa-encre) !important;
	text-decoration: none !important;
	transition: transform .25s var(--pa-lent), box-shadow .25s var(--pa-lent), background-color .25s;
	max-width: 100%;
	min-width: 0;
}
.fl-parcours__retour svg,
.fl-parcours__voisin svg,
.fl-parcours-mini svg,
.fl-parcours-continuer svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex: 0 0 auto;
}
.fl-parcours__retour > svg {
	box-sizing: content-box;
	padding: 8px;
	border-radius: 50%;
	background: var(--pa-doux);
	transition: transform .25s var(--pa-lent);
}
.fl-parcours__retour:hover,
.fl-parcours__retour:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 10px 26px rgba(45, 47, 82, .1);
}
.fl-parcours__retour:hover > svg { transform: translateX(-3px); }
.fl-parcours__mots { display: grid; line-height: 1.15; min-width: 0; }
.fl-parcours__mots b { font-weight: 600; font-size: .95rem; white-space: nowrap; }
.fl-parcours__mots small {
	font-size: .76rem;
	color: color-mix(in srgb, #2D2F52 72%, #FFFFFF);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fl-parcours__voisins {
	display: inline-flex;
	align-items: center;
	gap: .25rem;
	padding: 4px;
	border-radius: 999px;
	background: #FFFFFF;
	border: 1px solid var(--pa-trait);
	flex: 0 0 auto;
}
.fl-parcours__voisin {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	color: var(--pa-encre) !important;
	text-decoration: none !important;
	transition: background-color .2s;
	position: relative;
}
.fl-parcours__voisin::after { content: ""; position: absolute; inset: -3px; } /* 46 px au doigt */
a.fl-parcours__voisin:hover,
a.fl-parcours__voisin:focus-visible { background: var(--pa-doux); }
.fl-parcours__voisin[aria-disabled="true"] { opacity: .3; }
.fl-parcours__compte {
	min-width: 3.6em;
	text-align: center;
	font-size: .82rem;
	font-variant-numeric: tabular-nums;
	color: var(--pa-encre);
}

/* Téléphone : le rond « retour » dans la barre d'achat collante. */
.fl-parcours-mini {
	flex: 0 0 auto;
	display: inline-grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1px solid var(--pa-trait);
	background: #FFFFFF;
	color: var(--pa-encre) !important;
	text-decoration: none !important;
}

@media (max-width: 600px) {
	.fl-parcours { margin-bottom: .8rem; }
	.fl-parcours__retour { padding-right: .9rem; }
	.fl-parcours__mots b { font-size: .9rem; }
	.fl-parcours__compte { min-width: 3em; font-size: .78rem; }
	.fl-parcours__voisin { width: 38px; height: 38px; }
}

/* ---------- 2. Les cartes : « Dans le panier » et la carte qu'on vient de voir ---------- */
ul.products li.product { position: relative; }
.fl-dans-panier {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	gap: .3rem;
	padding: .3rem .65rem .3rem .45rem;
	border-radius: 999px;
	background: #FFFFFF;
	color: var(--pa-encre);
	font-size: .74rem;
	font-weight: 600;
	line-height: 1.2;
	box-shadow: 0 4px 14px rgba(45, 47, 82, .12);
	pointer-events: none;
	animation: pa-pastille .45s var(--pa-lent);
}
.fl-dans-panier[hidden] { display: none; }
.fl-dans-panier svg {
	width: 15px;
	height: 15px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
	padding: 2px;
	border-radius: 50%;
	background: color-mix(in srgb, #7B8CF6 30%, #FFFFFF);
}
@keyframes pa-pastille { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }

ul.products li.product.fl-parcours-vu { z-index: 2; }
.fl-parcours-halo {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	z-index: 5;
	animation: pa-vu 2.1s var(--pa-lent) both;
}
@keyframes pa-vu {
	0% { box-shadow: 0 0 0 0 color-mix(in srgb, #7B8CF6 0%, transparent); }
	18% { box-shadow: 0 0 0 4px color-mix(in srgb, #7B8CF6 75%, #FFFFFF), 0 18px 40px rgba(45, 47, 82, .14); }
	70% { box-shadow: 0 0 0 4px color-mix(in srgb, #7B8CF6 45%, #FFFFFF), 0 18px 40px rgba(45, 47, 82, .1); }
	100% { box-shadow: 0 0 0 0 color-mix(in srgb, #7B8CF6 0%, transparent); }
}

/* ---------- 3. « Continuer mes achats » dans le tiroir du panier ---------- */
.fl-parcours-continuer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .35rem;
	min-height: 44px;
	margin-top: .4rem;
	color: var(--pa-encre) !important;
	font-weight: 600;
	font-size: .92rem;
	text-decoration: none !important;
}
.fl-parcours-continuer:hover span,
.fl-parcours-continuer:hover { text-decoration: underline !important; text-underline-offset: 3px; }

/* ---------- 4. La photo qui voyage d'une page à l'autre ---------- */
#masthead { view-transition-name: fl-entete; }
#wpadminbar { view-transition-name: fl-barre-admin; }
.fl-buybar { view-transition-name: fl-barre-achat; }

/* 5 nov. 2026, optimisé (« ça saccade ») : durées plus courtes, pas de coins arrondis recalculés à chaque image (la
   photo capturée a déjà les siens), fondu de page en mélange normal (le mélange « plus-lighter » par défaut coûte cher
   sur une longue page), et rien qui apparaît en retard sur la page d'arrivée. */
::view-transition-group(fl-objet) {
	animation-duration: .42s;
	animation-timing-function: cubic-bezier(.3, .7, .1, 1);
	z-index: 50;
}
::view-transition-old(fl-objet),
::view-transition-new(fl-objet) {
	height: 100%;
	width: 100%;
	object-fit: cover;
}
::view-transition-old(fl-objet) { animation: pa-fondu-sort .2s ease both; }
::view-transition-new(fl-objet) { animation: pa-fondu-entre .26s ease both; }
::view-transition-image-pair(root) { isolation: auto; }
::view-transition-old(root),
::view-transition-new(root) { mix-blend-mode: normal; }
::view-transition-old(root) { animation: pa-fondu-sort .18s ease both; }
::view-transition-new(root) { animation: pa-fondu-entre .24s ease both; }
::view-transition-group(fl-entete),
::view-transition-group(fl-barre-admin) { animation-duration: .3s; }
@keyframes pa-fondu-sort { to { opacity: 0; } }
@keyframes pa-fondu-entre { from { opacity: 0; } }
html.fl-vt-arrivee .fl-reveal { opacity: 1 !important; animation: none !important; transform: none !important; }
/* Téléphone et tablette : fondu + léger glissement de toute la page (opacité et déplacement seulement). */
@keyframes pa-monte { from { opacity: 0; transform: translateY(14px); } }
html.fl-vt-simple::view-transition-old(root) { animation: pa-fondu-sort .16s ease both; }
html.fl-vt-simple::view-transition-new(root) { animation: pa-monte .3s cubic-bezier(.2, .7, .2, 1) both; }

/* Objet voisin : la page glisse dans le sens de la flèche. */
@keyframes pa-sort-g { to { opacity: 0; transform: translateX(-48px); } }
@keyframes pa-sort-d { to { opacity: 0; transform: translateX(48px); } }
@keyframes pa-entre-d { from { opacity: 0; transform: translateX(48px); } }
@keyframes pa-entre-g { from { opacity: 0; transform: translateX(-48px); } }
html:active-view-transition-type(suivant)::view-transition-old(root) { animation: pa-sort-g .3s var(--pa-lent) both; }
html:active-view-transition-type(suivant)::view-transition-new(root) { animation: pa-entre-d .38s var(--pa-lent) both; }
html:active-view-transition-type(precedent)::view-transition-old(root) { animation: pa-sort-d .3s var(--pa-lent) both; }
html:active-view-transition-type(precedent)::view-transition-new(root) { animation: pa-entre-g .38s var(--pa-lent) both; }

@media (prefers-reduced-motion: reduce) {
	.fl-parcours__retour, .fl-parcours__retour > svg { transition: none; }
	.fl-parcours-halo { animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, #7B8CF6 60%, #FFFFFF); }
	.fl-dans-panier { animation: none; }
}

/* ---------- 5. Les listes d'objets : le bandeau du haut reste en place (Vianney, 5 nov. 2026) ----------
   « Le champ en haut s'efface pas assez vite et il écrase les objets et filtres ; sur la boutique il doit rester fixe ».
   Ailleurs il se range toujours au défilement (peau-site.js) ; ici on l'annule. Un voile de la couleur du fond passe
   derrière la pilule : les cartes s'y fondent au lieu de défiler à moitié visibles autour d'elle. La colonne des
   filtres colle juste dessous. */
body.fl-v3-site.fl-liste-produits.fl-v3-entete-cache #masthead { transform: none !important; opacity: 1 !important; }
body.fl-v3-site.fl-liste-produits #masthead::before {
	content: "";
	position: absolute;
	inset: calc(-12px - var(--wp-admin--admin-bar--height, 0px)) 0 -18px; /* jusqu en haut de l écran (la barre d administration défile sur téléphone) */
	z-index: -1;
	pointer-events: none;
	background: linear-gradient(to bottom, var(--nu-fond, #F7F8FF) 0, var(--nu-fond, #F7F8FF) calc(100% - 26px), transparent);
}
@media (min-width: 922px) {
	html body.fl-v3-site.fl-liste-produits dialog.fl-filters[open]:not(.is-modal) {
		top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--v3-entete, 92px) + 16px) !important;
		max-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px) - var(--v3-entete, 92px) - 32px) !important;
	}
}

/* ---------- 6. Suggestions sous la fiche (inc/suggestions.php, 5 nov. 2026) : la phrase qui dit le lien ---------- */
.fl-aussi__pourquoi {
	margin: -.35rem 0 1.1rem;
	font-size: .92rem;
	color: color-mix(in srgb, #2D2F52 78%, #FFFFFF);
}
.fl-aussi + .fl-aussi { margin-top: 2.4rem; }

/* Retour sur une liste rechargée : la grille attend sa place puis apparaît (parcours-vt.js, parcours.js). */
html.fl-restaure .fl-shop ul.products, html.fl-restaure ul.products, html.fl-restaure .fl-more { opacity: 0 !important; }
@keyframes pa-reapparait { from { opacity: 0; } }
html:not(.fl-restaure) .fl-liste-produits ul.products { animation: pa-reapparait .2s ease both; }

/* ---------- 7. Fiche produit : la galerie ne fait plus sauter la page (5 nov. 2026) ----------
   Mesuré sur téléphone (processeur ×4) : le diaporama de WooCommerce se met en place vers 2,7 s ; avant, TOUTES les photos
   s'empilaient (2 770 px, invisibles mais présentes) et le texte de la fiche descendait puis remontait (CLS 0,28).
   Tant que le diaporama n'a pas donné leur largeur aux photos (style en ligne), seule la 1re occupe la place, à sa taille. */
.woocommerce-product-gallery { container-type: inline-size; }
/* (avant le diaporama, WooCommerce montre les autres photos en vignettes : presque la hauteur finale, on n'y touche pas ;
   le saut avait lieu à l'instant où le diaporama s'installe, d'où le « .flex-viewport ») */
.flex-viewport .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:not([style*="width"]):not(:first-child) { display: none !important; }
.flex-viewport .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:first-child:not([style*="width"]) { width: 100cqw !important; max-width: 100cqw; float: left; }
