/**
 * Il Tucano Pet – shop sidebar filters
 * Lives in a plugin so WoodMart updates cannot wipe it.
 */

:root {
	--iltf-red: #cf303c;
	--iltf-red-dark: #b52631;
	--iltf-ink: #1c1c1c;
	--iltf-muted: #6f6f6f;
	--iltf-line: #ececec;
	--iltf-bg: #f7f7f8;
	--iltf-card: #ffffff;
	--iltf-radius: 16px;
	--iltf-shadow: 0 10px 28px rgba(28, 28, 28, 0.06);
}

.wd-sidebar .sidebar-widget,
.widget-area .sidebar-widget,
.widget_filter_by_brand,
.woodmart-woocommerce-layered-nav,
.woocommerce-widget-layered-nav,
.widget_layered_nav,
.widget_price_filter,
.wd-sidebar .widget_block {
	background: var(--iltf-card);
	border: 1px solid var(--iltf-line);
	border-radius: var(--iltf-radius);
	box-shadow: var(--iltf-shadow);
	padding: 18px 16px 16px;
	margin: 0 0 16px;
}

.wd-sidebar .widget-title,
.widget-area .widget-title,
.wd-sidebar .wp-block-heading {
	font-size: 12px !important;
	font-weight: 800 !important;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--iltf-ink);
	margin: 0 0 14px !important;
	padding: 0 0 10px !important;
	border-bottom: 1px solid var(--iltf-line);
	position: relative;
}

.wd-sidebar .widget-title::after,
.widget-area .widget-title::after,
.wd-sidebar .wp-block-heading::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 42px;
	height: 3px;
	border-radius: 3px;
	background: linear-gradient(90deg, var(--iltf-red), #f3a3a9);
}

/* Hide empty WooCommerce block filters that never hydrate */
.wd-sidebar .widget_block:has(.wp-block-woocommerce-filter-wrapper[data-filter-type="attribute-filter"]),
.wd-sidebar .widget_block:has(.wp-block-woocommerce-filter-wrapper[data-filter-type="rating-filter"]),
.wd-sidebar .widget_block:has(.wp-block-woocommerce-price-filter.is-loading),
.wd-sidebar .wp-block-woocommerce-filter-wrapper[data-filter-type="attribute-filter"],
.wd-sidebar .wp-block-woocommerce-filter-wrapper[data-filter-type="rating-filter"] {
	display: none !important;
}

/* ------------------------------------------------------------------
   Brand checkboxes (Perfect WooCommerce Brands)
------------------------------------------------------------------- */
.ilt-brand-search-wrap {
	position: relative;
	display: block;
	width: 100%;
	margin: 0 0 12px;
}

.ilt-brand-search-wrap .ilt-brand-search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	width: 15px;
	height: 15px;
	transform: translateY(-50%);
	pointer-events: none;
	color: #8d8d8d;
}

.widget_filter_by_brand input.ilt-brand-search,
.pwb-filter-products input.ilt-brand-search {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	height: 40px !important;
	min-height: 40px !important;
	margin: 0 !important;
	padding: 0 12px 0 36px !important;
	box-sizing: border-box !important;
	border: 1px solid #e4e4e4 !important;
	border-radius: 10px !important;
	background: #f5f5f6 !important;
	background-image: none !important;
	color: var(--iltf-ink) !important;
	font-size: 13px !important;
	line-height: 40px !important;
	box-shadow: none !important;
	outline: none !important;
	appearance: none !important;
	-webkit-appearance: none !important;
}

.widget_filter_by_brand input.ilt-brand-search:hover,
.pwb-filter-products input.ilt-brand-search:hover {
	border-color: #d5d5d5 !important;
}

.widget_filter_by_brand input.ilt-brand-search:focus,
.pwb-filter-products input.ilt-brand-search:focus {
	border-color: #cfcfcf !important;
	background: #fff !important;
	box-shadow: none !important;
	outline: none !important;
}

.widget_filter_by_brand input.ilt-brand-search::placeholder,
.pwb-filter-products input.ilt-brand-search::placeholder {
	color: #9a9a9a !important;
	opacity: 1;
}

.widget_filter_by_brand input.ilt-brand-search::-webkit-search-decoration,
.widget_filter_by_brand input.ilt-brand-search::-webkit-search-cancel-button,
.pwb-filter-products input.ilt-brand-search::-webkit-search-decoration,
.pwb-filter-products input.ilt-brand-search::-webkit-search-cancel-button {
	-webkit-appearance: none;
	display: none;
}

.pwb-filter-products ul,
.widget_filter_by_brand ul {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 340px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #d8d8d8 transparent;
}

.pwb-filter-products ul::-webkit-scrollbar {
	width: 6px;
}

.pwb-filter-products ul::-webkit-scrollbar-thumb {
	background: #d8d8d8;
	border-radius: 99px;
}

.widget_filter_by_brand li {
	margin: 0 0 2px !important;
	padding: 0 !important;
	list-style: none !important;
}

.widget_filter_by_brand label {
	display: flex !important;
	align-items: center;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 8px 10px;
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.15s ease;
	font-size: 14px;
	font-weight: 500;
	color: var(--iltf-ink);
	line-height: 1.2;
}

.widget_filter_by_brand label:hover {
	background: #fff5f6;
}

.widget_filter_by_brand input[type="checkbox"] {
	appearance: none !important;
	-webkit-appearance: none !important;
	flex: 0 0 20px;
	width: 20px !important;
	height: 20px !important;
	margin: 0 !important;
	border: 2px solid #d2d2d2 !important;
	border-radius: 6px !important;
	background: #fff !important;
	background-image: none !important;
	box-shadow: none !important;
	cursor: pointer;
	position: relative;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.widget_filter_by_brand input[type="checkbox"]:hover {
	border-color: var(--iltf-red);
}

.widget_filter_by_brand input[type="checkbox"]:checked {
	background-color: var(--iltf-red) !important;
	border-color: var(--iltf-red) !important;
}

.widget_filter_by_brand input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 6px;
	height: 11px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.widget_filter_by_brand label:has(input:checked) {
	background: #fff5f6;
	font-weight: 700;
}

.pwb-apply-filter,
.widget_filter_by_brand button,
.widget_layered_nav button,
.woocommerce-widget-layered-nav button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 100% !important;
	min-height: 44px;
	margin-top: 12px;
	padding: 10px 16px !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: var(--iltf-red) !important;
	color: #fff !important;
	font-size: 12px !important;
	font-weight: 800 !important;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: 0 8px 18px rgba(207, 48, 60, 0.22);
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.pwb-apply-filter:hover,
.widget_filter_by_brand button:hover {
	background: var(--iltf-red-dark) !important;
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(207, 48, 60, 0.28);
}

/* ------------------------------------------------------------------
   Attribute / weight filters
------------------------------------------------------------------- */
.wd-filter-list,
.woocommerce-widget-layered-nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 320px;
	overflow-y: auto;
}

.wd-filter-list li,
.woocommerce-widget-layered-nav-list li {
	display: block !important;
	position: relative;
	width: 100%;
	margin: 0 0 6px !important;
	padding: 0 !important;
	background: transparent !important;
}

.wd-filter-list .layered-nav-link,
.woocommerce-widget-layered-nav-list a {
	display: flex !important;
	align-items: center;
	width: 100% !important;
	box-sizing: border-box;
	min-height: 40px;
	padding: 8px 46px 8px 12px !important;
	border-radius: 12px;
	background: var(--iltf-bg);
	border: 1px solid transparent;
	color: var(--iltf-ink) !important;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none !important;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wd-filter-list .layered-nav-link:hover,
.woocommerce-widget-layered-nav-list a:hover {
	background: #fff5f6;
	border-color: #f3c5c9;
	color: var(--iltf-red) !important;
}

.wd-filter-list li.chosen .layered-nav-link,
.woocommerce-widget-layered-nav-list li.chosen a {
	background: #fff5f6;
	border-color: var(--iltf-red);
	color: var(--iltf-red) !important;
}

.wd-filter-list .wd-filter-lable,
.wd-filter-list .layer-term-lable {
	background: none !important;
	padding: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
}

.wd-filter-list .count,
.woocommerce-widget-layered-nav-list .count {
	flex: 0 0 auto;
	min-width: 28px;
	height: 22px;
	margin-left: -36px;
	margin-right: 10px;
	padding: 0 7px;
	border-radius: 999px;
	background: #fff;
	border: 1px solid var(--iltf-line);
	color: var(--iltf-muted);
	font-size: 11px;
	font-weight: 800;
	line-height: 20px;
	text-align: center;
	position: relative;
	z-index: 1;
	pointer-events: none;
}

.wd-filter-list li.chosen .count {
	background: var(--iltf-red);
	border-color: var(--iltf-red);
	color: #fff;
}

/* Count sits inside the chip: rebuild as overlay on the row */
.wd-filter-list li,
.woocommerce-widget-layered-nav-list li {
	position: relative;
}

.wd-filter-list .count,
.woocommerce-widget-layered-nav-list .count {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	margin: 0;
}

.wd-filter-list .layered-nav-link,
.woocommerce-widget-layered-nav-list a {
	padding-right: 46px !important;
}

/* ------------------------------------------------------------------
   Price filter (when it actually renders)
------------------------------------------------------------------- */
.wd-sidebar .wc-block-components-price-slider,
.widget_price_filter .price_slider_wrapper {
	padding-top: 4px;
}

.wd-sidebar .wc-block-components-price-slider input[type="text"],
.widget_price_filter input[type="text"] {
	border-radius: 10px !important;
	border: 1px solid var(--iltf-line) !important;
}

/* Off-canvas mobile sidebar */
@media (max-width: 1024px) {
	.wd-sidebar .sidebar-widget,
	.widget_filter_by_brand,
	.woodmart-woocommerce-layered-nav {
		box-shadow: none;
	}
}
