/* ============================================================
   Zetu Commerce – Product Filter & Filterable List
   ============================================================ */

/* ── CSS Variables ───────────────────────────────────────── */
.zc-filter,
.zc-product-list--filterable {
	--zc-f-primary: #003229;
	--zc-f-accent: #f8be5c;
	--zc-f-text: #1e293b;
	--zc-f-muted: #64748b;
	--zc-f-border: #e2e8f0;
	--zc-f-bg: #ffffff;
	--zc-f-bg-hover: #f8fafc;
	--zc-f-radius: 6px;
	--zc-f-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--zc-f-font-heading: 'Manrope', var(--zc-f-font);
}

/* ════════════════════════════════════════════════════════════
   FILTER PANEL
   ════════════════════════════════════════════════════════════ */
.zc-filter {
	font-family: var(--zc-f-font);
	background: var(--zc-f-bg);
	border: 1px solid var(--zc-f-border);
	border-radius: 12px;
	padding: 24px;
	position: sticky;
	top: 32px;
}

/* ── Mobile Toggle ───────────────────────────────────────── */
.zc-filter__mobile-toggle {
	display: none;
	width: 100%;
	padding: 14px 20px;
	background: var(--zc-f-primary);
	color: #fff;
	border: none;
	border-radius: var(--zc-f-radius);
	font-family: var(--zc-f-font-heading);
	font-weight: 700;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	cursor: pointer;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: opacity 0.2s ease;
}

.zc-filter__mobile-toggle:hover {
	opacity: 0.9;
}

.zc-filter__mobile-toggle svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.zc-filter__mobile-close {
	display: none;
}

/* ── Search ──────────────────────────────────────────────── */
.zc-filter__search {
	position: relative;
	margin-bottom: 20px;
}

.zc-filter__search-input {
	width: 100%;
	padding: 11px 14px 11px 40px;
	border: 1px solid var(--zc-f-border);
	border-radius: var(--zc-f-radius);
	font-size: 14px;
	font-family: var(--zc-f-font);
	color: var(--zc-f-text);
	background: var(--zc-f-bg);
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	box-sizing: border-box;
}

.zc-filter__search-input:focus {
	border-color: var(--zc-f-primary);
	box-shadow: 0 0 0 3px rgba(0, 50, 41, 0.08);
}

.zc-filter__search-input::placeholder {
	color: var(--zc-f-muted);
}

.zc-filter__search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--zc-f-muted);
	pointer-events: none;
	display: flex;
}

.zc-filter__search-icon svg {
	width: 18px;
	height: 18px;
}

/* ── Sort ────────────────────────────────────────────────── */
.zc-filter__sort {
	margin-bottom: 20px;
}

.zc-filter__sort-label {
	display: block;
	font-family: var(--zc-f-font-heading);
	font-weight: 700;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--zc-f-text);
	margin-bottom: 8px;
}

.zc-filter__sort-select {
	width: 100%;
	padding: 10px 36px 10px 12px;
	border: 1px solid var(--zc-f-border);
	border-radius: var(--zc-f-radius);
	font-size: 14px;
	font-family: var(--zc-f-font);
	color: var(--zc-f-text);
	background: var(--zc-f-bg);
	cursor: pointer;
	outline: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 16px;
	box-sizing: border-box;
	transition: border-color 0.2s ease;
}

.zc-filter__sort-select:focus {
	border-color: var(--zc-f-primary);
}

/* ── Filter Group ────────────────────────────────────────── */
.zc-filter__group {
	border-top: 1px solid var(--zc-f-border);
	padding-top: 16px;
	margin-top: 16px;
}

.zc-filter__group-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
	padding: 0;
	margin: 0;
	background: none;
	border: none;
	width: 100%;
	font-family: var(--zc-f-font-heading);
	font-weight: 700;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--zc-f-text);
	text-align: left;
}

.zc-filter__group-toggle {
	display: flex;
	color: var(--zc-f-muted);
	transition: transform 0.25s ease;
}

.zc-filter__group-toggle svg {
	width: 16px;
	height: 16px;
}

.zc-filter__group.is-collapsed .zc-filter__group-toggle {
	transform: rotate(-90deg);
}

.zc-filter__group-body {
	padding-top: 12px;
	overflow: hidden;
	transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
	max-height: 500px;
	opacity: 1;
}

.zc-filter__group.is-collapsed .zc-filter__group-body {
	max-height: 0;
	opacity: 0;
	padding-top: 0;
}

/* ── Options List (scrollable when many) ─────────────────── */
.zc-filter__options {
	max-height: 220px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--zc-f-border) transparent;
}

.zc-filter__options::-webkit-scrollbar {
	width: 4px;
}

.zc-filter__options::-webkit-scrollbar-thumb {
	background: var(--zc-f-border);
	border-radius: 4px;
}

/* ── Checkbox Option ─────────────────────────────────────── */
.zc-filter__option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 5px 0;
	cursor: pointer;
	font-size: 14px;
	color: var(--zc-f-text);
	transition: color 0.15s ease;
	line-height: 1.4;
}

.zc-filter__option:hover {
	color: var(--zc-f-primary);
}

.zc-filter__checkbox {
	width: 18px;
	height: 18px;
	min-width: 18px;
	border: 2px solid #cbd5e1;
	border-radius: 4px;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	position: relative;
	flex-shrink: 0;
	transition: all 0.15s ease;
	background: var(--zc-f-bg);
	margin: 0;
}

.zc-filter__checkbox:checked {
	background-color: var(--zc-f-primary);
	border-color: var(--zc-f-primary);
}

.zc-filter__checkbox:checked::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 1px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.zc-filter__checkbox:focus-visible {
	outline: 2px solid var(--zc-f-primary);
	outline-offset: 2px;
}

.zc-filter__option-label {
	flex: 1;
	min-width: 0;
}

.zc-filter__option-count {
	margin-left: auto;
	font-size: 12px;
	color: var(--zc-f-muted);
	flex-shrink: 0;
}

/* ── Price Range ─────────────────────────────────────────── */
.zc-filter__price-inputs {
	display: flex;
	gap: 8px;
	align-items: flex-end;
}

.zc-filter__price-field {
	flex: 1;
}

.zc-filter__price-label {
	font-size: 11px;
	color: var(--zc-f-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 4px;
	display: block;
	font-weight: 500;
}

.zc-filter__price-input {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid var(--zc-f-border);
	border-radius: var(--zc-f-radius);
	font-size: 14px;
	font-family: var(--zc-f-font);
	color: var(--zc-f-text);
	outline: none;
	box-sizing: border-box;
	transition: border-color 0.2s ease;
}

.zc-filter__price-input:focus {
	border-color: var(--zc-f-primary);
}

.zc-filter__price-separator {
	color: var(--zc-f-muted);
	font-size: 14px;
	padding-bottom: 10px;
	flex-shrink: 0;
}

.zc-filter__price-go {
	padding: 9px 14px;
	background: var(--zc-f-primary);
	color: #fff;
	border: none;
	border-radius: var(--zc-f-radius);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	flex-shrink: 0;
	transition: opacity 0.2s ease;
}

.zc-filter__price-go:hover {
	opacity: 0.9;
}

/* ── Actions ─────────────────────────────────────────────── */
.zc-filter__actions {
	display: flex;
	gap: 10px;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--zc-f-border);
}

.zc-filter__clear-btn {
	width: 100%;
	padding: 10px 16px;
	background: none;
	color: var(--zc-f-muted);
	border: 1px solid var(--zc-f-border);
	border-radius: var(--zc-f-radius);
	font-family: var(--zc-f-font-heading);
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	cursor: pointer;
	transition: all 0.2s ease;
}

.zc-filter__clear-btn:hover {
	color: var(--zc-f-text);
	border-color: var(--zc-f-text);
}

/* ════════════════════════════════════════════════════════════
   PRODUCT TOOLBAR (above grid)
   ════════════════════════════════════════════════════════════ */
.zc-product-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 12px;
	font-family: var(--zc-f-font);
}

.zc-product-toolbar__count {
	font-size: 14px;
	color: var(--zc-f-muted);
}

.zc-product-toolbar__count strong {
	color: var(--zc-f-text);
	font-weight: 600;
}

.zc-product-toolbar__sort {
	display: flex;
	align-items: center;
	gap: 8px;
}

.zc-product-toolbar__sort-label {
	font-size: 13px;
	color: var(--zc-f-muted);
	white-space: nowrap;
}

.zc-product-toolbar__sort-select {
	padding: 8px 32px 8px 12px;
	border: 1px solid var(--zc-f-border);
	border-radius: var(--zc-f-radius);
	font-size: 13px;
	font-family: var(--zc-f-font);
	color: var(--zc-f-text);
	background: var(--zc-f-bg);
	cursor: pointer;
	outline: none;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-size: 16px;
	transition: border-color 0.2s ease;
}

.zc-product-toolbar__sort-select:focus {
	border-color: var(--zc-f-primary);
}

/* ════════════════════════════════════════════════════════════
   ACTIVE FILTER TAGS
   ════════════════════════════════════════════════════════════ */
.zc-active-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
	font-family: var(--zc-f-font);
}

.zc-active-filters:empty {
	display: none;
	margin: 0;
}

.zc-active-filter-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	background: #f1f5f9;
	border-radius: 100px;
	font-size: 12px;
	font-weight: 500;
	color: var(--zc-f-text);
}

.zc-active-filter-tag__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #cbd5e1;
	color: #fff;
	cursor: pointer;
	border: none;
	padding: 0;
	font-size: 10px;
	line-height: 1;
	transition: background 0.15s ease;
}

.zc-active-filter-tag__remove:hover {
	background: #64748b;
}

.zc-active-filter-tag__remove svg {
	width: 10px;
	height: 10px;
}

.zc-active-filters__clear-all {
	display: inline-flex;
	align-items: center;
	font-size: 12px;
	color: var(--zc-f-primary);
	cursor: pointer;
	border: none;
	background: none;
	padding: 5px 8px;
	font-family: var(--zc-f-font);
	font-weight: 600;
	transition: opacity 0.15s ease;
}

.zc-active-filters__clear-all:hover {
	opacity: 0.7;
}

/* ════════════════════════════════════════════════════════════
   LOADING OVERLAY
   ════════════════════════════════════════════════════════════ */
.zc-product-grid-wrap {
	position: relative;
	min-height: 200px;
}

.zc-product-grid-wrap.is-loading {
	pointer-events: none;
}

.zc-product-grid-wrap.is-loading::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.75);
	z-index: 10;
	border-radius: 8px;
}

.zc-product-grid-wrap.is-loading::before {
	content: '';
	position: absolute;
	top: 120px;
	left: 50%;
	width: 36px;
	height: 36px;
	margin-left: -18px;
	border: 3px solid var(--zc-f-border);
	border-top-color: var(--zc-f-primary);
	border-radius: 50%;
	animation: zc-spin 0.6s linear infinite;
	z-index: 11;
}

@keyframes zc-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ════════════════════════════════════════════════════════════
   PAGINATION
   ════════════════════════════════════════════════════════════ */
.zc-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 4px;
	margin-top: 40px;
	font-family: var(--zc-f-font);
}

.zc-pagination:empty {
	display: none;
}

.zc-pagination__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 8px;
	border: 1px solid var(--zc-f-border);
	border-radius: var(--zc-f-radius);
	background: var(--zc-f-bg);
	color: var(--zc-f-text);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s ease;
	text-decoration: none;
	font-family: var(--zc-f-font);
	line-height: 1;
}

.zc-pagination__btn:hover {
	border-color: var(--zc-f-primary);
	color: var(--zc-f-primary);
}

.zc-pagination__btn.is-active {
	background: var(--zc-f-primary);
	border-color: var(--zc-f-primary);
	color: #fff;
	cursor: default;
}

.zc-pagination__btn.is-disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

.zc-pagination__btn svg {
	width: 16px;
	height: 16px;
}

.zc-pagination__ellipsis {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 40px;
	color: var(--zc-f-muted);
	font-size: 14px;
	letter-spacing: 2px;
}

/* ════════════════════════════════════════════════════════════
   NO RESULTS
   ════════════════════════════════════════════════════════════ */
.zc-no-results {
	text-align: center;
	padding: 60px 20px;
	color: var(--zc-f-muted);
	font-family: var(--zc-f-font);
}

.zc-no-results__icon {
	margin-bottom: 16px;
	opacity: 0.4;
}

.zc-no-results__icon svg {
	width: 56px;
	height: 56px;
	stroke: var(--zc-f-muted);
}

.zc-no-results__title {
	font-size: 18px;
	font-weight: 600;
	color: var(--zc-f-text);
	margin: 0 0 8px;
}

.zc-no-results__text {
	font-size: 14px;
	margin: 0;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
	.zc-filter__mobile-toggle {
		display: flex;
	}

	.zc-filter__mobile-close {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 32px;
		height: 32px;
		border: none;
		background: none;
		color: var(--zc-f-muted);
		cursor: pointer;
		padding: 0;
		margin-left: auto;
		margin-bottom: 8px;
	}

	.zc-filter__mobile-close svg {
		width: 20px;
		height: 20px;
	}

	.zc-filter__body {
		display: none;
	}

	.zc-filter.is-open .zc-filter__body {
		display: block;
		margin-top: 16px;
	}

	.zc-filter {
		padding: 16px;
		position: static;
	}

	.zc-product-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.zc-product-toolbar__sort {
		width: 100%;
	}

	.zc-product-toolbar__sort-select {
		flex: 1;
	}

	.zc-pagination {
		gap: 2px;
	}

	.zc-pagination__btn {
		min-width: 36px;
		height: 36px;
		font-size: 13px;
	}
}
