/**
 * Bridges native Elementor/JetSmartFilters/JetWooBuilder markup to the
 * ExpertCN shop design system (see boutique.css) for the Elementor-rebuilt
 * shop/category archive. Loaded after boutique.css, on the same pages.
 */

/* --- Search filter (JetSmartFilters "Search" widget, rendered via [expertcn_shop_search]) --- */
.catalogue-toolbar .jet-search-filter {
	height: 50px;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 15px;
	border: 1px solid var(--shop-line);
	border-radius: 12px;
	background: var(--shop-surface-strong);
}
.catalogue-toolbar .jet-search-filter:focus-within {
	border-color: var(--shop-teal);
	box-shadow: 0 0 0 3px rgba(23,124,119,.11);
}
.catalogue-toolbar .jet-search-filter__input-wrapper {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}
.catalogue-toolbar .jet-search-filter__input-wrapper::before {
	content: '';
	flex: none;
	width: 20px;
	height: 20px;
	background-color: var(--shop-teal);
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M11 4a7 7 0 105.29 12.29l4.7 4.7 1.42-1.41-4.7-4.7A7 7 0 0011 4zm0 2a5 5 0 110 10 5 5 0 010-10z'/></svg>") center / contain no-repeat;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M11 4a7 7 0 105.29 12.29l4.7 4.7 1.42-1.41-4.7-4.7A7 7 0 0011 4zm0 2a5 5 0 110 10 5 5 0 010-10z'/></svg>") center / contain no-repeat;
}
.catalogue-toolbar .jet-search-filter__input {
	width: 100%;
	min-width: 0;
	border: 0;
	outline: 0;
	color: var(--shop-navy);
	background: transparent;
	font-size: 1rem;
}
.catalogue-toolbar .jet-search-filter__input::placeholder {
	color: #6d7f8b;
}
.catalogue-toolbar .jet-search-filter__input-clear,
.catalogue-toolbar .jet-search-filter__input-loading {
	flex: none;
	width: 16px;
	height: 16px;
	color: var(--shop-muted);
	cursor: pointer;
}

/* --- Familles / Usages radio filters --- */
.category-list-wrap .jet-radio-list-wrapper fieldset,
.subcategory-filter-wrap .jet-radio-list-wrapper fieldset {
	border: 0;
	margin: 0;
	padding: 0;
}
.category-list-wrap .jet-radio-list {
	display: flex;
	flex-direction: column;
	padding-top: 8px;
}
.category-list-wrap .jet-radio-list__row {
	border-bottom: 1px solid #e0e9ec;
}
.category-list-wrap .jet-radio-list__item {
	width: 100%;
	padding: 12px 0;
	display: flex;
	cursor: pointer;
}
.category-list-wrap .jet-radio-list__input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}
.category-list-wrap .jet-radio-list__button {
	width: 100%;
	display: flex;
	justify-content: space-between;
	gap: 12px;
	color: var(--shop-muted);
	font-size: .9rem;
}
.category-list-wrap .jet-radio-list__input:checked ~ .jet-radio-list__button,
.category-list-wrap .jet-radio-list__item:hover .jet-radio-list__button {
	color: var(--shop-teal);
	font-weight: var(--font-weight-action);
}
.category-list-wrap .jet-radio-list__decorator,
.subcategory-filter-wrap .jet-radio-list__decorator {
	display: none;
}
.category-list-wrap .jet-filter-counter {
	min-width: 24px;
	color: #7b8f99;
	font-size: .76rem;
	text-align: right;
}

/* Usages: pill layout, hidden until a Famille is active (see shop-filters.js) */
.subcategory-filter-wrap {
	margin-top: 24px;
}
.subcategory-filter-wrap.is-hidden {
	display: none;
}
.subcategory-filter-wrap .jet-radio-list {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}
.subcategory-filter-wrap .jet-radio-list-wrapper {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}
.subcategory-filter-wrap .jet-radio-list__row {
	border-bottom: 0;
}
.subcategory-filter-wrap .jet-radio-list__item {
	width: auto;
	padding: 0;
}
.subcategory-filter-wrap .jet-radio-list__button {
	padding: 8px 10px;
	border: 1px solid var(--shop-line);
	border-radius: 9px;
	color: var(--shop-muted);
	background: var(--shop-surface-strong);
	font-size: .77rem;
}
.subcategory-filter-wrap .jet-radio-list__input:checked ~ .jet-radio-list__button,
.subcategory-filter-wrap .jet-radio-list__item:hover .jet-radio-list__button {
	border-color: var(--shop-teal);
	color: var(--shop-teal);
	background: #e5f2f0;
}
.subcategory-filter-wrap [data-usages-for] {
	display: none;
}
.subcategory-filter-wrap.expertcn-usages-visible [data-usages-for="active"] {
	display: flex;
}

/* boutique.css's .catalogue-layout was written for a plain 2-div layout
   (display:grid; grid-template-columns:245px 1fr), which fights Elementor's
   own flexbox column engine now that this is a real Elementor section with
   real (25/75) Elementor columns. Let Elementor size the columns; keep the
   original gap/padding. */
.elementor-section.catalogue-layout {
	display: flex;
	grid-template-columns: unset;
}
@media (max-width: 1024px) {
	.elementor-section.catalogue-layout {
		flex-wrap: wrap;
	}
}

/* --- Products grid (JetWooBuilder Products Loop / native WooCommerce markup) --- */
.shop-products-main .jet-woo-products-wrapper .products {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.shop-products-main .jet-woo-products-wrapper .products > li.product {
	margin: 0;
	padding: 0;
	list-style: none;
	min-width: 0;
}
.shop-products-main .jet-woo-products-wrapper .products > li.product {
	display: flex;
	/* WooCommerce's default float/percentage-width column system
	   (.columns-N li.product { width:...; float:left }) fights our CSS
	   Grid layout above; neutralize it. */
	width: auto !important;
	float: none !important;
}
.shop-products-main .jet-woo-products-wrapper .products > li.product > div,
.shop-products-main .jet-woo-products-wrapper .products .product-card {
	width: 100%;
}
@media (max-width: 1024px) {
	.shop-products-main .jet-woo-products-wrapper .products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* --- Product card fine-tuning (widget wrappers can't carry css_classes directly) --- */
.product-title-wrap {
	min-height: 54px;
	margin: 11px 0 0;
}
.product-title-wrap h3,
.product-title-wrap .jet-woo-builder-archive-product-title {
	font-size: 1.24rem;
	line-height: 1.18;
	letter-spacing: -.02em;
	font-weight: var(--font-weight-title);
	margin: 0;
}
.product-title-wrap a {
	color: inherit;
	text-decoration: none;
}
.product-title-wrap a:hover {
	color: var(--shop-teal);
}

/* boutique.css hides .shop-filters on mobile behind a "Filtres" toggle button
   (.filters-toggle / data-expertcn-filters-toggle) that belonged to the old
   hand-coded widget. This rebuild has no such button yet, so without this
   override the Familles/Usages sidebar would be completely inaccessible on
   mobile. Keep it inline (stacked above the grid) until a toggle button is
   added. */
@media (max-width: 768px) {
	.shop-filters {
		display: block !important;
		position: static !important;
		margin-bottom: 24px;
	}
}

/* --- Catalogue toolbar: reuse existing grid rules but only one child now --- */
.catalogue-toolbar {
	display: flex;
	align-items: center;
}
