/**
 * AG Product Filters - filter options and active filter chips are <button>
 * (see ag-product-filters.php). Undo WoodMart's global button look and mirror
 * the theme rules that were written for <a>.
 *
 * Every selector keeps the specificity of the WoodMart rule it mirrors (".pf-value"
 * sits in :where()), so site / designer CSS overrides them exactly as it did for <a>.
 * The base rules still beat WoodMart's global :is(.btn, button, ...) at (0,1,0).
 */

/* ---------- Filter options ---------- */

.wd-pf-dropdown button:where(.pf-value) {
	position: static;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 0;
	width: 100%;
	min-height: 0;
	margin: 0;
	padding: 8px 18px;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: var(--color-gray-500);
	font: inherit;
	line-height: 1.3;
	letter-spacing: inherit;
	text-align: inherit;
	text-transform: none;
	transition: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

/* Also undoes WoodMart's button :hover (0,2,0) the way .wd-pf-dropdown a:hover did. */
.wd-pf-dropdown button:where(.pf-value):hover {
	background-color: var(--bgcolor-gray-200);
	box-shadow: none;
}

.wd-pf-dropdown .wd-active > button:where(.pf-value) {
	background-color: var(--bgcolor-gray-100);
}

/* Swatches (woo-mod-swatches-filter / -base) */

.wd-swatches-filter:is(.wd-layout-double, .wd-layout-inline) button:where(.pf-value) {
	padding: 0;
	background: transparent !important;
}

.wd-swatches-filter .wd-swatch-wrap.wd-active button:where(.pf-value):hover .wd-swatch.wd-bg:before {
	opacity: 1;
}

.wd-swatches-filter:not(.wd-bg-style-1) .wd-swatch-wrap.wd-active button:where(.pf-value):hover .wd-swatch.wd-bg:after {
	opacity: 0;
}

.wd-swatches-brands .wd-swatch-wrap button:where(.pf-value):hover .wd-swatch.wd-bg {
	opacity: .5;
}

[class*="wd-swatches"].wd-bg-style-1 .wd-swatch-wrap button:where(.pf-value):hover .wd-swatch.wd-bg:after,
[class*="wd-swatches"].wd-text-style-1 .wd-swatch-wrap button:where(.pf-value):hover .wd-swatch.wd-text:after,
[class*="wd-swatches"].wd-bg-style-4 .wd-swatch-wrap button:where(.pf-value):hover .wd-swatch.wd-bg:after {
	opacity: 1;
}

[class*="wd-swatches"].wd-text-style-4 .wd-swatch-wrap button:where(.pf-value):hover .wd-swatch.wd-text {
	border-color: var(--color-gray-900);
	background-color: var(--color-gray-900);
	color: var(--color-white);
}

/* ---------- Active filter chips ---------- */

.wd-active-filters button {
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-align: inherit;
	text-transform: none;
	gap: normal;
	transition: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

:where(.wd-active-filters) .wd-action-btn > button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

:where(.wd-active-filters) .wd-action-btn.wd-style-text > button {
	font-weight: 600;
}

:where(.wd-active-filters) .wd-action-btn.wd-style-text > button:hover .wd-action-text {
	color: var(--wd-action-text-color-hover);
}

:where(.wd-active-filters) .wd-action-btn > button:hover .wd-action-icon:before {
	color: var(--wd-action-icon-color-hover);
}

.widget_layered_nav_filters button {
	display: inline-flex;
	align-items: center;
	color: var(--color-gray-800);
	font-weight: 600;
	line-height: 2;
}

.widget_layered_nav_filters button:hover {
	color: var(--color-gray-500);
}

.widget_layered_nav_filters button:before {
	margin-inline-end: .3em;
	font-weight: 400;
	content: "\f112";
	font-family: "woodmart-font";
}

.widget_layered_nav_filters button .amount {
	margin-inline-start: 3px;
}

/* ---------- Loading ---------- */

.ag-pf-loading .elementor-widget-loop-grid,
.ag-pf-loading .elementor-widget-wd_product_filters {
	opacity: .5;
	pointer-events: none;
	transition: opacity .2s;
}
