/* ================================================================
 * Haika Base — Shop Filter Sidebar & Bar
 * ----------------------------------------------------------------
 * استایل سایدبار فیلتر و filter-bar بالای محصولات.
 * ================================================================ */

/* ─── Filter Bar ─── */
.haika-filter-bar {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	background: var(--hk-shop-card-bg);
	border: 1px solid var(--hk-shop-card-border);
	border-radius: var(--hk-shop-radius);
	margin-bottom: var(--hk-shop-gap);
}
.haika-filter-bar__left {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}
.haika-filter-bar__count {
	font-size: 13px;
	color: var(--hk-shop-text-muted);
}
.haika-filter-bar__count strong {
	color: var(--hk-fg, #fff);
	margin: 0 3px;
}
.haika-filter-bar__right {
	display: flex;
	align-items: center;
	gap: 10px;
}

.haika-filter-toggle {
	display: none;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	border-radius: 8px;
	border: 1px solid var(--hk-shop-card-border);
	background: transparent;
	color: var(--hk-fg, #fff);
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	font-family: inherit;
}
.haika-filter-toggle:hover {
	border-color: var(--hk-accent, #6aaecc);
	color: var(--hk-accent, #6aaecc);
}
@media (max-width: 960px) {
	.haika-filter-toggle { display: inline-flex; }
}

.haika-orderby {
	padding: 7px 28px 7px 12px;
	border-radius: 8px;
	border: 1px solid var(--hk-shop-card-border);
	background: transparent;
	color: var(--hk-fg, #fff);
	font-size: 13px;
	font-family: inherit;
	cursor: pointer;
	min-width: 160px;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 8px center;
}
[dir="ltr"] .haika-orderby { background-position: right 8px center; padding: 7px 12px 7px 28px; }
.haika-orderby:focus { outline: 2px solid var(--hk-accent, #6aaecc); outline-offset: 2px; }
.haika-orderby option { background: var(--hk-bg, #0d1117); color: var(--hk-fg, #fff); }

/* ─── Active filters row ─── */
.haika-filter-bar__active {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	padding-top: 10px;
	margin-top: 4px;
	border-top: 1px dashed var(--hk-shop-card-border);
}
.haika-active-label {
	font-size: 12px;
	color: var(--hk-shop-text-muted);
	margin-inline-end: 4px;
}
.haika-active-filter {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 8px 4px 10px;
	background: var(--hk-accent, #6aaecc);
	color: #fff;
	border-radius: 999px;
	font-size: 11.5px;
	text-decoration: none;
	transition: background .15s;
}
.haika-active-filter:hover { background: var(--hk-accent-hover, #5e9ebb); }
.haika-clear-all {
	font-size: 11.5px;
	color: var(--hk-shop-text-muted);
	text-decoration: underline;
	margin-inline-start: 4px;
}
.haika-clear-all:hover { color: #ef4444; }

/* ─── Sidebar ─── */
.haika-filter-sidebar {
	background: var(--hk-shop-card-bg);
	border: 1px solid var(--hk-shop-card-border);
	border-radius: var(--hk-shop-radius);
	padding: 16px 16px 20px;
	position: sticky;
	top: 20px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
}
.haika-filter-sidebar__header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--hk-shop-card-border);
}
.haika-filter-sidebar__header h3 {
	margin: 0;
	font-size: 15px;
	color: var(--hk-fg, #fff);
}
.haika-filter-sidebar__close {
	display: none;
	background: transparent;
	border: 0;
	color: var(--hk-shop-text-muted);
	cursor: pointer;
	padding: 4px;
}
@media (max-width: 960px) {
	.haika-filter-sidebar__close { display: inline-flex; }
	.haika-filter-sidebar {
		position: fixed;
		top: 0;
		inset-inline-start: -100%;
		max-width: 320px;
		width: 100%;
		height: 100vh;
		max-height: 100vh;
		z-index: 10000;
		border-radius: 0;
		transition: inset-inline-start .25s ease;
		box-shadow: 0 0 32px rgba(0,0,0,.4);
	}
	.haika-filter-sidebar.is-open { inset-inline-start: 0; }
}

.haika-filter-group {
	margin-bottom: 18px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--hk-shop-card-border);
}
.haika-filter-group:last-of-type { border-bottom: 0; }
.haika-filter-group__title {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 700;
	color: var(--hk-fg, #fff);
}
.haika-filter-list,
.haika-filter-quick {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

/* checkbox/radio styles */
.haika-check {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 10px;
	border-radius: 8px;
	cursor: pointer;
	transition: background .15s;
	font-size: 13px;
	color: var(--hk-fg, #fff);
}
.haika-check:hover { background: var(--hk-shop-card-border); }
.haika-check.is-active {
	background: rgba(106, 174, 204, 0.12);
	color: var(--hk-accent, #6aaecc);
	font-weight: 600;
}
.haika-check input[type="checkbox"],
.haika-check input[type="radio"] {
	width: 16px;
	height: 16px;
	cursor: pointer;
	accent-color: var(--hk-accent, #6aaecc);
}
.haika-check__icon { font-size: 14px; }
.haika-check__label { flex: 1; }
.haika-check__count {
	font-size: 11px;
	color: var(--hk-shop-text-muted);
}

/* price range */
.haika-filter-price {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.haika-filter-price label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 12px;
	color: var(--hk-shop-text-muted);
}
.haika-filter-price input {
	width: 100%;
	padding: 7px 10px;
	border-radius: 8px;
	border: 1px solid var(--hk-shop-card-border);
	background: transparent;
	color: var(--hk-fg, #fff);
	font-family: inherit;
	font-size: 13px;
}
.haika-filter-price input:focus {
	outline: 2px solid var(--hk-accent, #6aaecc);
	outline-offset: 1px;
}

/* actions */
.haika-filter-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 14px;
}

/* mobile backdrop */
.haika-filter-backdrop {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.5);
	z-index: 9999;
	opacity: 0;
	transition: opacity .25s;
}
.haika-filter-backdrop.is-open {
	display: block;
	opacity: 1;
}

/* ─── Loading state ─── */
.haika-products.is-loading {
	opacity: .5;
	pointer-events: none;
	position: relative;
}
.haika-products.is-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	background: repeating-linear-gradient(45deg,
		transparent,
		transparent 10px,
		rgba(255,255,255,0.02) 10px,
		rgba(255,255,255,0.02) 20px
	);
	pointer-events: none;
}
