/* ==========================================================================
   DriveKaro — components (product cards, comparison table, finder, forms,
   related links, notes). Loaded on the homepage, singular views and
   DriveKaro Core pages. Also loaded inside the block editor.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Vehicle finder — an "instrument panel": ink header strip, plain fields
   -------------------------------------------------------------------------- */
.dk-finder {
	display: grid;
	gap: 0;
	background: var(--dk-paper);
	border: 2px solid var(--dk-ink);
	border-radius: var(--dk-radius-l);
	overflow: hidden;
	box-shadow: 0 18px 40px rgba(23, 33, 43, 0.10);
}

.dk-finder__title {
	margin: 0;
	padding: 14px 20px;
	background: var(--dk-ink);
	color: #fff;
	font-size: 1.15rem;
	font-weight: 800;
	font-stretch: var(--dk-wide);
	line-height: 1.2;
}

.dk-finder__fields {
	display: grid;
	gap: 14px;
	padding: 18px 20px 4px;
}

.dk-finder__field label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.9rem;
}

.dk-finder__optional { color: var(--dk-muted); font-weight: 500; }

.dk-finder select { cursor: pointer; }

.dk-finder__submit {
	margin: 14px 20px 20px;
	width: calc(100% - 40px);
}

@media (min-width: 560px) {
	.dk-finder--compact .dk-finder__fields { grid-template-columns: 1fr 1fr 0.8fr; }
}

/* --------------------------------------------------------------------------
   Buttons used by product components
   -------------------------------------------------------------------------- */
.dk-btn--sm { min-height: 40px; padding: 8px 12px; font-size: 0.9rem; }

.dk-btn--merchant {
	background: var(--dk-paper);
	color: var(--dk-ink);
	border-color: var(--dk-line-strong);
}

.dk-btn--merchant:hover { border-color: var(--dk-ink); color: var(--dk-ink); }

.dk-merchants {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.dk-merchants .dk-btn { flex: 1 1 auto; white-space: nowrap; }

/* --------------------------------------------------------------------------
   Product profile card (extends .dk-product from base.css)
   -------------------------------------------------------------------------- */
.dk-product--profile .dk-product__media {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: #fff;
}

.dk-product--profile .dk-product__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* Phones: a shorter photo keeps the name, price and buttons near the top of each card. */
@media (max-width: 639px) {
	.dk-product--profile .dk-product__media { aspect-ratio: 16 / 9; max-height: 200px; padding: 10px; }
}

.dk-product__brand {
	margin: -8px 0 12px;
	color: var(--dk-muted);
	font-size: 0.875rem;
	font-weight: 600;
}

.dk-product__score { margin: 0 0 10px; }

.dk-product__facts {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0 0 16px;
	padding-top: 12px;
	border-top: 1px solid var(--dk-line);
	font-size: 0.875rem;
}

.dk-product__actions .dk-merchants { flex: 1 1 100%; }
.dk-product__actions .dk-merchants + .dk-btn { flex: 1 1 100%; }

.dk-product--compact .dk-product__media { aspect-ratio: 16 / 9; }
.dk-product--compact .dk-product__body { padding: 14px 16px 16px; }
.dk-product--compact .dk-product__title { font-size: 1.05rem; }

/* Price / fits / score lines */
.dk-price { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.dk-price__range { font-weight: 800; font-variant-numeric: tabular-nums; }
.dk-price__note,
.dk-price__typical { color: var(--dk-ink-2); }
.dk-price__check { color: var(--dk-muted); }
.dk-price__check a { color: inherit; }

.dk-fits { color: var(--dk-ink-2); }
.dk-fits a { color: var(--dk-ink); font-weight: 600; }

.dk-score { display: inline-flex; align-items: baseline; gap: 2px; flex-wrap: wrap; }

.dk-score__value {
	font-size: 1.4rem;
	font-weight: 800;
	font-stretch: var(--dk-wider);
	font-variant-numeric: tabular-nums;
	color: var(--dk-ink);
}

.dk-score__of { color: var(--dk-muted); font-weight: 700; }
.dk-score__how { margin-left: 8px; font-size: 0.8rem; color: var(--dk-ink-2); }

.dk-badge--research {
	background: var(--dk-surface);
	border-color: var(--dk-line-strong);
	color: var(--dk-ink-2);
	font-weight: 600;
}

.dk-badge--status { background: var(--dk-surface-2); color: var(--dk-ink-2); }
.dk-badge--coming_soon { background: var(--dk-primary-tint); color: var(--dk-primary); }

/* --------------------------------------------------------------------------
   Comparison table — products are columns, attributes are rows. The table
   scrolls inside its own box; the attribute column stays pinned.
   -------------------------------------------------------------------------- */
.dk-compare {
	margin: 1.5em 0 2em;
	border: 1px solid var(--dk-line);
	border-radius: var(--dk-radius-l);
	background: var(--dk-paper);
	overflow: hidden;
	font-size: 0.95rem;
	line-height: 1.45;
}

.dk-compare__title {
	padding: 14px 18px;
	border-bottom: 1px solid var(--dk-line);
	font-weight: 800;
	font-stretch: var(--dk-wide);
	font-size: 1.05rem;
	color: var(--dk-ink);
}

.dk-compare__scroll {
	position: relative; /* keeps absolutely positioned children (screen-reader text) inside the scroll box */
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x proximity;
}

.dk-compare__scroll:focus-visible { box-shadow: inset 0 0 0 3px var(--dk-primary); border-radius: 0; }

.dk-compare__table {
	width: 100%;
	min-width: calc(128px + var(--dk-cols, 3) * 190px);
	border-collapse: separate;
	border-spacing: 0;
	table-layout: fixed;
}

.dk-compare__table th,
.dk-compare__table td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--dk-line);
	text-align: left;
	vertical-align: top;
	scroll-snap-align: start;
}

.dk-compare__table tbody th {
	position: sticky;
	left: 0;
	z-index: 1;
	width: 128px;
	background: var(--dk-surface);
	box-shadow: 1px 0 0 var(--dk-line);
	color: var(--dk-ink-2);
	font-size: 0.85rem;
	font-weight: 700;
}

.dk-compare__corner {
	position: sticky;
	left: 0;
	z-index: 2;
	width: 128px;
	background: var(--dk-surface);
	box-shadow: 1px 0 0 var(--dk-line);
}

.dk-compare__table thead th {
	background: var(--dk-paper);
	border-bottom: 2px solid var(--dk-ink);
	font-weight: 700;
}

.dk-compare__img {
	display: block;
	width: 72px;
	height: 72px;
	margin-bottom: 8px;
	object-fit: contain;
	border-radius: var(--dk-radius-s);
	background: #fff;
}

.dk-compare__name { display: block; color: var(--dk-ink); font-weight: 800; text-decoration: none; margin-bottom: 6px; }
.dk-compare__name:hover { color: var(--dk-primary); text-decoration: underline; }

.dk-compare__list { margin: 0; padding-left: 1.1em; }
.dk-compare__list li { margin-bottom: 4px; }
.dk-compare__list--pros li::marker { color: var(--dk-good); }
.dk-compare__list--cons li::marker { color: var(--dk-bad); }
.dk-compare__note { color: var(--dk-muted); font-size: 0.85rem; }
.dk-compare__empty { color: var(--dk-line-strong); }
.dk-compare__row--buy .dk-merchants { flex-direction: column; }
.dk-compare__row--buy .dk-btn { width: 100%; }

.dk-compare__foot {
	margin: 0;
	padding: 10px 18px 14px;
	color: var(--dk-muted);
	font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   Related links (vehicles, problems, gear, guides)
   -------------------------------------------------------------------------- */
.dk-related-links { display: grid; gap: 18px; margin: 32px 0; }

.dk-related-links__title {
	margin: 0 0 10px;
	font-size: 1rem;
	font-weight: 800;
	font-stretch: var(--dk-wide);
}

.dk-related-links .dk-chip { min-height: 38px; }

@media (min-width: 760px) {
	.dk-related-links { grid-template-columns: 1fr 1fr; gap: 24px 32px; }
}

.dk-sidebar .dk-related-links { grid-template-columns: 1fr; margin: 0; }

/* Plain link rows */
.dk-linkrows { margin: 0; padding: 0; list-style: none; }
.dk-linkrows li { border-bottom: 1px solid var(--dk-line); }

.dk-linkrows a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 52px;
	padding: 10px 0;
	color: var(--dk-ink);
	font-weight: 600;
	text-decoration: none;
	line-height: 1.35;
}

.dk-linkrows a .dk-icon { color: var(--dk-muted); flex-shrink: 0; }
.dk-linkrows a:hover { color: var(--dk-primary); }
.dk-linkrows a:hover .dk-linkrows__title { text-decoration: underline; }

@media (min-width: 760px) {
	.dk-linkrows--grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
}

/* --------------------------------------------------------------------------
   Notes, quick answer, "when to stop", steps, sources, correction
   -------------------------------------------------------------------------- */
.dk-note {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 16px 0;
	padding: 12px 16px;
	background: var(--dk-primary-tint);
	border-left: 4px solid var(--dk-primary);
	border-radius: var(--dk-radius-s);
}

.dk-note p { margin: 0; }
.dk-note .dk-icon { color: var(--dk-primary); margin-top: 2px; }

.dk-quick {
	margin: 0 0 28px;
	padding: 18px 22px;
	background: var(--dk-primary-tint);
	border: 1px solid color-mix(in srgb, var(--dk-primary) 25%, #fff);
	border-radius: var(--dk-radius-l);
}

.dk-quick__title {
	margin: 0 0 6px;
	font-size: 0.95rem;
	font-weight: 800;
	font-stretch: var(--dk-wide);
	color: var(--dk-primary);
}

.dk-quick__text { font-size: 1.1rem; line-height: 1.6; }
.dk-quick__text p:last-child { margin-bottom: 0; }

.dk-stop {
	margin: 32px 0;
	padding: 18px 22px;
	background: #fff6f4;
	border: 1px solid #f0c9c3;
	border-left: 5px solid var(--dk-bad);
	border-radius: var(--dk-radius);
}

.dk-stop__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 8px;
	color: var(--dk-bad);
	font-size: 1.2rem;
	font-weight: 800;
	font-stretch: var(--dk-wide);
}

.dk-stop__text p:last-child { margin-bottom: 0; }

.dk-content .dk-steps { counter-reset: dk-step; list-style: none; padding-left: 0; }

.dk-content .dk-steps li {
	position: relative;
	padding: 2px 0 10px 44px;
	counter-increment: dk-step;
}

.dk-content .dk-steps li::before {
	content: counter(dk-step);
	position: absolute;
	left: 0;
	top: 0;
	width: 30px;
	height: 30px;
	display: grid;
	place-items: center;
	background: var(--dk-ink);
	color: #fff;
	border-radius: 50%;
	font-size: 0.85rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.dk-sources {
	margin: 32px 0 0;
	padding-top: 20px;
	border-top: 1px solid var(--dk-line);
	font-size: 0.9rem;
}

.dk-sources__title { margin: 0 0 8px; font-size: 1rem; font-weight: 800; }
.dk-sources ol { margin: 0; padding-left: 1.4em; color: var(--dk-ink-2); }
.dk-sources li { margin-bottom: 4px; overflow-wrap: anywhere; }

.dk-correction {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 24px 0;
	color: var(--dk-ink-2);
	font-size: 0.9rem;
}

.dk-correction .dk-icon { color: var(--dk-muted); }
.dk-correction a { color: var(--dk-ink-2); font-weight: 600; }

.dk-contact__title { margin: 0 0 8px; font-size: 1.4rem; font-stretch: var(--dk-wide); }
.dk-contact__intro { margin: 0 0 20px; color: var(--dk-ink-2); max-width: 62ch; }

/* --------------------------------------------------------------------------
   Contact form
   -------------------------------------------------------------------------- */
.dk-contact { margin: 1.5em 0; }
.dk-form { position: relative; display: grid; gap: 4px; max-width: 760px; }
.dk-form__row { display: grid; gap: 0 16px; }

@media (min-width: 640px) {
	.dk-form__row { grid-template-columns: 1fr 1fr; }
}

.dk-form__field { margin: 0 0 14px; }
.dk-form__field label { display: block; margin-bottom: 6px; }
.dk-form__hint { display: block; margin-top: 6px; color: var(--dk-muted); font-size: 0.85rem; }
.dk-form__check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 8px; }
.dk-form__check input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.dk-form__check label { font-weight: 500; }
.dk-form__error { margin: 6px 0 0; color: var(--dk-bad); font-weight: 600; font-size: 0.9rem; }
.dk-form [aria-invalid="true"] { border-color: var(--dk-bad); }
.dk-form .dk-btn { justify-self: start; margin-top: 8px; }
.dk-form__hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.dk-form__notice { padding: 12px 16px; margin-bottom: 16px; border-radius: var(--dk-radius-s); }
.dk-form__notice p { margin: 0; }
.dk-form__notice--ok { background: #e9f6ee; border-left: 4px solid var(--dk-good); }
.dk-form__notice--error { background: #fdeeee; border-left: 4px solid var(--dk-bad); }

/* --------------------------------------------------------------------------
   Gear category cards, vehicle cards, make tiles (home + directories)
   -------------------------------------------------------------------------- */
.dk-gearcards {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.dk-gearcards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

@media (min-width: 1100px) {
	.dk-gearcards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.dk-gearcard {
	padding: 16px;
	background: var(--dk-paper);
	border: 1px solid var(--dk-line);
	border-radius: var(--dk-radius);
}

.dk-gearcard__title { margin: 0; font-size: 1rem; line-height: 1.25; }

.dk-gearcard__title a {
	display: flex;
	flex-direction: column;
	gap: 10px;
	color: var(--dk-ink);
	text-decoration: none;
}

.dk-gearcard__title a:hover { color: var(--dk-primary); text-decoration: underline; }

.dk-gearcard__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--dk-primary);
	background: var(--dk-primary-tint);
	border-radius: var(--dk-radius);
}

.dk-gearcard__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0 10px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.85rem;
}

.dk-gearcard__links a {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	color: var(--dk-ink-2);
}

.dk-vcards {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.dk-vcards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

@media (min-width: 1100px) {
	.dk-vcards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.dk-vcard {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	height: 100%;
	padding: 12px 12px 14px;
	background: var(--dk-paper);
	border: 1px solid var(--dk-line);
	border-radius: var(--dk-radius);
}

.dk-vcard:hover { border-color: var(--dk-primary); }

.dk-vcard__media {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 9;
	margin-bottom: 6px;
	background: var(--dk-surface);
	border-radius: var(--dk-radius-s);
	overflow: hidden;
	color: var(--dk-line-strong);
}

.dk-vcard__media img { width: 100%; height: 100%; object-fit: contain; }

.dk-vcard__title { margin: 0; font-size: 1rem; line-height: 1.3; font-stretch: var(--dk-wide); }
.dk-vcard__title a { color: var(--dk-ink); text-decoration: none; }
.dk-vcard__title a::after { content: ""; position: absolute; inset: 0; }
.dk-vcard__title a:focus-visible { box-shadow: none; }
.dk-vcard__title a:focus-visible::after { box-shadow: var(--dk-focus); border-radius: var(--dk-radius); }
.dk-vcard__facts { margin: 0; color: var(--dk-muted); font-size: 0.85rem; }
.dk-vcard .dk-badge { align-self: flex-start; margin-top: 4px; font-size: 0.75rem; }

.dk-vcards--compact .dk-vcard__media { display: none; }

/* Text-only card (model without a photo): a plate-style tile. */
.dk-vcard--noimg { padding: 14px 16px; border-left: 4px solid var(--dk-ink); }
.dk-vcard--noimg .dk-vcard__title { font-size: 1.05rem; }
.dk-vcards + .dk-subhead { margin-top: 28px; }

/* --------------------------------------------------------------------------
   Mobile "where to buy" bar
   -------------------------------------------------------------------------- */
.dk-sticky {
	position: fixed;
	left: 8px;
	right: 8px;
	bottom: 8px;
	z-index: 40;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 8px 8px 14px;
	background: var(--dk-paper);
	border: 1px solid var(--dk-line-strong);
	border-radius: var(--dk-radius-l);
	box-shadow: 0 10px 30px rgba(23, 33, 43, 0.18);
}

.dk-sticky[hidden] { display: none; }

.dk-sticky__name {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.dk-sticky .dk-btn { flex-shrink: 0; min-height: 44px; padding-inline: 14px; }
.dk-sticky__close { flex-shrink: 0; width: 40px; height: 40px; }
body.dk-sticky-on { padding-bottom: 84px; }

@media (min-width: 900px) {
	.dk-sticky { display: none !important; }
}

/* Search best matches */
.dk-searchmatch {
	margin: 0 0 24px;
	padding: 16px;
	background: var(--dk-surface);
	border-radius: var(--dk-radius);
}

.dk-searchmatch__title { margin: 0 0 12px; font-size: 1rem; font-weight: 800; }
.dk-searchmatch .dk-chips { margin-top: 12px; }
.dk-card__type { color: var(--dk-ink-2); font-size: 0.8rem; font-weight: 700; }
