/* Catalogue catégorie produit */

.sp-cat {
	--sp-cat-fg: #151414;
	--sp-cat-muted: rgba(21, 20, 20, 0.55);
	--sp-cat-border: rgba(21, 20, 20, 0.12);
	--sp-cat-card-bg: #fcfcfc;
	color: var(--sp-cat-fg);
	position: relative;
	width: 100%;
}

.sp-cat.is-loading .sp-cat-grid {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* Loader navigation — fixe dans le viewport (au-dessus de la ligne de flottaison) */
.sp-cat-loader {
	align-items: flex-start;
	background: rgba(255, 255, 255, 0.55);
	bottom: 0;
	display: none;
	justify-content: center;
	left: 0;
	padding-top: var(--sp-cat-loader-top, 28vh);
	pointer-events: all;
	position: fixed;
	right: 0;
	top: 0;
	z-index: 200;
}

.sp-cat.is-navigating .sp-cat-loader,
.sp-cat.is-loading:not(.is-loading-more) .sp-cat-loader,
html.sp-cat-nav-loading .sp-cat-loader {
	display: flex;
}

.sp-cat-loader[hidden] {
	display: none !important;
}

.sp-cat.is-navigating .sp-cat-loader[hidden],
.sp-cat.is-loading:not(.is-loading-more) .sp-cat-loader[hidden],
html.sp-cat-nav-loading .sp-cat-loader[hidden] {
	display: flex !important;
}

.sp-cat-loader__spinner {
	animation: sp-cat-spin 0.7s linear infinite;
	border: 2px solid rgba(21, 20, 20, 0.15);
	border-radius: 50%;
	border-top-color: #151414;
	flex-shrink: 0;
	height: 2rem;
	width: 2rem;
}

.sp-cat-filters__btn.is-pending {
	opacity: 0.55;
	pointer-events: none;
}

.sp-cat.is-navigating .sp-cat-filters,
.sp-cat.is-loading:not(.is-loading-more) .sp-cat-filters {
	pointer-events: none;
}

/* Header */
.sp-cat-header {
	margin-bottom: 2rem;
	padding: 1.5rem 1.5rem 0;
}

.sp-cat-breadcrumb__list {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem 0.5rem;
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
}

.sp-cat-breadcrumb__item a,
.sp-cat-breadcrumb__item span {
	color: var(--sp-cat-muted);
	font-size: 0.875rem;
	font-weight: 300;
	text-decoration: none;
}

.sp-cat-breadcrumb__item a:hover {
	color: var(--sp-cat-fg);
}

.sp-cat-breadcrumb__item [aria-current="page"] {
	color: var(--sp-cat-fg);
	font-weight: 400;
}

.sp-cat-breadcrumb__sep {
	align-items: center;
	color: var(--sp-cat-muted);
	display: inline-flex;
}

.sp-cat-title {
	color: var(--sp-cat-fg);
	font-size: clamp(1.875rem, 4vw, 2.25rem);
	font-weight: 300;
	line-height: 1.2;
	margin: 0;
}

/* Filtres sous-catégories */
.sp-cat-filters {
	margin-bottom: 2.5rem;
	padding: 0;
}

@media (min-width: 768px) {
	.sp-cat-filters {
		margin-bottom: 3.5rem;
		padding: 0 1.5rem;
	}
}

.sp-cat-filters__list {
	-webkit-overflow-scrolling: touch;
	align-items: center;
	display: flex;
	flex-wrap: nowrap;
	gap: 0.75rem;
	list-style: none;
	margin: 0;
	overflow-x: auto;
	padding: 0 1.5rem;
	scroll-padding-inline: 1.5rem;
	scrollbar-width: none;
	white-space: nowrap;
}

.sp-cat-filters__list::-webkit-scrollbar {
	display: none;
}

@media (min-width: 768px) {
	.sp-cat-filters__list {
		flex-wrap: wrap;
		gap: 0.75rem 1rem;
		overflow: visible;
		padding: 0;
	}
}

.sp-cat-filters__item {
	flex-shrink: 0;
}

.sp-cat-filters__sep {
	align-self: center;
	flex-shrink: 0;
}

.sp-cat-filters__sep span {
	background: rgba(21, 20, 20, 0.2);
	display: block;
	height: 12px;
	width: 1px;
}

.sp-cat-filters__btn,
.sp-cat-filters__link {
	background: transparent;
	border: 0;
	border-radius: 2px;
	color: rgba(21, 20, 20, 0.7);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.875rem;
	font-weight: 300;
	letter-spacing: 0.02em;
	padding: 0;
	text-decoration: none;
	transition: color 0.2s ease;
}

.sp-cat-filters__btn:hover,
.sp-cat-filters__link:hover,
.sp-cat-filters__btn.is-active,
.sp-cat-filters__btn[aria-current="page"] {
	color: var(--sp-cat-fg);
}

.sp-cat-filters__btn.is-active,
.sp-cat-filters__btn[aria-current="page"] {
	font-weight: 400;
}

.sp-cat-filters__btn--back {
	color: var(--sp-cat-fg);
	font-weight: 400;
}

.sp-cat-filters__chevron {
	display: inline-flex;
	flex-shrink: 0;
	line-height: 0;
}

.sp-cat-filters__chevron svg {
	display: block;
}

/* Toolbar */
.sp-cat-toolbar {
	align-items: center;
	border-bottom: 1px solid var(--sp-cat-border);
	display: flex;
	justify-content: space-between;
	margin: 0 1.5rem 2rem;
	padding-bottom: 1rem;
}

.sp-cat-toolbar__count {
	color: var(--sp-cat-muted);
	font-size: 0.875rem;
	font-weight: 300;
	margin: 0;
}

.sp-cat-toolbar__actions {
	align-items: center;
	display: flex;
	gap: 1rem;
}

.sp-cat-toolbar__filter {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: 6px;
	color: var(--sp-cat-fg);
	cursor: pointer;
	display: inline-flex;
	font-size: 0.875rem;
	font-weight: 300;
	gap: 0.5rem;
	height: 2.25rem;
	justify-content: center;
	padding: 0 0.75rem;
	transition: color 0.2s ease;
	white-space: nowrap;
}

.sp-cat-toolbar__filter[hidden] {
	display: none;
}

.sp-cat-toolbar__filter:focus-visible {
	outline: 2px solid var(--sp-cat-fg);
	outline-offset: 2px;
}

.sp-cat-toolbar__filter-badge {
	align-items: center;
	background: var(--sp-cat-fg);
	border-radius: 999px;
	color: #fff;
	display: inline-flex;
	font-size: 0.6875rem;
	font-weight: 400;
	height: 1.125rem;
	justify-content: center;
	min-width: 1.125rem;
	padding: 0 0.25rem;
}

.sp-cat-toolbar__filter-badge[hidden] {
	display: none;
}

.sp-cat-toolbar__sort select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background: transparent
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23151414' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
		no-repeat right 0.25rem center;
	border: 0;
	color: var(--sp-cat-fg);
	cursor: pointer;
	font-size: 0.875rem;
	font-weight: 300;
	padding: 0.5rem 1.5rem 0.5rem 0.25rem;
}

/* Grille */
.sp-cat-grid-wrap {
	padding: 0 1.5rem 4rem;
}

@media (min-width: 768px) {
	.sp-cat-grid-wrap {
		padding-bottom: 6rem;
	}
}

.sp-cat-infinite {
	align-items: center;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	justify-content: center;
	min-height: 3rem;
	padding: 4rem 0 1.5rem;
}

@media (min-width: 768px) {
	.sp-cat-infinite {
		padding: 5rem 0 2rem;
	}
}

.sp-cat-infinite[hidden] {
	display: none;
}

.sp-cat-infinite__spinner {
	animation: sp-cat-spin 0.7s linear infinite;
	border: 2px solid rgba(21, 20, 20, 0.15);
	border-radius: 50%;
	border-top-color: #151414;
	height: 1.25rem;
	opacity: 0;
	width: 1.25rem;
}

.sp-cat-infinite__spinner[hidden] {
	display: none;
}

.sp-cat-infinite__progress {
	color: rgba(21, 20, 20, 0.55);
	font-size: 0.8125rem;
	font-weight: 300;
	letter-spacing: 0.02em;
	margin: 0;
	text-align: center;
}

.sp-cat.is-loading-more .sp-cat-infinite__spinner,
.sp-cat.is-loading .sp-cat-infinite__spinner:not([hidden]) {
	opacity: 1;
}

@keyframes sp-cat-spin {
	to {
		transform: rotate(360deg);
	}
}

.sp-cat.is-loading:not(.is-loading-more) .sp-cat-grid {
	opacity: 0.55;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.sp-cat.is-loading-more .sp-cat-grid {
	opacity: 1;
	pointer-events: auto;
}

.sp-cat-grid {
	display: grid;
	gap: 1rem;
	grid-auto-flow: dense;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Cartes orphelines de la dernière ligne : cachées tant qu’il reste du scroll */
.sp-cat-card.is-row-pending {
	display: none;
}

@media (min-width: 768px) {
	.sp-cat-grid {
		gap: 1.5rem;
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.sp-cat-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Cartes produit (réutilise .pc-* du carousel) */
.sp-cat-card .pc-link {
	color: inherit;
	display: block;
	text-decoration: none;
}

.sp-cat-card .pc-img-wrap {
	aspect-ratio: 1;
	background: var(--sp-cat-card-bg);
	margin-bottom: 0.75rem;
	overflow: hidden;
	position: relative;
}

.sp-cat-card .pc-img {
	height: 100%;
	mix-blend-mode: multiply;
	-o-object-fit: cover;
	object-fit: cover;
	transition: opacity 0.3s ease;
	width: 100%;
}

.sp-cat-card .pc-img--primary {
	display: block;
}

.sp-cat-card .pc-img--secondary {
	inset: 0;
	opacity: 0;
	position: absolute;
}

.sp-cat-card .pc-link:hover .pc-img--primary {
	opacity: 0;
}

.sp-cat-card .pc-link:hover .pc-img--secondary {
	opacity: 1;
}

.sp-cat-card .pc-img-overlay {
	background: rgba(0, 0, 0, 0.03);
	inset: 0;
	pointer-events: none;
	position: absolute;
}

.sp-cat-card .pc-badge {
	background: transparent;
	color: #000;
	font-size: 0.75rem;
	font-weight: 500;
	left: 0.5rem;
	padding: 0.25rem 0.5rem;
	position: absolute;
	top: 0.5rem;
}

.sp-cat-card .pc-category {
	font-size: 0.875rem;
	font-weight: 300;
	margin: 0 0 0.25rem;
}

.sp-cat-card .pc-info-row {
	align-items: center;
	display: flex;
	gap: 0.5rem;
	justify-content: space-between;
}

.sp-cat-card .pc-name {
	flex: 1;
	font-size: 0.875rem;
	font-weight: 500;
	margin: 0;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sp-cat-card .pc-price {
	font-size: 0.875rem;
	font-weight: 300;
	margin: 0;
	white-space: nowrap;
}

/* Tuiles visuelles 2×2 */
.sp-cat-visual {
	aspect-ratio: 1;
	background: rgba(0, 0, 0, 0.04);
	display: none;
	grid-column: span 2;
	grid-row: span 2;
	overflow: hidden;
	position: relative;
	text-decoration: none;
}

.sp-cat-visual--all {
	display: block;
}

/* mobile + large desktop */
.sp-cat-visual--mobile-lg {
	display: block;
}

@media (min-width: 768px) and (max-width: 1023px) {
	.sp-cat-visual--mobile-lg {
		display: none;
	}
}

/* tablette only */
.sp-cat-visual--tablet {
	display: none;
}

@media (min-width: 768px) and (max-width: 1023px) {
	.sp-cat-visual--tablet {
		display: block;
	}
}

.sp-cat-visual__img {
	display: block;
	height: 100%;
	-o-object-fit: cover;
	object-fit: cover;
	transition: transform 0.7s ease-out;
	width: 100%;
}

.sp-cat-visual:hover .sp-cat-visual__img {
	transform: scale(1.02);
}

.sp-cat-visual__overlay {
	background: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent 55%);
	bottom: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	left: 0;
	padding: 1.25rem 1.5rem;
	position: absolute;
	right: 0;
	top: 0;
}

.sp-cat.is-filtered .sp-cat-visual__overlay {
	display: none;
}

.sp-cat-visual__title {
	color: #fff;
	font-size: 1rem;
	font-weight: 300;
	letter-spacing: 0.02em;
}

@media (min-width: 768px) {
	.sp-cat-visual__title {
		font-size: 1.125rem;
	}

	.sp-cat-visual {
		align-self: start;
		aspect-ratio: auto;
		height: calc(100% - 2.75rem);
		min-height: 100%;
	}
}

.sp-cat-visual__subtitle {
	color: rgba(255, 255, 255, 0.8);
	font-size: 0.75rem;
	font-weight: 300;
	letter-spacing: 0.08em;
	margin-top: 0.25rem;
	text-transform: uppercase;
}

/* Panneau Filtrer */
.sp-cat-drawer {
	inset: 0;
	position: fixed;
	/* Au-dessus du header (z-50) et du panier (z-60) ; le panneau
	   est aussi déplacé sur document.body pour sortir du contexte
	   d'empilement de .site-main (z-10). */
	z-index: 70;
}

.sp-cat-drawer[hidden] {
	display: none !important;
}

.sp-cat-drawer__backdrop {
	animation: sp-cat-fade-in 0.2s ease;
	background: rgba(0, 0, 0, 0.8);
	cursor: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M12 12l16 16M28 12L12 28' stroke='%23FFFFFF' stroke-width='2.5' stroke-linecap='round' fill='none'/%3E%3C/svg%3E" ) 20 20, pointer;
	inset: 0;
	position: absolute;
}

@keyframes sp-cat-fade-in {
	from {
		opacity: 0;
	}
}

@keyframes sp-cat-slide-up {
	from {
		transform: translateY(100%);
	}
}

@keyframes sp-cat-slide-in {
	from {
		transform: translateX(100%);
	}
}

.sp-cat-drawer__panel {
	animation: sp-cat-slide-up 0.28s cubic-bezier(0.32, 0.72, 0, 1);
	background: #fff;
	bottom: 0;
	display: flex;
	flex-direction: column;
	left: 0;
	max-height: 85vh;
	position: absolute;
	right: 0;
}

@media (min-width: 768px) {
	.sp-cat-drawer__panel {
		animation-name: sp-cat-slide-in;
		bottom: 0;
		left: auto;
		max-height: none;
		top: 0;
		width: min(24rem, 100vw);
	}
}

.sp-cat-drawer__head {
	align-items: center;
	border-bottom: 1px solid var(--sp-cat-border);
	display: flex;
	flex-shrink: 0;
	justify-content: space-between;
	padding: 1.25rem 1.5rem;
}

.sp-cat-drawer__title {
	align-items: center;
	display: flex;
	font-size: 0.9375rem;
	font-weight: 400;
	gap: 0.5rem;
	letter-spacing: 0.02em;
}

.sp-cat-drawer__badge {
	align-items: center;
	background: var(--sp-cat-fg);
	border-radius: 999px;
	color: #fff;
	display: inline-flex;
	font-size: 0.6875rem;
	height: 1.125rem;
	justify-content: center;
	min-width: 1.125rem;
	padding: 0 0.25rem;
}

.sp-cat-drawer__close {
	align-items: center;
	background: transparent;
	border: 0;
	color: var(--sp-cat-fg);
	cursor: pointer;
	display: inline-flex;
	justify-content: center;
	line-height: 0;
	padding: 0.25rem;
}

.sp-cat-drawer__body {
	-webkit-overflow-scrolling: touch;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 0 1.5rem;
}

.sp-cat-drawer__nav {
	border-bottom: 1px solid var(--sp-cat-border);
	padding-bottom: 0.5rem;
}

.sp-cat-drawer__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sp-cat-drawer__btn {
	background: transparent;
	border: 0;
	color: var(--sp-cat-fg);
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.9375rem;
	font-weight: 300;
	padding: 0.75rem 0;
	text-align: left;
	text-decoration: none;
	width: 100%;
}

.sp-cat-drawer__btn.is-active,
.sp-cat-drawer__btn[aria-current="page"] {
	font-weight: 500;
}

.sp-cat-drawer__btn--back {
	font-weight: 400;
}

/* Groupes de facettes */
.sp-cat-facets {
	padding-bottom: 1.5rem;
}

.sp-cat-facet {
	border: 0;
	border-bottom: 1px solid var(--sp-cat-border);
	margin: 0;
	padding: 1.25rem 0;
}

.sp-cat-facet:last-child {
	border-bottom: 0;
}

.sp-cat-facet__legend {
	align-items: center;
	display: flex;
	font-size: 0.6875rem;
	font-weight: 400;
	gap: 0.5rem;
	letter-spacing: 0.1em;
	margin-bottom: 0.75rem;
	padding: 0;
	text-transform: uppercase;
}

.sp-cat-facet__badge {
	align-items: center;
	background: rgba(21, 20, 20, 0.08);
	border-radius: 999px;
	display: inline-flex;
	font-size: 0.6875rem;
	height: 1.0625rem;
	justify-content: center;
	letter-spacing: 0;
	min-width: 1.0625rem;
	padding: 0 0.25rem;
}

.sp-cat-facet__list {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.sp-cat-facet__label {
	align-items: center;
	cursor: pointer;
	display: flex;
	font-size: 0.875rem;
	font-weight: 300;
	gap: 0.625rem;
	padding: 0.375rem 0;
}

.sp-cat-facet__input {
	accent-color: #151414;
	flex-shrink: 0;
	height: 0.9375rem;
	margin: 0;
	width: 0.9375rem;
}

.sp-cat-facet__name {
	flex: 1;
	min-width: 0;
}

.sp-cat-facet__input:checked + .sp-cat-facet__name {
	font-weight: 400;
}

.sp-cat-facet__count {
	color: var(--sp-cat-muted);
	font-size: 0.75rem;
	font-variant-numeric: tabular-nums;
}

/* Pied du panneau */
.sp-cat-drawer__foot {
	align-items: center;
	background: #fff;
	border-top: 1px solid var(--sp-cat-border);
	display: flex;
	flex-shrink: 0;
	gap: 0.75rem;
	padding: 1rem 1.5rem;
}

.sp-cat-drawer__clear {
	background: transparent;
	border: 0;
	color: var(--sp-cat-muted);
	cursor: pointer;
	font-size: 0.875rem;
	font-weight: 300;
	padding: 0.5rem 0;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.sp-cat-drawer__clear:disabled {
	cursor: default;
	opacity: 0.4;
	text-decoration: none;
}

.sp-cat-drawer__apply {
	background: var(--sp-cat-fg);
	border: 0;
	color: #fff;
	cursor: pointer;
	flex: 1;
	font-size: 0.875rem;
	font-weight: 300;
	letter-spacing: 0.02em;
	padding: 0.8125rem 1rem;
}

body.sp-cat-drawer-open {
	overflow: hidden;
}
