/* =========================================================================
   THEORYS — catalogue: sticky filter sidebar, toolbar, product cards.
   Built on the tokens in style.css :root. The only new token is --forest-press,
   because the brief asks for a DARKER primary hover while the existing system
   hovers lighter (forest-deep -> forest-mid).
   ========================================================================= */

:root {
	--forest-press: #12271F;   /* NEW: pressed / hover state for primary buttons */
}

/* The hidden attribute has to outrank our own display declarations. Several
   controls here are toggled by setting el.hidden (filter count, clear button,
   no-results, incentive line, struck-through total) and a plain
   `display: grid/flex` on the same element silently defeats it — the filter
   badge rendered a literal "0" instead of disappearing. */
.thr-shell [hidden] { display: none !important; }

/* ---------- layout ----------------------------------------------------- */

.thr-shell .thr-catalog {
	max-width: 1200px;
	margin: 26px auto 0;
	padding: 0 24px;
	box-sizing: border-box;
	display: grid;
	grid-template-columns: 1fr;
	gap: 26px;
	align-items: start;
}

/* The grid lives inside .thr-catalog-main, so cancel the page-level gutter
   that theorys-shop.css puts on ul.products or it double-indents. */
.thr-shell .thr-catalog ul.products {
	max-width: none;
	margin: 0;
	padding: 0;
	grid-template-columns: 1fr;
	gap: 18px;
}

.thr-catalog-main { min-width: 0; }

/* ---------- toolbar ---------------------------------------------------- */

.thr-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding-bottom: 16px;
	margin-bottom: 18px;
	border-bottom: 1px solid var(--line);
}
.thr-count {
	margin: 0;
	font-family: var(--font-head);
	font-size: 12.5px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--platinum-lo);
}
.thr-count-shown, .thr-count-total { color: var(--ink); }

.thr-sort-wrap { position: relative; display: inline-flex; align-items: center; }
.thr-shell select.thr-sort {
	appearance: none;
	-webkit-appearance: none;
	font-family: var(--font-head);
	font-size: 14px;
	color: var(--ink);
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 10px 38px 10px 14px;
	cursor: pointer;
}
.thr-shell select.thr-sort:focus-visible { outline: 2px solid var(--forest-mid); outline-offset: 1px; }
.thr-sort-caret {
	position: absolute; right: 12px; width: 16px; height: 16px;
	pointer-events: none; color: var(--platinum-lo);
}

.thr-no-results {
	margin: 34px 0; padding: 26px 24px;
	border: 1px solid var(--line); border-radius: 14px;
	background: var(--off-white);
	font-size: 15px; color: #3a423d; text-align: center;
}
.thr-filters-clear-inline {
	background: none; border: 0; padding: 0;
	font-family: var(--font-head); font-size: 15px;
	color: var(--forest-deep); text-decoration: underline; cursor: pointer;
}

/* ---------- sidebar --------------------------------------------------- */

.thr-filter-toggle {
	display: inline-flex; align-items: center; gap: 9px;
	font-family: var(--font-head); font-size: 14.5px; font-weight: 500;
	padding: 12px 18px;
	border: 1px solid var(--line); border-radius: 12px;
	background: var(--white); color: var(--ink); cursor: pointer;
	align-self: start;
}
.thr-filter-toggle svg { width: 18px; height: 18px; }
.thr-filter-active-count {
	min-width: 19px; height: 19px; padding: 0 5px;
	border-radius: 999px; background: var(--forest-deep); color: var(--white);
	font-size: 11px; font-weight: 600; display: grid; place-items: center;
}

.thr-filters { min-width: 0; }
.thr-filters-inner {
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--white);
	padding: 20px 20px 6px;
}
.thr-filters-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.thr-filters-title {
	font-family: var(--font-head); font-size: 11.5px; font-weight: 600;
	letter-spacing: 0.18em; text-transform: uppercase; color: var(--platinum-lo);
	margin-right: auto;
}
.thr-filters-clear {
	background: none; border: 0; padding: 0; cursor: pointer;
	font-family: var(--font-head); font-size: 12.5px; color: var(--forest-mid);
	text-decoration: underline;
}
.thr-filters-close { display: none; background: none; border: 0; font-size: 26px; line-height: 1; color: var(--ink); cursor: pointer; padding: 0 4px; }

.thr-filter-group { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.thr-filter-group:last-child { border-bottom: 0; }
.thr-filter-label {
	display: block;
	font-family: var(--font-head); font-size: 11.5px; font-weight: 600;
	letter-spacing: 0.16em; text-transform: uppercase; color: var(--platinum-lo);
	margin-bottom: 12px;
}

.thr-search-wrap { position: relative; display: flex; align-items: center; }
.thr-search-icon {
	position: absolute; left: 12px; width: 16px; height: 16px;
	color: var(--platinum-lo); pointer-events: none;
}
.thr-shell input.thr-search {
	width: 100%;
	font-family: var(--font-body); font-size: 14.5px;
	padding: 11px 34px 11px 36px;
	border: 1px solid var(--line); border-radius: 10px;
	background: var(--white); color: var(--ink);
	box-sizing: border-box;
}
.thr-shell input.thr-search::-webkit-search-cancel-button { display: none; }
.thr-shell input.thr-search:focus { border-color: var(--forest-mid); outline: none; }
.thr-search-clear {
	position: absolute; right: 8px; background: none; border: 0;
	font-size: 20px; line-height: 1; color: var(--platinum-lo); cursor: pointer; padding: 0 4px;
}

/* checkbox + radio rows */
.thr-checks, .thr-radios { list-style: none; margin: 0; padding: 0; }
.thr-checks li, .thr-radios li { margin-bottom: 4px; }
.thr-check, .thr-radio {
	display: flex; align-items: center; gap: 10px;
	padding: 7px 0; cursor: pointer; font-size: 14px; color: var(--ink);
}
.thr-check input, .thr-radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.thr-check-box {
	width: 18px; height: 18px; flex: none;
	border: 1px solid var(--silver); border-radius: 5px; background: var(--white);
	display: grid; place-items: center; color: transparent;
	transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.thr-check-box svg { width: 12px; height: 12px; }
.thr-check input:checked + .thr-check-box {
	background: var(--forest-deep); border-color: var(--forest-deep); color: var(--white);
}
.thr-check input:focus-visible + .thr-check-box { outline: 2px solid var(--forest-mid); outline-offset: 2px; }
.thr-check-text { flex: 1 1 auto; }
.thr-check-n { font-size: 12px; color: var(--platinum-lo); font-variant-numeric: tabular-nums; }

.thr-radio-dot {
	width: 18px; height: 18px; flex: none;
	border: 1px solid var(--silver); border-radius: 999px; background: var(--white);
	position: relative; transition: border-color .12s ease;
}
.thr-radio input:checked + .thr-radio-dot { border-color: var(--forest-deep); border-width: 2px; }
.thr-radio input:checked + .thr-radio-dot::after {
	content: ""; position: absolute; inset: 3px;
	border-radius: 999px; background: var(--forest-deep);
}
.thr-radio input:focus-visible + .thr-radio-dot { outline: 2px solid var(--forest-mid); outline-offset: 2px; }

.thr-filters-scrim {
	position: fixed; inset: 0; z-index: 940;
	background: rgba(14,18,15,0.42);
}
body.thr-drawer-open { overflow: hidden; }

/* ---------- product card ---------------------------------------------- */

.thr-shell ul.products li.thr-card {
	display: flex; flex-direction: column;
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: none;
	transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
	margin: 0; padding: 0; width: auto; float: none; text-align: left;
	position: relative;
}
.thr-shell ul.products li.thr-card:hover {
	transform: translateY(-2px);
	border-color: #cfd7d3;
	box-shadow: 0 8px 24px rgba(14,18,15,0.06);
}
.thr-card[hidden] { display: none !important; }

/* image sits on white with generous padding */
.thr-card-media {
	position: relative; display: block;
	padding: 14px;
	background: var(--white);
	border-bottom: 1px solid var(--line);
	text-decoration: none;
}
.thr-shell ul.products li.thr-card img.thr-card-img {
	display: block; width: 100%; height: auto;
	aspect-ratio: 1 / 1; object-fit: contain;
	background: transparent; border-radius: 0; box-shadow: none; margin: 0;
}
.thr-card-size {
	position: absolute; top: 14px; right: 14px;
	font-family: var(--font-head); font-size: 10.5px; font-weight: 600;
	letter-spacing: 0.1em; text-transform: uppercase;
	color: var(--ink); background: var(--off-white);
	border: 1px solid var(--line); border-radius: 999px;
	padding: 5px 10px;
}

.thr-card-body { display: flex; flex-direction: column; flex: 1 1 auto; padding: 16px 18px 18px; }
.thr-card-cat {
	font-family: var(--font-head); font-size: 10px; font-weight: 600;
	letter-spacing: 0.16em; text-transform: uppercase; color: var(--platinum-lo);
	margin-bottom: 8px;
}
/* Name clamped to exactly two lines so every card in a row aligns. */
.thr-shell ul.products li.thr-card .thr-card-name {
	font-family: var(--font-head); font-size: 17px; font-weight: 600;
	line-height: 1.28; letter-spacing: -0.01em;
	margin: 0 0 6px; padding: 0;
	min-height: calc(2 * 1.28em);
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
	overflow: hidden;
}
.thr-card-name a { color: var(--ink); text-decoration: none; }
.thr-card-name a:hover { color: var(--forest-mid); }

/* Description truncated to a single line. */
.thr-card-blurb {
	margin: 0 0 12px; font-size: 13px; line-height: 1.45; color: #5b6660;
	min-height: 1.45em;
	display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
	overflow: hidden;
}

.thr-card-coa {
	display: inline-flex; align-items: center; gap: 6px;
	font-family: var(--font-head); font-size: 11.5px; font-weight: 500;
	letter-spacing: 0.06em; color: var(--forest-mid);
	margin-bottom: 12px;
}
.thr-card-coa svg { width: 13px; height: 13px; flex: none; }

.thr-shell ul.products li.thr-card .thr-card-price {
	font-family: var(--font-head); font-size: 17px; font-weight: 600;
	color: var(--ink); padding: 0; margin: 0 0 14px;
}
.thr-shell ul.products li.thr-card .thr-card-price .price { padding: 0; margin: 0; font-size: inherit; color: inherit; }
.thr-shell ul.products li.thr-card .thr-card-price del { color: var(--platinum-lo); font-weight: 400; margin-right: 6px; }
.thr-shell ul.products li.thr-card .thr-card-price ins { text-decoration: none; }
.thr-shell ul.products li.thr-card .thr-card-price .thr-signin-price { font-size: 14px; font-weight: 500; color: var(--forest-mid); }

/* CTA pinned to the bottom so buttons align across the row. */
.thr-card-cta { margin-top: auto; }
.thr-shell ul.products li.thr-card .thr-card-btn {
	display: flex; width: 100%; margin: 0;
	justify-content: center; text-align: center;
	font-size: 14.5px; padding: 12px 16px;
	background: var(--forest-deep); border-color: var(--forest-deep);
	color: var(--white) !important; border-radius: 10px;
}
.thr-shell ul.products li.thr-card .thr-card-btn:hover {
	background: var(--forest-press); border-color: var(--forest-press);
	color: var(--white) !important; transform: none;
}
/* WooCommerce swaps in a "View cart" link after an ajax add. */
.thr-shell ul.products li.thr-card a.added_to_cart {
	display: block; margin: 8px 0 0; text-align: center;
	font-family: var(--font-head); font-size: 13px;
	background: none; border: 0; color: var(--forest-mid) !important;
	text-decoration: underline; padding: 0;
}
.thr-shell ul.products li.thr-card .thr-card-btn.loading { opacity: .72; }

/* ---------- responsive ------------------------------------------------ */

/* mobile + tablet: sidebar becomes a slide-in drawer */
@media (max-width: 1023px) {
	.thr-filters {
		position: fixed; top: 0; left: 0; bottom: 0; z-index: 950;
		width: min(340px, 88vw);
		background: var(--white);
		transform: translateX(-100%);
		transition: transform .22s ease;
		overflow-y: auto;
		box-shadow: 0 0 40px rgba(14,18,15,0.18);
	}
	.thr-filters.is-open { transform: translateX(0); }
	.thr-filters-inner { border: 0; border-radius: 0; padding: 20px 20px 40px; }
	.thr-filters-close { display: block; }
}

@media (min-width: 768px) {
	.thr-shell .thr-catalog ul.products { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media (min-width: 1024px) {
	.thr-shell .thr-catalog { grid-template-columns: 244px minmax(0, 1fr); gap: 32px; }
	.thr-shell .thr-catalog ul.products { grid-template-columns: repeat(3, 1fr); gap: 22px; }
	.thr-filter-toggle { display: none; }
	.thr-filters-scrim { display: none !important; }
	/* sticky sidebar — offset by the sticky header height */
	.thr-filters { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 112px); overflow-y: auto; }
}
