/* WooCommerce archive list view + quote drawer.
   Loaded after Blocksy so the attribute-selector overrides below win. */

/* ---------- list rows ---------- */

ul.products[data-bw-view="list"] {
	display: block;
}

.bw-list-head {
	position: sticky;
	top: calc( var(--wp-admin--admin-bar--height, 0px) + var(--header-sticky-height, 0px) );
	z-index: 20;
	display: grid;
	grid-template-columns: var(--bw-list-template);
	column-gap: 16px;
	align-items: center;
	padding: 13px 16px;
	border-block: 0;
/*	border-bottom: 2px solid var(--theme-global-border-color, #e2e2e2); */
	background: var(--theme-content-background-color, #fff);
/*	box-shadow: 0 10px 12px -12px rgba(0, 0, 0, 0.3);   */
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--theme-heading-text-color, #121212);
}

/* Track 1 is the thumbnail column, which has no heading of its own. */
.bw-list-head .bw-lh-product {
	grid-column: 2;
}

.bw-list-head .bw-lh-cell {
	grid-column: var(--bw-col, 3);
	min-width: 0;
}

.bw-list-head .bw-lh-action {
	grid-column: -2;
	justify-self: end;
}

ul.products[data-bw-view="list"] > li.product {
	display: grid;
	grid-template-columns: var(--bw-list-template);
	grid-template-rows: auto auto;
	column-gap: 16px;
	align-items: center;
	text-align: left;
	padding: 18px 16px;
	border-bottom: 1px solid var(--theme-global-border-color, #e2e2e2);
}

/* Anything Blocksy adds that we do not place explicitly stacks under the title
   instead of landing in an attribute column. */
ul.products[data-bw-view="list"] > li.product > * {
	grid-column: 2;
	grid-row: auto;
	margin-bottom: 0;
}

ul.products[data-bw-view="list"] > li.product > figure {
	grid-column: 1;
	grid-row: 1 / span 2;
	width: 100%;
	max-width: 88px;
	align-self: center;
	margin: 0;
}

ul.products[data-bw-view="list"] > li.product > figure img {
	width: 100%;
	height: auto;
}

ul.products[data-bw-view="list"] > li.product > .woocommerce-loop-product__title {
	grid-column: 2;
	grid-row: 1;
	font-size: 15px;
}

ul.products[data-bw-view="list"] > li.product > .bw-cell {
	grid-column: var(--bw-col, 3);
	grid-row: 1;
	font-size: 14px;
}

ul.products[data-bw-view="list"] > li.product > .bw-cell-extra {
	grid-column: 2;
	grid-row: 2;
	display: grid;
	row-gap: 6px;
	min-width: 0;
}

/* The thumbnail is taller than the two text rows, and the height it forces into
   them lands as dead space between the title and its options. Pinning each block
   to the shared row edge collapses that gap while the text block stays centred
   against the image. */
@media (min-width: 782px) {
	ul.products[data-bw-view="list"] > li.product > .woocommerce-loop-product__title,
	ul.products[data-bw-view="list"] > li.product > .bw-cell {
		align-self: end;
	}

	ul.products[data-bw-view="list"] > li.product > .bw-cell-extra {
		align-self: start;
	}
}

ul.products[data-bw-view="list"] .bw-cell-local {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	column-gap: 16px;
	font-size: 13px;
	color: var(--theme-content-light-text-color, #6b6b6b);
}

ul.products[data-bw-view="list"] .bw-cell-local > div {
	display: flex;
	column-gap: 4px;
}

ul.products[data-bw-view="list"] .bw-cell-local dt {
	font-weight: 600;
}

ul.products[data-bw-view="list"] .bw-cell-local dt::after {
	content: ":";
}

ul.products[data-bw-view="list"] .bw-cell-local dd {
	margin: 0;
}

ul.products[data-bw-view="list"] .bw-cell-variations {
	margin: 0;
	font-size: 13px;
	color: var(--theme-content-light-text-color, #6b6b6b);
}

ul.products[data-bw-view="list"] .bw-cell-variations b {
	font-weight: 600;
}

/* Quoting is price-free, and the column is gone from the grid template. */
ul.products[data-bw-view="list"] > li.product .price {
	display: none;
}

/* Blocksy renders its cart button in a container that moves around per card
   skin, plus a toolbar nested inside <figure> that overlays the thumbnail. The
   row action is rendered by the theme instead. */
ul.products[data-bw-view="list"] > li.product > .ct-woo-card-actions,
ul.products[data-bw-view="list"] > li.product figure .ct-woo-card-extra {
	display: none;
}

ul.products[data-bw-view="list"] > li.product > .bw-row-action {
	grid-column: -2;
	grid-row: 1 / span 2;
	justify-self: end;
	align-self: center;
}

ul.products[data-bw-view="list"] > li.product > .bw-row-action .bw-quote-add {
	/* Half of Blocksy's default 5px/20px button padding. The label stays at
	   11px because 50% of the theme type size is unreadable. */
	--theme-icon-size: 13px;
	/* Blocksy tints .ct-icon with the global icon colour, not the button text. */
	--theme-icon-color: currentColor;
	font-size: 11px;
	padding: 6px 10px;
	min-height: 0;
	line-height: 1.4;
	column-gap: 5px;
}

.bw-quote-add__icon,
.bw-quote-inquiry__icon,
.bw-quote-trigger__icon {
	display: inline-flex;
	flex: none;
}

.bw-quote-add__icon svg,
.bw-quote-inquiry__icon svg,
.bw-quote-trigger__icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* Blocksy's button is inline-flex without a gap, so the icon would sit flush
   against the label. The list rows override this with a tighter one. */
.bw-quote-add {
	align-items: center;
	column-gap: 8px;
}

/* Blocksy stretches and orders the single-product button through
   `.single_add_to_cart_button`, the very class the quote button must not carry
   (it is what `wc-add-to-cart-variation` disables). Take over the two
   declarations it contributed. */
.entry-summary .ct-cart-actions > .bw-quote-add {
	flex: 1;
	max-width: var(--theme-button-max-width);
	--item-order: 2;
}

/* The row splits left/right: the quote button above takes the slack, the
   quick-inquiry link keeps its own width at the right edge. Blocksy sizes every
   child of this row with `--item-width`, which defaults to a full line. */
.entry-summary .ct-cart-actions > .bw-quote-inquiry {
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	column-gap: 8px;
	/* Half again the 104px the bare label measured, added on top of the glyph
	   rather than paid for by it: the icon and its gap only take the natural box
	   to 127px, which reads as no change at all. */
	min-width: 179px;
	--item-order: 3;
	--item-width: auto;
}

/* Rows run half a dozen columns wide and the headings float above them, so the
   row under the pointer has to be unmistakable. */
ul.products[data-bw-view="list"] > li.product:hover {
	background: rgba(0, 0, 0, 0.025);
}

/* ---------- quote trigger + drawer ---------- */

/* Blocksy's `.ct-menu-link` supplies the font, colour, padding, hover state and
   icon tint, so only the space between the three parts is ours. */
.bw-quote-trigger {
	align-items: center;
	column-gap: 6px;
	text-decoration: none;
}

.bw-quote-trigger__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	/* The colour the menu uses for the item under the pointer, so the counter is
	   the same accent the rest of the row reacts with. */
	background: var(--theme-link-hover-color, var(--theme-palette-color-1, #1e73be));
	color: var(--theme-text-color, #fff);
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
}

.bw-quote-drawer {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	justify-content: flex-end;
}

body.bw-quote-drawer-open {
	overflow: hidden;
}

/* Both set their own `display`, which beats the UA `[hidden]` rule and would
   leave the backdrop covering the page and a "0" badge always visible. */
.bw-quote-drawer[hidden],
.bw-quote-trigger__count[hidden] {
	display: none;
}

.bw-quote-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.bw-quote-drawer__panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(460px, 100%);
	height: 100%;
	background: var(--theme-content-background-color, #fff);
	box-shadow: -8px 0 28px rgba(0, 0, 0, 0.18);
}

.bw-quote-drawer__head,
.bw-quote-drawer__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-block: 1px solid var(--theme-global-border-color, #e2e2e2);
}

.bw-quote-drawer__title {
	margin: 0;
	font-size: 17px;
}

.bw-quote-drawer__close {
	border: 0;
	background: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

.bw-quote-drawer__body {
	flex: 1;
	overflow-y: auto;
	padding: 8px 20px;
}

.bw-quote-drawer__empty {
	padding: 40px 0;
	text-align: center;
	color: var(--theme-content-light-text-color, #6b6b6b);
}

.bw-quote-item {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr) auto;
	column-gap: 12px;
	align-items: start;
	padding: 14px 0;
	border-bottom: 1px solid var(--theme-global-border-color, #e2e2e2);
}

.bw-quote-item__thumb img {
	display: block;
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: var(--theme-border-radius, 3px);
}

.bw-quote-item__name {
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	color: inherit;
}

/* Labels in one aligned column and figures in the next: eight of them flow
   beside each other into a sentence nobody can scan, and the drawer is far too
   narrow to hold two of these pairs on a line. */
.bw-quote-item__spec {
	display: grid;
	grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
	column-gap: 10px;
	row-gap: 3px;
	margin: 7px 0 0;
	font-size: 12px;
	line-height: 1.45;
}

.bw-quote-item__spec dt {
	font-weight: 600;
	color: var(--theme-content-light-text-color, #6b6b6b);
}

.bw-quote-item__spec dt::after {
	content: ":";
}

.bw-quote-item__spec dd {
	margin: 0;
	overflow-wrap: anywhere;
}

/* One size for both drawer controls, so the picker and the stepper line up. */
.bw-quote-item__controls {
	display: flex;
	align-items: center;
	column-gap: 8px;
	margin-top: 8px;
	min-width: 0;
	--bw-quote-control-size: calc( var(--theme-form-field-height, 40px) * 0.5 );
}

.bw-quote-variation-field {
	display: flex;
	/* Without this the longest option label pushes the stepper out of the row. */
	min-width: 0;
	flex: 0 1 auto;
	/* The theme's form-label spacing survives here and lifts the picker above the
	   stepper it shares a row with, which reads as two controls out of line. */
	margin: 0;
}

.bw-quote-variation {
	display: block;
	width: -webkit-fit-content;
	width: fit-content;
	max-width: 100%;
	/* Blocksy forces selects to the full form field height. */
	height: var(--bw-quote-control-size);
	padding: 0 24px 0 8px;
	border: 1px solid var(--theme-global-border-color, #e2e2e2);
	border-radius: var(--theme-border-radius, 3px);
	/* `background` would wipe the chevron below. */
	background-color: var(--theme-content-background-color, #fff);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b6b6b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-size: 10px 6px;
	appearance: none;
	color: inherit;
	font-size: 12px;
	line-height: 1.4;
	cursor: pointer;
}

.bw-quote-variation:focus-visible {
	outline: 2px solid var(--theme-palette-color-1, #1e73be);
	outline-offset: 1px;
}

.bw-quote-item__remove {
	border: 0;
	background: none;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	padding: 0 2px;
	color: var(--theme-content-light-text-color, #6b6b6b);
}

.bw-quote-stepper {
	display: inline-flex;
	align-items: center;
	flex: none;
	height: var(--bw-quote-control-size);
	border: 1px solid var(--theme-global-border-color, #e2e2e2);
	border-radius: var(--theme-border-radius, 3px);
}

.bw-quote-stepper:focus-within {
	outline: 2px solid var(--theme-palette-color-1, #1e73be);
	outline-offset: 1px;
}

/* Scoped through the row so the theme's form field height cannot win here. */
.bw-quote-item .bw-quote-stepper button {
	width: 20px;
	height: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	font-size: 12px;
	line-height: 1;
}

.bw-quote-item .bw-quote-stepper input {
	width: 30px;
	height: 100%;
	/* The theme's field padding would leave two usable pixels for the digits. */
	padding: 0;
	border: 0;
	border-inline: 1px solid var(--theme-global-border-color, #e2e2e2);
	border-radius: 0;
	background: none;
	text-align: center;
	font-size: 12px;
	line-height: 1;
	-moz-appearance: textfield;
}

.bw-quote-item .bw-quote-stepper input:focus {
	outline: none;
}

.bw-quote-item .bw-quote-stepper input::-webkit-outer-spin-button,
.bw-quote-item .bw-quote-stepper input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.bw-quote-drawer__clear {
	border: 0;
	background: none;
	cursor: pointer;
	font-size: 13px;
	text-decoration: underline;
	color: var(--theme-content-light-text-color, #6b6b6b);
}

/* ---------- quote page detail ---------- */

.bw-spec-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

/* Horizontal rules only: with ten columns a box around every cell reads as a
   grid of empty slots rather than a list of parts. Blocksy borders every `th`
   and `td` it is given, so the sides have to be zeroed to be rid of them. */
.bw-spec-table th,
.bw-spec-table td {
	padding: 12px 14px;
	border: 0;
	border-bottom: 1px solid var(--theme-global-border-color, #e2e2e2);
	text-align: left;
	vertical-align: top;
	line-height: 1.5;
	font-variant-numeric: tabular-nums;
}

/* No `text-transform` here on purpose: a heading is an ACF sub-field label, and
   the shop writes it in the casing it wants seen — capitals on every letter just
   makes `No. of Outputs` unreadable. */
.bw-spec-table thead th {
	background: rgba(0, 0, 0, 0.03);
	border-bottom: 2px solid var(--theme-global-border-color, #e2e2e2);
	font-size: 13px;
	font-weight: 700;
	color: var(--theme-heading-text-color, #121212);
}

.bw-spec-table .bw-qt-qty,
.bw-spec-table thead th:last-child {
	text-align: center;
}

.bw-spec-table .bw-qt-qty {
	font-weight: 700;
	white-space: nowrap;
}

.bw-qt-sku,
.bw-qt-variation {
	display: block;
	font-size: 12px;
	color: var(--theme-content-light-text-color, #6b6b6b);
}

/* The part a quote is actually for, which the series name above it does not say. */
.bw-qt-variation {
	margin-top: 2px;
	font-size: 13px;
	font-weight: 700;
	color: var(--theme-heading-text-color, #121212);
}

/* Only the on-page copy of the table carries images, so the cell needs no
   layout changes until one is actually there. */
.bw-qt-product--image {
	display: flex;
	/* Not `center`: the cell is as tall as its attribute list, and the name has
	   to stay level with the photo it belongs to. */
	align-items: flex-start;
	gap: 12px;
}

.bw-qt-thumb {
	flex: none;
}

.bw-qt-thumb img {
	display: block;
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: var(--theme-border-radius, 3px);
}

.bw-qt-info {
	display: block;
	min-width: 0;
}

/* Attributes that earned no column, listed under the name the same way the
   shop rows list them. */
.bw-qt-local {
	display: flex;
	flex-wrap: wrap;
	margin: 4px 0 0;
	column-gap: 16px;
	font-size: 13px;
	color: var(--theme-content-light-text-color, #6b6b6b);
}

.bw-qt-local > div {
	display: flex;
	column-gap: 4px;
}

.bw-qt-local dt {
	font-weight: 600;
}

.bw-qt-local dt::after {
	content: ":";
}

.bw-qt-local dd {
	margin: 0;
}

/* The part's own numbers, which WooCommerce has no per-option value for. Eight
   of them read as a sheet, not as a sentence, so they align instead of wrapping
   into each other. */
.bw-qt-specs {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 170px, 1fr ) );
	column-gap: 16px;
	row-gap: 2px;
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--theme-content-light-text-color, #6b6b6b);
}

.bw-qt-specs > div {
	display: flex;
	column-gap: 4px;
	min-width: 0;
}

.bw-qt-specs dt {
	flex: 0 0 auto;
	font-weight: 600;
}

.bw-qt-specs dt::after {
	content: ":";
}

.bw-qt-specs dd {
	margin: 0;
	min-width: 0;
}

.bw-qt-options {
	margin: 4px 0 0;
	font-size: 13px;
	color: var(--theme-content-light-text-color, #6b6b6b);
}

.bw-qt-options b {
	font-weight: 600;
}

.bw-quote-notice {
	padding: 14px 18px;
	border: 1px dashed var(--theme-global-border-color, #e2e2e2);
	font-size: 14px;
}

/* ---------- quote page layout ---------- */

/* The table is the part of this page that grows with the catalogue: eight
   attribute columns would otherwise push the page, and the form under it,
   sideways. */
.bw-quote-detail {
	overflow-x: auto;
	overscroll-behavior-x: contain;
}

/* A form reads best in a column, not across the whole content area. */
.bw-quote-page .wpforms-container {
	max-width: 760px;
}

/* WPForms caps medium fields at 60% of the container. Its rule is printed after
   the theme stylesheet, so beating it takes more classes rather than order. */
.bw-quote-page .wpforms-container .wpforms-form input.wpforms-field-medium,
.bw-quote-page .wpforms-container .wpforms-form select.wpforms-field-medium,
.bw-quote-page .wpforms-container .wpforms-form .wpforms-field-row.wpforms-field-medium {
	width: 100%;
	max-width: 100%;
}

@media (max-width: 480px) {
	/* Two 50% columns are too narrow to type a name into; WPForms only drops
	   its rows to full width, not the halves inside them. */
	.bw-quote-page .wpforms-container .wpforms-form .wpforms-field-row .wpforms-one-half {
		width: 100%;
		margin-left: 0;
	}
}

/* `[bw_quote_page]…[/bw_quote_page]` puts the form on the left and the enclosed
   content on the right; the table stays full width above them. */
.bw-quote-cols {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
	column-gap: clamp(24px, 5vw, 56px);
	align-items: start;
}

@media (max-width: 900px) {
	.bw-quote-cols {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 32px;
	}
}

@media (min-width: 782px) {
	/* Inside the scroller a column is allowed to be as wide as its header,
	   rather than being squeezed to one word per line. */
	.bw-spec-table th,
	.bw-spec-table td {
		min-width: 88px;
	}

	.bw-spec-table .bw-qt-product {
		min-width: 220px;
	}

	/* One or two digits: the track is what makes it look like a missing value. */
	.bw-spec-table .bw-qt-qty,
	.bw-spec-table thead th:last-child {
		min-width: 0;
		width: 1%;
	}

	/* Rows run ten columns wide, so the eye needs the line it is on. */
	.bw-spec-table tbody tr:nth-child(even) {
		background: rgba(0, 0, 0, 0.017);
	}
}

/* ---------- spec filter bar ---------- */

/* Printed before the loop, one step ahead of WooCommerce's result count, so the
   controls read as the header of the table they narrow rather than a sidebar
   beside it. */
.bw-filter {
	position: relative;
	margin-block: 0 14px;
	padding: 12px 16px 13px;
	border: 1px solid var(--theme-global-border-color, #e2e2e2);
	border-radius: 8px;
	background: var(--theme-content-background-color, #fff);
	font-size: 13px;
	line-height: 1.35;
	color: var(--theme-body-font-color, #313131);
}

.bw-filter__head {
	display: flex;
	align-items: center;
	column-gap: 8px;
	list-style: none;
	cursor: pointer;
	font-weight: 700;
	color: var(--theme-heading-text-color, #121212);
}

.bw-filter__head::-webkit-details-marker {
	display: none;
}

/* The fold is the browser's, driven by the `open` attribute (rendered in the
   markup, removed on phones by bw-filter.js), so the arrow is drawn here and
   turned from that same state rather than from any author-level display override. */
.bw-filter__head::after {
	content: "";
	inline-size: 7px;
	block-size: 7px;
	margin-inline-start: auto;
	border-inline-end: 1.5px solid currentColor;
	border-block-end: 1.5px solid currentColor;
	transform: rotate(45deg);
	transition: transform 120ms ease;
}

.bw-filter[open] > .bw-filter__head::after {
	transform: rotate(-135deg);
}

.bw-filter__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-inline-size: 19px;
	block-size: 19px;
	padding-inline: 5px;
	border-radius: 999px;
	background: var(--theme-primary-color, #1c1c1c);
	color: #fff;
	font-size: 11px;
}

/* The panel is a form, and it lays out as one: labels over controls, fields
   beside each other while there is room, so six spec columns read as one block
   of choices rather than six separate decisions. */
.bw-filter__body {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 150px, 1fr ) );
	column-gap: 10px;
	row-gap: 10px;
	align-items: end;
	padding-block-start: 11px;
	margin: 0;
}

.bw-filter__field {
	display: grid;
	row-gap: 4px;
	min-inline-size: 0;
}

.bw-filter__label {
	font-weight: 700;
	color: var(--theme-heading-text-color, #121212);
}

/*
 * Blocksy forces every select to its own form field height and default box, so
 * the whole control is set here rather than adjusted: two classes to outrank the
 * theme, an inline chevron because `appearance` has to go for the height to
 * stick, and 16px text on phones, which is the size iOS stops zooming the page
 * at when a control takes focus.
 */
.bw-filter .bw-filter__select {
	block-size: 42px;
	min-block-size: 0;
	inline-size: 100%;
	max-inline-size: 100%;
	padding-block: 0;
	padding-inline: 10px 28px;
	border: 1px solid var(--theme-global-border-color, #d8d8d8);
	border-radius: 6px;
	background-color: var(--theme-content-background-color, #fff);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b6b6b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 10px 6px;
	appearance: none;
	color: var(--theme-body-font-color, #313131);
	font-size: 14px;
	line-height: 1.3;
	cursor: pointer;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bw-filter .bw-filter__select:focus-visible {
	outline: 2px solid var(--theme-palette-color-1, #1e73be);
	outline-offset: 1px;
}

.bw-filter__field--on .bw-filter__select {
	border-color: var(--theme-primary-color, #1c1c1c);
	font-weight: 600;
}

.bw-filter__search {
	display: flex;
	flex-wrap: wrap;
	column-gap: 6px;
	row-gap: 6px;
}

.bw-filter__input {
	flex: 1 1 120px;
	min-inline-size: 0;
	padding: 5px 9px;
	border: 1px solid var(--theme-global-border-color, #d8d8d8);
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.4;
}

.bw-filter__submit {
	flex: 0 0 auto;
	padding: 5px 14px;
	border: 1px solid var(--theme-primary-color, #1c1c1c);
	border-radius: 6px;
	background: var(--theme-primary-color, #1c1c1c);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
}

/*
 * Blocksy sizes every `input[type=search]` and every `[type=submit]` by its own
 * rules, which are more specific than a single class here: on the live shop the
 * field came out 50px and the button 55px, a row with a step in it. Two classes
 * beat them — and the button needs `min-block-size` gone as well, since
 * `--theme-button-min-height` is what held it at 55 after the height was set.
 * Only the box is pinned; the text stays the theme's size, except on phones,
 * where anything under 16px makes iOS zoom the page when the box is focused.
 */
.bw-filter__search .bw-filter__input,
.bw-filter__search .bw-filter__submit {
	block-size: 42px;
	min-block-size: 0;
	padding-block: 0;
	padding-inline: 12px;
}

/* While a choice is navigating the panel stays on screen — the document behind
   it is still the previous page, so it must read as working, not frozen. The
   fields stop answering clicks because a second choice made during a navigation
   never reaches the URL it was meant to change. */
.bw-filter--busy .bw-filter__body {
	opacity: 0.55;
	pointer-events: none;
}

/* The ring rides above the whole box, not just the fields, because the result
   count is what is actually changing. It is inert markup until JS flags the
   panel busy, so with scripting off nothing is ever shown. */
.bw-filter__loading {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: rgba( 255, 255, 255, 0.45 );
	pointer-events: none;
}

.bw-filter__loading::after {
	content: "";
	inline-size: 22px;
	block-size: 22px;
	border: 2.5px solid var(--theme-primary-color, #1c1c1c);
	border-top-color: transparent;
	border-radius: 50%;
	animation: bw-filter-spin 0.7s linear infinite;
}

.bw-filter--busy .bw-filter__loading {
	display: flex;
}

@keyframes bw-filter-spin {
	to {
		transform: rotate( 360deg );
	}
}

/* Respect the OS setting: the panel still dims, only the spin slows down. */
@media (prefers-reduced-motion: reduce) {
	.bw-filter__loading::after {
		animation-duration: 1.4s;
	}
}

.bw-filter__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 14px;
	margin-block-start: 11px;
	padding-block-start: 10px;
	border-top: 1px solid var(--theme-global-border-color, #ececec);
}

.bw-filter__summary {
	opacity: 0.78;
}

/* Wide screens: the bar is the table's header, and a header that has to be
   discovered is not a header. The toggle goes away and the dropdowns are always
   up. The part number box gets two cells so the model number in it can be read. */
@media (min-width: 782px) {
	.bw-filter__head {
		display: none;
	}

	.bw-filter__body {
		padding-block-start: 0;
	}

	.bw-filter__field--search {
		grid-column: span 2;
	}
}

/* Phones: two dropdowns to a row keeps the folded panel barely taller than one
   product row, and every control is set to the 16px text that stops iOS jumping
   the page to its own zoom the moment a box takes focus. */
@media (max-width: 781px) {
	.bw-filter__body {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
		column-gap: 8px;
		row-gap: 9px;
	}

	.bw-filter__field--search {
		grid-column: 1 / -1;
	}

	.bw-filter__label {
		font-size: 12px;
	}

	.bw-filter .bw-filter__select,
	.bw-filter__search .bw-filter__input,
	.bw-filter__search .bw-filter__submit {
		font-size: 16px;
	}
}

/* ---------- narrow screens: rows become stacked cards ---------- */

@media (max-width: 781px) {
	.bw-list-head {
		display: none;
	}

	ul.products[data-bw-view="list"] > li.product {
		grid-template-columns: 84px minmax(0, 1fr);
		grid-template-rows: none;
		row-gap: 6px;
	}

	ul.products[data-bw-view="list"] > li.product > * {
		grid-column: 2;
		grid-row: auto;
	}

	ul.products[data-bw-view="list"] > li.product > figure {
		grid-column: 1;
		grid-row: 1 / span 3;
	}

	ul.products[data-bw-view="list"] > li.product > .bw-cell,
	ul.products[data-bw-view="list"] > li.product > .bw-cell-extra {
		grid-column: 2;
		grid-row: auto;
	}

	ul.products[data-bw-view="list"] > li.product > .bw-cell::before {
		content: attr(data-label) ": ";
		font-weight: 600;
	}

	ul.products[data-bw-view="list"] > li.product > .bw-row-action {
		grid-column: 2;
		grid-row: auto;
	}

	.bw-spec-table thead {
		display: none;
	}

	/* One card per product instead of one line per cell: the product keeps the
	   full width and the remaining values flow onto the line beneath it. */
	.bw-spec-table tr {
		/* Card inset plus the 48px thumbnail and its 12px gap, so the values
		   under a product line up with its name. */
		--bw-qt-gutter: 74px;
		display: flex;
		flex-wrap: wrap;
		column-gap: 14px;
		row-gap: 2px;
		padding-block: 12px;
		padding-inline-start: var(--bw-qt-gutter);
		padding-inline-end: 14px;
		border-bottom: 1px solid var(--theme-global-border-color, #e2e2e2);
	}

	/* Pulls the photo back to the card inset. The name follows it inside this
	   cell, so it stays on the gutter the values below are indented to. */
	.bw-spec-table .bw-qt-product {
		flex: 1 1 100%;
		margin-inline-start: calc(14px - var(--bw-qt-gutter));
	}

	.bw-spec-table td {
		border: 0;
		padding: 0;
	}

	.bw-spec-table .bw-qt-qty {
		margin-inline-start: auto;
	}

	/* The card is about 300px wide once the photo and its gutter are paid for;
	   the desktop gaps leave a pair stranded on its own line. */
	.bw-qt-local {
		column-gap: 12px;
		row-gap: 2px;
	}

	.bw-spec-table td::before {
		content: attr(data-label) ": ";
		font-weight: 600;
	}

	/* As a flex item the label would split the thumbnail from its name, and a
	   photo plus a name needs no prefix on its own line. */
	.bw-qt-product--image::before {
		display: none;
	}

	/* A phone shows the chips folded: eight rows of them is taller than the first
	   product, and the fold is the one thing the `<details>` is for. */
	.bw-filter:not([open]) .bw-filter__body,
	.bw-filter:not([open]) .bw-filter__foot {
		display: none;
	}

	/* 15ch of label plus a row of chips does not fit: the label takes its own
	   line and the chips get the full width. */
	.bw-filter__group {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 5px;
	}
}
