/* =============================================
   SIB Product Filters — Brand-matched UI
   ============================================= */

.sib-filters {
	font-family: inherit;
	font-size: 14px;
}

/*
 * Reset theme's global button styles (styles.css applies bg, radius, padding to all <button>).
 * All .sib-filters buttons need explicit overrides.
 */
.sib-filters button:not(.sib-color-swatch) {
	background: none !important;
	background-color: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	padding: 0 !important;
	color: inherit !important;
	font-size: inherit !important;
	line-height: inherit !important;
	text-transform: none !important;
	gap: 0 !important;
	justify-content: flex-start !important;
	min-height: 0 !important;
}

/* Color swatch button reset — preserve inline background-color */
.sib-filters .sib-color-swatch {
	text-transform: none !important;
	line-height: 1 !important;
	min-height: 0 !important;
	justify-content: center !important;
}

/* ── Active filter chips ────────────────────── */
.sib-filter-chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--line, #e9e9e9);
}

.sib-filter-chips-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.sib-filter-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	font-size: 13px;
	font-weight: 500;
	color: #333 !important;
	background: #f5f5f5 !important;
	border: 1px solid #e0e0e0 !important;
	border-radius: 20px !important;
}

.sib-filter-chip button {
	cursor: pointer;
	font-size: 14px !important;
	line-height: 1 !important;
	color: #888 !important;
	padding: 0 0 0 2px !important;
}

.sib-filter-chip button:hover {
	color: var(--critical, #f03e3e) !important;
}

.sib-filters .sib-filter-clear-all {
	cursor: pointer;
	font-size: 13px !important;
	font-weight: 600 !important;
	color: var(--critical, #f03e3e) !important;
	margin-left: 8px;
}

.sib-filter-clear-all:hover {
	text-decoration: underline;
}

/* ── Filter sections ────────────────────────── */
.sib-filter-section {
	border-bottom: 1px solid var(--line, #e9e9e9);
	padding: 0 0 4px;
}

.sib-filter-section:last-child {
	border-bottom: none;
}

.sib-filters button.sib-filter-toggle {
	display: flex !important;
	justify-content: space-between !important;
	align-items: center !important;
	width: 100%;
	padding: 14px 0 !important;
	cursor: pointer;
	font-size: 16px !important;
	font-weight: 600 !important;
	color: #222 !important;
	text-align: left;
}

.sib-filter-toggle:hover {
	color: #000 !important;
}

.sib-filter-chevron {
	transition: transform 0.2s ease;
}

.sib-filter-toggle[aria-expanded="false"] .sib-filter-chevron {
	transform: rotate(-90deg);
}

.sib-filter-body {
	padding: 0 0 14px;
}

/* ── Filter search input ──────────────────────── */
.sib-filter-search {
	margin-bottom: 8px;
}

.sib-filter-search-input {
	border: none;
	border-bottom: 1px solid #e0e0e0;
	outline: none;
	font-size: 13px;
	color: #444;
	width: 100%;
	background: transparent;
	padding: 4px 0;
	line-height: 1.4;
}

.sib-filter-search-input::placeholder {
	color: #aaa;
	font-size: 12px;
}

/* ── Collapsible list + Show More ─────────────── */
.sib-collapsible-list li.sib-hidden {
	display: none;
}

.sib-collapsible-list li.sib-search-hidden {
	display: none;
}

.sib-filters .sib-filter-show-more {
	display: inline-block;
	font-size: 13px !important;
	font-weight: 600 !important;
	color: #1a73e8 !important;
	cursor: pointer;
	margin-top: 6px;
	padding: 2px 0 !important;
}

.sib-filter-show-more:hover {
	text-decoration: underline;
}

/* ── Checkbox / radio list ──────────────────── */
.sib-filter-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sib-filter-list li {
	margin-bottom: 6px;
}

.sib-filter-list label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 15px;
	color: #444;
	padding: 4px 0;
}

.sib-filter-list label:hover {
	color: #000;
}

/* Hide native checkbox/radio */
.sib-filter-list input[type="checkbox"],
.sib-filter-list input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

/* Custom checkbox */
.sib-filter-checkbox {
	width: 16px;
	height: 16px;
	border: 2px solid #ccc;
	border-radius: 3px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: all 0.15s;
}

.sib-filter-list input[type="checkbox"]:checked + .sib-filter-checkbox {
	background: var(--main, #d3e061);
	border-color: var(--main, #d3e061);
}

.sib-filter-list input[type="checkbox"]:checked + .sib-filter-checkbox::after {
	content: '';
	display: block;
	width: 10px;
	height: 10px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") no-repeat center/contain;
}

.sib-filter-label {
	flex: 1;
}

.sib-filter-count {
	color: #aaa;
	font-size: 13px;
}

/* ── Customer Ratings (Amazon-style) ──────────── */
.sib-rating-list li {
	margin-bottom: 2px;
}

.sib-rating-list label {
	gap: 8px;
	padding: 4px 0;
	cursor: pointer;
}

.sib-rating-list label:hover {
	color: #000;
}

.sib-rating-list .sib-filter-label {
	font-size: 15px;
	color: #444;
}

.sib-rating-list input[type="checkbox"]:checked ~ .sib-filter-label {
	font-weight: 600;
	color: #222;
}

/* ── Color swatches ─────────────────────────── */
.sib-color-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	overflow: visible;
	padding: 4px;
}

.sib-filters .sib-color-swatch {
	width: 36px !important;
	height: 36px !important;
	border-radius: 50% !important;
	border: 2.5px solid rgba(0,0,0,0.08) !important;
	cursor: pointer;
	position: relative;
	transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
	padding: 0 !important;
	gap: 0 !important;
	box-shadow: 0 2px 6px rgba(0,0,0,0.1), inset 0 -1px 3px rgba(0,0,0,0.06);
}

.sib-color-swatch:hover {
	transform: scale(1.12);
	border-color: rgba(0,0,0,0.2) !important;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15), inset 0 -1px 3px rgba(0,0,0,0.06);
}

.sib-color-swatch.active {
	border-color: #222 !important;
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #222;
}

.sib-color-check {
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: #fff;
	filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
	pointer-events: none;
}

.sib-color-swatch.active .sib-color-check {
	display: block;
}

/* ── Price slider (dual range) ──────────────── */
.sib-price-slider {
	padding: 0 4px;
}

.sib-price-track {
	position: relative;
	height: 6px;
	background: #e0e0e0;
	border-radius: 3px;
	margin: 20px 0 12px;
}

.sib-price-range {
	position: absolute;
	height: 100%;
	background: var(--main, #d3e061);
	border-radius: 3px;
	left: 0;
	right: 0;
}

.sib-price-track input[type="range"] {
	position: absolute;
	width: 100%;
	top: -6px;
	height: 18px;
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
	pointer-events: none;
	margin: 0;
}

.sib-price-track input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 18px;
	height: 18px;
	background: #fff;
	border: 2px solid #222;
	border-radius: 50%;
	cursor: pointer;
	pointer-events: all;
	box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.sib-price-track input[type="range"]::-moz-range-thumb {
	width: 18px;
	height: 18px;
	background: #fff;
	border: 2px solid #222;
	border-radius: 50%;
	cursor: pointer;
	pointer-events: all;
	box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.sib-price-values {
	display: flex;
	justify-content: space-between;
	font-size: 14px;
	font-weight: 600;
	color: #333;
}

/* ── No products ────────────────────────────── */
.sib-no-products {
	text-align: center;
	padding: 60px 20px;
	color: #888;
	font-size: 15px;
}

/* ── Animations ────────────────────────────── */
@keyframes sibFadeIn {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes sibChipIn {
	from { opacity: 0; transform: scale(0.8); }
	to { opacity: 1; transform: scale(1); }
}

@keyframes sibCheckPop {
	0% { transform: scale(0); }
	60% { transform: scale(1.2); }
	100% { transform: scale(1); }
}

/* Filter body expand/collapse */
.sib-filter-body {
	overflow: hidden;
	transition: max-height 0.25s ease, opacity 0.2s ease;
}

.sib-filter-toggle[aria-expanded="false"] + .sib-filter-body {
	max-height: 0 !important;
	opacity: 0;
	padding: 0 !important;
}

.sib-filter-toggle[aria-expanded="true"] + .sib-filter-body {
	max-height: 600px;
	opacity: 1;
	overflow: visible;
}

/* Chip appear */
.sib-filter-chip {
	animation: sibChipIn 0.2s ease;
}

/* Checkbox tick pop */
.sib-filter-list input[type="checkbox"]:checked + .sib-filter-checkbox {
	animation: sibCheckPop 0.2s ease;
}

/* Product grid fade-in after AJAX */
.sib-product-fade-in .product {
	animation: sibFadeIn 0.3s ease both;
}

.sib-product-fade-in .product:nth-child(1) { animation-delay: 0s; }
.sib-product-fade-in .product:nth-child(2) { animation-delay: 0.05s; }
.sib-product-fade-in .product:nth-child(3) { animation-delay: 0.1s; }
.sib-product-fade-in .product:nth-child(4) { animation-delay: 0.15s; }
.sib-product-fade-in .product:nth-child(5) { animation-delay: 0.2s; }
.sib-product-fade-in .product:nth-child(6) { animation-delay: 0.25s; }

/* Loading state */
.sib-loading {
	position: relative;
	pointer-events: none;
}

.sib-loading::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.6);
	z-index: 10;
}

/* ── Mobile responsive ──────────────────────── */
@media (max-width: 991px) {
	.sib-filter-section {
		padding: 0;
	}

	.sib-filters button.sib-filter-toggle {
		padding: 10px 0 !important;
		font-size: 15px !important;
	}

	.sib-filter-body {
		padding: 0 0 10px;
	}

	/* Mobile modal */
	.fiter-content-for-mobile {
		background: #fff;
		overflow-y: auto;
		flex: 1;
	}

	.fiter-content-for-mobile .sib-filters {
		padding: 0 20px 20px;
	}

	.fiter-content-for-mobile .sib-filter-section {
		padding: 0;
		border-bottom: 1px solid #eee;
	}

	.fiter-content-for-mobile .sib-filter-chips {
		margin-bottom: 12px;
		padding-bottom: 12px;
	}
}
