/*
 Theme Name: Ywh Shop
 Template: kadence
 Version: 0.1.0
*/


/**
 * Page d'archives YWH.
 *
 * Direction : colonne de filtres à gauche en accordéons séparés par des
 * filets, grille de visuels pleine chasse à droite, aucun ornement.
 * Toutes les valeurs passent par des variables --ywh- redéfinissables
 * depuis le thème enfant.
 */

.ywh-archive {
	--ywh-ink: #111;
	--ywh-muted: #6e6e6e;
	--ywh-rule: #e3e3e3;
	--ywh-surface: #fff;
	--ywh-media: #f2f1f0;
	--ywh-sale: #b23b2e;
	--ywh-sidebar-width: 280px;
	--ywh-columns: 3;
	--ywh-gutter: 1.5rem;
	--ywh-card-ratio: 0.82;
	--ywh-transition: 160ms ease;

	max-width: var(--ywh-archive-max, 1600px);
	margin-inline: auto;
	padding-inline: clamp(1rem, 3vw, 2.5rem);
	color: var(--ywh-ink);
}

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

.ywh-archive__head {
	padding-block: clamp(1.25rem, 3vw, 2.25rem) 1.25rem;
}

.ywh-archive__title {
	margin: 0.3em 0 0;
	font-size: clamp(1.5rem, 2.6vw, 2rem);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.ywh-archive__intro {
	max-width: 62ch;
	margin-top: 0.6rem;
	font-size: 0.9375rem;
	color: var(--ywh-muted);
}

.ywh-archive .woocommerce-breadcrumb {
	margin: 0;
	font-size: 0.75rem;
	color: var(--ywh-muted);
}

/* -- Barre supérieure ---------------------------------------------------- */

.ywh-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-block: 0.75rem 1.25rem;
}

.ywh-bar__toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.6rem 1.15rem;
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--ywh-ink);
	background: var(--ywh-surface);
	border: 1px solid var(--ywh-ink);
	border-radius: 999px;
	cursor: pointer;
	transition: background-color var(--ywh-transition), color var(--ywh-transition);
}

.ywh-bar__toggle:hover,
.ywh-bar__toggle:focus-visible {
	color: var(--ywh-surface);
	background: var(--ywh-ink);
}

.ywh-bar__toggle svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
}

.ywh-bar__badge {
	display: inline-grid;
	place-items: center;
	min-width: 19px;
	height: 19px;
	padding-inline: 5px;
	font-size: 0.6875rem;
	color: var(--ywh-surface);
	background: var(--ywh-ink);
	border-radius: 10px;
}

.ywh-bar__toggle:hover .ywh-bar__badge,
.ywh-bar__toggle:focus-visible .ywh-bar__badge {
	color: var(--ywh-ink);
	background: var(--ywh-surface);
}

.ywh-bar__right {
	display: flex;
	align-items: center;
	gap: 1.25rem;
}

.ywh-bar__count {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 600;
}

.ywh-density {
	display: flex;
	gap: 0.5rem;
}

.ywh-density__button {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
	opacity: 0.35;
	transition: opacity var(--ywh-transition);
}

.ywh-density__button svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: var(--ywh-ink);
	stroke-width: 1.6;
}

.ywh-density__button[aria-pressed='true'] {
	opacity: 1;
}

.ywh-density__button[aria-pressed='true'] svg rect {
	fill: var(--ywh-ink);
}

.ywh-density__button[data-ywh-density='dense'][aria-pressed='true'] svg rect {
	fill: none;
}

/* -- Structure ----------------------------------------------------------- */

.ywh-archive__layout {
	display: grid;
	grid-template-columns: var(--ywh-sidebar-width) minmax(0, 1fr);
	gap: clamp(1.5rem, 3vw, 3.5rem);
	align-items: start;
	padding-bottom: 5rem;
}

.ywh-archive.filters-hidden .ywh-archive__layout {
	grid-template-columns: minmax(0, 1fr);
	--ywh-columns: 4;
}

.ywh-archive.filters-hidden .ywh-archive__sidebar {
	display: none;
}

.ywh-archive__main {
	min-width: 0;
}

/* -- Colonne de filtres --------------------------------------------------- */

.ywh-archive__sidebar {
	position: sticky;
	top: var(--ywh-sticky-offset, 1.5rem);
	max-height: calc(100vh - var(--ywh-sticky-offset, 1.5rem) - 1rem);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
}

.ywh-filters__head {
	display: none;
}

.ywh-filters__active {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	padding-bottom: 1rem;
}

.ywh-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.3rem 0.7rem;
	font-size: 0.8125rem;
	line-height: 1.3;
	text-decoration: none;
	color: var(--ywh-ink);
	border: 1px solid var(--ywh-ink);
	border-radius: 999px;
}

.ywh-chip__remove {
	font-size: 0.95rem;
	line-height: 1;
}

.ywh-chip:hover,
.ywh-chip:focus-visible {
	color: var(--ywh-surface);
	background: var(--ywh-ink);
}

.ywh-filters__reset {
	margin-left: auto;
	font-size: 0.8125rem;
	color: var(--ywh-muted);
	text-underline-offset: 3px;
}

.ywh-filter-group {
	border-top: 1px solid var(--ywh-rule);
}

.ywh-filter-group:last-of-type {
	border-bottom: 1px solid var(--ywh-rule);
}

.ywh-filter-group__head {
	margin: 0;
	font-size: inherit;
}
.ywh-swatches__list{
	display:flex!important;
}

.ywh-filter-group__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	width: 100%;
	padding: 1.15rem 0;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	text-align: left;
	color: var(--ywh-ink);
	background: none;
	border: 0;
	cursor: pointer;
}

.ywh-filter-group__chevron {
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	border-right: 1.8px solid currentColor;
	border-bottom: 1.8px solid currentColor;
	transform: translateY(-3px) rotate(45deg);
	transition: transform var(--ywh-transition);
}

.ywh-filter-group__toggle[aria-expanded='true'] .ywh-filter-group__chevron {
	transform: translateY(2px) rotate(225deg);
}

.ywh-filter-group__body {
	padding-bottom: 1.25rem;
}

.ywh-filter-list {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ywh-filter-group--swatch .ywh-filter-list {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.ywh-filter-option {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.4rem 0;
	font-size: 0.9375rem;
	color: var(--ywh-ink);
	text-decoration: none;
}

.ywh-filter-option:hover .ywh-filter-option__label,
.ywh-filter-option:focus-visible .ywh-filter-option__label {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ywh-filter-option.is-active .ywh-filter-option__label {
	font-weight: 600;
}

.ywh-filter-option__count {
	margin-left: auto;
	font-size: 0.8125rem;
	font-variant-numeric: tabular-nums;
	color: var(--ywh-muted);
}

.ywh-checkbox {
	position: relative;
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	border: 1.4px solid var(--ywh-ink);
	transition: background-color var(--ywh-transition);
}

.ywh-filter-option.is-active .ywh-checkbox {
	background: var(--ywh-ink);
}

.ywh-filter-option.is-active .ywh-checkbox::after {
	content: '';
	position: absolute;
	inset: 3px 4px;
	border-right: 2px solid var(--ywh-surface);
	border-bottom: 2px solid var(--ywh-surface);
	transform: rotate(40deg) translate(-1px, -1px);
}

.ywh-radio {
	position: relative;
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	border: 1.4px solid var(--ywh-ink);
	border-radius: 50%;
}

.ywh-filter-option.is-active .ywh-radio::after {
	content: '';
	position: absolute;
	inset: 3px;
	background: var(--ywh-ink);
	border-radius: 50%;
}

/* -- Pastilles ------------------------------------------------------------ */

.ywh-swatch {
	display: inline-flex;
	flex: 0 0 auto;
	width: auto;
	height: auto;
	overflow: hidden;
	background: var(--ywh-media);
	border: 1px solid var(--ywh-rule);
	transition: box-shadow var(--ywh-transition), border-color var(--ywh-transition);
}

.ywh-swatch--color {
	background: var(--ywh-swatch-color, var(--ywh-media));
}

.ywh-swatch--image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ywh-filter-group--swatch .ywh-filter-option {
	flex-direction: column;
	gap: 0.35rem;
	width: 58px;
	padding: 0;
	text-align: center;
}

.ywh-filter-group--swatch .ywh-filter-option__label {
	font-size: 0.6875rem;
	line-height: 1.2;
	color: var(--ywh-muted);
	overflow-wrap: anywhere;
}

.ywh-filter-group--swatch .ywh-filter-option__count {
	display: none;
}

.ywh-filter-group--swatch .ywh-filter-option.is-active .ywh-swatch {
	border-color: var(--ywh-ink);
	box-shadow: inset 0 0 0 1px var(--ywh-ink);
}

/* -- Prix ----------------------------------------------------------------- */

.ywh-price__fields {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.ywh-price__field {
	flex: 1 1 0;
	min-width: 0;
}

.ywh-price__field input {
	width: 100%;
	padding: 0.5rem 0.55rem;
	font-family: inherit;
	font-size: 0.875rem;
	color: var(--ywh-ink);
	background: var(--ywh-surface);
	border: 1px solid var(--ywh-rule);
	border-radius: 0;
}

.ywh-price__submit {
	padding: 0.5rem 0.85rem;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--ywh-surface);
	background: var(--ywh-ink);
	border: 1px solid var(--ywh-ink);
	cursor: pointer;
}

/* -- Grille --------------------------------------------------------------- */

.ywh-grid {
	display: grid;
	grid-template-columns: repeat(var(--ywh-columns), minmax(0, 1fr));
	gap: 2.5rem var(--ywh-gutter);
}

.ywh-card {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ywh-card__media {
	position: relative;
	aspect-ratio: var(--ywh-card-ratio);
	overflow: hidden;
	background: var(--ywh-media);
}

.ywh-card__link {
	display: block;
	height: 100%;
}

.ywh-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity var(--ywh-transition);
}

.ywh-card__image--hover {
	position: absolute;
	inset: 0;
	opacity: 0;
}

.ywh-card:hover .ywh-card__image--hover,
.ywh-card:focus-within .ywh-card__image--hover {
	opacity: 1;
}

.ywh-card__fav {
	position: absolute;
	top: 0.85rem;
	right: 0.85rem;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	background: var(--ywh-surface);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: transform var(--ywh-transition);
}

.ywh-card__fav svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: var(--ywh-ink);
	stroke-width: 1.6;
	stroke-linejoin: round;
}

.ywh-card__fav:hover {
	transform: scale(1.06);
}

.ywh-card__fav[aria-pressed='true'] svg {
	fill: var(--ywh-ink);
}

.ywh-card__badges {
	position: absolute;
	top: 0.85rem;
	left: 0.85rem;
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.ywh-badge {
	padding: 0.22rem 0.5rem;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ywh-surface);
	background: var(--ywh-ink);
}

.ywh-badge--sale { background: var(--ywh-sale); }
.ywh-badge--out { background: var(--ywh-muted); }

/* Vignettes de déclinaison sous le visuel */

.ywh-card__variants {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	margin: 0.75rem 0 0;
	padding: 0;
	list-style: none;
}

.ywh-card__variant a {
	display: block;
	width: 48px;
	height: 48px;
	overflow: hidden;
	background: var(--ywh-media);
	border: 1px solid transparent;
	transition: border-color var(--ywh-transition);
}

.ywh-card__variant a:hover,
.ywh-card__variant a:focus-visible {
	border-color: var(--ywh-muted);
}

.ywh-card__variant.is-current a {
	border-color: var(--ywh-ink);
}

.ywh-card__variant img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ywh-card__variant-color {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--ywh-swatch-color, var(--ywh-media));
}

.ywh-card__variant--more {
	font-size: 0.8125rem;
	color: var(--ywh-muted);
}

.ywh-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding-top: 0.9rem;
}

.ywh-card__title {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.ywh-card__title a {
	color: var(--ywh-ink);
	text-decoration: none;
}

.ywh-card__title a:hover,
.ywh-card__title a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ywh-card__subtitle {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.35;
	color: var(--ywh-ink);
}

.ywh-card__price {
	margin: 0.1rem 0 0;
	font-size: 0.9375rem;
	font-variant-numeric: tabular-nums;
}

.ywh-card__price del {
	margin-right: 0.4em;
	font-size: 0.9em;
	color: var(--ywh-muted);
}

.ywh-card__price ins {
	color: var(--ywh-sale);
	text-decoration: none;
}

/* -- Vide, pagination, boutons -------------------------------------------- */

.ywh-archive__empty {
	padding: 4rem 0;
	text-align: center;
	color: var(--ywh-muted);
}

.ywh-archive__empty-title {
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--ywh-ink);
}

.ywh-button {
	display: inline-block;
	padding: 0.7rem 1.4rem;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--ywh-surface);
	background: var(--ywh-ink);
	border: 1px solid var(--ywh-ink);
	border-radius: 999px;
	cursor: pointer;
}

.ywh-button--full {
	display: block;
	width: 100%;
	text-align: center;
}

.ywh-archive__pagination {
	margin-top: 3.5rem;
}

.ywh-archive__pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ywh-archive__pagination a,
.ywh-archive__pagination span {
	display: grid;
	place-items: center;
	min-width: 40px;
	height: 40px;
	padding-inline: 0.6rem;
	font-size: 0.9375rem;
	text-decoration: none;
	color: var(--ywh-ink);
	border: 1px solid var(--ywh-rule);
	border-radius: 999px;
}

.ywh-archive__pagination .current {
	color: var(--ywh-surface);
	background: var(--ywh-ink);
	border-color: var(--ywh-ink);
}

.ywh-archive.is-loading .ywh-archive__results {
	opacity: 0.4;
	pointer-events: none;
	transition: opacity var(--ywh-transition);
}

/* -- Densité --------------------------------------------------------------- */

.ywh-archive[data-density='large'] {
	--ywh-columns: 2;
	--ywh-card-ratio: 0.95;
}

.ywh-archive[data-density='large'].filters-hidden .ywh-archive__layout {
	--ywh-columns: 3;
}

/* -- Adaptatif -------------------------------------------------------------- */
/* -- Pastilles ------------------------------------------------------------ */
/* Scopé sous .ywh-archive : la classe .ywh-swatch est aussi utilisée par
   le plugin de fiche produit, avec un gabarit différent. */

.ywh-archive .ywh-swatch {
	display: inline-flex;
	flex: 0 0 auto;
	width: auto!important;
	height: auto!important;
	overflow: hidden;
	background: var(--ywh-media);
	border: 1px solid var(--ywh-rule);
	transition: box-shadow var(--ywh-transition), border-color var(--ywh-transition);
}

.ywh-archive .ywh-swatch--color {
	background: var(--ywh-swatch-color, var(--ywh-media));
}

.ywh-archive .ywh-swatch--image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
@media (max-width: 1280px) {
	.ywh-archive { --ywh-columns: 3; }
	.ywh-archive.filters-hidden .ywh-archive__layout { --ywh-columns: 4; }
}

@media (max-width: 1024px) {
	.ywh-archive { --ywh-sidebar-width: 240px; }
	.ywh-archive { --ywh-columns: 2; }
	.ywh-archive.filters-hidden .ywh-archive__layout { --ywh-columns: 3; }
}

@media (max-width: 900px) {
	.ywh-archive__layout,
	.ywh-archive.filters-hidden .ywh-archive__layout {
		grid-template-columns: minmax(0, 1fr);
		--ywh-columns: 2;
	}

	.ywh-archive.filters-hidden .ywh-archive__sidebar {
		display: block;
	}

	.ywh-bar__toggle-label {
		display: none;
	}

	.ywh-bar__toggle {
		padding: 0.55rem 0.8rem;
	}

	.ywh-density {
		display: none;
	}

	.ywh-filters__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding-bottom: 1rem;
	}

	.ywh-filters__title {
		margin: 0;
		font-size: 1.0625rem;
		font-weight: 700;
		text-transform: uppercase;
	}

	.ywh-filters__close {
		padding: 0.25rem;
		background: none;
		border: 0;
		cursor: pointer;
	}

	.ywh-filters__close svg {
		display: block;
		width: 22px;
		height: 22px;
		fill: none;
		stroke: currentColor;
		stroke-width: 1.5;
		stroke-linecap: round;
	}

	.ywh-archive__sidebar {
		position: fixed;
		inset: 0 auto 0 0;
		z-index: 9999;
		width: min(360px, 90vw);
		max-height: none;
		padding: 1.25rem;
		background: var(--ywh-surface);
		box-shadow: 0 0 40px rgb(0 0 0 / 18%);
		transform: translateX(-100%);
		visibility: hidden;
		transition: transform 240ms ease, visibility 240ms;
	}

	.ywh-archive__sidebar.is-open {
		transform: none;
		visibility: visible;
	}

	.ywh-archive__overlay {
		position: fixed;
		inset: 0;
		z-index: 9998;
		background: rgb(0 0 0 / 35%);
		opacity: 0;
		visibility: hidden;
		transition: opacity 240ms ease, visibility 240ms;
	}

	.ywh-archive__overlay.is-open {
		opacity: 1;
		visibility: visible;
	}

	.ywh-filters__foot {
		display: block;
		padding-top: 1.25rem;
	}
}

.ywh-filters__foot {
	display: none;
}

@media (max-width: 560px) {
	.ywh-archive__layout { --ywh-gutter: 0.75rem; }
	.ywh-card__variant a { width: 40px; height: 40px; }
	.ywh-card__fav { width: 34px; height: 34px; }
	.ywh-card__fav svg { width: 17px; height: 17px; }
}

@media (prefers-reduced-motion: reduce) {
	.ywh-archive *,
	.ywh-archive__sidebar {
		transition-duration: 1ms !important;
	}
}

.ywh-archive :focus-visible {
	outline: 2px solid var(--ywh-ink);
	outline-offset: 2px;
}