/* T01 "Search this table" (inc/ux2/t01-table-search.php, js/ux2/t01-table-search.js).
 * Px only: html{font-size:10px}. Selectors are over-qualified on purpose (legacy input/button rules).
 *
 * Toolbar layout (owner, 29 Oct), from js-set `.sb-tq-rows` on [data-sb-tb]:
 *   row 1  search box (left) ............................ Columns / Copy link / Export (right)
 *   ---- hairline (.sb-tq-break) ----
 *   row 2  filter groups, then APPLIED chips + Clear all (wrap as needed)
 * The "N lots available" count is kept for scripts and screen readers but not shown (owner, 29 Oct).
 */

/* --- the field ----------------------------------------------------------- */
.sb-tb .sb-tb__bar > div.sb-tq {
	position: relative;
	box-sizing: border-box;
	display: flex;
	flex-direction: row;
	align-items: center;
	flex: 0 1 420px;
	width: 420px;
	max-width: 100%;
	min-width: 220px;
	height: 42px;
	margin: 0;
	padding: 0 0 0 12px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
	gap: 8px;
	transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.sb-tb .sb-tb__bar > div.sb-tq:hover {
	border-color: #94a3b8;
}
.sb-tb .sb-tb__bar > div.sb-tq:focus-within {
	border-color: #1b2a4a;
	box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.18), 0 1px 2px rgba(15, 23, 42, 0.06);
}
.sb-tb .sb-tq label.sb-tq__label {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.sb-tb .sb-tq span.sb-tq__icon {
	position: static;
	flex: 0 0 16px;
	display: flex;
	align-items: center;
	color: #1b2a4a;
	pointer-events: none;
}
.sb-tb .sb-tq input[type="search"].sb-tq__input {
	box-sizing: border-box;
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	height: 40px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #141d2e;
	font-family: inherit;
	font-size: 13px;
	line-height: 40px;
	box-shadow: none;
	outline: 0;
	-webkit-appearance: none;
	appearance: none;
}
/* #5b6577 on #fff = 5.9:1 (AA). */
.sb-tb .sb-tq input[type="search"].sb-tq__input::placeholder {
	color: #5b6577;
	opacity: 1;
}
.sb-tb .sb-tq input[type="search"].sb-tq__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}
.sb-tb .sb-tq input[type="search"].sb-tq__input:focus {
	outline: 0;
	box-shadow: none;
}
.sb-tb .sb-tq button.sb-tq__clear {
	position: static;
	flex: 0 0 40px;
	padding: 0;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: transparent;
	color: #475569;
	border-radius: 0 7px 7px 0;
	cursor: pointer;
	font-size: 12px;
	box-shadow: none;
}
.sb-tb .sb-tb__bar > div.sb-tq button.sb-tq__clear {
	width: 40px !important;
	height: 40px !important;
	min-width: 40px !important;
}
.sb-tb .sb-tq button.sb-tq__clear[hidden] {
	display: none;
}
.sb-tb .sb-tq button.sb-tq__clear:hover {
	color: #141d2e;
	background: #f1f5f9;
}
.sb-tb .sb-tq button.sb-tq__clear:focus-visible {
	outline: 2px solid #1b2a4a !important;
	outline-offset: -2px;
}

/* --- count: kept for scripts (export dialog) and screen readers, not shown -- */
.sb-sf .sb-tb.sb-tq-rows .sb-tb__count {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}
.sb-sf .sb-tb.sb-tq-rows .sb-tb__divider {
	display: none !important;
}

/* --- two rows ------------------------------------------------------------ */
.sb-sf .sb-tb.sb-tq-rows .sb-tb__bar {
	position: relative;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 10px 8px;
	padding: 10px;
}
.sb-sf .sb-tb.sb-tq-rows .sb-tb__bar > div.sb-tq {
	order: 0;
	flex: 1 1 360px;
	width: auto;
	max-width: 520px;
}
.sb-sf .sb-tb.sb-tq-rows .sb-tb__bar > .sb-tb__right {
	order: 1;
	margin-left: auto;
	align-self: center;
}
.sb-sf .sb-tb.sb-tq-rows .sb-tb__bar > span.sb-tq-break {
	order: 2;
	display: block;
	flex: 0 0 100%;
	height: 1px;
	margin: 0;
	background: rgba(219, 223, 230, 0.6);
}
/*
 * Desktop: the form and its group wrappers dissolve (display: contents) so each filter button is an item
 * of the bar's second row, and the APPLIED block flows on the same line after them, wrapping as a unit.
 * The DOM is untouched: the inputs are still inside the <form> that sample-finder.js reads.
 */
@media (min-width: 768px) {
	.sb-sf .sb-tb.sb-tq-rows .sb-tb__bar > form.sb-tb__form {
		display: contents;
	}
	.sb-sf .sb-tb.sb-tq-rows .sb-tb__bar > form.sb-tb__form > *,
	.sb-sf .sb-tb.sb-tq-rows .sb-tb__bar > form.sb-tb__form .sb-tb__groups:not(.is-sheet) > *,
	.sb-sf .sb-tb.sb-tq-rows .sb-tb__bar > form.sb-tb__form .sb-tb__groups:not(.is-sheet) .sb-tb-sheet__body > * {
		order: 3;
	}
	.sb-sf .sb-tb.sb-tq-rows .sb-tb__bar > .sb-tb__applied {
		order: 4;
		flex: 0 1 auto;
		min-width: 0;
		align-items: center;
		margin: 0 0 0 4px;
		padding: 0 0 0 12px;
		border-top: 0;
		border-left: 1px solid rgba(219, 223, 230, 0.9);
	}
	.sb-sf .sb-tb.sb-tq-rows .sb-tb__bar > .sb-tb__applied ul.sb-tb__chips {
		flex: 0 1 auto;
	}
}

/* --- instant feedback while the server answers -------------------------- */
.sb-sf table.sb-sf-instock-table.sb-tq-pending tbody {
	opacity: 0.6;
	transition: opacity 0.1s ease;
}
.sb-sf table.sb-sf-instock-table tbody tr.sb-tq-miss {
	display: none !important;
}

/* --- empty state ----------------------------------------------------------- */
.sb-tq-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}
.sb-tq-empty p.sb-tq-empty__title {
	margin: 0;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	color: #141d2e;
	word-break: break-word;
}
.sb-tq-empty p.sb-tq-empty__hint {
	margin: 0;
	font-family: inherit;
	font-size: 14px;
	color: #5b6577;
}
.sb-tq-empty button.sb-tq-empty__btn {
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid #1b2a4a;
	border-radius: 8px;
	background: #fff;
	color: #1b2a4a;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}
.sb-tq-empty button.sb-tq-empty__btn:hover {
	background: #f1f5f9;
}

/* --- phone ------------------------------------------------------------------ */
@media (max-width: 767px) {
	.sb-sf .sb-tb.sb-tq-rows .sb-tb__bar {
		padding: 8px 10px;
		gap: 8px;
	}
	.sb-sf .sb-tb.sb-tq-rows .sb-tb__bar > div.sb-tq {
		order: -1;
		flex: 1 1 100%;
		width: 100%;
		max-width: 100%;
		min-width: 0;
		height: 46px;
	}
	.sb-tb .sb-tq input[type="search"].sb-tq__input {
		height: 44px;
		line-height: 44px;
		font-size: 16px;
	}
	.sb-tb .sb-tb__bar > div.sb-tq button.sb-tq__clear {
		flex-basis: 44px;
		width: 44px !important;
		height: 44px !important;
		min-width: 44px !important;
	}
	.sb-sf .sb-tb.sb-tq-rows .sb-tb__bar > span.sb-tq-break {
		display: none;
	}
	.sb-sf .sb-tb.sb-tq-rows .sb-tb__bar > form.sb-tb__form {
		order: 0;
		flex: 1 1 100%;
		width: 100%;
	}
	.sb-sf .sb-tb.sb-tq-rows .sb-tb__bar > .sb-tb__applied {
		order: 10;
		flex: 1 1 100%;
		flex-wrap: wrap;
		padding: 8px 0 0;
		border-left: 0;
		border-top: 1px solid rgba(219, 223, 230, 0.6);
	}
}
