/*
 * Colonne de filtres (ordinateur) et panneau de filtres mobile du catalogue — apparence seulement,
 * aux jetons du design system (inc/functions-catalog.php, pages body.tm-catalog-page).
 *
 * Contenu des deux zones (barres latérales Elementor « product-archive » et « sidebar-mobile » du
 * modèle Elementor des archives de produits) : widgets « Parcourir par catégorie / métier », filtre de prix
 * de WooCommerce (.widget_price_filter), formulaire WOOF (.woof : curseur ion.rangeSlider, listes
 * radio et cases à cocher, listes à choix multiple « chosen »). Rien ne change dans le filtrage :
 * mêmes champs, mêmes noms, mêmes événements ; seules les règles d'apparence sont remplacées.
 *
 * Repères : maquette « Catalogue Produits » (menus de filtres en pastilles : options 13,5 →
 * --text-sm, cases 17 × 17 rayon 5 → --space-4 / --radius-xs, compteurs --fg-4, survol --tm-blue-50,
 * choix actifs --tm-pale-blue) ; la colonne elle-même n'est pas dessinée dans la maquette.
 * Le correctif du panneau mobile (css/shop.css : flex-wrap du conteneur, z-index de la croix) n'est
 * pas touché : aucune de ces deux propriétés n'est redéfinie ici.
 */

/* ---------- Sections ---------- */

body.tm-catalog-page .elementor-widget-sidebar .widget {
	margin: 0;
	padding: var(--space-5) 0;
	font-family: var(--font-sans);
	color: var(--fg-2);
	border-top: 1px solid var(--border-subtle);
}

body.tm-catalog-page .elementor-widget-sidebar .elementor-widget-container > .widget:first-child {
	padding-top: 0;
	border-top: 0;
}

/* Le formulaire WOOF est un widget dans un widget, et chacune de ses sections porte sa bordure. */
body.tm-catalog-page .elementor-widget-sidebar .widget .widget,
body.tm-catalog-page .elementor-widget-sidebar .widget.WOOF_Widget {
	padding: 0;
	border-top: 0;
}

body.tm-catalog-page .elementor-widget-sidebar .widget .widget-title {
	margin: 0 0 var(--space-3);
	padding: 0;
	font-family: var(--font-sans);
	font-size: var(--text-md);
	font-weight: var(--fw-semibold);
	line-height: var(--lh-snug);
	letter-spacing: var(--ls-snug);
	color: var(--fg-1);
}

body.tm-catalog-page .elementor-widget-sidebar .woof_container {
	margin: 0;
	padding: var(--space-5) 0;
	border-top: 1px solid var(--border-subtle);
}

body.tm-catalog-page .elementor-widget-sidebar .woof_container .woof_container_inner > h4 {
	margin: 0 0 var(--space-3);
	padding: 0;
	font-family: var(--font-sans);
	font-size: var(--text-sm);
	font-weight: var(--fw-semibold);
	line-height: var(--lh-snug);
	color: var(--fg-1);
}

/* ---------- « Parcourir par catégorie / métier » (widgets natifs, inc/functions-catalog-widgets.php) ----------
 * Widget « Catégories de produits » de WooCommerce et « Nuage d'étiquettes » sur la taxonomie
 * metier (affiché en liste par css/catalog-widgets.css) : un lien par ligne, surligné au survol,
 * le terme de l'archive en cours (current-cat) en gras.
 */

body.tm-catalog-page .elementor-widget-sidebar .widget_product_categories ul.product-categories,
body.tm-catalog-page .elementor-widget-sidebar .widget_product_categories ul.children {
	margin: 0;
	padding: 0;
	list-style: none;
}

body.tm-catalog-page .elementor-widget-sidebar .widget_product_categories ul.children {
	padding-left: var(--space-3);
}

body.tm-catalog-page .elementor-widget-sidebar .widget_product_categories li {
	margin: 0;
	padding: 0;
}

body.tm-catalog-page .elementor-widget-sidebar .widget_product_categories li > a,
body.tm-catalog-page .elementor-widget-sidebar .widget_tag_cloud .tagcloud a {
	display: block;
	margin: 0 calc(-1 * var(--space-2));
	padding: var(--space-1) var(--space-2);
	font-family: var(--font-sans);
	font-size: var(--text-sm) !important; /* le nuage d'étiquettes fixe une taille en ligne par terme */
	font-weight: var(--fw-regular);
	line-height: var(--lh-normal);
	color: var(--fg-2);
	text-decoration: none;
	border-radius: var(--radius-sm);
}

body.tm-catalog-page .elementor-widget-sidebar .widget_product_categories li > a:hover,
body.tm-catalog-page .elementor-widget-sidebar .widget_tag_cloud .tagcloud a:hover {
	color: var(--tm-blue-700);
	background: var(--tm-blue-50);
}

body.tm-catalog-page .elementor-widget-sidebar .widget_product_categories li.current-cat > a,
body.tm-catalog-page .elementor-widget-sidebar .widget_tag_cloud .tagcloud a.current-cat {
	font-weight: var(--fw-semibold);
	color: var(--tm-blue-700);
}

body.tm-catalog-page .elementor-widget-sidebar .widget_product_categories li > a:focus-visible,
body.tm-catalog-page .elementor-widget-sidebar .widget_tag_cloud .tagcloud a:focus-visible {
	outline: none;
	box-shadow: var(--shadow-focus);
}

/* Compteurs de produits du widget de catégories (réglage « Afficher le nombre ») : discrets. */
body.tm-catalog-page .elementor-widget-sidebar .widget_product_categories .count {
	font-size: var(--text-xs);
	color: var(--fg-4);
}
/* ---------- Listes radio et cases à cocher de WOOF ----------
 * Les champs restent ceux de WOOF (masqués par le thème, comme avant) ; leur libellé reçoit un
 * indicateur dessiné (case ou rond) qui suit l'état coché du champ (input:checked + label).
 */

body.tm-catalog-page .elementor-widget-sidebar .woof_list {
	margin: 0;
	padding: 0;
	list-style: none;
}

body.tm-catalog-page .elementor-widget-sidebar .woof_list li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 var(--space-2);
	margin: 0;
	padding: 0;
	line-height: var(--lh-normal);
}

/* WOOF impose display: inline-block !important aux libellés (front.css) : l'indicateur est donc
   en ligne (inline-block), aligné au milieu du texte, plutôt qu'en flex. */
body.tm-catalog-page .elementor-widget-sidebar .woof_list label {
	margin: 0;
	padding: var(--space-1) 0;
	font-family: var(--font-sans);
	font-size: var(--text-sm);
	font-weight: var(--fw-regular);
	line-height: var(--lh-normal);
	color: var(--fg-2);
	cursor: pointer;
}

/* Besa masque ces pseudo-éléments (template2.css : ul.woof_list label::before { display: none }) ;
   le thème enfant aussi pour « Type de vendeur » (règle en ligne avec !important, cf.
   woof-ext/tm_seller_type/views/woof.php : .woof_checkbox_tm_seller_type_container input + label::before), d'où
   le !important de display et content, avec un sélecteur plus précis. */
body.tm-catalog-page .elementor-widget-sidebar ul.woof_list label::before {
	content: "" !important;
	display: inline-block !important;
	margin: 0 var(--space-2) 0 0;
	vertical-align: -3px;
	box-sizing: border-box;
	width: var(--space-4);
	height: var(--space-4);
	background: var(--bg-surface) center / 11px 11px no-repeat;
	border: 1.5px solid var(--border-strong);
	border-radius: var(--radius-xs);
}

body.tm-catalog-page .elementor-widget-sidebar ul.woof_list_radio label::before {
	border-radius: var(--radius-pill);
}

body.tm-catalog-page .elementor-widget-sidebar .woof_list label:hover {
	color: var(--tm-blue-700);
}

body.tm-catalog-page .elementor-widget-sidebar ul.woof_list label:hover::before {
	border-color: var(--tm-blue-300);
}

/* Choix actif : champ coché, ou marqué par WOOF au rendu (attribut checked et classe
   woof_radio_label_selected ; sur les listes radio, la propriété checked du champ peut rester fausse). */
body.tm-catalog-page .elementor-widget-sidebar .woof_list input:checked + label,
body.tm-catalog-page .elementor-widget-sidebar .woof_list input[checked] + label,
body.tm-catalog-page .elementor-widget-sidebar .woof_list label.woof_radio_label_selected {
	font-weight: var(--fw-medium);
	color: var(--fg-1);
}

body.tm-catalog-page .elementor-widget-sidebar ul.woof_list_checkbox input:checked + label::before,
body.tm-catalog-page .elementor-widget-sidebar ul.woof_list_checkbox input[checked] + label::before {
	background-color: var(--tm-blue-500);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 13 4 4L19 7'/%3E%3C/svg%3E");
	border-color: var(--tm-blue-500);
}

body.tm-catalog-page .elementor-widget-sidebar ul.woof_list_radio input:checked + label::before,
body.tm-catalog-page .elementor-widget-sidebar ul.woof_list_radio input[checked] + label::before,
body.tm-catalog-page .elementor-widget-sidebar ul.woof_list_radio label.woof_radio_label_selected::before {
	background: var(--bg-surface);
	border: 5px solid var(--tm-blue-500);
}

/* Lien de retrait d'un choix (croix de WOOF, affichée par WOOF ou le thème seulement quand le choix
   est actif : son affichage n'est pas modifié ici). */
body.tm-catalog-page .elementor-widget-sidebar .woof_list li > a[class*="reset"] {
	/* WOOF la place en absolu (front.css : .woof_radio_term_reset_visible) et Besa avant le libellé
	   (order: -1) : elle recouvrait l'indicateur. Elle suit désormais le libellé. */
	position: static;
	order: 2;
	align-items: center;
	opacity: 0.6;
}

body.tm-catalog-page .elementor-widget-sidebar .woof_list li > a[class*="reset"]:hover {
	opacity: 1;
}

/* ---------- Listes à choix multiple (chosen) ---------- */

body.tm-catalog-page .elementor-widget-sidebar .chosen-container {
	width: 100% !important; /* chosen fixe une largeur en ligne */
	font-family: var(--font-sans);
	font-size: var(--text-sm);
}

body.tm-catalog-page .elementor-widget-sidebar .chosen-container-multi .chosen-choices {
	box-sizing: border-box;
	min-height: 40px;
	padding: var(--space-1) var(--space-3);
	background: var(--bg-surface);
	background-image: none;
	border: 1px solid var(--border-default);
	border-radius: var(--radius-md);
	box-shadow: none;
	cursor: pointer;
}

body.tm-catalog-page .elementor-widget-sidebar .chosen-container-multi .chosen-choices:hover {
	border-color: var(--border-strong);
}

body.tm-catalog-page .elementor-widget-sidebar .chosen-container-active .chosen-choices {
	border-color: var(--border-focus);
	box-shadow: var(--shadow-focus);
}

body.tm-catalog-page .elementor-widget-sidebar .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
	height: 30px;
	margin: 0;
	padding: 0;
	font-family: var(--font-sans);
	font-size: var(--text-sm);
	color: var(--fg-3);
}

body.tm-catalog-page .elementor-widget-sidebar .chosen-container-multi .chosen-choices li.search-choice {
	margin: 3px var(--space-1) 3px 0;
	padding: var(--space-1) 22px var(--space-1) var(--space-2);
	font-size: var(--text-xs);
	font-weight: var(--fw-medium);
	line-height: var(--lh-snug);
	color: var(--tm-blue-800);
	background: var(--tm-pale-blue);
	background-image: none;
	border: 0;
	border-radius: var(--radius-pill);
	box-shadow: none;
}

body.tm-catalog-page .elementor-widget-sidebar .chosen-container .chosen-drop {
	margin-top: var(--space-1);
	background: var(--bg-surface);
	border: 1px solid var(--border-default);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-md);
}

body.tm-catalog-page .elementor-widget-sidebar .chosen-container .chosen-results {
	margin: 0;
	padding: var(--space-1);
}

body.tm-catalog-page .elementor-widget-sidebar .chosen-container .chosen-results li {
	padding: var(--space-2);
	font-size: var(--text-sm);
	line-height: var(--lh-snug);
	color: var(--fg-2);
	border-radius: var(--radius-sm);
}

body.tm-catalog-page .elementor-widget-sidebar .chosen-container .chosen-results li.highlighted {
	color: var(--tm-blue-700);
	background: var(--tm-blue-50);
	background-image: none;
}

/* ---------- Filtre de prix (WooCommerce, jQuery UI) ---------- */

body.tm-catalog-page .elementor-widget-sidebar .price_slider.ui-slider {
	height: 4px;
	/* 10 px de chaque côté : les poignées (18 px, centrées sur les extrémités) restent entières. */
	margin: var(--space-3) 10px var(--space-5);
	background: var(--tm-neutral-200);
	border: 0;
	border-radius: var(--radius-pill);
}

body.tm-catalog-page .elementor-widget-sidebar .price_slider .ui-slider-range {
	background: var(--tm-blue-500);
	border-radius: var(--radius-pill);
}

body.tm-catalog-page .elementor-widget-sidebar .price_slider .ui-slider-handle {
	top: -7px;
	width: 18px;
	height: 18px;
	margin-left: -9px;
	background: var(--bg-surface);
	border: 2px solid var(--tm-blue-500);
	border-radius: var(--radius-pill);
	box-shadow: var(--shadow-sm);
	cursor: grab;
}

body.tm-catalog-page .elementor-widget-sidebar .price_slider .ui-slider-handle:focus-visible {
	outline: none;
	box-shadow: var(--shadow-focus);
}

body.tm-catalog-page .elementor-widget-sidebar .price_slider_amount {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	text-align: left;
}

body.tm-catalog-page .elementor-widget-sidebar .price_slider_amount .button {
	order: 2;
}

body.tm-catalog-page .elementor-widget-sidebar .price_slider_amount .price_label {
	order: 1;
	margin: 0;
	font-size: var(--text-sm);
	line-height: var(--lh-normal);
	color: var(--fg-3);
}

body.tm-catalog-page .elementor-widget-sidebar .price_slider_amount .price_label span {
	font-weight: var(--fw-semibold);
	color: var(--fg-1);
}

body.tm-catalog-page .elementor-widget-sidebar .price_slider_amount .button,
body.tm-catalog-page .elementor-widget-sidebar .woof_reset_search_form {
	box-sizing: border-box;
	height: 36px;
	margin: 0;
	padding: 0 var(--space-4);
	font-family: var(--font-sans);
	font-size: var(--text-sm);
	font-weight: var(--fw-semibold);
	line-height: 1;
	color: var(--fg-inverse);
	background: var(--tm-blue-500);
	border: 1px solid var(--tm-blue-500);
	border-radius: var(--radius-md);
	box-shadow: none;
	cursor: pointer;
}

body.tm-catalog-page .elementor-widget-sidebar .price_slider_amount .button:hover {
	background: var(--tm-blue-600);
	border-color: var(--tm-blue-600);
}

/* Bouton de remise à zéro de WOOF : bouton secondaire */
body.tm-catalog-page .elementor-widget-sidebar .woof_reset_search_form {
	width: 100%;
	color: var(--fg-2);
	background: var(--bg-surface);
	border-color: var(--border-default);
}

body.tm-catalog-page .elementor-widget-sidebar .woof_reset_search_form:hover {
	color: var(--tm-blue-700);
	border-color: var(--tm-blue-300);
}

body.tm-catalog-page .elementor-widget-sidebar .price_slider_amount .button:focus-visible,
body.tm-catalog-page .elementor-widget-sidebar .woof_reset_search_form:focus-visible {
	outline: none;
	box-shadow: var(--shadow-focus);
}

/* ---------- Curseur « Date de mise en service » (ion.rangeSlider, habillage « round ») ---------- */

body.tm-catalog-page .elementor-widget-sidebar .irs--round .irs-line {
	background: var(--tm-neutral-200);
}

body.tm-catalog-page .elementor-widget-sidebar .irs--round .irs-bar {
	background: var(--tm-blue-500);
}

body.tm-catalog-page .elementor-widget-sidebar .irs--round .irs-handle {
	background: var(--bg-surface);
	border-color: var(--tm-blue-500);
	box-shadow: var(--shadow-sm);
}

body.tm-catalog-page .elementor-widget-sidebar .irs--round .irs-from,
body.tm-catalog-page .elementor-widget-sidebar .irs--round .irs-to,
body.tm-catalog-page .elementor-widget-sidebar .irs--round .irs-single {
	font-family: var(--font-sans);
	font-size: var(--text-2xs);
	font-weight: var(--fw-semibold);
	background: var(--tm-blue-500);
	border-radius: var(--radius-xs);
}

body.tm-catalog-page .elementor-widget-sidebar .irs--round .irs-from::before,
body.tm-catalog-page .elementor-widget-sidebar .irs--round .irs-to::before,
body.tm-catalog-page .elementor-widget-sidebar .irs--round .irs-single::before {
	border-top-color: var(--tm-blue-500);
}

body.tm-catalog-page .elementor-widget-sidebar .irs--round .irs-grid-text {
	font-family: var(--font-sans);
	font-size: var(--text-2xs);
	color: var(--fg-4);
}

body.tm-catalog-page .elementor-widget-sidebar .irs--round .irs-grid-pol {
	background: var(--tm-neutral-300);
}

/* ---------- Panneau de filtres mobile (conteneur .filter-mobile du modèle Elementor des archives de produits) ---------- */

body.tm-catalog-page .filter-mobile .heading-title .elementor-heading-title {
	margin: 0;
	font-family: var(--font-sans);
	font-size: var(--text-lg);
	font-weight: var(--fw-semibold);
	line-height: var(--lh-snug);
	color: var(--fg-1);
}

body.tm-catalog-page .filter-mobile a.close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--fg-2);
	border-radius: var(--radius-pill);
}

body.tm-catalog-page .filter-mobile a.close:hover {
	color: var(--fg-1);
	background: var(--bg-sunken);
}

body.tm-catalog-page .filter-mobile a.close:focus-visible {
	outline: none;
	box-shadow: var(--shadow-focus);
}

/* ---------- Filtres actifs au-dessus des produits (panneau WOOF, js/tm-active-filters.js) ----------
 * Maquette « Catalogue Produits » : puces 6 × 8 × 6 × 12, 12,5 px demi-gras, --tm-pale-blue /
 * --tm-blue-800, croix 12 px ; « Effacer les filtres » en lien 12,5 px --tm-blue-600. Ramené aux
 * jetons. Le panneau est masqué par WOOF quand aucun filtre n'est actif ; sur une archive de métier
 * ou de catégorie sans filtre, la puce du terme est rendue par le serveur (.tm-active-filters--archive,
 * inc/functions-active-filters.php) au même style.
 */

body.tm-catalog-page .woof_products_top_panel,
body.tm-catalog-page .tm-active-filters--archive {
	margin: 0 0 var(--space-5);
	padding: 0;
	font-family: var(--font-sans);
}

body.tm-catalog-page .woof_products_top_panel ul.woof_products_top_panel_ul,
body.tm-catalog-page .woof_products_top_panel ul.woof_products_top_panel_ul ul,
body.tm-catalog-page .tm-active-filters--archive ul.tm-active-filters__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

body.tm-catalog-page .woof_products_top_panel ul.woof_products_top_panel_ul li,
body.tm-catalog-page .tm-active-filters--archive ul.tm-active-filters__list li {
	display: block;
	float: none;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Nom du groupe (« Marques: ») : gardé pour les lecteurs d'écran dans le nom de chaque puce. */
body.tm-catalog-page .woof_products_top_panel .tm-active-filters__group {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

body.tm-catalog-page .woof_products_top_panel a.tm-active-filters__chip,
body.tm-catalog-page .tm-active-filters--archive a.tm-active-filters__chip {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	/* Agrandies à la demande de la cliente (22/10) : 14 px, environ 34 px de haut (zone de toucher). */
	padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4);
	font-size: var(--text-sm);
	font-weight: var(--fw-medium);
	line-height: var(--lh-snug);
	color: var(--tm-blue-800);
	text-decoration: none;
	background: var(--tm-pale-blue);
	border-radius: var(--radius-pill);
}

/* WOOF dessine sa croix en image de fond de la valeur (réglage delete_image) : remplacée. */
body.tm-catalog-page .woof_products_top_panel a.tm-active-filters__chip span,
body.tm-catalog-page .tm-active-filters--archive a.tm-active-filters__chip span {
	padding: 0;
	color: inherit;
	background: none;
}

body.tm-catalog-page .woof_products_top_panel a.tm-active-filters__chip::after,
body.tm-catalog-page .tm-active-filters--archive a.tm-active-filters__chip::after {
	content: "";
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / contain no-repeat;
}

body.tm-catalog-page .woof_products_top_panel a.tm-active-filters__chip:hover,
body.tm-catalog-page .tm-active-filters--archive a.tm-active-filters__chip:hover {
	background: var(--tm-pale-200);
}

body.tm-catalog-page .woof_products_top_panel a.tm-active-filters__chip:focus-visible,
body.tm-catalog-page .tm-active-filters--archive a.tm-active-filters__chip:focus-visible,
body.tm-catalog-page a.tm-active-filters__clear:focus-visible {
	outline: none;
	box-shadow: var(--shadow-focus);
}

body.tm-catalog-page a.tm-active-filters__clear {
	display: inline-block;
	padding: var(--space-2);
	font-family: var(--font-sans);
	font-size: var(--text-sm);
	font-weight: var(--fw-semibold);
	line-height: var(--lh-snug);
	color: var(--tm-blue-600);
	text-decoration: none;
	border-radius: var(--radius-xs);
}

body.tm-catalog-page a.tm-active-filters__clear:hover {
	color: var(--tm-blue-700);
	text-decoration: underline;
}

/* Mobile : lien en haut du panneau de filtres (rendu par le serveur) */
body.tm-catalog-page .tm-active-filters-mobile {
	margin: 0 0 var(--space-4);
	padding: 0 0 var(--space-3);
	border-bottom: 1px solid var(--border-subtle);
}

body.tm-catalog-page .tm-active-filters-mobile a.tm-active-filters__clear {
	padding-left: 0;
	font-size: var(--text-sm);
}

/* Aucun produit pour les filtres choisis : lien d'effacement sous le message d'Elementor */
body.tm-catalog-page .tm-active-filters-empty {
	margin: var(--space-3) 0 0;
}

body.tm-catalog-page .tm-active-filters-empty a.tm-active-filters__clear {
	padding-left: 0;
	font-size: var(--text-sm);
}
