/* =====================================================================
   Shop Filter Drawer — Lindex-style slide-in panel
   ===================================================================== */

/* —— Filter bar (above grid) —— */
.cb-filter-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding: 12px clamp(16px, 2.5vw, 32px);
	box-sizing: border-box;
}

.cb-filter-bar__count {
	font-size: 14px;
	color: #1a1a1a;
}

.cb-filter-bar__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 24px;
	border: 1px solid #1a1a1a;
	border-radius: 9999px;
	background: transparent;
	color: #1a1a1a;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background 150ms ease, color 150ms ease;
}

.cb-filter-bar__btn:hover {
	background: #1a1a1a;
	color: #fff;
}

/* —— Active filter chips —— */
.cb-filter-chips {
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding: 0 clamp(16px, 2.5vw, 32px) 12px;
	box-sizing: border-box;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.cb-filter-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	border: 0;
	border-radius: 9999px;
	background: #1a1a1a;
	color: #fff;
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: background 120ms ease;
	white-space: nowrap;
}

.cb-filter-chip:hover {
	background: #333;
}

.cb-filter-chip svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.cb-filter-chips__clear {
	display: inline-flex;
	align-items: center;
	padding: 8px 0;
	border: 0;
	background: transparent;
	color: #1a1a1a;
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 120ms ease;
}

.cb-filter-chips__clear:hover {
	color: #d6253b;
}

/* —— Overlay —— */
.cb-filter-overlay {
	position: fixed;
	inset: 0;
	z-index: 9998;
	background: rgba(0, 0, 0, 0.4);
	opacity: 0;
	visibility: hidden;
	transition: opacity 250ms ease, visibility 250ms ease;
}

.cb-filter-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

/* —— Drawer —— */
.cb-filter-drawer {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 9999;
	width: 100%;
	max-width: 480px;
	height: 100dvh;
	background: #fff;
	transform: translateX(100%);
	transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
	display: flex;
	overflow: hidden;
}

/* Account for WP admin bar */
.admin-bar .cb-filter-drawer {
	top: 32px;
	height: calc(100dvh - 32px);
}
@media (max-width: 782px) {
	.admin-bar .cb-filter-drawer {
		top: 46px;
		height: calc(100dvh - 46px);
	}
}

.cb-filter-drawer.is-open {
	transform: translateX(0);
}

/* —— Views —— */
.cb-filter-drawer__view {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	background: #fff;
	transform: translateX(100%);
	transition: transform 250ms cubic-bezier(0.32, 0.72, 0, 1);
	visibility: hidden;
}

.cb-filter-drawer__view.is-active {
	transform: translateX(0);
	visibility: visible;
}

/* —— Header —— */
.cb-filter-drawer__header {
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	padding: 20px 24px;
	border-bottom: 1px solid #eee;
	flex-shrink: 0;
}

.cb-filter-drawer__title {
	margin: 0;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	color: #1a1a1a;
	text-align: center;
}

.cb-filter-drawer__close {
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 9999px;
	background: #1a1a1a;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

.cb-filter-drawer__back {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 9999px;
	background: transparent;
	color: #1a1a1a;
	cursor: pointer;
	padding: 0;
}

.cb-filter-drawer__back:hover {
	background: #f5f3ee;
}

/* —— Body —— */
.cb-filter-drawer__body {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

/* —— Main menu rows —— */
.cb-filter-drawer__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 18px 24px;
	border: 0;
	border-bottom: 1px solid #f0f0f0;
	background: transparent;
	color: #1a1a1a;
	font: inherit;
	font-size: 15px;
	text-align: left;
	cursor: pointer;
	transition: background 120ms ease, color 120ms ease;
}

.cb-filter-drawer__row:hover {
	color: #d6253b;
}

.cb-filter-drawer__row:hover svg {
	stroke: #d6253b;
}

.cb-filter-drawer__row-label {
	display: block;
}

.cb-filter-drawer__row-label strong {
	font-weight: 600;
	font-size: 14px;
}

.cb-filter-drawer__row-sub {
	font-size: 13px;
	color: #666;
	font-weight: 400;
}

.cb-filter-drawer__row.has-active-filters .cb-filter-drawer__row-text {
	font-weight: 600;
}

.cb-filter-drawer__row-active {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	color: #1a1a1a;
}

.cb-filter-drawer__row-values {
	display: block;
	font-size: 13px;
	font-weight: 400;
	color: #666;
	margin-top: 2px;
}

/* —— Section label —— */
.cb-filter-drawer__section-label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 24px 12px;
	background: #f9f7f3;
	font-size: 15px;
	font-weight: 600;
	color: #1a1a1a;
	border-bottom: 1px solid #f0f0f0;
}

.cb-filter-drawer__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 9999px;
	background: #1a1a1a;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	margin-left: 8px;
	vertical-align: middle;
}

.cb-filter-drawer__clear {
	padding: 6px 16px;
	border: 1px solid #ccc;
	border-radius: 9999px;
	background: transparent;
	color: #1a1a1a;
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: background 120ms ease, border-color 120ms ease;
}

.cb-filter-drawer__clear:hover {
	background: #f5f3ee;
	border-color: #1a1a1a;
}

/* —— Radio options —— */
.cb-filter-drawer__radio {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px 24px;
	border-bottom: 1px solid #f0f0f0;
	cursor: pointer;
	font-size: 15px;
	color: #1a1a1a;
	transition: background 120ms ease, color 120ms ease;
}

.cb-filter-drawer__radio:hover {
	color: #d6253b;
}

.cb-filter-drawer__radio input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.cb-filter-drawer__radio-dot {
	width: 22px;
	height: 22px;
	border: 2px solid #ccc;
	border-radius: 9999px;
	flex-shrink: 0;
	position: relative;
	transition: border-color 150ms ease;
}

.cb-filter-drawer__radio input:checked + .cb-filter-drawer__radio-dot {
	border-color: #1a1a1a;
}

.cb-filter-drawer__radio input:checked + .cb-filter-drawer__radio-dot::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 12px;
	height: 12px;
	border-radius: 9999px;
	background: #1a1a1a;
}

/* —— Checkbox options —— */
.cb-filter-drawer__checkbox {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 24px;
	border-bottom: 1px solid #f0f0f0;
	cursor: pointer;
	font-size: 15px;
	color: #1a1a1a;
	transition: background 120ms ease, color 120ms ease;
}

.cb-filter-drawer__checkbox:hover {
	color: #d6253b;
}

.cb-filter-drawer__checkbox input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.cb-filter-drawer__check-box {
	width: 20px;
	height: 20px;
	border: 2px solid #ccc;
	border-radius: 4px;
	flex-shrink: 0;
	position: relative;
	transition: background 150ms ease, border-color 150ms ease;
}

.cb-filter-drawer__checkbox input:checked + .cb-filter-drawer__check-box {
	background: #1a1a1a;
	border-color: #1a1a1a;
}

.cb-filter-drawer__checkbox input:checked + .cb-filter-drawer__check-box::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 5px;
	width: 6px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.cb-filter-drawer__check-count {
	margin-left: auto;
	font-size: 13px;
	color: #999;
}

/* —— Price inputs —— */
.cb-filter-drawer__price-inputs {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	padding: 24px;
}

.cb-filter-drawer__price-field {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 13px;
	color: #666;
}

.cb-filter-drawer__price-field input {
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font: inherit;
	font-size: 15px;
	color: #1a1a1a;
}

.cb-filter-drawer__price-field input:focus {
	outline: none;
	border-color: #1a1a1a;
}

.cb-filter-drawer__price-sep {
	padding-bottom: 10px;
	color: #999;
}

/* —— Empty state —— */
.cb-filter-drawer__empty {
	padding: 32px 24px;
	font-size: 14px;
	color: #999;
	text-align: center;
}

/* —— Footer / Apply button —— */
.cb-filter-drawer__footer {
	padding: 16px 24px;
	border-top: 1px solid #eee;
	flex-shrink: 0;
}

.cb-filter-drawer__apply {
	display: block;
	width: 100%;
	padding: 16px;
	border: 0;
	border-radius: 9999px;
	background: #1a1a1a;
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
	transition: background 150ms ease;
}

.cb-filter-drawer__apply:hover {
	background: #000;
}

/* —— Loading state —— */
.cb-filter-loading ul.products {
	opacity: 0.4;
	pointer-events: none;
	transition: opacity 200ms ease;
}

/* —— Responsive —— */
@media (max-width: 480px) {
	.cb-filter-drawer {
		max-width: 100%;
	}
}