/* Rent Vehicles hub — rebuilt to match
   design_handoff_cbm_marketplace/pages/CBM Rent Vehicles.dc.html exactly
   (see page-templates/template-rent-vehicles.php's header comment for the
   full rationale). Depot/Services share this same page structure.
   The old .cbm-rv-sponsor-row__flex/__wraptext hack has been replaced by
   the shared .cbm-textwrap component (components.css) — see
   inc/template-tags.php's cbm_render_intro_textwrap(). */

.cbm-rv-grid { display: grid; grid-template-columns: 1fr minmax(260px, 320px); gap: 32px; padding-block: 20px 56px; align-items: start; }
.cbm-rv-main { min-width: 0; }

.cbm-rv-cat-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 32px; }
.cbm-rv-cat-btn {
	display: block; background: var(--cbm-red); color: #fff; font-weight: 700; font-size: 14px;
	letter-spacing: 0.03em; text-transform: uppercase; text-align: center; padding: 18px; border-radius: 2px;
	transition: opacity 0.15s ease;
}
.cbm-rv-cat-btn:hover { filter: brightness(1.1); }
/* Used Vehicles Search's category switcher (template-used-vehicles-search.php):
   the current category stays full colour, the other two dim to show they're
   still real, clickable options rather than the active one — brightening
   back to full colour on hover as the "you can still pick this" cue. */
.cbm-rv-cat-btn--dim { opacity: 0.4; }
.cbm-rv-cat-btn--dim:hover { opacity: 1; }

.cbm-rv-section-heading { font-family: var(--cbm-font-body); font-weight: 700; font-size: 20px; text-transform: uppercase; letter-spacing: 0.02em; margin: 0 0 14px; }

/* Auto-scrolling right-to-left ticker: .cbm-rv-dealers holds the tile list
   rendered TWICE back to back (see template-used-vehicles.php) so the
   animation can loop from translateX(0) to translateX(-50%) — exactly one
   full copy's width — and jump back to 0% unnoticed, reading as a
   continuous drift rather than a visible reset. Pauses on hover so a
   visitor can actually click a tile without it sliding out from under
   them; falls back to the original manual scroll for anyone who prefers
   reduced motion. */
.cbm-rv-dealers-viewport {
	overflow: hidden; margin-bottom: 40px;
	/* 2026-09-12: no explicit width here relied on default block sizing
	   to stay within its container — fine normally, but nested inside a
	   flex-direction:column mobile layout (Used Vehicles hub's
	   .cbm-uv-dealers-row at <=640px) the box was sizing to fit its own
	   max-content child (the scrolling track, ~2982px) instead of
	   clipping to the page, dragging the ENTIRE page into horizontal
	   scroll on mobile. width:100% forces it back to its real container
	   width regardless of ancestor flex-direction; overflow:hidden above
	   then correctly clips the wide scrolling track inside it. */
	width: 100%; max-width: 100%;
}
.cbm-rv-dealers { display: flex; gap: 14px; width: max-content; padding-bottom: 10px; animation: cbm-dealers-scroll 32s linear infinite; }
.cbm-rv-dealers-viewport:hover .cbm-rv-dealers { animation-play-state: paused; }
@keyframes cbm-dealers-scroll {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}
/* 2026-10-19: Windows "Animation effects" off makes Edge/Chrome report
   reduced motion. The old fallback put overflow-x on the max-content track
   (so it never scrolled) and set the viewport overflow:visible, so the
   tiles ran straight off the page's right margin. The viewport is now the
   scroller, and the duplicate copy (only there for the seamless loop) is
   hidden. */
@media (prefers-reduced-motion: reduce) {
	.cbm-rv-dealers { animation: none; }
	.cbm-rv-dealers-viewport { overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; }
	.cbm-rv-dealer-tile { scroll-snap-align: start; }
	.cbm-rv-dealer-tile--dup { display: none; }
}
.cbm-rv-dealer-tile {
	flex: 0 0 200px; aspect-ratio: 16/9; border-radius: 4px; display: flex;
	align-items: center; justify-content: center; padding: 12px; text-align: center; transition: filter 0.15s;
}
.cbm-rv-dealer-tile:hover { filter: brightness(1.2); }
.cbm-rv-dealer-tile span { font-family: var(--cbm-font-body); font-weight: 700; font-size: 14px; }
.cbm-rv-dealer-tile--logo { background: #fff; padding: 0; }
.cbm-rv-dealer-tile--logo img { width: 100%; height: 100%; object-fit: fill; }
/* Parnell's logo is a very wide/flat banner shape (500x64) — stretching it
   to fill the tile's full height like the others would badly distort it,
   so it fills the width only and keeps its own natural proportions. */
.cbm-rv-dealer-tile--parnell-coaches img { height: auto; object-fit: contain; }

/* Compact variant — Featured Dealers moved into the (narrower) sidebar
   on Used Vehicles 2026-09-03, at half its previous tile size to fit;
   aspect-ratio keeps height following width automatically. */
.cbm-rv-dealers--compact .cbm-rv-dealer-tile { flex-basis: 100px; }
.cbm-rv-dealers-viewport--compact { margin-bottom: 24px; }

.cbm-rv-offers { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--cbm-gap); margin-bottom: 20px; }
.cbm-rv-offer { display: flex; flex-direction: column; border: 1px solid var(--cbm-hairline); border-radius: var(--cbm-radius); overflow: hidden; background: #fff; color: var(--cbm-near-black-alt); }

/* aspect-ratio was 8/3 after the 2026-09-04 height cut, but Jonathan found
   that too small to see the vehicle in ("hard to see the vehicle") -
   widened back by 30% (8/3 Ã· 1.3 = ~2.05/1), while keeping the tightened
   body/row spacing from that same pass, which he confirmed was a real
   improvement. */
/* Restored close to the ORIGINAL 16/10 depth - per Jonathan (2026-09-04):
   "I was wrong to reduce them" - the whole photo-shrinking idea from
   earlier today didn't work out. Text/row spacing below stays tightened
   (that part he did want to keep), doing all the remaining depth-saving
   work instead of the photo. */
.cbm-vphoto { position: relative; display: block; aspect-ratio: 1.6/1; overflow: hidden; background: linear-gradient(135deg,#dcdcdc,#c2c2c2); }
.cbm-vphoto-zoom { width: 100%; height: 100%; object-fit: cover; }

/* "Featured Ad" — magazine_checked on the listing (the seller paid extra
   to also appear in the print magazine, unrelated to the standard/bronze/
   silver/gold package tier). Diagonal green ribbon, top-left corner. */
.cbm-rv-offer__featured {
	position: absolute; top: 10px; left: -32px; z-index: 1; width: 130px;
	background: var(--cbm-green); color: #fff; font-size: 10px; font-weight: 700;
	letter-spacing: 0.04em; text-transform: uppercase; text-align: center; padding: 3px 0;
	transform: rotate(-45deg); box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.cbm-rv-offer__price {
	position: absolute; top: 10px; right: 10px; background: var(--cbm-red); color: #fff; font-weight: 700;
	font-size: 13px; padding: 4px 10px; border-radius: 2px;
}
.cbm-rv-offer__body { padding: 8px 12px 10px; }
.cbm-rv-offer__title { display: block; font-family: var(--cbm-font-body); font-weight: 600; font-size: 14px; line-height: 1.3; }
.cbm-rv-offer__divider { border: none; border-top: 1px dashed var(--cbm-hairline); margin: 4px 0; }
.cbm-rv-offer__row { display: flex; justify-content: space-between; font-size: 10px; color: var(--cbm-muted-grey); margin-bottom: 1px; line-height: 1.35; }
.cbm-rv-offer__row span:last-child { color: var(--cbm-near-black-alt); font-weight: 500; }
.cbm-rv-offer__seller { display: block; font-weight: 700; font-size: 12px; color: var(--cbm-red); }

.cbm-rv-more-btn {
	display: block; width: 100%; box-sizing: border-box; text-align: center; background: #fff; color: #333;
	border: 1px solid var(--cbm-hairline); font-weight: 700; font-size: 13px; text-transform: uppercase;
	letter-spacing: 0.02em; padding: 14px; border-radius: 2px;
}
.cbm-rv-more-btn:hover { background: var(--cbm-fill-light); }

.cbm-rv-sidebar { display: flex; flex-direction: column; gap: 16px; }
/* align-self:flex-end, not a change to .cbm-rv-sidebar's own align-items —
   the Facebook widget below (.cbm-rv-sidebar__facebook) is meant to stay
   full-width via the column's default stretch behaviour, so only this
   fixed-300px item needs pulling to the sidebar's right edge (matching the
   page's true right margin, same "range right" fix as the New Vehicles
   Showroom page's skyscraper/search box — see new-vehicles.css). Without
   this, the billboard sat flush with the sidebar's own left edge, leaving
   a ~20px unexplained gap before the true margin on the right. Also fixes
   the Depot and Services pages, which reuse this same component. */
.cbm-rv-sidebar__billboard { width: 100%; max-width: 300px; min-height: 426px; align-self: flex-end; }
.cbm-rv-sidebar__billboard .cbm-ad-empty-slot { background: var(--cbm-fill-light); border: 1px dashed var(--cbm-muted-grey); border-radius: 2px; min-height: 426px; }
.cbm-rv-sidebar__facebook {
	display: block; text-align: center; border: 1px solid var(--cbm-hairline); border-radius: 2px; padding: 18px;
	font-family: var(--cbm-font-body); font-weight: 700; font-size: 15px; color: #333;
}
.cbm-rv-sidebar__facebook:hover { background: var(--cbm-fill-light); }

@media (max-width: 1024px) {
	.cbm-rv-grid { grid-template-columns: 1fr; }
	.cbm-rv-sidebar { flex-direction: row; }
	.cbm-rv-sidebar__billboard { max-width: none; flex: 1; }
	.cbm-rv-sidebar__facebook { flex: 1; }
}
@media (max-width: 640px) {
	.cbm-rv-cat-buttons { grid-template-columns: 1fr; }
	.cbm-rv-offers { grid-template-columns: 1fr; }
	.cbm-rv-sidebar { flex-direction: column; }
}
