/*
Theme Name: Papiers d'Histoire
Theme URI: https://papiers-histoire.fr
Author: Patrick Sanchez
Author URI: https://patrick-sanchez.fr
Description: Thème de blocs pour papiers-histoire.fr — boutique WooCommerce de documents anciens et d'autographes. Sans constructeur de pages, polices auto-hébergées, accessible (RGAA niveau AA visé).
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
Version: 1.3.6
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: papiers-histoire
Tags: e-commerce, block-patterns, full-site-editing, accessibility-ready
*/

/* ---------- Base & accessibilité ---------- */

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--rouge);
	outline-offset: 3px;
	border-radius: 2px;
}

.wp-element-button:focus-visible,
.wp-block-button__link:focus-visible {
	outline: 3px solid var(--wp--preset--color--encre);
	outline-offset: 3px;
}

::selection {
	background: var(--wp--preset--color--rouge);
	color: var(--wp--preset--color--blanc);
}

img {
	height: auto;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ---------- Signature « ph » (monogramme + nom en minuscules) ---------- */

.ph-brand {
	gap: 0.75rem;
}

.ph-brand__mark {
	display: block;
	width: 36px;
	height: 36px;
	flex: none;
}

.ph-brand .wp-block-site-title {
	margin: 0;
}

/* Petites étiquettes typographiques (catégorie, référence, rubriques) */
.ph-eyebrow {
	font-family: var(--wp--preset--font-family--texte);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--wp--preset--color--rouge-texte);
}

.ph-eyebrow a {
	color: inherit;
	text-decoration: none;
}

.ph-eyebrow a:hover {
	text-decoration: underline;
}

/* ---------- En-tête ---------- */

.ph-topbar p {
	margin: 0;
}

.ph-header {
	border-bottom: 1px solid var(--wp--preset--color--trait);
}

.ph-header .wp-block-search__button {
	background: transparent;
	color: var(--wp--preset--color--encre);
	padding: 0.5rem;
	min-width: 44px;
	min-height: 44px;
}

.ph-header .wc-block-mini-cart__badge {
	background: var(--wp--preset--color--rouge);
	color: var(--wp--preset--color--blanc);
}

.ph-header .wc-block-mini-cart__button,
.ph-header .wc-block-customer-account__account-icon {
	min-width: 44px;
	min-height: 44px;
}

/* ---------- Boutons secondaires ---------- */

.is-style-outline > .wp-block-button__link,
.ph-button-outline {
	background: transparent;
	color: var(--wp--preset--color--encre);
	border: 1px solid var(--wp--preset--color--encre);
}

.is-style-outline > .wp-block-button__link:hover,
.ph-button-outline:hover {
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--papier);
}

.ph-button-outline {
	display: block;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	text-decoration: none;
	border-radius: 4px;
	padding: 0.85rem 1.5rem;
	font-weight: 700;
}

/* ---------- Badge (réglé pièce par pièce dans le back-office) ---------- */

.ph-badge {
	display: inline-block;
	background: var(--wp--preset--color--rouge);
	color: var(--wp--preset--color--blanc);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 700;
	line-height: 1.2;
	padding: 0.35rem 0.65rem;
	border-radius: 4px;
}

.wc-block-components-product-image,
.wp-block-woocommerce-product-image-gallery {
	position: relative;
}

.wc-block-components-product-image > .ph-badge,
.wp-block-woocommerce-product-image-gallery > .ph-badge {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 5;
}

/* ---------- Cartes produit (listes) ---------- */

.wc-block-product-template .wc-block-components-product-image img,
.wc-block-components-product-image img {
	background: var(--wp--preset--color--brume);
	border-radius: 6px;
	aspect-ratio: 4 / 5;
	object-fit: contain;
	transition: transform 0.25s ease;
}

.wc-block-product-template .wc-block-product:hover .wc-block-components-product-image img {
	transform: scale(1.015);
}

.wc-block-product-template .wp-block-post-title a:hover {
	color: var(--wp--preset--color--rouge-texte);
}

.wc-block-components-product-sale-badge {
	display: none;
}

/* ---------- Fiche produit ---------- */

@media (min-width: 782px) {
	.ph-sticky {
		position: sticky;
		top: 2rem;
	}
}

.woocommerce-product-gallery__image,
.woocommerce-product-gallery .flex-viewport {
	background: var(--wp--preset--color--brume);
	border-radius: 6px;
	overflow: hidden;
}

.woocommerce-product-gallery .flex-control-thumbs {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 0.625rem;
	margin: 0.75rem 0 0;
	padding: 0;
	list-style: none;
}

.woocommerce-product-gallery .flex-control-thumbs img {
	border-radius: 4px;
	background: var(--wp--preset--color--brume);
	opacity: 0.75;
	cursor: pointer;
}

.woocommerce-product-gallery .flex-control-thumbs img.flex-active,
.woocommerce-product-gallery .flex-control-thumbs img:hover {
	opacity: 1;
	outline: 2px solid var(--wp--preset--color--encre);
	outline-offset: -2px;
}

.wp-block-add-to-cart-form .quantity {
	display: none;
}

.wp-block-add-to-cart-form .single_add_to_cart_button {
	width: 100%;
}

.wp-block-add-to-cart-form .stock {
	font-size: var(--wp--preset--font-size--s);
	color: var(--wp--preset--color--gris-doux);
	margin: 0 0 0.75rem;
}

.wp-block-add-to-cart-form .stock.out-of-stock {
	font-weight: 700;
	color: var(--wp--preset--color--gris-texte);
}

.ph-mentions-prix {
	color: var(--wp--preset--color--gris-doux);
}

/* Accordéons (bloc Détails) */
.wp-block-details {
	padding: 0;
}

.wp-block-details > summary {
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding: 1rem 0;
	font-weight: 700;
	cursor: pointer;
}

.wp-block-details > summary::-webkit-details-marker {
	display: none;
}

.wp-block-details > summary::after {
	content: "";
	width: 0.6rem;
	height: 0.6rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translate(-2px, -2px);
	flex: none;
}

.wp-block-details[open] > summary::after {
	transform: rotate(-135deg) translate(-2px, -2px);
}

.wp-block-details > :not(summary) {
	margin-bottom: 1rem;
}

.ph-accordeons {
	border-top: 1px solid var(--wp--preset--color--trait);
}

/* Fiche technique (attributs WooCommerce) */
.ph-fiche table.woocommerce-product-attributes {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--s);
}

.ph-fiche th,
.ph-fiche td {
	text-align: left;
	vertical-align: top;
	padding: 0.45rem 0;
	border: 0;
}

.ph-fiche th {
	width: 38%;
	font-weight: 400;
	color: var(--wp--preset--color--gris-doux);
	padding-right: 1rem;
}

.ph-fiche td p {
	margin: 0;
}

/* Carte « personne » */
.ph-personne {
	border-radius: 6px;
}

/* ---------- Divers WooCommerce ---------- */

.wc-block-breadcrumbs,
.woocommerce-breadcrumb {
	font-size: var(--wp--preset--font-size--xs);
	color: var(--wp--preset--color--gris-doux);
}

.wc-block-breadcrumbs a,
.woocommerce-breadcrumb a {
	color: inherit;
	text-decoration: none;
}

.wc-block-breadcrumbs a:hover,
.woocommerce-breadcrumb a:hover {
	text-decoration: underline;
}

.wp-block-woocommerce-product-results-count,
.wp-block-woocommerce-catalog-sorting {
	font-size: var(--wp--preset--font-size--s);
	color: var(--wp--preset--color--gris-doux);
}

.woocommerce-ordering select {
	min-height: 44px;
	border: 1px solid var(--wp--preset--color--gris-doux);
	border-radius: 4px;
	padding: 0 0.75rem;
	background: var(--wp--preset--color--blanc);
}

/* Champs de formulaire génériques */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="tel"],
textarea,
select {
	font: inherit;
	border: 1px solid var(--wp--preset--color--gris-doux);
	border-radius: 4px;
}

/* ---------- Pied de page ---------- */

.ph-footer {
	border-top: 1px solid var(--wp--preset--color--trait);
}

.ph-footer ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.ph-footer li + li {
	margin-top: 0.4rem;
}

.ph-footer a {
	text-decoration: none;
}

.ph-footer a:hover {
	text-decoration: underline;
}

/* ---------- Chaleur (v1.1.1) ---------- */

/* Champs : fond blanc net sur le papier chaud */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="tel"],
textarea,
select {
	background-color: var(--wp--preset--color--blanc);
}

/* Pièce à la une : posée sur la table */
.ph-hero-piece {
	text-align: center;
}

.ph-hero-piece .wp-block-image {
	margin: 0;
}

.ph-hero-piece img {
	display: block;
	width: auto;
	max-width: 100%;
	max-height: 30rem;
	margin-inline: auto;
	box-shadow: 0 1px 2px rgba(40, 28, 16, 0.08), 0 14px 36px rgba(40, 28, 16, 0.16);
	transition: transform 0.3s ease;
}

.ph-hero-piece a:hover img {
	transform: translateY(-3px);
}

.ph-hero-piece figcaption {
	margin-top: 1.25rem;
	font-size: var(--wp--preset--font-size--s);
	color: var(--wp--preset--color--gris-doux);
}

.ph-hero-piece figcaption strong {
	color: var(--wp--preset--color--encre);
}

/* Liens dans les textes : le rouge de la marque */
.wp-block-post-content a:not(.wp-element-button):not(.wp-block-button__link),
.woocommerce-product-details__short-description a,
.wc-block-components-product-summary a {
	color: var(--wp--preset--color--rouge-texte);
}

/* Étapes numérotées */
.ph-etapes {
	list-style: none;
	counter-reset: ph-etape;
	padding: 0;
	margin: 0;
}

.ph-etapes > li {
	counter-increment: ph-etape;
	position: relative;
	padding: 1.1rem 0 1.1rem 3.25rem;
	border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}

.ph-etapes > li:last-child {
	border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}

.ph-etapes > li::before {
	content: counter(ph-etape, decimal-leading-zero);
	position: absolute;
	left: 0;
	top: 1.05rem;
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--l);
	line-height: 1.2;
	color: var(--wp--preset--color--rouge-texte);
}

/* Section sombre */
.ph-section-sombre .ph-eyebrow,
.ph-section-sombre .ph-etapes > li::before {
	color: var(--wp--preset--color--rouge-clair);
}

.ph-section-sombre a {
	color: inherit;
}
/* ---------- Galerie « table d'archives » (fiche produit, v1.1.2) ---------- */

/* La pièce est posée sur la table : fond papier, léger halo, ombre tintée */
.wp-block-woocommerce-product-image-gallery,
.woocommerce-product-gallery {
	position: relative;
}

.wp-block-woocommerce-product-image-gallery .wc-block-components-product-image,
.woocommerce-product-gallery__wrapper,
.woocommerce-product-gallery__image {
	background: radial-gradient(ellipse at 50% 40%, var(--wp--preset--color--blanc) 0%, var(--wp--preset--color--brume) 72%);
	border-radius: 6px;
	overflow: hidden;
}

.wp-block-woocommerce-product-image-gallery img,
.woocommerce-product-gallery__image img {
	box-shadow: 0 1px 2px rgba(40, 28, 16, 0.08), 0 18px 40px -12px rgba(40, 28, 16, 0.28);
	cursor: zoom-in;
	transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.wp-block-woocommerce-product-image-gallery img:hover,
.woocommerce-product-gallery__image img:hover {
	transform: translateY(-2px);
	box-shadow: 0 2px 4px rgba(40, 28, 16, 0.1), 0 26px 50px -14px rgba(40, 28, 16, 0.34);
}

/* Vignettes : petites feuilles, la sélection se lit par le contour rouge */
.wp-block-woocommerce-product-image-gallery .wc-block-product-image-gallery__thumbnails,
.woocommerce-product-gallery .flex-control-thumbs {
	gap: 0.6rem;
}

.wp-block-woocommerce-product-image-gallery .wc-block-product-image-gallery__thumbnails img,
.woocommerce-product-gallery .flex-control-thumbs img {
	border-radius: 3px;
	box-shadow: 0 1px 3px rgba(40, 28, 16, 0.14);
	opacity: 0.6;
	transition: opacity 0.2s ease, outline-color 0.2s ease;
}

.wp-block-woocommerce-product-image-gallery .wc-block-product-image-gallery__thumbnails img:hover,
.woocommerce-product-gallery .flex-control-thumbs img:hover,
.woocommerce-product-gallery .flex-control-thumbs img.flex-active {
	opacity: 1;
	outline: 2px solid var(--wp--preset--color--rouge);
	outline-offset: 2px;
}

/* Titre et prix : hiérarchie par le poids et le corps, pas par la taille */
.wp-block-post-title.product_title,
.product_title {
	letter-spacing: -0.02em;
}

.wp-block-woocommerce-product-price .wc-block-components-product-price,
.woocommerce-Price-amount {
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 600;
}

/* Mouvement réduit : pas de transition ni de déplacement */
@media (prefers-reduced-motion: reduce) {
	.wp-block-woocommerce-product-image-gallery img,
	.woocommerce-product-gallery__image img {
		transition: none;
	}
	.wp-block-woocommerce-product-image-gallery img:hover,
	.woocommerce-product-gallery__image img:hover {
		transform: none;
	}
}
/* ---------- Fiche : nom du signataire en grand (v1.1.3) ---------- */
.ph-signataire {
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 600;
	font-size: clamp(2.6rem, 5.2vw, 4.4rem);
	line-height: 1;
	letter-spacing: -0.035em;
	color: var(--wp--preset--color--encre);
	margin: 0 0 0.35rem;
}

.ph-sticky .wp-block-post-title.has-xxl-font-size {
	font-size: var(--wp--preset--font-size--l);
	font-weight: 500;
	color: var(--wp--preset--color--gris-texte);
	line-height: 1.25;
}

/* Galerie qui reste visible pendant la lecture de la fiche (v1.1.4) */
@media (min-width: 782px) {
	.ph-galerie-col {
		align-self: flex-start;
		position: sticky;
		top: 2rem;
	}
}


/* ---------- Fiche « grandiose » (v1.1.5) ---------- */

/* Signataire : filet rouge + grand format */
.ph-signataire::before {
	content: "";
	display: block;
	width: 3.5rem;
	height: 3px;
	background: var(--wp--preset--color--rouge);
	margin-bottom: 1.25rem;
}

@media (min-width: 782px) {
	/* La photo déborde vers la marge gauche, comme posée sur la table */
	.ph-galerie-col {
		margin-left: -3vw;
	}

	.ph-galerie-col img {
		display: block;
		max-height: 78vh;
		width: auto;
		max-width: 100%;
		margin-inline: auto;
	}

	.ph-galerie-col .wc-block-product-image-gallery__thumbnails img {
		max-height: 84px;
		width: auto;
	}

	.ph-sticky {
		padding-left: 1.5rem;
		border-left: 1px solid var(--wp--preset--color--trait);
	}

	.ph-signataire {
		font-size: clamp(3.4rem, 6.4vw, 6.2rem);
		line-height: 0.92;
		letter-spacing: -0.045em;
	}

	.ph-sticky .wp-block-post-title.has-xxl-font-size {
		font-size: var(--wp--preset--font-size--m);
	}

	.ph-sticky .wc-block-components-product-price,
	.ph-sticky .wp-block-woocommerce-product-price {
		font-size: 2.2rem;
		line-height: 1.1;
	}
}


/* Ajustement v1.1.5b : colonnes et tailles */
@media (min-width: 782px) {
	.wp-block-columns > .ph-galerie-col {
		flex-basis: 54% !important;
	}

	.ph-galerie-col img {
		max-height: 84vh;
	}

	.ph-signataire {
		font-size: clamp(2.8rem, 4.2vw, 4.6rem);
		line-height: 0.95;
		letter-spacing: -0.04em;
		word-break: normal;
		overflow-wrap: normal;
	}
}

.ph-nw {
	white-space: nowrap;
}

/* ---------- Fiche « grandiose » : bandeau nuit (v1.1.6) ---------- */
.ph-fiche-nuit {
	background: var(--wp--preset--color--nuit);
	color: var(--wp--preset--color--papier);
}

.ph-fiche-nuit .ph-sticky {
	border-left-color: rgba(255, 255, 255, 0.14);
}

.ph-fiche-nuit .ph-signataire {
	color: var(--wp--preset--color--papier);
}

.ph-fiche-nuit .ph-signataire::before {
	background: var(--wp--preset--color--rouge-clair);
}

.ph-fiche-nuit .wp-block-post-title.has-xxl-font-size,
.ph-fiche-nuit .ph-mentions-prix,
.ph-fiche-nuit .wp-block-post-excerpt,
.ph-fiche-nuit .wp-block-add-to-cart-form .stock,
.ph-fiche-nuit .wc-block-components-product-price {
	color: var(--wp--preset--color--gris-clair);
}

.ph-fiche-nuit .wc-block-components-product-price {
	color: var(--wp--preset--color--papier);
}

.ph-fiche-nuit .wp-block-details > summary,
.ph-fiche-nuit .wp-block-details p,
.ph-fiche-nuit .ph-fiche th,
.ph-fiche-nuit .ph-fiche td {
	color: var(--wp--preset--color--papier);
}

.ph-fiche-nuit .ph-accordeons,
.ph-fiche-nuit .wp-block-details {
	border-color: rgba(255, 255, 255, 0.14);
}

.ph-fiche-nuit .ph-button-outline,
.ph-fiche-nuit .is-style-outline > .wp-block-button__link {
	color: var(--wp--preset--color--papier);
	border-color: var(--wp--preset--color--papier);
}

.ph-fiche-nuit .ph-button-outline:hover,
.ph-fiche-nuit .is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--papier);
	color: var(--wp--preset--color--nuit);
}

.ph-fiche-nuit .flex-control-thumbs img.flex-active,
.ph-fiche-nuit .flex-control-thumbs img:hover {
	outline-color: var(--wp--preset--color--papier);
}

@media (min-width: 782px) {
	.ph-fiche-nuit .ph-signataire {
		font-size: clamp(3.6rem, 7.4vw, 7.4rem);
		line-height: 0.9;
	}

	.ph-fiche-nuit .ph-galerie-col img {
		box-shadow: 0 34px 70px -24px rgba(0, 0, 0, 0.75);
	}
}

/* v1.1.6b : nom contenu dans la colonne, pas de débordement horizontal */
.ph-fiche-nuit {
	overflow-x: clip;
}

@media (min-width: 782px) {
	.ph-fiche-nuit .ph-signataire {
		font-size: clamp(2.8rem, 4.6vw, 4.8rem);
		line-height: 0.95;
		letter-spacing: -0.04em;
	}
}


/* v1.1.6c : taille du nom adaptée à la colonne */
@media (min-width: 782px) {
	.ph-fiche-nuit .ph-signataire {
		font-size: clamp(2.4rem, 3.6vw, 3.8rem);
	}
}


/* v1.1.6d : texte descriptif lisible sur fond nuit (WordPress impose la couleur des classes has-*-color avec !important) */
.ph-fiche-nuit .has-gris-texte-color,
.ph-fiche-nuit .has-gris-doux-color,
.ph-fiche-nuit .wp-block-post-excerpt p,
.ph-fiche-nuit .wp-block-post-excerpt {
	color: var(--wp--preset--color--gris-clair) !important;
}


/* v1.1.7 : bulle « Promo » aux couleurs de la marque, à la place du vert olive par défaut */
.onsale,
.wc-block-components-product-sale-badge--promo,
.woocommerce span.onsale {
	background: var(--wp--preset--color--rouge) !important;
	color: var(--wp--preset--color--blanc) !important;
	font-family: var(--wp--preset--font-family--texte);
	font-size: var(--wp--preset--font-size--xs) !important;
	font-weight: 700;
	letter-spacing: 0.02em;
	border-radius: 4px;
	min-height: 0;
	min-width: 0;
	line-height: 1.2;
	padding: 0.35rem 0.65rem !important;
	top: 0.75rem !important;
	left: 0.75rem !important;
}


/* v1.1.7b : bulle Promo, sélecteur plus précis */
.wp-block-woocommerce-product-image-gallery span.onsale,
.woocommerce-product-gallery span.onsale,
.ph-galerie-col span.onsale {
	background-color: #D13D4B !important;
	background-image: none !important;
	color: #FFFFFF !important;
	opacity: 1 !important;
	border: 0 !important;
	box-shadow: none !important;
}


/* v1.1.8 : grille, piece entiere et une seule categorie */
.wp-block-woocommerce-product-collection .wc-block-components-product-image img {
	object-fit: contain !important;
}

.wp-block-woocommerce-product-collection .wp-block-post-terms a ~ a,
.wp-block-woocommerce-product-collection .wp-block-post-terms .wp-block-post-terms__separator {
	display: none;
}


/* v1.2 : logo manuscrit (piste C, Homemade Apple + point rouge) */
.ph-brand .wp-block-site-title,
.ph-brand .wp-block-site-title a {
	font-family: var(--wp--preset--font-family--manuscrite) !important;
	font-size: 1.45rem !important;
	font-weight: 400 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	line-height: 1.6 !important;
	text-decoration: none !important;
	color: var(--wp--preset--color--encre);
	white-space: nowrap;
}

.ph-brand .wp-block-site-title a::after {
	content: "";
	display: inline-block;
	width: 0.3em;
	height: 0.3em;
	margin-left: 0.15em;
	border-radius: 50%;
	background: var(--wp--preset--color--rouge);
	vertical-align: 0.1em;
}

@media (max-width: 600px) {
	.ph-brand .wp-block-site-title,
	.ph-brand .wp-block-site-title a {
		font-size: 1.1rem !important;
	}
}


/* v1.2 : lien panier léger (remplace le mini-panier à tiroir) */
.ph-panier {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--wp--preset--color--encre);
}

.ph-panier svg {
	width: 32px;
	height: 32px;
	fill: currentColor;
}

.ph-panier__nb {
	position: absolute;
	top: 2px;
	right: 0;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	box-sizing: border-box;
	border-radius: 9px;
	background: var(--wp--preset--color--rouge);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}


/* v1.2.2 : en-tete mobile sur une seule ligne (logo, icones, menu) ; 599px = seuil du menu burger WordPress */
@media (max-width: 599px) {
	.ph-header .alignwide.is-content-justification-space-between {
		flex-wrap: nowrap !important;
		gap: 0.25rem !important;
		align-items: center;
	}
	.ph-header .ph-brand {
		flex: 1 1 auto;
		min-width: 0;
	}
	.ph-header .alignwide > .wp-block-navigation {
		order: 3;
	}
	.ph-header .alignwide > .wp-block-group.is-nowrap:not(.ph-brand) {
		gap: 0 !important;
	}
	.ph-header .wp-block-search__button,
	.ph-header .ph-panier,
	.ph-header .wc-block-customer-account__account-icon {
		min-width: 40px !important;
		width: 40px;
	}
}

@media (max-width: 400px) {
	.ph-brand .wp-block-site-title,
	.ph-brand .wp-block-site-title a {
		font-size: 1rem !important;
	}
}


/* v1.2.2 : fond du menu mobile ouvert */
.ph-header .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--papier) !important;
	color: var(--wp--preset--color--encre) !important;
}
.ph-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: 1.25rem;
	padding-block: 0.4rem;
}


/* v1.2.4 : panier classique sur mobile (pieces uniques, pas de mise a jour des quantites) */
.woocommerce-cart-form button[name="update_cart"] {
	display: none !important;
}
@media (max-width: 768px) {
	.woocommerce-cart-form td.actions .coupon {
		display: flex;
		flex-direction: column;
		gap: 0.5rem;
		width: 100%;
	}
	.woocommerce-cart-form td.actions .coupon .input-text,
	.woocommerce-cart-form td.actions .coupon .button {
		width: 100% !important;
		float: none !important;
		margin: 0 !important;
	}
}


/* v1.2.5 : en-tete de la page de paiement (pas de menu) */
.ph-header .alignwide:not(:has(.wp-block-navigation)) > .ph-brand {
	flex: none;
	min-width: auto;
}
@media (max-width: 600px) {
	.ph-header .alignwide:not(:has(.wp-block-navigation)) > p {
		display: none;
	}
}


/* v1.2.7 : tablette (600 a 1023 px) : menu burger et en-tete sur une ligne, au lieu du menu complet sur plusieurs lignes */
@media (min-width: 600px) and (max-width: 1199px) {
	.ph-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex !important;
	}
	.ph-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none !important;
	}
	.ph-header .alignwide.is-content-justification-space-between {
		flex-wrap: nowrap !important;
		align-items: center;
	}
	.ph-header .alignwide > .wp-block-navigation {
		order: 3;
	}
	.ph-header .alignwide > .wp-block-group.is-nowrap:not(.ph-brand) {
		margin-left: auto;
	}
}


/* v1.2.9 : bouton du formulaire Formidable aux couleurs du site */
.frm_forms .frm_button_submit,
.frm_forms button.frm_button_submit {
	background: var(--wp--preset--color--rouge) !important;
	border: 1px solid var(--wp--preset--color--rouge) !important;
	color: #fff !important;
	font-family: inherit !important;
	font-weight: 700 !important;
	font-size: 1rem !important;
	padding: 0.85rem 1.6rem !important;
	border-radius: 4px !important;
	box-shadow: none !important;
	height: auto !important;
}
.frm_forms .frm_button_submit:hover,
.frm_forms .frm_button_submit:focus {
	background: var(--wp--preset--color--encre) !important;
	border-color: var(--wp--preset--color--encre) !important;
}


/* v1.3.0 : panier et paiement centres sur ordinateur, alignes sur le titre */
body.woocommerce-checkout main .woocommerce,
body.woocommerce-cart main .woocommerce {
	max-width: 1000px;
	margin-left: auto !important;
	margin-right: auto !important;
}


/* v1.3.1 : bloc de paiement aux couleurs du site (au lieu du mauve WooCommerce) */
.woocommerce-checkout #payment {
	background: var(--wp--preset--color--brume) !important;
	border-radius: 6px;
}
.woocommerce-checkout #payment div.payment_box {
	background: var(--wp--preset--color--papier) !important;
	color: var(--wp--preset--color--gris-texte, #48443F) !important;
}
.woocommerce-checkout #payment div.payment_box::before {
	border-bottom-color: var(--wp--preset--color--papier) !important;
}
.woocommerce-checkout #payment ul.payment_methods {
	border-bottom-color: rgba(22, 22, 22, 0.1) !important;
}


/* v1.3.2 : bandeau du haut, mention du port offert masquée sur petit écran */
@media (max-width: 599px) {
	.ph-topbar__opt {
		display: none;
	}
}

/* Filtres en pastilles, index des personnalités (v1.3.4, 27/10/2026) */
.ph-filtres {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 2rem;
	margin-block: var(--wp--preset--spacing--30) 0;
	padding-block: 1rem;
	border-block: 1px solid var(--wp--preset--color--trait);
}
.ph-filtres__groupe {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
}
.ph-filtres__titre {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gris-texte);
}
.ph-filtres__liste {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ph-pastille {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	min-height: 44px;
	padding: 0.375rem 0.875rem;
	border: 1px solid var(--wp--preset--color--trait);
	border-radius: 999px;
	background: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--encre);
	font-size: 0.9375rem;
	line-height: 1.2;
	text-decoration: none;
	transition: border-color 0.15s, background-color 0.15s;
}
.ph-pastille:hover {
	border-color: var(--wp--preset--color--encre);
}
.ph-pastille:focus-visible {
	outline: 2px solid var(--wp--preset--color--rouge-texte);
	outline-offset: 2px;
}
.ph-pastille__n {
	color: var(--wp--preset--color--gris-doux);
	font-size: 0.8125rem;
}
.ph-pastille[aria-current="true"] {
	background: var(--wp--preset--color--encre);
	border-color: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--blanc);
}
.ph-pastille[aria-current="true"] .ph-pastille__n {
	color: var(--wp--preset--color--gris-clair);
}
.ph-pastille[aria-current="true"]::after {
	content: "\00d7";
	margin-left: 0.25rem;
	font-size: 1.1em;
}
.ph-filtres__effacer {
	flex-basis: 100%;
	margin: 0;
	font-size: 0.9375rem;
}
.ph-filtres__effacer a {
	color: var(--wp--preset--color--rouge-texte);
}
.ph-index__lettres {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 var(--wp--preset--spacing--30);
	padding: 0;
	list-style: none;
}
.ph-index__lettres a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	border: 1px solid var(--wp--preset--color--trait);
	border-radius: 6px;
	background: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--encre);
	font-weight: 700;
	text-decoration: none;
}
.ph-index__lettres a:hover,
.ph-index__lettres a:focus-visible {
	border-color: var(--wp--preset--color--encre);
}
.ph-index__section {
	padding-block: 1rem;
	border-top: 1px solid var(--wp--preset--color--trait);
	scroll-margin-top: 6rem;
}
.ph-index__section h2 {
	margin: 0 0 0.5rem;
	font-size: 1.5rem;
}
.ph-index__liste {
	margin: 0;
	padding: 0;
	list-style: none;
	columns: 2 16rem;
	column-gap: 2rem;
}
.ph-index__liste li {
	padding-block: 0.375rem;
	break-inside: avoid;
}
.ph-index__n {
	color: var(--wp--preset--color--gris-doux);
	font-size: 0.875rem;
}
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
@media (max-width: 599px) {
	.ph-filtres {
		flex-direction: column;
		gap: 0.75rem;
	}
}

/* Entrée active du menu (v1.3.4) */
.ph-header .wp-block-navigation-item__content[aria-current],
.ph-header .ph-menu-actif > .wp-block-navigation-submenu__toggle {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--rouge);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.4em;
}

/* Miniatures de la galerie produit (v1.3.5, 28/10/2026) : taille fixe, serrées à gauche */
.woocommerce div.product div.images.woocommerce-product-gallery .flex-control-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.75rem 0 0;
	padding: 0;
}
.woocommerce div.product div.images.woocommerce-product-gallery .flex-control-thumbs li {
	float: none;
	flex: 0 0 88px;
	width: 88px;
	margin: 0;
	padding: 0;
}
.woocommerce div.product div.images.woocommerce-product-gallery .flex-control-thumbs li img {
	display: block;
	width: 100%;
	height: 88px;
	object-fit: cover;
}
@media (max-width: 599px) {
	.woocommerce div.product div.images.woocommerce-product-gallery .flex-control-thumbs li {
		flex-basis: 64px;
		width: 64px;
	}
	.woocommerce div.product div.images.woocommerce-product-gallery .flex-control-thumbs li img {
		height: 64px;
	}
}
