/* ---------------------------------------------------------------------------
 * Novatis — filtre de catégories (pages catégorie et sous-catégorie)
 * Mêmes repères visuels que le méga menu : rouge #E20613, encre #1c2024,
 * filets clairs, rayons généreux.
 * ------------------------------------------------------------------------- */

.nv-cat-layout {
	--nv-f-rouge: #E20613;
	--nv-f-voile: rgba(226, 6, 19, .07);
	--nv-f-encre: #1c2024;
	--nv-f-texte: #3d434a;
	--nv-f-gris: #6b7178;
	--nv-f-filet: #eceef0;
	--nv-f-fond: #f6f6f7;

	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

@media (min-width: 1024px) {
	.nv-cat-layout {
		grid-template-columns: 280px minmax(0, 1fr);
		gap: 40px;
	}
}
@media (min-width: 1280px) {
	.nv-cat-layout { grid-template-columns: 300px minmax(0, 1fr); gap: 48px; }
}

/* ---- Colonne produits ---- */
.nv-cat-principal { min-width: 0; }

.nv-cat-barre {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
	margin-bottom: 28px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--nv-f-filet);
}
.nv-cat-total {
	margin: 0;
	color: var(--nv-f-encre);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.nv-cat-total strong { color: var(--nv-f-rouge); font-weight: 800; }
.nv-cat-courante {
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--nv-f-voile);
	color: var(--nv-f-rouge);
	font-size: 12px;
	font-weight: 700;
}

.nv-cat-groupe + .nv-cat-groupe { margin-top: 40px; }

/* Titres des sous-catégories : le thème ajoute 50px au-dessus de ces titres
   (h2.reveal…mb-8.in { padding-top: 50px }) et 32px en dessous. Sur la page
   catégorie, l'écart entre les groupes est géré ci-dessus. */
.nv-cat-principal .nv-cat-groupe > h2 {
	padding-top: 0 !important;
	margin-top: 0 !important;
	margin-bottom: 20px !important;
}

.nv-cat-grille {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 24px;
}
@media (min-width: 640px) {
	.nv-cat-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
	.nv-cat-grille { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.nv-cat-vide {
	padding: 40px 24px;
	border: 1px dashed var(--nv-f-filet);
	border-radius: 20px;
	color: var(--nv-f-gris);
	text-align: center;
}
.nv-cat-vide p { margin: 0 0 12px; }
.nv-cat-vide a { color: var(--nv-f-rouge); font-weight: 700; }

/* ---- Bloc filtre ---- */
.nv-filtre { min-width: 0; }

.nv-filtre-boite {
	border: 1px solid var(--nv-f-filet);
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}
/* Collant uniquement si le bloc tient en entier dans la fenêtre (classe posée
   par filtre-categories.js) : sinon le bas de la liste serait inaccessible. */
@media (min-width: 1024px) {
	.nv-filtre-boite.nv-filtre-collant {
		position: sticky;
		top: 140px;
	}
}

.nv-filtre-entete {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 18px 14px;
	list-style: none;
	cursor: pointer;
	user-select: none;
}
.nv-filtre-entete::-webkit-details-marker { display: none; }
.nv-filtre-entete::marker { content: ""; }
.nv-filtre-entete:focus-visible { outline: 2px solid var(--nv-f-rouge); outline-offset: -2px; border-radius: 20px; }

.nv-filtre-icone {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: var(--nv-f-voile);
	color: var(--nv-f-rouge);
}
.nv-filtre-titres { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.nv-filtre-titre {
	color: var(--nv-f-encre);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
}
.nv-filtre-selection {
	display: none;
	overflow: hidden;
	margin-top: 2px;
	color: var(--nv-f-gris);
	font-size: 12.5px;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.nv-filtre-bascule {
	display: none;
	flex: none;
	color: var(--nv-f-gris);
	transition: transform .2s ease;
}
.nv-filtre-boite[open] .nv-filtre-bascule { transform: rotate(180deg); }

.nv-filtre-corps {
	padding: 0 10px 12px;
	border-top: 1px solid var(--nv-f-filet);
	padding-top: 10px;
}

/* ---- Lignes ---- */
.nv-filtre-liste {
	margin: 0;
	padding: 0;
	list-style: none;
}
.nv-filtre-item { margin: 0; padding: 0; list-style: none; }
.nv-filtre-item::before, .nv-filtre-item::marker { content: none; }

.nv-filtre-ligne {
	display: flex;
	align-items: center;
	gap: 2px;
}

.nv-filtre-lien,
.nv-filtre-tout {
	display: flex;
	flex: 1;
	align-items: center;
	gap: 10px;
	min-width: 0;
	padding: 9px 12px;
	border-radius: 10px;
	color: var(--nv-f-texte) !important;
	font-size: 14px;
	line-height: 1.35;
	text-decoration: none !important;
	transition: background-color .15s ease, color .15s ease;
}
.nv-filtre-lien:hover,
.nv-filtre-tout:hover { background: var(--nv-f-fond); color: var(--nv-f-rouge) !important; }
.nv-filtre-lien:focus-visible,
.nv-filtre-tout:focus-visible,
.nv-filtre-parent:focus-visible { outline: 2px solid var(--nv-f-rouge); outline-offset: 1px; }

.nv-filtre-tout { margin-bottom: 4px; font-weight: 600; color: var(--nv-f-encre) !important; }

/* Flèche qui plie / déplie les sous-catégories, à droite du lien. */
.nv-filtre-parent {
	appearance: none;
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: none;
	cursor: pointer;
	transition: background-color .15s ease;
}
.nv-filtre-parent:hover { background: var(--nv-f-fond); }
.nv-filtre-parent:hover .nv-filtre-chevron { color: var(--nv-f-encre); }
@media (max-width: 1023px) {
	.nv-filtre-parent { width: 40px; height: 40px; } /* cible tactile */
}
.nv-filtre-chevron {
	flex: none;
	color: var(--nv-f-gris);
	transition: transform .2s ease;
}
.nv-filtre-parent[aria-expanded="true"] .nv-filtre-chevron { transform: rotate(180deg); }

.nv-filtre-nom { flex: 1; min-width: 0; }


/* Premier niveau : familles */
.nv-filtre-niveau-0 > .nv-filtre-item > .nv-filtre-ligne .nv-filtre-lien {
	color: var(--nv-f-encre) !important;
	font-weight: 600;
}
.nv-filtre-niveau-0 > .nv-filtre-item + .nv-filtre-item { margin-top: 2px; }

/* Sous-niveaux : filet vertical et retrait */
.nv-filtre-sous {
	margin: 2px 0 6px 18px;
	padding-left: 8px;
	border-left: 1px solid var(--nv-f-filet);
}
.nv-filtre-sous[hidden] { display: none; }
.nv-filtre-sous .nv-filtre-lien { padding: 7px 10px; font-size: 13.5px; }

/* Branche de la catégorie courante */
.nv-filtre-item.est-parent > .nv-filtre-ligne .nv-filtre-lien { color: var(--nv-f-encre) !important; font-weight: 700; }

/* Catégorie courante : seule la couleur du texte change (ni fond, ni filet, ni gras). */
.nv-filtre-item.est-actif > .nv-filtre-ligne .nv-filtre-lien {
	color: var(--nv-f-rouge) !important;
}
.nv-filtre-item.est-actif > .nv-filtre-ligne .nv-filtre-chevron { color: var(--nv-f-rouge); }

/* ---- Mobile et tablette : bloc repliable au-dessus des produits ---- */
@media (max-width: 1023px) {
	.nv-filtre-entete { padding: 14px 16px; }
	.nv-filtre-selection { display: block; }
	.nv-filtre-bascule { display: flex; }
	.nv-filtre-boite:not([open]) .nv-filtre-corps { display: none; }
	.nv-filtre-lien, .nv-filtre-tout { padding: 11px 12px; } /* cibles tactiles plus grandes */
	.nv-cat-barre { margin-bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
	.nv-filtre-bascule, .nv-filtre-chevron { transition: none; }
}
