/* ==========================================================================
   Frame Studio — archive filter sidebar / drawer
   Loaded only on shop, product category and product tag archives.
   Desktop: fixed-width left column beside the products grid.
   ≤1024px: off-canvas drawer opened by the FİLTRELE button.
   ========================================================================== */

.frame-shop-layout {
	display: grid;
	grid-template-columns: 232px minmax(0, 1fr);
	gap: 0 clamp(24px, 3vw, 48px);
	align-items: start;
	clear: both;
}
.frame-shop-col { min-width: 0; }

/* Storefront floats the sort row; keep it contained inside our column. */
.frame-shop-col .storefront-sorting::after { content: ""; display: table; clear: both; }

/* --------------------------------------------------------------------------
   Panel
   -------------------------------------------------------------------------- */
.frame-filters {
	position: sticky;
	top: calc(var(--header-h) + 20px);
	align-self: start;
	max-height: calc(100vh - var(--header-h) - 40px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0 4px 0 0;
	border-top: 1px solid var(--color-border);
	scrollbar-width: thin;
	scrollbar-color: #d4d4d4 transparent;
}
.frame-filters::-webkit-scrollbar { width: 6px; }
.frame-filters::-webkit-scrollbar-thumb { background: #d4d4d4; }
.frame-filters::-webkit-scrollbar-track { background: transparent; }
.frame-filters--empty { display: none; }

.frame-filters__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 0 4px;
}
.frame-filters__title {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--color-text);
}
.frame-filters__close {
	display: none;
	background: none;
	border: 0;
	padding: 0 2px;
	font-size: 26px;
	line-height: 1;
	color: var(--color-text);
	cursor: pointer;
}

.frame-filter {
	border-bottom: 1px solid var(--color-border);
	padding: 16px 0 18px;
}
.frame-filter:last-of-type { border-bottom: 0; }
.frame-filter__label {
	margin: 0 0 10px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 1.8px;
	text-transform: uppercase;
	color: var(--color-muted);
}
.frame-filter__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

/* Category quick links */
.frame-filter__cats a {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	padding: 5px 0;
	font-size: 13.5px;
	color: var(--color-text);
	text-decoration: none;
	transition: color var(--dur) var(--ease);
}
.frame-filter__cats a:hover { color: var(--color-accent); }
.frame-filter__cats em {
	font-style: normal;
	font-size: 11px;
	color: var(--color-muted);
}

/* Checkbox rows */
.frame-filter__opt {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 5px 0;
	cursor: pointer;
	font-size: 13.5px;
	color: var(--color-text);
	line-height: 1.3;
}
.frame-filter__opt input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	margin: 0;
	pointer-events: none;
}
.frame-filter__box {
	flex: 0 0 auto;
	width: 15px;
	height: 15px;
	border: 1px solid #c9c9c9;
	background: var(--color-bg-alt);
	position: relative;
	transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.frame-filter__opt:hover .frame-filter__box { border-color: var(--color-text); }
.frame-filter__opt input:focus-visible + .frame-filter__box { outline: 2px solid var(--color-text); outline-offset: 2px; }
.frame-filter__opt input:checked + .frame-filter__box {
	background: var(--color-text);
	border-color: var(--color-text);
}
.frame-filter__opt input:checked + .frame-filter__box::after {
	content: "";
	position: absolute;
	left: 4px;
	top: 1px;
	width: 4px;
	height: 8px;
	border: solid #fff;
	border-width: 0 1.6px 1.6px 0;
	transform: rotate(43deg);
}
.frame-filter__name { flex: 1 1 auto; }
.frame-filter__count {
	font-style: normal;
	font-size: 11px;
	color: var(--color-muted);
}

/* Price */
.frame-filter__price {
	display: flex;
	align-items: center;
	gap: 8px;
}
.frame-filter__price input {
	width: 100%;
	min-width: 0;
	padding: 9px 10px;
	border: 1px solid var(--color-border);
	border-radius: 0;
	background: var(--color-bg-alt);
	color: var(--color-text);
	font-family: var(--font-sans);
	font-size: 13px;
	-moz-appearance: textfield;
}
.frame-filter__price input::-webkit-outer-spin-button,
.frame-filter__price input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.frame-filter__price input:focus { outline: 0; border-color: var(--color-text); }
.frame-filter__price span { color: var(--color-muted); }
.frame-filter__hint {
	margin: 8px 0 0;
	font-size: 11px;
	color: var(--color-muted);
}
.frame-filter__hint .amount { color: var(--color-muted); }

/* Actions */
.frame-filters__actions {
	position: sticky;
	bottom: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 0;
	margin-top: 4px;
	background: var(--color-bg);
	border-top: 1px solid var(--color-border);
}
.frame-filters__apply {
	flex: 1 1 auto;
	justify-content: center;
	text-align: center;
	padding: 12px 16px;
	font-size: 10.5px;
	letter-spacing: 1.8px;
	cursor: pointer;
}
.frame-filters__clear {
	flex: 0 0 auto;
	font-size: 10.5px;
	letter-spacing: 1.4px;
	text-transform: uppercase;
	color: var(--color-muted);
	text-decoration: none;
	border-bottom: 1px solid var(--color-border);
	padding-bottom: 2px;
}
.frame-filters__clear:hover { color: var(--color-text); border-color: var(--color-text); }

/* --------------------------------------------------------------------------
   Bar above the sort row: mobile trigger + active filter chips
   -------------------------------------------------------------------------- */
.frame-filterbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0 0 6px;
}
.frame-filterbar__toggle {
	display: none;              /* desktop uses the always-visible sidebar */
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: var(--color-bg-alt);
	border: 1px solid var(--color-text);
	border-radius: 0;
	color: var(--color-text);
	font-family: var(--font-sans);
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 1.8px;
	text-transform: uppercase;
	cursor: pointer;
}
.frame-filterbar__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	background: var(--color-text);
	color: #fff;
	border-radius: 999px;
	font-size: 10px;
	font-style: normal;
	font-weight: 700;
	letter-spacing: 0;
}

.frame-chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.frame-chips li { margin: 0; }
.frame-chips a {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 6px 11px;
	border: 1px solid var(--color-border);
	background: var(--color-bg-alt);
	color: var(--color-text);
	font-size: 11.5px;
	line-height: 1.2;
	text-decoration: none;
	transition: border-color var(--dur) var(--ease);
}
.frame-chips a:hover { border-color: var(--color-text); }
.frame-chips a span { color: var(--color-muted); font-size: 14px; line-height: 1; }
.frame-chips__clear a {
	border: 0;
	background: none;
	padding: 6px 2px;
	font-size: 10.5px;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--color-muted);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.frame-chips__clear a:hover { color: var(--color-text); }

/* Backdrop (mobile drawer only) */
.frame-filters__backdrop {
	position: fixed;
	inset: 0;
	z-index: 998;
	background: var(--color-overlay);
	border: 0;
}
.frame-filters__backdrop[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Narrower desktops — keep the grid readable next to the sidebar
   -------------------------------------------------------------------------- */
@media (max-width: 1340px) and (min-width: 1025px) {
	.frame-shop-layout { grid-template-columns: 208px minmax(0, 1fr); }
	body.tax-product_cat .site-main ul.products,
	body.post-type-archive-product .site-main ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   Mobile / tablet — off-canvas drawer
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.frame-shop-layout { display: block; }

	.frame-filterbar__toggle { display: inline-flex; }

	.frame-filters {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		z-index: 999;
		width: min(88vw, 340px);
		max-height: none;
		height: 100%;
		padding: 0 20px 24px;
		background: var(--color-bg);
		border-top: 0;
		border-right: 1px solid var(--color-border);
		box-shadow: 0 0 40px rgba(0, 0, 0, .16);
		transform: translateX(-102%);
		visibility: hidden;
		transition: transform .3s var(--ease), visibility .3s var(--ease);
		-webkit-overflow-scrolling: touch;
	}
	.frame-filters.is-open {
		transform: translateX(0);
		visibility: visible;
	}
	.frame-filters--empty { display: none; }

	.frame-filters__head {
		position: sticky;
		top: 0;
		z-index: 2;
		background: var(--color-bg);
		padding: 18px 0 14px;
		border-bottom: 1px solid var(--color-border);
	}
	.frame-filters__close { display: block; }

	/* Apply / clear pinned to the bottom of the drawer so they're always reachable */
	.frame-filters__actions {
		padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px));
	}
	.frame-filters__apply { padding: 14px 16px; }

	/* Roomier tap targets in the drawer */
	.frame-filter__opt,
	.frame-filter__cats a { padding: 9px 0; font-size: 15px; }
	.frame-filter__box { width: 17px; height: 17px; }
	.frame-filter__opt input:checked + .frame-filter__box::after { left: 5px; top: 2px; }
	.frame-filter__price input { padding: 12px 12px; font-size: 15px; }
}

@media (max-width: 700px) {
	.frame-filterbar { margin-bottom: 10px; }
	.frame-chips { width: 100%; }
}

/* Body scroll lock while the drawer is open */
body.frame-filters-open { overflow: hidden; }

/* --------------------------------------------------------------------------
   Storefront renders its sorting row both above and below the grid, each with
   a full pagination block. The top copy is redundant (and on mobile it pushes
   the products a whole screen down), so hide the pagination in whichever
   sorting row still has the product grid after it. main.css attempts this too
   but targets `nav.woocommerce-pagination:has(~ ul.products)`, which never
   matches — the nav is wrapped, so it is not a sibling of ul.products.
   -------------------------------------------------------------------------- */
.frame-shop-col .storefront-sorting:has(~ ul.products) .woocommerce-pagination { display: none; }
