/* Preserve the theme's link appearance after filter anchors become buttons. */
[data-cloz-archive-state] {
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	line-height: inherit;
	text-align: inherit;
	cursor: pointer;
}

[data-cloz-archive-state]:hover,
[data-cloz-archive-state]:focus-visible {
	background: transparent;
	color: inherit;
}

.widget.woocommerce button[data-cloz-archive-state]:not(.bijan_filter) {
	display: flex;
	align-items: center;
	gap: 8px;
	position: relative;
	color: var(--text-300);
	font-size: .875rem;
	justify-content: flex-start;
}

.widget.woocommerce button[data-cloz-archive-state]:not(.bijan_filter)::before {
	content: "";
	width: 24px;
	height: 24px;
	flex: 0 0 24px;
	border: 1px solid #d9d9d9;
	border-radius: 6px;
	background: transparent;
}

.widget.woocommerce .chosen > button[data-cloz-archive-state]:not(.bijan_filter)::before {
	border-color: var(--primary-100);
	background: var(--primary-100);
}

.widget.woocommerce .chosen > button[data-cloz-archive-state]:not(.bijan_filter)::after {
	content: "\e03e";
	position: absolute;
	inset-inline-start: 0;
	color: #fff;
	font-family: Bijan, sans-serif !important;
	font-size: .75rem;
	transform: translateX(-50%);
}

.cloz-archive-is-loading .entry-container {
	opacity: .52;
	pointer-events: none;
	transition: opacity .16s ease;
}

.cloz-archive-is-loading #sort-wrap,
.cloz-archive-is-loading #sidebar.sidebar-shop form[role="search"],
.cloz-archive-is-loading #sidebar.sidebar-shop .cloz-filter-widgets,
.cloz-archive-is-loading #sidebar.sidebar-shop .cloz-filter-reset {
	pointer-events: none;
}

/* Archive discovery area: one compact, predictable flow before the products. */
body.woocommerce.archive .woocommerce-products-header {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 8px;
	align-items: start;
	width: 100%;
	margin-block: 8px 4px;
	box-sizing: border-box;
}

body.woocommerce.archive .woocommerce-products-header > .section-title-wrap {
	grid-column: 1;
	grid-row: 1;
	min-width: 0;
}

body.woocommerce.archive .woocommerce-products-header > #sort-wrap {
	grid-column: 1;
	grid-row: 3;
}

body.woocommerce.archive #sort-wrap {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	min-width: 0;
	min-height: 34px;
	padding-block: 2px;
	overflow-x: auto;
	overflow-y: hidden;
	color: var(--text-200, #4e5364);
	font-size: .8rem;
	scrollbar-width: none;
}

body.woocommerce.archive #sort-wrap::-webkit-scrollbar { display: none; }
body.woocommerce.archive #sort-wrap #sort-label { display: flex; flex: 0 0 auto; }
body.woocommerce.archive #sort-wrap .sort-item { display: block; flex: 0 0 auto; padding-bottom: 4px; white-space: nowrap; }
body.woocommerce.archive #sort-wrap .sort-item-active::after { bottom: 0; height: 3px; }

body.woocommerce.archive #sort-wrap select.orderby {
	display: none !important;
}

body.woocommerce.archive #primary.content-area {
	display: flex !important;
	flex-direction: column !important;
	gap: 6px;
	width: 100%;
	margin: 0 !important;
}

body.woocommerce.archive #primary.content-area > #sidebar.sidebar-shop,
body.woocommerce.archive #primary.content-area > .entry-container {
	width: 100% !important;
	max-width: 100% !important;
	flex: 0 0 100% !important;
}

body.woocommerce.archive #primary.content-area > #sidebar.sidebar-shop {
	order: 1;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

body.woocommerce.archive #primary.content-area > .entry-container {
	order: 2;
}

.woocommerce-products-header .cloz-category-intro-section {
	grid-column: 1 / -1;
	grid-row: 2;
	width: 100%;
	margin: 0;
}

.cloz-category-intro-text {
	width: 100%;
	margin: 0;
	padding: 0 2px;
	border: 0;
	border-radius: 0;
	box-sizing: border-box;
	background: transparent;
	color: var(--text-300, #475569);
}

.cloz-category-intro-content {
	max-inline-size: none;
	width: 100%;
	padding: 0;
	color: inherit;
	font-size: .875rem;
	line-height: 1.85;
}

.cloz-category-intro-content p { margin: 0; }
.cloz-category-intro-content p + p { margin-top: 7px; }

.cloz-subcategories-grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 12px;
}

.cloz-subcat-card {
	display: grid;
	grid-template-columns: 76px minmax(0, 1fr);
	align-items: center;
	min-width: 0;
	border: 1px solid #e7eaf0;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 3px 12px rgba(20, 28, 40, .04);
	overflow: hidden;
	transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.cloz-subcat-card:hover {
	border-color: color-mix(in srgb, var(--primary-100) 35%, #e7eaf0);
	box-shadow: 0 8px 22px rgba(20, 28, 40, .08);
	transform: translateY(-2px);
}

.cloz-subcat-image-wrapper {
	display: grid;
	place-items: center;
	width: 76px;
	height: 76px;
	background: var(--gray-600, #f5f6f8);
	overflow: hidden;
}

.cloz-subcat-image {
	width: 100%;
	height: 100%;
	margin: 0 !important;
	object-fit: contain;
	transition: transform .2s ease;
}

.cloz-subcat-card:hover .cloz-subcat-image { transform: scale(1.04); }
.cloz-subcat-title {
	padding: 8px 10px;
	color: var(--text-200, #28323f);
	font-size: .78rem;
	font-weight: 650;
	line-height: 1.55;
	text-align: start;
}

.cloz-filter-shell { position: relative; }
.cloz-filter-trigger {
	display: grid;
	grid-template-columns: 36px minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 54px;
	padding: 7px 12px;
	border: 1px solid #dfe4ea;
	border-radius: 13px;
	background: #fff;
	box-shadow: none;
	color: var(--text-100, #222c38);
	font-family: inherit;
	text-align: start;
	cursor: pointer;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.cloz-filter-trigger:hover,
.cloz-filter-trigger:focus-visible,
.cloz-filter-trigger[aria-expanded="true"] {
	border-color: color-mix(in srgb, var(--primary-100) 55%, #dfe4ea);
	background: color-mix(in srgb, var(--primary-100) 2.5%, #fff);
}

.cloz-filter-trigger:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary-100) 18%, transparent); outline-offset: 2px; }
.cloz-filter-trigger-icon {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: color-mix(in srgb, var(--primary-100) 10%, #fff);
	color: var(--primary-100);
}

.cloz-filter-trigger-icon svg,
.cloz-filter-trigger-chevron svg {
	width: 20px;
	height: 20px;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.cloz-filter-trigger-copy { display: grid; gap: 2px; }
.cloz-filter-trigger-copy strong { font-size: .86rem; line-height: 1.5; }
.cloz-filter-trigger-copy small { color: var(--text-400, #77808d); font-size: .68rem; line-height: 1.5; }
.cloz-filter-count {
	display: grid;
	place-items: center;
	min-width: 27px;
	height: 27px;
	padding-inline: 6px;
	border-radius: 20px;
	box-sizing: border-box;
	background: color-mix(in srgb, var(--primary-100) 11%, #fff);
	color: var(--primary-100);
	font-size: .75rem;
	font-weight: 800;
}

.cloz-filter-trigger-chevron { display: grid; place-items: center; color: var(--text-400, #77808d); transition: transform .2s ease; }
.cloz-filter-trigger[aria-expanded="true"] .cloz-filter-trigger-chevron { transform: rotate(180deg); }
.cloz-filter-panel[hidden] { display: none !important; }
.cloz-filter-panel {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
	margin-top: 6px;
	padding: 14px;
	border: 1px solid #e1e6ec;
	border-radius: 13px;
	background: #fff;
	box-shadow: 0 8px 22px rgba(20, 28, 40, .055);
	animation: cloz-filter-expand .16s ease-out;
}

@keyframes cloz-filter-expand {
	from { opacity: 0; transform: translateY(-5px); }
	to { opacity: 1; transform: translateY(0); }
}

.cloz-filter-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 12px;
	min-width: 0;
}

.cloz-filter-widgets > .widget {
	margin: 0 !important;
	padding: 14px !important;
	border: 1px solid #edf0f3;
	border-radius: 14px;
	background: #fbfcfd;
}

.cloz-filter-widgets .widgettitle { margin: 0 0 10px !important; color: var(--text-100, #222c38); font-size: .82rem !important; font-weight: 750; }
.cloz-filter-panel-foot { grid-column: 1 / -1; display: flex; justify-content: flex-start; gap: 8px; padding-bottom: 11px; border-bottom: 1px solid #eef0f3; }
.cloz-filter-panel-foot button { min-width: 126px; min-height: 40px; padding: 7px 16px; border-radius: 10px; font-family: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; }
.cloz-filter-reset { border: 1px solid #dde2e8; background: #fff; color: var(--text-300, #586270); }
.cloz-filter-reset:disabled { opacity: .42; cursor: default; }
.cloz-filter-done { border: 1px solid var(--primary-100); background: var(--primary-100); color: #fff; }

@media (max-width: 1100px) {
	.cloz-subcategories-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.cloz-filter-panel-foot { grid-column: 1; }
}

@media (max-width: 768px) {
	body.woocommerce.archive .woocommerce-products-header {
		grid-template-columns: minmax(0, 1fr);
		gap: 6px;
		margin-block: 5px 2px;
	}
	body.woocommerce.archive .woocommerce-products-header > .section-title-wrap { grid-column: 1; grid-row: 1; }
	body.woocommerce.archive .woocommerce-products-header .cloz-category-intro-section { grid-column: 1; grid-row: 2; }
	body.woocommerce.archive .woocommerce-products-header > #sort-wrap { grid-column: 1; grid-row: 3; }
	body.woocommerce.archive #sort-wrap { display: flex; gap: 12px; min-height: 32px; padding-bottom: 2px; }
	body.woocommerce.archive #sort-wrap select.orderby { display: none !important; }
	.cloz-category-intro-text { margin-bottom: 0; padding: 0 1px; }
	.cloz-category-intro-content { font-size: .78rem; line-height: 1.75; }
	.cloz-subcategories-grid {
		display: flex;
		gap: 9px;
		margin-inline: -20px;
		padding: 2px 20px 7px;
		overflow-x: auto;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
	}
	.cloz-subcategories-grid::-webkit-scrollbar { display: none; }
	.cloz-subcat-card { flex: 0 0 132px; grid-template-columns: 48px minmax(0, 1fr); min-height: 58px; border-radius: 12px; scroll-snap-align: start; }
	.cloz-subcat-image-wrapper { width: 48px; height: 58px; }
	.cloz-subcat-title { padding: 6px 7px; font-size: .7rem; line-height: 1.5; }
	body.woocommerce.archive #primary.content-area { gap: 5px; }
	body.woocommerce.archive #primary.content-area > #sidebar.sidebar-shop {
		position: static !important;
		top: auto !important;
		z-index: auto;
	}
	.cloz-filter-trigger { min-height: 52px; padding: 7px 10px; border-radius: 12px; }
	.cloz-filter-trigger-icon { width: 34px; height: 34px; border-radius: 9px; }
	.cloz-filter-trigger-copy strong { font-size: .8rem; }
	.cloz-filter-trigger-copy small { font-size: .63rem; }
	.cloz-filter-panel {
		position: static;
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		gap: 10px;
		width: 100%;
		max-height: none;
		margin-top: 5px;
		padding: 12px;
		border: 1px solid #e1e6ec;
		border-radius: 12px;
		box-sizing: border-box;
		box-shadow: 0 7px 20px rgba(20, 28, 40, .05);
		overflow: visible;
	}
	.cloz-filter-widgets { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 0; overflow: visible; }
	.cloz-filter-widgets > .widget { padding: 12px !important; }
	.cloz-filter-panel-foot { position: static; display: grid; grid-template-columns: 1fr 1fr; padding: 0 0 10px; border-top: 0; border-bottom: 1px solid #e9edf2; background: transparent; box-shadow: none; }
	.cloz-filter-panel-foot button { min-width: 0; width: 100%; }


}

@media (prefers-reduced-motion: reduce) {
	.cloz-archive-is-loading .entry-container {
		transition: none;
	}
	.cloz-filter-panel,
	.cloz-filter-trigger-chevron { transition: none; }
	.cloz-filter-panel { animation: none; }
}
