.rsa-grid { display: grid; gap: clamp(16px, 2vw, 28px); }
.rsa-grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rsa-grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rsa-grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .rsa-grid--cols-4, .rsa-grid--cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .rsa-grid { grid-template-columns: 1fr; } }
.rsa-grid--carousel { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: min(82%, 340px); overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 18px; margin-inline: -4px; scrollbar-width: thin; scrollbar-color: var(--rsa-chrome) transparent; }
.rsa-grid--carousel > * { scroll-snap-align: start; }

/*
 * Vehicle card. Photo on top, then make / title, a "window sticker" strip of up to three facts, and a price line pinned to the
 * bottom so a row of cards lines up whatever the title length. The round arrow is the visual "view car" cue; the whole card is
 * the link (the title link's ::after covers it).
 */
.rsa-card {
	position: relative; display: flex; flex-direction: column; height: 100%;
	background: var(--rsa-bg); color: var(--rsa-ink); border: 1px solid var(--rsa-border); border-radius: calc(var(--rsa-radius) + 2px);
	box-shadow: var(--rsa-shadow-sm); overflow: hidden; isolation: isolate;
	transition: transform .45s var(--rsa-ease-out), box-shadow .45s var(--rsa-ease-out), border-color .25s var(--rsa-ease);
}
.rsa-card:hover { transform: translateY(-6px); box-shadow: var(--rsa-shadow-lg); border-color: var(--rsa-chrome); }
.rsa-card__media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--rsa-surface); }
/* A soft shade at the top keeps the badges and the save / compare buttons readable on bright skies. */
.rsa-card__media::after { content: ""; position: absolute; inset: 0 0 auto; height: 38%; background: linear-gradient(180deg, rgba(5, 11, 23, .28), transparent); pointer-events: none; }
.rsa-card__img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; transition: transform .9s var(--rsa-ease-out); }
.rsa-card:hover .rsa-card__img { transform: scale(1.05); }
.rsa-card__ph { display: grid; place-items: center; width: 100%; height: 100%; color: var(--rsa-chrome); background: linear-gradient(135deg, var(--rsa-surface), var(--rsa-chip)); }
.rsa-card__badges { position: absolute; left: 12px; top: 12px; z-index: 1; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.rsa-card__badges .rsa-chip { background: rgba(255, 255, 255, .94); color: #14294d; box-shadow: 0 2px 8px rgba(5, 11, 23, .18); }
.rsa-card__badges .rsa-chip--sold { background: #0b1527; color: #fff; }
.rsa-card__actions { position: absolute; right: 10px; top: 10px; z-index: 3; display: flex; flex-direction: column; gap: 6px; opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s; }
.rsa-card:hover .rsa-card__actions, .rsa-card:focus-within .rsa-card__actions, .rsa-card__actions:has([aria-pressed="true"]) { opacity: 1; transform: none; }
@media (hover: none) { .rsa-card__actions { opacity: 1; transform: none; } }
.rsa-card__act { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .94); color: #14294d; cursor: pointer; box-shadow: 0 2px 10px rgba(5, 11, 23, .2); transition: background .2s, color .2s, transform .2s; }
.rsa-card__act:hover { background: #fff; color: #2457b3; transform: scale(1.06); }
.rsa-card__act[aria-pressed="true"] { background: var(--rsa-brand); color: var(--rsa-on-brand); }
.rsa-card__act[aria-pressed="true"] svg { fill: currentColor; }

.rsa-card__body { position: relative; display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 18px 20px 20px; }
.rsa-card__make { margin: 0; font: 700 .7rem/1 var(--rsa-font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--rsa-muted); }
.rsa-card__title { margin: 0; font: 700 1.12rem/1.25 var(--rsa-font-head); letter-spacing: -.015em; }
.rsa-card__title a { color: var(--rsa-ink); text-decoration: none; }
.rsa-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.rsa-card:hover .rsa-card__title a { color: var(--rsa-link); }
/* Window-sticker strip: facts separated by hairlines, tabular figures for the mileage. */
.rsa-card__facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: 4px 0 8px; padding: 0; list-style: none; font: 500 .84rem/1.3 var(--rsa-font-body); font-variant-numeric: tabular-nums; color: var(--rsa-muted); }
.rsa-card__facts li { padding-inline: 10px; }
.rsa-card__facts li:first-child { padding-left: 0; }
.rsa-card__facts li + li { border-left: 1px solid var(--rsa-border); }
.rsa-card__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: auto 0 0; padding: 14px 52px 0 0; border-top: 1px solid var(--rsa-border); }
.rsa-card__price strong { font: 800 1.5rem/1 var(--rsa-font-head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--rsa-link); }
.rsa-card__price s { font-size: .9rem; color: var(--rsa-muted); font-variant-numeric: tabular-nums; }
.rsa-card__price--ask { font-size: .95rem; color: var(--rsa-muted); font-weight: 650; }
/* "View" cue: a round arrow in the bottom-right corner that fills on hover. Decorative; the title link carries the name. */
.rsa-card__body::after {
	content: ""; position: absolute; right: 18px; bottom: 16px; width: 38px; height: 38px; border-radius: 50%;
	border: 1px solid var(--rsa-border);
	background: var(--rsa-link);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 18px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 18px no-repeat;
	transition: transform .35s var(--rsa-ease-out);
}
.rsa-card__body::before { content: ""; position: absolute; right: 18px; bottom: 16px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--rsa-border); background: var(--rsa-surface); transition: background .25s var(--rsa-ease), border-color .25s var(--rsa-ease), transform .35s var(--rsa-ease-out); }
.rsa-card:hover .rsa-card__body::before { background: var(--rsa-chip); border-color: var(--rsa-electric); }
.rsa-card:hover .rsa-card__body::after, .rsa-card:hover .rsa-card__body::before { transform: translateX(3px); }

.rsa-card__body:not(:has(.rsa-card__price))::before, .rsa-card__body:not(:has(.rsa-card__price))::after { display: none; }

.rsa-card.is-sold .rsa-card__img { filter: saturate(.55) brightness(.96); }
.rsa-card.is-sold:hover .rsa-card__img { filter: none; }
.rsa-card.is-sold .rsa-card__price strong { color: var(--rsa-muted); }

.rsa-card--feature .rsa-card__media { aspect-ratio: 16 / 11; }
.rsa-card--feature .rsa-card__title { font-size: 1.3rem; }
.rsa-card--compact { flex-direction: row; }
.rsa-card--compact .rsa-card__media { flex: 0 0 38%; aspect-ratio: auto; }
.rsa-card--compact .rsa-card__body { padding: 12px 14px; justify-content: center; }
.rsa-card--compact .rsa-card__body::before, .rsa-card--compact .rsa-card__body::after { display: none; }
.rsa-card--compact .rsa-card__price { padding: 8px 0 0; margin-top: 4px; }
.rsa-card--compact .rsa-card__facts { display: none; }
.rsa-card--compact .rsa-card__actions { display: none; }

@media (forced-colors: active) { .rsa-card__body::before, .rsa-card__body::after { display: none; } }
@media (prefers-reduced-motion: reduce) {
	.rsa-card, .rsa-card__img, .rsa-card__actions, .rsa-card__act, .rsa-card__body::before, .rsa-card__body::after { transition: none; }
	.rsa-card:hover, .rsa-card:hover .rsa-card__body::before, .rsa-card:hover .rsa-card__body::after { transform: none; }
	.rsa-card:hover .rsa-card__img { transform: none; }
}
