/* ==========================================================================
   Listes de produits : catégories, marques, /boutique/, pages à shortcode
   Chargé par inc/product-archive.php.
   ========================================================================== */

/* --- En-tête de page (bandeau Kadence, vidé de sa photo en PHP) --- */

.product-archive-hero-section .entry-hero-container-inner {
	background: var(--cristime-alt);
	border-bottom: 1px solid var(--cristime-line);
}

.entry-hero.product-archive-hero-section .entry-header {
	min-height: 0;
	padding: 26px 0 28px;
}

.product-archive-hero-section .kadence-breadcrumbs {
	margin: 0 0 8px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--cristime-faint);
}

.product-archive-hero-section .kadence-breadcrumbs a {
	color: var(--cristime-muted);
	text-decoration: none;
}

.product-archive-hero-section .kadence-breadcrumbs a:hover {
	color: var(--cristime-ink);
}

/* L'icône maison suit la ligne de texte au lieu de ses 24 px d'origine. */
.product-archive-hero-section .kadence-breadcrumbs .kadence-svg-iconset svg {
	width: 14px;
	height: 14px;
}

/* Kadence écrit la couleur du titre en 0-2-1 (palette7, gris très clair
   prévu pour la photo sombre). */
.wp-site-blocks .product-archive-hero-section .product-archive-title h1 {
	margin: 0;
	font-size: 30px;
	line-height: 1.15;
	letter-spacing: -.01em;
	color: var(--cristime-ink);
}

/* 48 px de Kadence entre le bandeau et la liste. */
.woocommerce.archive .content-area {
	margin-top: 32px;
}

@media (max-width: 767px) {
	.entry-hero.product-archive-hero-section .entry-header {
		padding: 16px 0 18px;
	}

	.product-archive-hero-section .kadence-breadcrumbs {
		margin-bottom: 4px;
		font-size: 12px;
	}

	.wp-site-blocks .product-archive-hero-section .product-archive-title h1 {
		font-size: 24px;
	}

	.woocommerce.archive .content-area {
		margin-top: 16px;
	}
}

/* --- Barre d'outils : compteur, tri, bascule grille / liste --- */

.kadence-shop-top-row {
	align-items: center;
	gap: 16px;
	padding-bottom: 20px;
}

.kadence-shop-top-row .woocommerce-result-count {
	margin: 0;
	font-size: 14px;
	line-height: 1.4;
	color: var(--cristime-muted);
}

.woocommerce .cristime-ordering {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
}

.cristime-ordering__label {
	margin: 0;
	font-size: 14px;
	color: var(--cristime-muted);
	white-space: nowrap;
}

/* Kadence et WooCommerce stylisent `select.orderby` (soulignement gris-bleu
   #cbd5e0, graisse 600) : préfixe par le formulaire. */
.woocommerce .cristime-ordering select.cristime-ordering__select {
	-webkit-appearance: none;
	appearance: none;
	min-width: 190px;
	height: 40px;
	margin: 0;
	padding: 0 38px 0 14px;
	font-family: var(--global-body-font-family);
	font-size: 14px;
	font-weight: 500;
	color: var(--cristime-ink);
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 12px center / 16px 16px no-repeat;
	border: 1px solid var(--cristime-border);
	border-radius: 4px;
	box-shadow: none;
	cursor: pointer;
}

.woocommerce .cristime-ordering select.cristime-ordering__select:hover {
	border-color: var(--cristime-accent-dark);
}

.woocommerce .cristime-ordering select.cristime-ordering__select:focus-visible {
	outline: 2px solid var(--cristime-accent-dark);
	outline-offset: 2px;
}

/* Bascule grille / liste : deux boutons Kadence, recette habituelle
   (padding, et les trois états hover / focus / active). */
.kadence-shop-top-row .kadence-product-toggle-container {
	gap: 4px;
}

.kadence-shop-top-row .kadence-toggle-shop-layout,
.kadence-shop-top-row .kadence-toggle-shop-layout:hover,
.kadence-shop-top-row .kadence-toggle-shop-layout:focus,
.kadence-shop-top-row .kadence-toggle-shop-layout:active {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	color: var(--cristime-faint);
	background: #fff;
	border: 1px solid var(--cristime-border);
	border-radius: 4px;
	box-shadow: none;
}

.kadence-shop-top-row .kadence-toggle-shop-layout:hover {
	color: var(--cristime-ink);
}

.kadence-shop-top-row .kadence-toggle-shop-layout.toggle-active {
	color: var(--cristime-ink);
	border-color: var(--cristime-ink);
}

.kadence-shop-top-row .kadence-toggle-shop-layout:focus-visible {
	outline: 2px solid var(--cristime-accent-dark);
	outline-offset: 2px;
}

/* --- Tablette et téléphone : « Filtres » et « Trier » sur une rangée ---

   Le bouton Filtres (élément Kadence, masqué en desktop) et la barre de tri
   sont deux voisins dans le même conteneur : `#main` sur une archive,
   `div.woocommerce` du shortcode [products] sur /promotions/ et les pages
   budget. `display: contents` sur la barre fait de ses enfants des éléments
   du flex de ce conteneur : on les range sans toucher au balisage, que
   l'extension de filtres recharge en AJAX. */
@media (max-width: 1024px) {
	/* `#main` : sous 768 px, la feuille générée par Filter Everything
	   (uploads/cache/filter-everything/) met `body #main` en colonne, pour
	   remonter la barre latérale de thèmes qui n'est pas Kadence. Un
	   identifiant bat nos classes, et en colonne Filtres et Tri s'empilaient. */
	:is(.woocommerce.archive #main.site-main, .entry-content > div.woocommerce):has(> .kadence-shop-top-row) {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		column-gap: 10px;
	}

	:is(.woocommerce.archive #main.site-main, .entry-content > div.woocommerce):has(> .kadence-shop-top-row) > * {
		flex: 0 0 100%;
		min-width: 0;
	}

	:is(.woocommerce.archive #main.site-main, .entry-content > div.woocommerce) > .kadence-shop-top-row {
		display: contents;
	}

	/* Filtres à sa largeur, le tri prend le reste : « Prix décroissant »
	   ne tenait pas dans une demi-rangée de téléphone. */
	:is(.woocommerce.archive #main.site-main, .entry-content > div.woocommerce) > .kadence-element-wrap:has(.wpc-filters-open-button-container) {
		flex: 0 0 auto;
		order: 1;
		margin: 0 0 12px;
	}

	/* `min-width: 0` : sinon le tri refuse de descendre sous la largeur de
	   sa plus longue option (« Prix décroissant ») et repasse à la ligne. */
	:is(.woocommerce.archive #main.site-main, .entry-content > div.woocommerce) > .kadence-shop-top-row > .kadence-woo-ordering {
		flex: 1 1 0;
		min-width: 0;
		order: 2;
		margin: 0 0 12px;
	}

	/* Kadence donne `flex: 1 1 auto` aux éléments de sa barre : sans ce
	   100 %, le compteur partageait la rangée de Filtres et Tri. */
	:is(.woocommerce.archive #main.site-main, .entry-content > div.woocommerce) > .kadence-shop-top-row > .kadence-woo-results-count {
		flex: 0 0 100%;
		order: 3;
		margin: 0 0 14px;
	}

	:is(.woocommerce.archive #main.site-main, .entry-content > div.woocommerce) > .kadence-shop-top-row > .kadence-woo-toggle {
		display: none;
	}

	:is(.woocommerce.archive #main.site-main, .entry-content > div.woocommerce) > ul.products,
	:is(.woocommerce.archive #main.site-main, .entry-content > div.woocommerce) > .woocommerce-pagination,
	:is(.woocommerce.archive #main.site-main, .entry-content > div.woocommerce) > .term-description {
		order: 4;
	}

	:is(.woocommerce.archive #main.site-main, .entry-content > div.woocommerce) .wpc-filters-open-button-container {
		margin: 0;
	}

	/* L'élément Kadence qui porte le bouton l'entoure de deux paragraphes
	   vides (mise en forme automatique), dont les marges le décalaient de
	   17 px vers le bas par rapport au tri. */
	:is(.woocommerce.archive #main.site-main, .entry-content > div.woocommerce) > .kadence-element-wrap > p:empty {
		display: none;
	}

	/* Même gabarit que le bouton Filtres voisin. Le libellé « Trier » passe
	   dans la case, devant la valeur : `pointer-events: none` laisse le toucher
	   atteindre le menu. */
	:is(.woocommerce.archive #main.site-main, .entry-content > div.woocommerce) .cristime-ordering {
		position: relative;
		width: 100%;
	}

	:is(.woocommerce.archive #main.site-main, .entry-content > div.woocommerce) .cristime-ordering__label {
		position: absolute;
		top: 50%;
		left: 14px;
		transform: translateY(-50%);
		font-size: 14px;
		pointer-events: none;
	}

	:is(.woocommerce.archive #main.site-main, .entry-content > div.woocommerce) .cristime-ordering__label-more {
		display: none;
	}

	/* 16 px : en dessous, Safari iOS zoome la page à l'ouverture du menu. */
	:is(.woocommerce.archive #main.site-main, .entry-content > div.woocommerce) .cristime-ordering select.cristime-ordering__select {
		width: 100%;
		min-width: 0;
		height: 44px;
		padding-right: 34px;
		padding-left: 58px;
		font-size: 16px;
		font-weight: 600;
		border-color: var(--cristime-ink);
	}
}

/* ==========================================================================
   Pages de collection éditoriales (inc/collections.php) et lien vers elles
   depuis la page marque
   ========================================================================== */

.cristime-collection__fil {
	margin: 0 0 8px;
	font-size: 13px;
	color: var(--cristime-faint);
}

.cristime-collection__fil a {
	color: var(--cristime-muted);
	text-decoration: none;
}

.cristime-collection__fil a:hover {
	color: var(--cristime-ink);
}

.entry-content p.cristime-collection__intro {
	max-width: 760px;
	margin-bottom: 28px;
	font-size: 17px;
	line-height: 1.6;
	color: var(--cristime-ink);
}

.entry-content .cristime-collection__choix li {
	margin-bottom: 10px;
}

.cristime-collection__faq {
	margin: 0 0 32px;
	border-top: 1px solid var(--cristime-line);
}

.cristime-collection__faq-item {
	border-bottom: 1px solid var(--cristime-line);
}

.cristime-collection__faq-item summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 0;
	font-weight: 600;
	color: var(--cristime-ink);
	list-style: none;
	cursor: pointer;
}

.cristime-collection__faq-item summary::-webkit-details-marker {
	display: none;
}

.cristime-collection__faq-item summary::after {
	content: "+";
	flex: 0 0 auto;
	font-size: 20px;
	font-weight: 400;
	color: var(--cristime-accent-dark);
}

.cristime-collection__faq-item[open] summary::after {
	content: "−";
}

.entry-content .cristime-collection__faq-item p {
	margin: 0 0 16px;
	color: var(--cristime-muted);
}

.entry-content ul.cristime-collection__reassurance {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin: 0 0 28px;
	padding: 0;
	list-style: none;
}

.entry-content ul.cristime-collection__reassurance li {
	margin: 0;
	padding: 16px;
	font-size: 14px;
	background: var(--cristime-alt);
	border-radius: 4px;
}

@media (max-width: 767px) {
	.entry-content ul.cristime-collection__reassurance {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Lien « Découvrir la collection … » au-dessus de la grille de la page marque. */
p.cristime-collection-lien--marque {
	margin: 0 0 16px;
	font-size: 14px;
	font-weight: 600;
}

p.cristime-collection-lien a {
	color: var(--cristime-ink);
	text-decoration: underline;
	text-decoration-color: var(--cristime-accent);
	text-underline-offset: 3px;
}
