/* Matériaux V2 — sidebar + grille filtrable
   Compilé depuis scss/v2/_materiaux-v2.scss
   Toutes les classes préfixées .lm-v2-* pour éviter toute collision avec v1. */

.lm-v2-section { position: relative; }

/* Layout 2 colonnes (le .container vient du markup parent et limite la largeur) */
.lm-v2-grille {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 2rem;
	align-items: flex-start;
}
@media (max-width: 991px) {
	.lm-v2-grille { grid-template-columns: 1fr; gap: 1rem; }
}

/* ============ TOGGLE MOBILE (visible < 992px) ============ */
.lm-v2-toggle-mobile {
	display: none;
	width: 100%;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	font-size: 0.85rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #111827;
	cursor: pointer;
	align-items: center;
	gap: 0.5rem;
	transition: border-color 0.15s ease;
}
.lm-v2-toggle-mobile:hover { border-color: #ee2e24; }
.lm-v2-toggle-mobile__texte { flex: 1; text-align: left; }
.lm-v2-toggle-mobile__compteur {
	background: #ee2e24;
	color: #ffffff;
	font-size: 0.7rem;
	min-width: 1.4rem;
	height: 1.4rem;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 0.4rem;
}
.lm-v2-toggle-mobile__compteur.is-zero { display: none; }
.lm-v2-toggle-mobile__chevron {
	width: 12px;
	height: 8px;
	display: inline-block;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}
.lm-v2-toggle-mobile[aria-expanded="true"] .lm-v2-toggle-mobile__chevron {
	transform: rotate(180deg);
}
@media (max-width: 991px) {
	.lm-v2-toggle-mobile { display: flex; }
}

/* ============ WRAPPER SIDEBAR (gère la collapse sur mobile) ============ */
.lm-v2-sidebar-wrap {
	/* Desktop : visible par défaut */
}
@media (max-width: 991px) {
	.lm-v2-sidebar-wrap {
		display: none;
		margin-bottom: 1rem;
	}
	.lm-v2-sidebar-wrap.is-open { display: block; }
}

/* ============ SIDEBAR ============ */
.lm-v2-sidebar {
	position: sticky;
	top: 100px;
	background: transparent;
	padding: 0 1rem 0 0;
}
@media (max-width: 991px) {
	.lm-v2-sidebar {
		position: static;
		padding: 1rem 1.25rem;
		background: #ffffff;
		border-radius: 4px;
	}
}

.lm-v2-sidebar__compteur {
	margin: 0 0 1.25rem;
	padding: 0 0 0.75rem;
	border-bottom: 1px solid #9ca3af;
	display: flex;
	align-items: baseline;
	gap: 0.45rem;
	color: #111827;
	line-height: 1.1;
}
.lm-v2-sidebar__compteur-nombre {
	font-weight: 900;
	color: #111827;
	font-size: 2.4rem;
	line-height: 1;
}
.lm-v2-sidebar__compteur-label {
	font-weight: 700;
	color: #111827;
	font-size: 1.05rem;
	text-transform: none;
	letter-spacing: 0;
}
@media (max-width: 991px) {
	.lm-v2-sidebar__compteur { display: none; } /* déjà visible dans le toggle */
}

.lm-v2-sidebar__form { margin: 0; padding: 0; }

.lm-v2-sidebar__reset {
	background: transparent;
	border: 1px solid #e5e7eb;
	color: #4a5563;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0.5rem 0.75rem;
	margin-top: 1rem;
	width: 100%;
	cursor: pointer;
	transition: all 0.15s ease;
}
.lm-v2-sidebar__reset:hover { border-color: #ee2e24; color: #ee2e24; }

/* GROUPES DE FILTRES (accordéon natif <details>/<summary>) */
.lm-v2-filtre {
	border: 0;
	margin: 0;
	padding: 0.9rem 0;
	border-bottom: 1px solid #9ca3af;
}
.lm-v2-filtre:last-of-type { border-bottom: 0; }

.lm-v2-filtre__titre {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	font-size: 0.95rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0;
	color: #111827;
	cursor: pointer;
	list-style: none;
	padding: 0.25rem 0;
	user-select: none;
	transition: color 0.15s ease;
}
.lm-v2-filtre__titre::-webkit-details-marker { display: none; }
.lm-v2-filtre__titre::marker { display: none; content: ''; }
.lm-v2-filtre__titre:hover { color: #ee2e24; }
.lm-v2-filtre__titre:focus-visible {
	outline: 2px solid #ee2e24;
	outline-offset: 2px;
}

.lm-v2-filtre__chevron {
	width: 12px;
	height: 8px;
	display: inline-block;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}
.lm-v2-filtre[open] > .lm-v2-filtre__titre .lm-v2-filtre__chevron {
	transform: rotate(180deg);
}

.lm-v2-filtre__liste {
	list-style: none;
	margin: 0.35rem 0 0;
	padding: 0;
}
.lm-v2-filtre__item { margin-bottom: 0.15rem; }
.lm-v2-filtre__item:last-child { margin-bottom: 0; }

.lm-v2-filtre__checkbox {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.lm-v2-filtre__label {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	cursor: pointer;
	font-size: 0.95rem;
	color: #4a5563;
	margin: 0;
	user-select: none;
	transition: color 0.15s ease;
	padding: 0.1rem 0;
}
.lm-v2-filtre__label::before {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 1.5px solid #9ca3af;
	background: #ffffff;
	flex-shrink: 0;
	transition: all 0.15s ease;
}
.lm-v2-filtre__label:hover { color: #111827; }
.lm-v2-filtre__label:hover::before { border-color: #ee2e24; }

.lm-v2-filtre__checkbox:checked + .lm-v2-filtre__label {
	color: #111827;
	font-weight: 600;
}
.lm-v2-filtre__checkbox:checked + .lm-v2-filtre__label::before {
	background-color: #707070;
	border-color: #707070;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'><path d='M2.5 7.2 L5.8 10.3 L11.5 4.2' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 80% 80%;
	box-shadow: none;
}
.lm-v2-filtre__checkbox:focus-visible + .lm-v2-filtre__label::before {
	outline: 2px solid #707070;
	outline-offset: 2px;
}

/* Description du groupe de filtre (page d'options), sous les cases à cocher */
.lm-v2-filtre__description {
	margin-top: 0.6rem;
	font-size: 0.8rem;
	line-height: 1.45;
	color: #4a5563;
}
.lm-v2-filtre__description p { margin: 0 0 0.4rem; }
.lm-v2-filtre__description p:last-child { margin-bottom: 0; }
.lm-v2-filtre__description a {
	color: #ee2e24;
	text-decoration: underline;
}
.lm-v2-filtre__description a:hover { color: #c5251c; }

@media (max-width: 575px) {
	.lm-v2-filtre__label {
		font-size: 0.95rem;
		padding: 0.4rem 0;
		gap: 0.65rem;
	}
	.lm-v2-filtre__label::before {
		width: 18px;
		height: 18px;
	}
	.lm-v2-filtre__titre { font-size: 0.78rem; padding: 0.5rem 0; }
}

/* VIGNETTE D'UN TERME (sidebar) */
.lm-v2-filtre__vignette {
	width: 22px;
	height: 22px;
	object-fit: cover;
	border-radius: 2px;
	flex-shrink: 0;
	background: #f3f4f6;
}
@media (max-width: 575px) {
	.lm-v2-filtre__vignette { width: 26px; height: 26px; }
}

/* PASTILLES DE COULEUR */
.lm-v2-pastille {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.15);
	background: #9ca3af;
	margin: 0;
	flex-shrink: 0;
}
.lm-v2-pastille--inline { margin-left: 0.25rem; }
.lm-v2-pastille--inconnue { background: linear-gradient(#06b6d4 0%, #8b5cf6 50%, #1e3a8a 100%); }

/* ZONE RÉSULTATS */
.lm-v2-resultats { position: relative; min-height: 400px; }

.lm-v2-resultats__overlay {
	position: absolute;
	top: 0; right: 0; bottom: 0; left: 0;
	background: rgba(255, 255, 255, 0.75);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
}
.lm-v2-resultats__overlay.is-visible { opacity: 1; pointer-events: auto; }
.lm-v2-resultats__loader { width: 64px; height: 64px; }

.lm-v2-resultats__vide {
	background: #ffffff;
	padding: 3rem 1rem;
	text-align: center;
	color: #4a5563;
	border-radius: 4px;
}

.lm-v2-resultats__liste {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.lm-v2-resultats__plus { text-align: center; margin-top: 2rem; }
.lm-v2-resultats__plus-btn {
	background: #ee2e24;
	color: #ffffff;
	border: 0;
	padding: 0.75rem 2rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-size: 0.85rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease;
}
.lm-v2-resultats__plus-btn:hover { background: #c5251c; }
.lm-v2-resultats__plus-btn i { margin-left: 0.5rem; }

/* CARTE MATÉRIAU (format ligne horizontale)
   Image column: 220px × 165px (ratio 4:3 strict, ligne entière fixée à 165px). */
.lm-v2-carte {
	background: #ffffff;
	overflow: hidden;
	transition: box-shadow 0.2s ease;
}
.lm-v2-carte:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); }

.lm-v2-carte__lien {
	display: grid;
	grid-template-columns: 1fr 2fr; /* image = 1/3 de la carte, contenu = 2/3 */
	gap: 0;
	color: inherit;
	text-decoration: none;
	position: relative;
}

.lm-v2-carte__image {
	width: 100%;
	aspect-ratio: 4 / 3; /* hauteur dérivée de la largeur (1/3 de la carte) */
	background-size: cover;
	background-position: center;
	background-color: #e5e7eb;
	overflow: hidden;
}
.lm-v2-carte__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
}

.lm-v2-carte__contenu {
	padding: 1rem;
	display: flex;
	flex-direction: column;
	justify-content: center; /* centrage vertical par rapport à l'image */
	min-width: 0; /* évite les débordements horizontaux dans grid */
	overflow: hidden;
}

.lm-v2-carte__titre {
	font-size: 1.35rem;
	font-weight: 900;
	color: #111827;
	margin: 0 0 0.35rem;
	line-height: 1.15;
}

.lm-v2-carte__extrait {
	font-size: 0.95rem;
	color: #4a5563;
	line-height: 1.3;
	margin-bottom: 0.4rem;
}
.lm-v2-carte__extrait p,
.lm-v2-carte__extrait ol { margin: 0 0 0.2rem; line-height: 1.3; }
.lm-v2-carte__extrait ul {
	margin: 0.4rem 0 0.2rem; /* léger margin-top pour aérer la liste */
	line-height: 1.3;
	list-style: none;
	padding-left: 0;
}
.lm-v2-carte__extrait ul li {
	position: relative;
	padding-left: 1rem;
	margin-bottom: 0.1rem;
	line-height: 1.3;
}
.lm-v2-carte__extrait ul li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.05em;
	width: 0.7rem;
	height: 1.1em;
	background-image: url("../../images/v2/fleche-rouge.svg");
	background-repeat: no-repeat;
	background-position: left center;
	background-size: contain;
}
.lm-v2-carte__extrait ol { padding-left: 1.25rem; }

.lm-v2-carte__couleurs {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 0.4rem;
	flex-wrap: wrap;
	align-items: center;
}
.lm-v2-carte__couleurs .lm-v2-pastille {
	width: 14px;
	height: 14px;
}

/* Hover state — overlay noir + bouton blanc */
.lm-v2-carte__hover {
	position: absolute;
	top: 0; right: 0; bottom: 0; left: 0;
	background: rgba(0, 0, 0, 0.72);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
}
.lm-v2-carte__lien:hover .lm-v2-carte__hover,
.lm-v2-carte__lien:focus-visible .lm-v2-carte__hover {
	opacity: 1;
	pointer-events: auto;
}

.lm-v2-carte__btn {
	background: #ffffff;
	color: #111827;
	padding: 0.7rem 1.4rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-size: 0.85rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	gap: 0.85rem;
}
.lm-v2-carte__btn-fleche {
	width: 21px;
	height: 18px;
	display: inline-block;
	flex-shrink: 0;
}

/* ===== Responsive carte : pile vertical sur mobile ===== */
@media (max-width: 767px) {
	.lm-v2-carte__lien {
		grid-template-columns: 1fr;
		height: auto; /* libère la hauteur fixe desktop */
	}
	.lm-v2-carte__image {
		aspect-ratio: 4 / 3; /* ratio préservé en pleine largeur */
		height: auto;
	}
	.lm-v2-carte__contenu {
		padding: 1rem;
		overflow: visible;
	}
	.lm-v2-carte__titre { font-size: 1.15rem; }
	/* Sur mobile, le hover overlay n'a pas de sens : on remplace par un lien visible permanent */
	.lm-v2-carte__hover {
		position: static;
		opacity: 1;
		background: transparent;
		justify-content: flex-start;
		padding: 0 1.1rem 1rem;
		pointer-events: none; /* le clic se fait sur la carte entière */
	}
	.lm-v2-carte__btn {
		background: transparent;
		color: #ee2e24;
		padding: 0.5rem 0;
		font-size: 0.8rem;
		gap: 0.5rem;
	}
	.lm-v2-carte__btn-fleche { width: 16px; height: 14px; }
}
