/* Tyres Filter for WooCommerce — front-end & admin styles.
   The front-end finder / search bar / sidebar widget all use the .tf-card look below,
   driven by CSS custom properties so themes (and the Accent colour setting) can recolour it. */

/* ---- Design tokens (overridable) -------------------------------------- */
.tf-card {
	--tf-accent: var( --wd-primary-color, #e8344e );   /* WoodMart primary, or a sensible red */
	--tf-accent-contrast: #fff;                         /* text on the accent button */
	--tf-card-bg: #fff;
	--tf-field-bg: #f4f5f7;
	--tf-border: #e4e6ea;
	--tf-text: #1d2327;
	--tf-text-muted: rgba( 29, 35, 39, .55 );
	--tf-radius: 14px;

	background: var( --tf-card-bg );
	color: var( --tf-text );
	border: 1px solid var( --tf-border );
	border-radius: var( --tf-radius );
	padding: clamp( 16px, 3vw, 28px );
	box-shadow: 0 1px 3px rgba( 0, 0, 0, .06 ), 0 8px 24px rgba( 0, 0, 0, .06 );
	box-sizing: border-box;
	margin: 0 0 1.5em;
}
.tf-card * {
	box-sizing: border-box;
}

/* ---- Tabs / head row -------------------------------------------------- */
.tf-card__head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	flex-wrap: wrap;
	gap: .5em 1em;
	margin: 0 0 1.1em;
	border-bottom: 1px solid var( --tf-border );
}
.tf-card__tabs {
	display: flex;
	gap: 1.25em;
}
.tf-tab {
	background: transparent;
	border: 0;
	padding: .55em .15em;
	margin: 0;
	font: inherit;
	font-weight: 600;
	letter-spacing: .02em;
	color: var( --tf-text-muted );
	cursor: pointer;
	position: relative;
}
.tf-tab--active {
	color: var( --tf-accent );
}
.tf-tab--active::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 3px;
	border-radius: 3px;
	background: var( --tf-accent );
}
.tf-card__hint {
	font-size: .82em;
	margin: 0 0 .35em;
}
.tf-card__hint a {
	color: var( --tf-text-muted );
	text-decoration: none;
}
.tf-card__hint a:hover {
	color: var( --tf-accent );
	text-decoration: underline;
}

/* ---- Field row + segmented field cards -------------------------------- */
.tf-card__row {
	display: flex;
	flex-wrap: wrap;
	gap: .75em;
	align-items: stretch;
}
.tf-card__row--filters {
	margin-top: .75em;
	font-size: .92em;
	align-items: center;
}
/* Panes are layout-transparent so their fields flow as flex items of .tf-card__row. */
.tf-pane:not( [hidden] ) {
	display: contents;
}
.tf-field {
	flex: 1 1 12em;
	min-width: 9.5em;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: .15em;
	background: var( --tf-field-bg );
	border: 1px solid var( --tf-border );
	border-radius: calc( var( --tf-radius ) - 4px );
	padding: .5em .85em;
	transition: border-color .15s ease;
}
.tf-field:hover,
.tf-field:focus-within {
	border-color: var( --tf-accent );
}
.tf-field label {
	font-size: .7em;
	letter-spacing: .07em;
	text-transform: uppercase;
	font-weight: 700;
	color: var( --tf-text-muted );
	line-height: 1.2;
}
.tf-field select {
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	font-weight: 600;
	color: var( --tf-text );
	width: 100%;
	max-width: 100%;
	cursor: pointer;
	line-height: 1.4;
}
.tf-field select:disabled {
	color: var( --tf-text-muted );
	cursor: default;
	opacity: 1;
}
.tf-field--action {
	flex: 1 1 11em;
	background: transparent;
	border: 0;
	padding: 0;
}

/* ---- CTA button ------------------------------------------------------- */
.tf-card .tf-submit,
.tf-card .tf-submit.button {
	flex: 1 1 11em;
	min-width: 9.5em;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5em;
	width: 100%;
	background: var( --tf-accent, var( --wd-primary-color, #e8344e ) );
	color: var( --tf-accent-contrast, #fff );
	border: 0;
	border-radius: calc( var( --tf-radius ) - 4px );
	padding: .85em 1.4em;
	font: inherit;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: none;
	line-height: 1.2;
	cursor: pointer;
	transition: filter .15s ease;
	text-decoration: none;
}
.tf-card .tf-submit:hover,
.tf-card .tf-submit:focus {
	filter: brightness( .92 );
	color: var( --tf-accent-contrast );
}
.tf-card .tf-submit:focus-visible {
	outline: 2px solid var( --tf-accent );
	outline-offset: 2px;
}
.tf-submit__arrow {
	font-weight: 400;
}

/* Secondary filter row text-button "Reset" */
.tf-reset {
	background: transparent;
	border: 0;
	padding: .5em .25em;
	font: inherit;
	color: var( --tf-text-muted );
	text-decoration: underline;
	cursor: pointer;
	flex: 0 0 auto;
}
.tf-reset:hover {
	color: var( --tf-accent );
}

/* ---- Validation flash ------------------------------------------------- */
.tf-card--needs-input .tf-card__row:not( .tf-card__row--filters ) .tf-field {
	border-color: #d63638;
}

/* ---- Hints / loading -------------------------------------------------- */
.tf-hint,
.tf-capped-note {
	font-size: .85em;
	color: var( --tf-text-muted );
	margin: .25em 0 0;
}
.tf-loading {
	margin: 1em 0;
	font-style: italic;
	opacity: .8;
}

/* ---- Finder results (below the card) ---------------------------------- */
.tf-results {
	margin-top: 1.5em;
}
.tf-resolved-sizes {
	font-weight: 600;
	margin: 0 0 1em;
}
.tf-result-group {
	margin-bottom: 2em;
}
.tf-result-group__title {
	margin: 0 0 .75em;
	padding-bottom: .3em;
	border-bottom: 2px solid var( --tf-accent, currentColor );
}
.tf-badge--recommended {
	display: inline-block;
	font-size: .7em;
	font-weight: 700;
	letter-spacing: .05em;
	padding: .2em .5em;
	border-radius: .4em;
	background: var( --tf-accent );
	color: var( --tf-accent-contrast );
	margin-bottom: .4em;
}
.tf-no-results {
	padding: 1em 0;
	opacity: .8;
}
.tf-pagination {
	display: flex;
	gap: .25em;
	flex-wrap: wrap;
	margin-top: 1.5em;
	align-items: center;
}
.tf-page {
	border: 1px solid var( --tf-border, rgba( 0, 0, 0, .2 ) );
	background: transparent;
	padding: .35em .7em;
	cursor: pointer;
	font: inherit;
	border-radius: 4px;
	color: inherit;
}
.tf-page:hover:not( [disabled] ) {
	border-color: var( --tf-accent, currentColor );
}
.tf-page[disabled] {
	opacity: .4;
	cursor: default;
}
.tf-page-current {
	font-weight: 700;
	background: var( --tf-accent, transparent );
	color: var( --tf-accent-contrast, inherit );
	border-color: var( --tf-accent, currentColor );
}
.tf-page-ellipsis {
	padding: 0 .35em;
	opacity: .6;
}

/* ---- Sidebar widget (narrow → stacked) -------------------------------- */
.tf-widget .tf-card,
.tf-widget__inner.tf-card {
	padding: 1.1em 1.25em;
}
.tf-widget .tf-card__row {
	flex-direction: column;
	gap: .6em;
}
.tf-widget .tf-field,
.tf-widget .tf-field--action,
.tf-widget .tf-submit {
	flex: 1 1 auto;
	min-width: 0;
}
.tf-widget__active {
	font-size: .85em;
	margin: 0 0 .6em;
	color: var( --tf-text-muted );
}
.tf-widget__active a,
.tf-widget__clear {
	color: var( --tf-accent );
}
.tf-widget__actions {
	display: flex;
	gap: .75em;
	flex-wrap: wrap;
	align-items: center;
	margin-top: .25em;
}
/* ---- Compact search bar ----------------------------------------------- */
.tf-searchbar__title {
	margin: 0 0 .75em;
	font-size: 1.1em;
	font-weight: 700;
}

/* ---- Responsive ------------------------------------------------------- */
@media ( max-width: 680px ) {
	.tf-card__row {
		flex-direction: column;
	}
	.tf-field,
	.tf-field--action,
	.tf-card .tf-submit {
		flex: 1 1 auto;
		min-width: 0;
	}
	.tf-card__head {
		gap: .25em .75em;
	}
}

/* ---- Single product: fits these vehicles ------------------------------ */
.tf-product-fitments {
	margin: 2em 0;
}
.tf-product-fitments h2 {
	font-size: 1.1em;
}
.tf-product-fitments__brand {
	margin: .75em 0 .25em;
	font-weight: 600;
}
.tf-product-fitments ul {
	margin: 0 0 1em 1.2em;
}

/* ---- Admin product metabox ------------------------------------------- */
.tf-metabox__row {
	display: flex;
	gap: .5em;
	align-items: center;
	margin-bottom: .5em;
}
.tf-metabox__row .tf-remove-binding {
	color: #b32d2e;
	cursor: pointer;
	text-decoration: none;
}
.tf-metabox__add {
	margin-top: .5em;
}
.tf-coverage-list {
	max-height: 12em;
	overflow: auto;
	border: 1px solid #dcdcde;
	padding: .5em;
	margin-top: .5em;
	font-size: .9em;
}
