/*
 * TruckerDude Core - Truck GPS Finder
 * v0.5.0
 */

.td-gps-finder {
	--tdf-border: rgba(34,34,34,.14);
	--tdf-soft: #f7f8f9;
	--tdf-muted: #5f6368;
	--tdf-link: #1e73be;
	margin-top: 1.4rem;
}

/* Filters */
.td-gps-finder__filters {
	display: grid;
	grid-template-columns: repeat(3,minmax(0,1fr));
	gap: 1rem;
	margin: 0 0 2rem;
	padding: 1rem;
	border: 1px solid var(--tdf-border);
	border-radius: 10px;
	background: var(--tdf-soft);
}

.td-gps-filter {
	min-width: 0;
}

.td-gps-filter__label {
	margin-bottom: .4rem;
	font-size: .72em;
	font-weight: 700;
	line-height: 1.25;
}

.td-gps-filter .facetwp-facet {
	margin-bottom: 0;
	font-size: .76em;
}

.td-gps-filter .facetwp-dropdown {
	width: 100%;
	min-height: 40px;
	padding: .35rem .55rem;
	border-radius: 5px;
}

.td-gps-filter .facetwp-checkbox,
.td-gps-filter .facetwp-radio {
	margin-bottom: .28rem;
	line-height: 1.35;
}

.td-gps-filter--reset {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
}

/* With the dash-cam facet enabled there are seven controls. Keep the
   three-column filter grid and give Reset a compact full-row position. */
.td-gps-filter--reset {
	grid-column: 1 / -1;
	align-items: flex-start;
}

.td-gps-filter--reset .facetwp-reset {
	min-height: 40px;
	padding: .5rem .8rem;
	border: 0;
	border-radius: 5px;
	cursor: pointer;
}

/* Listing */
.td-gps-finder__results .facetwp-template {
	min-height: 80px;
}

.td-gps-finder__results .fwpl-layout {
	display: grid !important;
	grid-template-columns: repeat(2,minmax(0,1fr)) !important;
	gap: 1.2rem !important;
}

.td-gps-finder__results .fwpl-result {
	min-width: 0;
	height: 100%;
	padding: 1rem;
	border: 1px solid var(--tdf-border);
	border-radius: 10px;
	background: #fff;
	box-sizing: border-box;
	transition: transform .15s ease, box-shadow .15s ease;
}

.td-gps-finder__results .fwpl-result:hover {
	transform: translateY(-1px);
	box-shadow: 0 5px 16px rgba(0,0,0,.07);
}

.td-gps-finder__results .fwpl-result img {
	display: block;
	width: 100%;
	height: 145px;
	margin: 0 auto .8rem;
	object-fit: contain;
}

/* Works best when Listing Builder item names are:
   image, title, brand, verdict, screen, battery, cta */
.td-gps-finder__results .fwpl-item.title {
	margin-bottom: .25rem;
	font-size: 1em;
	font-weight: 700;
	line-height: 1.25;
}

.td-gps-finder__results .fwpl-item.title a {
	text-decoration: none;
}

.td-gps-finder__results .fwpl-item.brand {
	margin-bottom: .7rem;
	font-size: .7em;
	font-weight: 600;
	color: var(--tdf-muted);
}

.td-gps-finder__results .fwpl-item.verdict {
	margin-bottom: .8rem;
	font-size: .75em;
	line-height: 1.48;
}

.td-gps-finder__results .fwpl-item.screen,
.td-gps-finder__results .fwpl-item.battery {
	display: inline-block;
	margin: 0 .3rem .55rem 0;
	padding: .25rem .45rem;
	border-radius: 999px;
	background: var(--tdf-soft);
	font-size: .66em;
	line-height: 1.3;
}

/* FacetWP Listing Builder still outputs the item wrapper when a field is
   blank. Hide truly empty wrappers so they do not render as empty pills. */
.td-gps-finder__results .fwpl-item.screen:empty,
.td-gps-finder__results .fwpl-item.battery:empty {
	display: none !important;
}

.td-gps-finder__results .fwpl-item.cta {
	margin-top: .45rem;
}

.td-gps-finder__results .fwpl-item.cta a,
.td-gps-finder__results .fwpl-result .fwpl-item:last-child a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: .48rem .75rem;
	border-radius: 5px;
	background: var(--tdf-link);
	color: #fff;
	font-size: .72em;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
}

.td-gps-finder__results .fwpl-item.cta a:hover,
.td-gps-finder__results .fwpl-item.cta a:focus,
.td-gps-finder__results .fwpl-result .fwpl-item:last-child a:hover,
.td-gps-finder__results .fwpl-result .fwpl-item:last-child a:focus {
	color: #fff;
	filter: brightness(.92);
}

/* Keep the lower card controls aligned even when verdict lengths vary.
   This relies on the recommended Listing Builder unique item names:
   image, title, brand, verdict, screen, battery, cta. */
.td-gps-finder__results .fwpl-result > .fwpl-row {
	height: 100%;
}

.td-gps-finder__results .fwpl-result .fwpl-col {
	display: grid !important;
	grid-template-columns: max-content max-content minmax(0,1fr);
	grid-template-rows: auto auto auto minmax(0,1fr) auto auto;
	column-gap: .3rem;
	height: 100%;
	min-height: 0;
}

.td-gps-finder__results .fwpl-item.image,
.td-gps-finder__results .fwpl-item.title,
.td-gps-finder__results .fwpl-item.brand,
.td-gps-finder__results .fwpl-item.verdict,
.td-gps-finder__results .fwpl-item.cta {
	grid-column: 1 / -1;
}

.td-gps-finder__results .fwpl-item.image {
	grid-row: 1;
}

.td-gps-finder__results .fwpl-item.title {
	grid-row: 2;
}

.td-gps-finder__results .fwpl-item.brand {
	grid-row: 3;
}

.td-gps-finder__results .fwpl-item.verdict {
	grid-row: 4;
}

.td-gps-finder__results .fwpl-item.screen {
	grid-column: 1;
	grid-row: 5;
}

.td-gps-finder__results .fwpl-item.battery {
	grid-column: 2;
	grid-row: 5;
}

.td-gps-finder__results .fwpl-item.cta {
	grid-row: 6;
	align-self: end;
}

.td-gps-finder__results .fwpl-item {
	overflow-wrap: anywhere;
}

@media (max-width: 760px) {
	.td-gps-finder__filters {
		grid-template-columns: repeat(2,minmax(0,1fr));
	}

	.td-gps-finder__results .fwpl-layout {
		grid-template-columns: repeat(2,minmax(0,1fr)) !important;
	}
}

@media (max-width: 560px) {
	.td-gps-finder__filters {
		grid-template-columns: 1fr;
		padding: .8rem;
	}

	.td-gps-finder__results .fwpl-layout {
		grid-template-columns: 1fr !important;
	}

	.td-gps-finder__results .fwpl-result img {
		height: 160px;
	}
}

/* =========================================================
   v0.5.0 — Truck GPS guided matcher
   ========================================================= */

.td-gps-match {
	--tdm-border: rgba(34,34,34,.14);
	--tdm-soft: #f7f8f9;
	--tdm-muted: #5f6368;
	--tdm-link: #1e73be;
	margin: 0 0 2.25rem;
}

.td-gps-match__heading {
	margin-bottom: .9rem;
}

.td-gps-match__heading h2 {
	margin: 0 0 .3rem;
	font-size: 1.3em;
	line-height: 1.25;
}

.td-gps-match__heading p,
.td-gps-match__results-heading p {
	margin: 0;
	font-size: .72em;
	line-height: 1.5;
	color: var(--tdm-muted);
}

.td-gps-match__form {
	display: grid;
	grid-template-columns: repeat(2,minmax(0,1fr));
	gap: .85rem 1rem;
	padding: 1rem;
	border: 1px solid var(--tdm-border);
	border-radius: 10px;
	background: var(--tdm-soft);
}

.td-gps-match__field {
	display: flex;
	flex-direction: column;
	gap: .38rem;
	min-width: 0;
	font-size: .74em;
	font-weight: 700;
	line-height: 1.25;
}

.td-gps-match__field select {
	width: 100%;
	min-height: 42px;
	padding: .42rem .55rem;
	border-radius: 5px;
	font-size: 1em;
	font-weight: 400;
}

.td-gps-match__submit {
	display: flex;
	align-items: center;
	gap: .8rem;
	grid-column: 1 / -1;
	margin-top: .15rem;
}

.td-gps-match__submit button,
.td-gps-match-button--primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: .52rem .85rem;
	border: 0;
	border-radius: 5px;
	background: var(--tdm-link);
	color: #fff;
	font-size: .74em;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

.td-gps-match__submit a {
	font-size: .7em;
	font-weight: 600;
}

.td-gps-match__results {
	margin-top: 1.1rem;
	scroll-margin-top: 1rem;
}

.td-gps-match__notice {
	margin: 0;
	padding: .8rem .9rem;
	border: 1px solid var(--tdm-border);
	border-radius: 8px;
	background: #fff;
	font-size: .76em;
	line-height: 1.45;
}

.td-gps-match__results-heading {
	margin-bottom: .7rem;
}

.td-gps-match__results-heading h3 {
	margin: 0 0 .2rem;
	font-size: 1.05em;
	line-height: 1.25;
}

.td-gps-match__cards {
	display: grid;
	grid-template-columns: repeat(3,minmax(0,1fr));
	gap: .8rem;
}

.td-gps-match-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: .85rem;
	border: 1px solid var(--tdm-border);
	border-radius: 10px;
	background: #fff;
}

.td-gps-match-card__media {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 115px;
	margin-bottom: .6rem;
}

.td-gps-match-card__image {
	display: block;
	max-width: 100%;
	max-height: 105px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.td-gps-match-card__placeholder {
	font-size: .65em;
	color: var(--tdm-muted);
}

.td-gps-match-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.td-gps-match-card__rank {
	align-self: flex-start;
	margin-bottom: .35rem;
	padding: .2rem .45rem;
	border-radius: 999px;
	background: var(--tdm-soft);
	font-size: .58em;
	font-weight: 700;
	line-height: 1.25;
	text-transform: uppercase;
	letter-spacing: .035em;
}

.td-gps-match-card__title {
	margin: 0 0 .15rem;
	font-size: .9em;
	line-height: 1.3;
}

.td-gps-match-card__title a {
	text-decoration: none;
}

.td-gps-match-card__brand {
	margin: 0 0 .5rem;
	font-size: .62em;
	font-weight: 600;
	color: var(--tdm-muted);
}

.td-gps-match-card__summary {
	margin: 0 0 .6rem;
	font-size: .66em;
	line-height: 1.45;
}

.td-gps-match-card__reasons {
	margin: 0 0 .55rem;
	padding-left: 1.05rem;
	font-size: .64em;
	line-height: 1.42;
}

.td-gps-match-card__reasons li + li {
	margin-top: .25rem;
}

.td-gps-match-card__caveat {
	margin: 0 0 .45rem;
	font-size: .61em;
	line-height: 1.4;
	color: var(--tdm-muted);
}

.td-gps-match-card__meta {
	margin-top: auto;
	padding-top: .45rem;
	font-size: .58em;
	color: var(--tdm-muted);
}

.td-gps-match-card__actions {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: .38rem;
	margin-top: .55rem;
}

.td-gps-match-button--secondary {
	display: inline-flex;
	align-items: center;
	min-height: 34px;
	padding: .35rem .55rem;
	border: 1px solid var(--tdm-border);
	border-radius: 5px;
	background: #fff;
	font-size: .62em;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
}

.td-gps-match__affiliate-note {
	margin: .55rem 0 0;
	font-size: .58em;
	line-height: 1.4;
	color: var(--tdm-muted);
}

@media (max-width: 760px) {
	.td-gps-match__cards {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 560px) {
	.td-gps-match__form {
		grid-template-columns: 1fr;
		padding: .8rem;
	}
}

.td-gps-match__reset.is-hidden {
	display: none;
}

.td-gps-match__submit button:disabled {
	opacity: .65;
	cursor: wait;
}
