/* ==========================================================================
   Enginery Smart Filter
   ========================================================================== */

/* ---------- Directory page shell ---------- */
.eng-dir { display: block; min-height: 60vh; background: #FBFAF7; }
.eng-dir__body { padding-top: 28px; padding-bottom: 64px; }

.eng-dir-hero {
	--_c: var(--eng-copper);
	position: relative;
	padding: 34px 0 34px;
	border-bottom: 1px solid rgba(28, 32, 36, .08);
	background-color: var(--eng-paper);
	background-image:
		linear-gradient(rgba(var(--eng-steel-rgb), .13) 1px, transparent 1px),
		linear-gradient(90deg, rgba(var(--eng-steel-rgb), .13) 1px, transparent 1px);
	background-size: 28px 28px;
	font-family: var(--eng-font-body);
}
.eng-dir-hero::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 3px;
	background: linear-gradient(90deg, var(--_c) 0 120px, transparent 120px);
}
.eng-crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; color: #7A7F86; font: 500 12px/1.4 var(--eng-font-mono); letter-spacing: .04em; text-transform: uppercase; }
.eng-crumbs a { color: #5C626A; text-decoration: none; }
.eng-crumbs a:hover { color: var(--eng-copper); }
.eng-crumbs span[aria-hidden] { color: #B5B0A8; }
.eng-dir-hero__row { display: flex; align-items: flex-start; gap: 20px; }
.eng-dir-hero__icon {
	display: grid;
	flex: none;
	place-items: center;
	width: 64px;
	height: 64px;
	border-radius: 16px;
	background: var(--eng-graphite);
	color: var(--eng-amber);
	box-shadow: 0 10px 24px -10px rgba(28, 32, 36, .5);
}
.eng-dir-hero.has-color .eng-dir-hero__icon { background: var(--_c); color: #fff; box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--_c) 70%, transparent); }
.eng-dir-hero__eyebrow { margin: 0 0 6px; color: var(--_c); font: 600 12px/1 var(--eng-font-mono); letter-spacing: .12em; text-transform: uppercase; }
.eng-dir-hero__title { margin: 0; color: var(--eng-graphite); font: 700 clamp(30px, 4.2vw, 46px)/1.05 var(--eng-font-head); letter-spacing: -.025em; }
.eng-dir-hero__intro { max-width: 680px; margin: 12px 0 0; color: #50565D; font-size: 17px; line-height: 1.55; }

/* ---------- Layout ---------- */
.esf { --esf-line: rgba(28, 32, 36, .1); font-family: var(--eng-font-body); color: var(--eng-ink); }
.esf *, .esf *::before, .esf *::after { box-sizing: border-box; }
.esf [hidden] { display: none !important; }
.esf__layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 28px; align-items: start; }
.esf--no-panel .esf__layout { grid-template-columns: minmax(0, 1fr); }
.esf__main { min-width: 0; }

/* ---------- Panel ---------- */
.esf__panel {
	position: sticky;
	top: calc(var(--eng-header-h, 64px) + 16px);
	max-height: calc(100vh - var(--eng-header-h, 64px) - 32px);
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 1px solid var(--esf-line);
	border-radius: var(--eng-radius-lg);
	background: #fff;
	scrollbar-width: thin;
}
.esf__panel-head {
	position: sticky;
	top: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 18px;
	border-bottom: 1px solid var(--esf-line);
	background: #fff;
}
.esf__panel-title { display: flex; align-items: center; gap: 8px; margin: 0; flex: 1; color: var(--eng-graphite); font: 600 12px/1 var(--eng-font-mono); letter-spacing: .12em; text-transform: uppercase; }
.esf__panel-title .eng-icon { color: var(--eng-copper); }
.esf a.esf__clear { color: var(--eng-copper); font-size: 13px; font-weight: 600; text-decoration: none; }
.esf a.esf__clear:hover { text-decoration: underline; }
.esf .esf__close { display: none; }
.esf__form { margin: 0; padding: 4px 18px 8px; }

.esf-filter { padding: 12px 0; border-bottom: 1px dashed var(--esf-line); }
.esf-filter:last-of-type { border-bottom: 0; }
.esf .esf-filter__head {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	margin: 0;
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--eng-graphite);
	font: 600 14.5px/1.3 var(--eng-font-head);
	text-align: left;
	cursor: pointer;
	box-shadow: none;
}
.esf .esf-filter__head > span:first-child { flex: 1; }
.esf .esf-filter__head .eng-icon { color: #8B939B; transition: transform .2s var(--eng-ease); }
.esf .esf-filter__head[aria-expanded="false"] .eng-icon { transform: rotate(-90deg); }
.esf .esf-filter__head:hover { color: var(--eng-copper); background: none; }
.esf-filter__n {
	display: inline-grid;
	place-items: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 99px;
	background: var(--eng-copper);
	color: #fff;
	font: 600 11px/1 var(--eng-font-mono);
}
.esf-filter__body { padding-top: 8px; }

/* Options */
.esf .esf-opts { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; }
.esf .esf-opt { margin: 0; padding: 0; }
.esf .esf-opt::before, .esf .esf-opt::marker { content: none; }
.esf .esf-opt label {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 6px 8px;
	border-radius: 7px;
	color: var(--eng-ink);
	font-size: 14.5px;
	line-height: 1.3;
	cursor: pointer;
	transition: background-color .15s;
}
.esf .esf-opt label:hover { background: var(--eng-paper); }
.esf .esf-opt input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.esf-opt__box {
	position: relative;
	flex: none;
	width: 18px;
	height: 18px;
	border: 1.5px solid #B9BEC4;
	border-radius: 5px;
	background: #fff;
	transition: background-color .15s, border-color .15s;
}
.esf-opt__box.is-radio { border-radius: 50%; }
.esf .esf-opt input:checked + .esf-opt__box { border-color: var(--eng-copper); background: var(--eng-copper); }
.esf .esf-opt input:checked + .esf-opt__box::after {
	content: "";
	position: absolute;
	inset: 0;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.esf .esf-opt input:checked + .esf-opt__box.is-radio::after { background: #fff; inset: 4px; border-radius: 50%; }
.esf .esf-opt input:focus-visible + .esf-opt__box { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--eng-copper); }
.esf-opt__dot { flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--_c); }
.esf-opt__label { flex: 1; min-width: 0; }
.esf .esf-count {
	flex: none;
	min-width: 26px;
	padding: 2px 6px;
	border-radius: 99px;
	background: #F1EEE8;
	color: #6B7178;
	font: 500 11.5px/1.3 var(--eng-font-mono);
	text-align: center;
}
.esf .esf-opt.is-zero label { opacity: .42; }
.esf .esf-showmore {
	margin: 6px 0 0 8px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--eng-copper);
	font: 600 13px/1.4 var(--eng-font-body);
	cursor: pointer;
	box-shadow: none;
}
.esf .esf-showmore:hover { text-decoration: underline; background: none; }

.esf .esf-filter select,
.esf__sort select {
	width: 100%;
	height: 40px;
	padding: 0 34px 0 12px;
	border: 1.5px solid rgba(28, 32, 36, .16);
	border-radius: 8px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B939B' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center / 16px no-repeat;
	color: var(--eng-ink);
	font: 500 14px/1 var(--eng-font-body);
	appearance: none;
	-webkit-appearance: none;
}
.esf select:focus { outline: none; border-color: var(--eng-copper); }

/* Search */
.esf-filter--search { padding-top: 14px; }
.esf-search { position: relative; }
.esf-search .eng-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #8B939B; pointer-events: none; }
.esf .esf-search input {
	width: 100%;
	height: 42px;
	margin: 0;
	padding: 0 12px 0 38px;
	border: 1.5px solid rgba(28, 32, 36, .14);
	border-radius: 9px;
	background: var(--eng-paper);
	color: var(--eng-ink);
	font: 400 14.5px/1 var(--eng-font-body);
	box-shadow: none;
}
.esf .esf-search input:focus { outline: none; border-color: var(--eng-copper); background: #fff; }

/* Switch */
.esf-filter--toggle { padding: 14px 0; }
.esf .esf-switch { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--eng-graphite); font: 600 14.5px/1.3 var(--eng-font-head); cursor: pointer; }
.esf .esf-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.esf-switch__track { position: relative; flex: none; width: 36px; height: 20px; border-radius: 99px; background: #CDD1D5; transition: background-color .2s; }
.esf-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s var(--eng-ease); }
.esf .esf-switch input:checked + .esf-switch__track { background: var(--eng-patina); }
.esf .esf-switch input:checked + .esf-switch__track::after { transform: translateX(16px); }
.esf .esf-switch input:focus-visible + .esf-switch__track { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--eng-copper); }

/* Range */
.esf-range { padding: 6px 2px 0; }
.esf-range__track { position: relative; height: 22px; }
.esf-range__track::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 4px; background: #E3E0DA; }
.esf-range__fill { position: absolute; top: 9px; height: 4px; border-radius: 4px; background: var(--eng-copper); }
.esf .esf-range input[type="range"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 22px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}
.esf .esf-range input[type="range"]::-webkit-slider-runnable-track { background: none; border: 0; }
.esf .esf-range input[type="range"]::-moz-range-track { background: none; border: 0; }
.esf .esf-range input[type="range"]::-webkit-slider-thumb {
	width: 20px;
	height: 20px;
	border: 2px solid var(--eng-copper);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 6px rgba(28, 32, 36, .2);
	cursor: grab;
	pointer-events: auto;
	-webkit-appearance: none;
}
.esf .esf-range input[type="range"]::-moz-range-thumb {
	width: 16px;
	height: 16px;
	border: 2px solid var(--eng-copper);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 6px rgba(28, 32, 36, .2);
	cursor: grab;
	pointer-events: auto;
}
.esf .esf-range input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(var(--eng-copper-rgb), .25); }
.esf-range__inputs { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.esf .esf-range__inputs label { position: relative; flex: 1; margin: 0; }
.esf .esf-range__inputs label span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #8B939B; font: 500 13px var(--eng-font-mono); pointer-events: none; }
.esf .esf-range__inputs input {
	width: 100%;
	height: 38px;
	margin: 0;
	padding: 0 8px 0 24px;
	border: 1.5px solid rgba(28, 32, 36, .14);
	border-radius: 8px;
	background: #fff;
	color: var(--eng-ink);
	font: 500 14px/1 var(--eng-font-mono);
	-moz-appearance: textfield;
}
.esf .esf-range__inputs input::-webkit-inner-spin-button { -webkit-appearance: none; }
.esf .esf-range__inputs input:focus { outline: none; border-color: var(--eng-copper); }
.esf-range__dash { color: #8B939B; }

.esf__apply-wrap { position: sticky; bottom: 0; padding: 12px 0 10px; background: linear-gradient(transparent, #fff 30%); }
.esf .esf__apply { width: 100%; min-height: 44px; }
.esf.is-js .esf__apply-wrap { display: none; }

/* ---------- Top chips ---------- */
.esf__top { display: grid; gap: 10px; margin-bottom: 16px; }
.esf-filter--chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 0; border: 0; }
.esf-chips__label { color: #7A7F86; font: 600 11.5px/1 var(--eng-font-mono); letter-spacing: .1em; text-transform: uppercase; }
.esf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.esf .esf-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 7px 12px;
	border: 1.5px solid rgba(28, 32, 36, .14);
	border-radius: 99px;
	background: #fff;
	color: var(--eng-graphite);
	font: 500 14px/1 var(--eng-font-body);
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s;
}
.esf .esf-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.esf .esf-chip:hover { border-color: var(--eng-copper); color: var(--eng-copper); }
.esf .esf-chip.is-on { border-color: var(--eng-graphite); background: var(--eng-graphite); color: #fff; }
.esf .esf-chip.is-on .esf-count { background: rgba(255, 255, 255, .16); color: #fff; }
.esf .esf-chip.is-zero { opacity: .45; }
.esf .esf-chip:focus-within { box-shadow: 0 0 0 3px rgba(var(--eng-copper-rgb), .3); }

/* ---------- Bar ---------- */
.esf__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.esf .esf__open {
	display: none;
	align-items: center;
	gap: 8px;
	height: 40px;
	margin: 0;
	padding: 0 14px;
	border: 1.5px solid rgba(28, 32, 36, .16);
	border-radius: 8px;
	background: #fff;
	color: var(--eng-graphite);
	font: 600 14px/1 var(--eng-font-body);
	cursor: pointer;
}
.esf__badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--eng-copper); color: #fff; font: 600 11px/1 var(--eng-font-mono); }
.esf__count { flex: 1; margin: 0; color: var(--eng-graphite); font: 600 16px/1.2 var(--eng-font-head); }
.esf__sort { display: flex; align-items: center; gap: 8px; margin: 0; color: #7A7F86; font: 500 12px/1 var(--eng-font-mono); letter-spacing: .06em; text-transform: uppercase; }
.esf__sort select { width: auto; min-width: 170px; text-transform: none; letter-spacing: 0; }

.esf__active { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 16px; }
.esf .esf-active {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 5px 8px 5px 11px;
	border: 1px solid rgba(var(--eng-copper-rgb), .3);
	border-radius: 99px;
	background: rgba(var(--eng-copper-rgb), .08);
	color: #9C3F1B;
	font: 500 13px/1.2 var(--eng-font-body);
	cursor: pointer;
}
.esf .esf-active:hover { background: var(--eng-copper); border-color: var(--eng-copper); color: #fff; }

/* ---------- Results ---------- */
.esf__results { position: relative; margin: 0 !important; transition: opacity .2s; container-type: inline-size; }
.esf__results::before {
	content: "";
	position: absolute;
	top: -8px;
	left: 0;
	height: 2px;
	width: 0;
	background: var(--eng-copper);
	opacity: 0;
}
.esf.is-loading .esf__results { opacity: .5; pointer-events: none; }
.esf.is-loading .esf__results::before { opacity: 1; animation: esf-load 1s var(--eng-ease) infinite; }
@keyframes esf-load { 0% { left: 0; width: 0; } 50% { left: 20%; width: 50%; } 100% { left: 100%; width: 0; } }

.esf-empty { padding: 56px 20px; border: 1.5px dashed rgba(28, 32, 36, .16); border-radius: var(--eng-radius-lg); text-align: center; }
.esf-empty__icon { display: inline-grid; place-items: center; width: 60px; height: 60px; margin-bottom: 14px; border-radius: 50%; background: var(--eng-paper); color: var(--eng-copper); }
.esf-empty__title { margin: 0 0 6px !important; color: var(--eng-graphite); font: 600 19px/1.3 var(--eng-font-head); }
.esf-empty__text { margin: 0 0 18px !important; color: #6B7178; }

/* ---------- Paging ---------- */
.esf__paging { display: flex; justify-content: center; margin-top: 28px; }
.esf a.esf-more { min-width: 200px; text-decoration: none; }
.esf a.esf-more.is-busy { opacity: .6; pointer-events: none; }
.esf-pages { display: flex; flex-wrap: wrap; gap: 6px; }
.esf-pages a,
.esf-pages span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 8px; font: 600 14px/1 var(--eng-font-mono); text-decoration: none; }
.esf-pages a { border: 1.5px solid rgba(28, 32, 36, .14); color: var(--eng-graphite); }
.esf-pages a:hover { border-color: var(--eng-copper); color: var(--eng-copper); }
.esf-pages__cur { background: var(--eng-graphite); color: #fff; }
.esf-pages__gap { color: #8B939B; }

/* ---------- Mobile drawer ---------- */
@media (max-width: 960px) {
	.esf__layout { grid-template-columns: minmax(0, 1fr); }
	.esf .esf__open { display: inline-flex; }
	.esf__panel {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 100002;
		width: min(360px, 88vw);
		max-height: none;
		border: 0;
		border-radius: 0;
		box-shadow: 20px 0 40px rgba(28, 32, 36, .2);
		transform: translateX(-105%);
		transition: transform .3s var(--eng-ease);
	}
	.esf__panel.is-open { transform: none; }
	.esf .esf__close { display: inline-grid; place-items: center; width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--eng-graphite); cursor: pointer; }
	.esf .esf__close:hover { background: var(--eng-paper); }
	.esf__backdrop { position: fixed; inset: 0; z-index: 100001; background: rgba(28, 32, 36, .5); }
	.esf.is-js .esf__apply-wrap { display: block; }
	.esf__sort { margin-left: auto; }
	.esf__sort span { display: none; }
	.esf__count { order: 3; flex-basis: 100%; }
	.eng-dir-hero__icon { width: 52px; height: 52px; border-radius: 13px; }
}
@media (max-width: 560px) {
	.eng-dir-hero { padding: 24px 0; }
	.eng-dir-hero__row { gap: 14px; }
	.eng-dir-hero__intro { font-size: 15.5px; }
	.esf__sort select { min-width: 0; }
}
html.esf-lock,
html.esf-lock body { overflow: hidden !important; }

@media (prefers-reduced-motion: reduce) {
	.esf *, .esf *::before, .esf *::after { animation: none !important; transition: none !important; }
}
