/* ==========================================================================
   Quattro Design · shop, category, tag and search pages
   Big category title (Heebo 300) + category chips (includes/woo.php, qc_shop_head_html).
   Desktop: filters sidebar 240px. Phones / tablets: sticky chips row, "סינון" opens WoodMart's
   off-canvas sidebar (drawer). Benchmark §2.12.
   Layout markup: WoodMart 8.5.7 main.wd-content-layout.wd-grid-g > aside.wd-sidebar + .wd-content-area.
   ========================================================================== */

/* ---------- Head ---------- */
.qc-shop-head {
	margin: 8px 0 24px;
}
.qc-shop-head__title {
	margin: 0 0 20px;
	font-family: var(--qc-font-display);
	font-weight: 300;
	font-size: clamp(40px, 5.6vw, 76px);
	line-height: 1.05;
	letter-spacing: -.01em;
	color: var(--qc-ink);
}
.qc-shop-chips {
	display: flex;
	align-items: center;
	gap: 8px;
}
.qc-shop-chips__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.qc-shop-chips__list li { margin: 0; padding: 0; list-style: none; }
html body .qc-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 18px;
	border: 1px solid var(--qc-line);
	border-radius: var(--qc-pill);
	background-color: transparent;
	color: var(--qc-ink);
	font-family: var(--qc-font);
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	text-transform: none;
	letter-spacing: 0;
	box-shadow: none;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
@media (hover: hover) {
	html body .qc-chip:hover { border-color: var(--qc-ink); color: var(--qc-ink); }
}
html body .qc-chip.is-active,
html body .qc-chip[aria-current="page"] {
	background-color: var(--qc-ink);
	border-color: var(--qc-ink);
	color: var(--qc-white);
}
html body .qc-chip--filter {
	gap: 6px;
	background-color: var(--qc-stone);
	border-color: var(--qc-stone);
}
html body .qc-chip--filter::before {
	content: "";
	width: 16px;
	height: 12px;
	background:
		linear-gradient(currentColor 0 0) top / 100% 1.5px no-repeat,
		linear-gradient(currentColor 0 0) center / 70% 1.5px no-repeat,
		linear-gradient(currentColor 0 0) bottom / 40% 1.5px no-repeat;
	background-position-x: right;
}
@media (min-width: 1025px) {
	html body .qc-chip--filter { display: none; }
}

/* ---------- Toolbar: result count + sort ---------- */
html body .shop-loop-head {
	align-items: center;
	margin-bottom: 20px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--qc-line);
}
html body .woocommerce-result-count { color: var(--qc-grey); font-size: 14px; }
html body .woocommerce-ordering select.orderby {
	min-height: 40px;
	border-radius: var(--qc-pill);
	padding-inline: 16px 36px;
	font-weight: 600;
}
/* ONE filter bar (staging 15.10 showed two on phones): our sticky chips row with the "סינון" pill.
   WoodMart's own "Show sidebar" button is switched on by .wd-sidebar-hidden-* (0,2,0), so this is one notch higher.
   It stays in the DOM: assets/shop.js clicks it to open WoodMart's off-canvas sidebar. */
html body .wd-show-sidebar-btn,
html body [class*="wd-sidebar-hidden"] .wd-show-sidebar-btn { display: none; }
@media (max-width: 1024px) {
	html body .wd-filter-buttons { display: none; }
	/* the sort control moves into the chips row (assets/shop.js), at its end, as a compact pill */
	.qc-shop-chips .qc-sort { margin: 0; margin-inline-start: auto; flex: none; }
	html body .qc-shop-chips .qc-sort select.orderby {
		max-width: 132px;
		min-height: 40px;
		padding-inline: 12px 28px;
		border: 1px solid var(--qc-line);
		border-radius: var(--qc-pill);
		background-color: var(--qc-paper);
		font-size: 14px;
		font-weight: 600;
	}
	html body .shop-loop-head:not(:has(.woocommerce-ordering)) .wd-shop-tools:empty { display: none; }
}

/* ---------- Sidebar 240px (desktop) ---------- */
@media (min-width: 1025px) {
	/* sidebar first in the DOM ("sidebar-left"): in RTL it is the right-hand (start) column */
	html body main.wd-content-layout.wd-grid-g:has(> .wd-sidebar:first-child) {
		grid-template-columns: 240px minmax(0, 1fr); /* VERIFY-ON-STAGING */
		gap: 40px;
	}
	html body main.wd-content-layout.wd-grid-g:has(> .wd-sidebar:last-child) {
		grid-template-columns: minmax(0, 1fr) 240px; /* VERIFY-ON-STAGING */
		gap: 40px;
	}
	html body main.wd-content-layout.wd-grid-g:has(> .wd-sidebar) > * { grid-column: auto / span 1; }
	html body .wd-sidebar {
		position: sticky;
		top: 96px;
		align-self: start;
		max-height: calc(100vh - 112px);
		overflow-y: auto;
		scrollbar-width: thin;
	}
}

/* ---------- Filter widgets ---------- */
html body .wd-sidebar .widget {
	margin: 0 0 24px;
	padding: 0 0 24px;
	border-bottom: 1px solid var(--qc-line);
}
html body .wd-sidebar .widget-title {
	margin: 0 0 14px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	color: var(--qc-ink);
}
/* Size filter as a button grid, not checkboxes (benchmark §2.12). VERIFY-ON-STAGING: WoodMart layered-nav markup per widget setting. */
html body .wd-sidebar .wd-filter-list.wd-swatches-filter,
html body .wd-sidebar .wd-swatches-filter {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 6px;
}
html body .wd-sidebar .wd-swatches-filter > li { margin: 0; }
html body .wd-sidebar .wd-swatches-filter > li > a {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	border: 1px solid var(--qc-line);
	border-radius: var(--qc-radius);
	color: var(--qc-ink);
	font-size: 14px;
}
html body .wd-sidebar .wd-swatches-filter > li.wd-active > a,
html body .wd-sidebar .wd-swatches-filter > li.chosen > a {
	background-color: var(--qc-ink);
	border-color: var(--qc-ink);
	color: var(--qc-white);
}
html body .wd-sidebar .wd-swatches-filter .wd-filter-lable,
html body .wd-sidebar .wd-swatches-filter .count { display: none; }
/* Price filter as chips (200 / 250 / 300 / 400+) when the WoodMart price filter list is used. */
html body .wd-sidebar .woodmart-price-filter ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
html body .wd-sidebar .woodmart-price-filter li > a {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 14px;
	border: 1px solid var(--qc-line);
	border-radius: var(--qc-pill);
	color: var(--qc-ink);
	font-size: 14px;
}
html body .wd-sidebar .woodmart-price-filter li.current-state > a {
	background-color: var(--qc-ink);
	border-color: var(--qc-ink);
	color: var(--qc-white);
}
html body .wd-sidebar .product-categories a { color: var(--qc-ink); }
html body .wd-sidebar .product-categories .count { color: var(--qc-grey); }

/* Active filters + "נקה הכל" */
html body .wd-active-filters,
html body .widget_layered_nav_filters ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
html body :is(.wd-active-filters, .widget_layered_nav_filters) a {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	padding: 0 12px;
	border-radius: var(--qc-pill);
	background-color: var(--qc-stone);
	color: var(--qc-ink);
	font-size: 14px;
}

/* ---------- Load more ---------- */
html body .wd-load-more {
	min-width: 220px;
	min-height: 52px;
	background-color: var(--qc-ink);
	color: var(--qc-white);
}

/* ---------- Phones and tablets: sticky chips row + drawer ---------- */
@media (max-width: 1024px) {
	.qc-shop-head { margin: 0 0 12px; }
	.qc-shop-head__title { margin-bottom: 12px; }
	.qc-shop-chips {
		position: sticky;
		top: 0; /* VERIFY-ON-STAGING: sits under WoodMart's sticky header if that is sticky on phones */
		z-index: 20;
		min-height: 56px;
		margin-inline: -16px;
		padding: 8px 16px;
		background-color: var(--qc-paper);
		border-bottom: 1px solid var(--qc-line);
	}
	.qc-shop-chips__list {
		flex: 1 1 auto;
		min-width: 0;
		flex-wrap: nowrap;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}
	.qc-shop-chips__list::-webkit-scrollbar { display: none; }
	.qc-chip { min-height: 40px; padding: 0 14px; font-size: 14px; }

	/* WoodMart off-canvas sidebar as a drawer: header with title, scrolling list */
	html body .wd-sidebar.wd-side-hidden {
		background-color: var(--qc-paper);
		width: min(360px, 88vw);
	}
	html body .wd-sidebar .wd-heading {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 16px;
		border-bottom: 1px solid var(--qc-line);
	}
	html body .wd-sidebar .widget-area { padding: 16px; }
}

/* ---------- 1.9.5 (20.10, "סינון לפי מידה בחנות"): one row of sizes under the categories ---------- */
html body .qc-shop-sizes { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-block-start: 14px; }
html body .qc-shop-sizes__label { font: 600 14px / 1 var(--qc-font); color: var(--qc-grey); margin-inline-end: 4px; }
html body .qc-shop-sizes__list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
html body .qc-shop-sizes__list li { margin: 0; padding: 0; list-style: none; }
html body .qc-size {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; min-height: 40px; padding: 0 8px;
	border: 1px solid var(--qc-line); border-radius: var(--qc-pill);
	color: var(--qc-ink); font: 500 15px / 1 var(--qc-font); text-decoration: none;
	transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
@media (hover: hover) { html body .qc-size:hover { border-color: var(--qc-ink); color: var(--qc-ink); } }
html body .qc-size.is-active { background-color: var(--qc-ink); border-color: var(--qc-ink); color: var(--qc-paper); }
html body .qc-shop-sizes__clear { font: 500 14px / 1 var(--qc-font); color: var(--qc-grey); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 767px) {
	html body .qc-shop-sizes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
	html body .qc-shop-sizes::-webkit-scrollbar { display: none; }
	html body .qc-shop-sizes__list { flex-wrap: nowrap; }
	html body .qc-shop-sizes__clear { white-space: nowrap; }
}
