/* Ad Format filters (archive tpl 4702 + single tpl 4696): search, checkbox groups, active-filter chips. */
.ldr2-filters { display: flex; flex-direction: column; gap: var(--space-l); width: 100%; }
/* `html` en préfixe : la global class m8mems (ldr2-filters) embarque une ancienne copie de cette règle qui passe après ce fichier. */
html #ldr2-search.ldr2-filters__search {
	display: flex;
	height: 50px;
	padding: 8px 16px;
	align-items: center;
	gap: 4px;
	align-self: stretch;
	border-radius: var(--radius-circle);
	border: 1px solid var(--primary);
	background: var(--white) var(--ldr2-search-icon, none) no-repeat left 16px center / 16px 16px;
	padding-left: 40px;
	font-size: var(--text-s);
	color: var(--primary);
}
html #ldr2-search.ldr2-filters__search::placeholder { color: var(--text-dark); opacity: 1; }
/* Accordéons de groupes de filtres (tpl 4702) : <details open> + <summary>, ouverts par défaut.
   Chevron = média 3111 (pointe à droite) : fermé = vers le bas (90deg), ouvert = vers le haut (-90deg). */
.ldr2-filters-acc__title { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); cursor: pointer; list-style: none; user-select: none; }
.ldr2-filters-acc__title::-webkit-details-marker { display: none; }
.ldr2-filters-acc__title::after { content: ''; flex: 0 0 auto; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--ldr2-acc-chevron) center / contain no-repeat; mask: var(--ldr2-acc-chevron) center / contain no-repeat; transform: rotate(90deg); transition: transform .2s ease; }
.ldr2-filters-acc[open] > .ldr2-filters-acc__title::after { transform: rotate(-90deg); }
.ldr2-filters-acc__title:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .ldr2-filters-acc__title::after { transition: none; } }
/* Carte par groupe (desktop) : mêmes valeurs que le bottom sheet mobile (bloc max-width 767px). */
.ldr2-filters .ldr2-filters-acc { border: 1px solid var(--neutral-ultra-light); border-radius: calc(var(--radius) / 2); padding: calc(var(--space-xs) / 2); }
.ldr2-filters__group { display: flex; flex-direction: column; gap: 4px; }
.ldr2-filters__group-title { font-weight: 600; margin: 0 0 4px; }
/* Fermé : pas de marge sous le summary, sinon le titre paraît remonté dans la carte. */
.ldr2-filters-acc:not([open]) { gap: 0; }
.ldr2-filters-acc:not([open]) > .ldr2-filters-acc__title { margin-bottom: 0; }
.ldr2-filters__option { display: flex; align-items: center; gap: 6px; font-size: var(--text-s); margin-bottom: 0; }
/* Checkbox custom : fond blanc, bordure primary, coche secondary (appearance:none + coche clip-path en ::before). */
html .ldr2-filters__option-input {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--primary);
	border-radius: 3px;
	background: var(--white);
	cursor: pointer;
}
html .ldr2-filters__option-input::before {
	content: "";
	position: absolute;
	inset: 1px;
	background: var(--secondary);
	-webkit-mask: var(--ldr2-cb-check) center / 100% 100% no-repeat;
	mask: var(--ldr2-cb-check) center / 100% 100% no-repeat;
	transform: scale(0);
	transition: transform .1s ease-in-out;
}
/* Coche fine (trait 1.4) ; barre horizontale quand un parent n'a qu'une partie de ses enfants cochee (indeterminate posé par archive-filters.js). */
html .ldr2-filters__option-input {
	--ldr2-cb-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.6 6.4l3.2 3.2 5.6-6.8'/%3E%3C/svg%3E");
	--ldr2-cb-dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M1.8 6h8.4'/%3E%3C/svg%3E");
}
html .ldr2-filters__option-input:checked::before { transform: scale(1); }
html .ldr2-filters__option-input:indeterminate::before {
	-webkit-mask-image: var(--ldr2-cb-dash);
	mask-image: var(--ldr2-cb-dash);
	transform: scale(1);
}
html .ldr2-filters__option-input:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }
.ldr2-filters__option--child { margin-left: var(--space-s); }
html .ldr2-filters__option--disabled { opacity: 1; color: var(--text-dark); cursor: not-allowed; }
html .ldr2-filters__option--disabled input { pointer-events: none; cursor: not-allowed; }
.ldr2-no-results { display: none; }
.ldr2-active-filters { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-s); margin-bottom: var(--space-m); }
.ldr2-active-filters > * { margin: 0; }
.ldr2-active-filters__chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); flex: 1 1 auto; }
.ldr2-active-filters__chip { display: inline-flex; align-items: center; gap: 6px; background: var(--base-ultra-light); color: var(--primary); font-size: var(--text-xs); padding: 4px 10px; border: none; border-radius: var(--radius-xs); cursor: pointer; font-family: inherit; }
.ldr2-active-filters__chip::after { content: ''; display: inline-block; flex: 0 0 auto; width: 12px; height: 12px; background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M9 9L15 15M15 9L9 15' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.ldr2-active-filters__reset { margin-left: auto; }

/* "Show N more" toggle (ldr2_filters_render_options() + ldr2_filters_more_toggle_assets()).
   `display: contents` on the open group keeps the revealed options in the list's own layout. */
.ldr2-filters__more-options { display: none; }
.ldr2-filters__more-options.is-open { display: contents; }
.ldr2-filters__more-toggle {
	display: block;
	width: 100%;
	background: none;
	border: none;
	margin: 0;
	padding: var(--space-s) calc(var(--space-s) / 2);
	font: inherit;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
}

/* Archive results: sections grouped by creative type (archive-filters.js ldr2RenderSections). */
div#ldr2-sections { width: 100%; margin-top: calc(var(--section-space-s) / 2); }
.ldr2-archive-section { margin-bottom: var(--space-l); }
.ldr2-archive-section .grid--4 { row-gap: calc(var(--section-space-s) / 2); }
.ldr2-archive-section__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: var(--space-m); }
.ldr2-archive-section__title { display: flex; align-items: center; gap: 8px; }
.ldr2-archive-section__title img { width: 32px; height: 32px; object-fit: contain; border-radius: 0; }
.ldr2-archive-section__title h2 { margin: 0; color: var(--primary); font-family: var(--text-font-family); font-weight: var(--heading-font-weight); font-size: var(--h6); }
.ldr2-archive-section__count { display: inline-block; background: var(--base-ultra-light); color: var(--primary); font-size: var(--text-xs); font-weight: 600; text-align: center; padding: calc(var(--space-xs) / 2) var(--space-xs); border-radius: var(--radius-xs); }

/* Category nav bar: sticky under the sticky header on creative-type term pages and single ad formats (not on the archive). */
body.tax-ad_creative_type .nav-container-section,
body.single-ad_format .nav-container-section { position: sticky; top: 0; z-index: 10; background: white; }
body.tax-ad_creative_type .nav-container-section,
body.single-ad_format .nav-container-section { transition: box-shadow .2s ease; }
body.tax-ad_creative_type .nav-container-section.is-stuck,
body.single-ad_format .nav-container-section.is-stuck { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); }

/* Filters sidebar: sticky on the archive and on creative-type term pages. On term pages it sits below the sticky nav bar (height published by js/nav-sticky-shadow.js). */
body.archive { --ldr2-sticky-top: 0px; }
body.tax-ad_creative_type,
body.single-ad_format { --ldr2-sticky-top: var(--ldr2-nav-bar-height, 0px); }
body.archive .ldr2-filters,
body.single-ad_format .ldr2-filters { position: sticky; top: var(--ldr2-sticky-top); align-self: flex-start; max-height: calc(100vh - var(--ldr2-sticky-top)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }

/* Filters Panel component (tpl 4702 + 4696).
   Desktop: toggle/header/footer/overlay hidden, panel + body are transparent wrappers (groups stay direct flex items of .ldr2-filters).
   Mobile (<= 767px): search + Filters button on one row, groups live in a bottom sheet. */
.ldr2-filters .ldr2-filters__toggle,
.ldr2-filters .ldr2-filters-overlay,
.ldr2-filters .ldr2-filters-panel__header,
.ldr2-filters .ldr2-filters-panel__footer { display: none; }
.ldr2-filters .ldr2-filters-panel,
.ldr2-filters .ldr2-filters-panel__body { display: contents; }
.ldr2-filters__toggle-icon { width: 20px; height: 20px; flex: 0 0 auto; }

@media (max-width: 767px) {
	body.archive .ldr2-filters,
	body.single-ad_format .ldr2-filters { position: static; width: 100%; max-width: 100%; max-height: none; overflow: visible; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: var(--space-s); border: 0; padding-inline: 0; }
	.ldr2-filters .ldr2-filters__search-group.brxe-block { flex: 0 0 auto; width: 100%; }
	/* Label "Search" hidden visually, the placeholder carries it. */
	.ldr2-filters .ldr2-filters__search-group > .ldr2-filters__group-title { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

	.ldr2-filters .ldr2-filters__toggle.brxe-block,
	.ldr2-filters .ldr2-filters-panel__badge.brxe-block { flex-direction: row; width: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; height: 50px; padding: 0 var(--space-s); background: var(--white); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent); border-radius: var(--radius-m, 12px); font: inherit; font-size: var(--text-m); font-weight: 500; cursor: pointer; }
	.ldr2-filters .ldr2-filters__toggle:focus-visible,
	.ldr2-filters-panel__close:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

	.ldr2-filters .ldr2-filters-overlay.brxe-block { display: block; position: fixed; inset: 0; z-index: 10000; background: rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
	.ldr2-filters.is-open .ldr2-filters-overlay { opacity: 1; pointer-events: auto; }

	.ldr2-filters .ldr2-filters-panel.brxe-block { display: flex; flex-direction: column; flex-wrap: nowrap; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10001; max-height: 85dvh; background: var(--white); border-radius: 24px 24px 0 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, .12); transform: translateY(100%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
	.ldr2-filters.is-open .ldr2-filters-panel { transform: none; visibility: visible; transition: transform .25s ease; }

	.ldr2-filters .ldr2-filters-panel__header.brxe-block { display: flex; flex-direction: row; align-items: center; justify-content: space-between; padding: var(--space-s); }
	.ldr2-filters .ldr2-filters-panel__badge.brxe-block { height: 44px; cursor: default; }
	.ldr2-filters .ldr2-filters-panel__close.brxe-block { display: inline-grid; flex: 0 0 auto; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--base-ultra-light); color: var(--primary); cursor: pointer; }

	.ldr2-filters .ldr2-filters-panel__body.brxe-block { display: flex; flex-direction: column; flex-wrap: nowrap; gap: var(--space-s); flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--space-s) var(--space-s); }
	.ldr2-filters-panel__body .ldr2-filters-acc { border: 1px solid var(--neutral-ultra-light); border-radius: calc(var(--radius) / 2); padding: calc(var(--space-xs) / 2); }

	.ldr2-filters .ldr2-filters-panel__footer.brxe-block { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xs); padding: var(--space-s); border-top: 1px solid var(--neutral-ultra-light); }
	.ldr2-filters-panel__footer .bricks-button { width: 100%; margin: 0; justify-content: center; border-radius: var(--radius-circle); min-height: 50px; }
	html .ldr2-filters-panel__footer .bricks-button.ldr2-filters-panel__clear { border-radius: var(--radius-circle); background: transparent; color: var(--primary); border: 1px solid var(--primary); }

	html.ldr2-filters-lock { overflow: hidden; }

	/* Archive results: one column. */
	body.archive .ldr2-archive-section > .grid--4 { grid-template-columns: 1fr; }
}

/* Archive results grid: 4 columns (ACSS grid--4) -> 3 (<= 1199px) -> 2 (<= 991px) -> 1 (<= 767px, see mobile block above). Ranges do not overlap. */
@media (min-width: 992px) and (max-width: 1199px) { body.archive .ldr2-archive-section > .grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px) and (max-width: 991px) { body.archive .ldr2-archive-section > .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Archive with few results: the sidebar is taller than the grid, so the listing has no slack and sticky cannot move. Give the listing a floor height (desktop/tablet only; mobile uses the bottom sheet). */
@media (min-width: 768px) { body.archive .ldr2-listing { min-height: calc(100vh - 100px); } }
