/*
 * LisaCars design layer, v2 (design-system/lisacars/MASTER.md, bolder pass). Loaded after design.css.
 * Slate header with the red call to action, Marketplace home (full-width slate hero, category tiles,
 * featured cars, slate trust band), larger cards, gallery-led car page with a sticky summary,
 * hero-centric rent to own. No wording changes: markup comes from parts/*.php or LisaCars Core.
 */
:root { --color-accent-on-dark: #f87171; --slate-text: #cbd5e1; --header-h: 86px; }
html { overflow-x: clip; }

/* ---------- Header: slate bar, red call to action (MASTER "sticky nav CTA") ---------- */
.header { background: var(--color-primary); border-bottom: 0; backdrop-filter: none; color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.06), var(--shadow-md); }
.header .brand img { filter: brightness(0) invert(1); }
.desktop-nav a, .desktop-nav .nav-sub-toggle { color: #e2e8f0; }
.desktop-nav > a, .desktop-nav .nav-item > a { position: relative; }
.desktop-nav > a:hover, .desktop-nav .nav-item > a:hover, .desktop-nav > a.active, .desktop-nav .nav-item > a.active { color: #fff; }
.desktop-nav > a::after, .desktop-nav .nav-item > a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; border-radius: 2px; background: var(--color-accent); transform: scaleX(0); transition: transform var(--dur) var(--ease-out); }
.desktop-nav > a:hover::after, .desktop-nav > a.active::after, .desktop-nav .nav-item > a:hover::after, .desktop-nav .nav-item > a.active::after { transform: scaleX(1); }
.desktop-nav .nav-sub a { color: var(--color-foreground); }
.desktop-nav .nav-sub a::after { display: none; }
.header .header-icon { border-color: rgba(255,255,255,.28); color: #fff; background: transparent; }
.header .header-icon:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.header .header-contact--whatsapp .header-icon { border-color: transparent; background: #128c7e; color: #fff; }
.header .header-contact--whatsapp .header-icon:hover { background: #075e54; }
.header .save-nav, .header .menu-toggle { color: #fff; }
.header .menu-toggle { background: transparent; }
.header .visit-button.btn.outline { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.header .visit-button.btn.outline:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
.header :focus-visible { outline-color: #fff; }
.mobile-menu { background: #fff; color: var(--color-foreground); }
.header-panel { color: var(--color-foreground); }

/* ---------- Home hero: full-width slate band, the hero car's photo on the right, search dominant ---------- */
.v2-hero { position: relative; isolation: isolate; overflow: hidden; background: var(--color-primary); color: #fff; }
.v2-hero-photo { position: absolute; inset: 0 0 0 auto; width: 60%; z-index: -1; background: #0f172a; }
.v2-hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 55%; display: block; }
/* Text only ever sits on 80 %+ slate (white 7.8:1, #cbd5e1 4.9:1 over the brightest pixel). */
.v2-hero-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--color-primary) 0%, rgba(30,41,59,.9) 22%, rgba(30,41,59,.45) 62%, rgba(30,41,59,.2) 100%), linear-gradient(0deg, rgba(30,41,59,.85) 0%, rgba(30,41,59,0) 45%); }
.v2-hero-inner { position: relative; display: grid; gap: 36px; padding-block: 64px 48px; }
.v2-hero .hero-copy { max-width: 600px; }
.v2-hero .hero-h1 { color: #e2e8f0; margin: 0 0 14px; display: inline-flex; align-items: center; gap: 10px; }
.v2-hero .hero-h1::before { content: ""; width: 28px; height: 3px; border-radius: 2px; background: var(--color-accent); }
.v2-hero .hero-slogan { color: #fff; font-size: clamp(2.5rem, 4.6vw, 4rem); line-height: 1.04; font-weight: 750; letter-spacing: -.03em; margin: 0; }
.v2-hero .hero-slogan span { color: var(--color-accent-on-dark); }
.v2-hero .lede { color: var(--slate-text); font-size: 18px; line-height: 1.6; margin-top: 20px; }
.v2-hero .hero-trust { color: #f1f5f9; margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 14px; font-weight: 600; }
.v2-hero .hero-trust .icon { color: var(--color-accent-on-dark); }
.v2-hero .home-search { margin: 0; border: 0; border-radius: var(--radius-lg); box-shadow: 0 24px 48px rgba(2,6,23,.35); padding: 24px; color: var(--color-foreground); grid-template-columns: 1.8fr 1fr auto; }
.v2-hero .home-search label { color: var(--color-foreground); font-weight: 600; }
.v2-hero .home-search .btn[type=submit] { min-height: 52px; padding-inline: 32px; font-size: 16px; }
.v2-hero .home-search input, .v2-hero .home-search select { min-height: 52px; }

/* Category tiles (the existing quick links, with icons) */
.v2-home .v2-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; padding-top: 36px; font-size: 15px; }
.v2-home .v2-tiles > span { display: block; grid-column: 1 / -1; margin: 0; color: var(--color-foreground); font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.v2-home .v2-tiles a { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 18px; min-height: 112px; padding: 18px; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); color: var(--color-foreground); font-weight: 650; line-height: 1.25; transition: box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out); }
.v2-home .v2-tiles a:hover { background: #fff; border-color: var(--color-accent); color: var(--color-accent); box-shadow: var(--shadow-md); }
.v2-home .v2-tiles .tile-icon { width: 32px; height: 32px; padding: 6px; box-sizing: content-box; margin: -6px; color: var(--color-accent); background: #fdf2f4; border-radius: 10px; }

/* Featured cars: a large card per car (xl shadow) */
.v2-featured { padding-top: 40px; }
.v2-featured .hero-slides { border-radius: var(--radius-lg); }
@media (min-width: 901px) {
	.v2-featured .hero-slide { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
	.v2-featured .hero-featured { box-shadow: var(--shadow-xl); border-radius: var(--radius-lg); }
	.v2-featured .hero-slide-media { border-radius: 0; aspect-ratio: 4 / 3; }
	.v2-featured .hero-slide-info { position: static; box-shadow: none; background: #fff; border-radius: 0; padding: 40px; align-content: center; grid-template-columns: 1fr; gap: 8px; }
	.v2-featured .hero-slide-title { font-size: 26px; line-height: 1.2; letter-spacing: -.03em; }
	.v2-featured .hero-slide-meta { font-size: 15px; grid-column: 1; }
	.v2-featured .hero-slide-price { font-size: 34px; margin-top: 8px; grid-column: 1; }
	.v2-featured .hero-slide-actions { grid-column: 1; grid-row: auto; margin-top: 16px; }
	.v2-featured .hero-slide-actions .btn { min-height: 48px; padding-inline: 28px; }
	.v2-featured .hero-slide-actions .card-wa { width: 48px; min-width: 48px; min-height: 48px; padding: 0; }
	.v2-featured .hero-controls { margin-top: 0; padding: 10px 0 2px; }
}

/* Trust: a slate band */
.trust-strip { background: var(--color-primary); border: 0; color: #f1f5f9; }
.trust-strip span { color: #f1f5f9; font-weight: 600; }
.trust-strip .icon { color: var(--color-accent-on-dark); }

/* ---------- Cards: 4:3 photo, price first, consistent buttons ---------- */
.car-card { border-radius: var(--radius-lg); }
.car-card .card-media, .car-card .card-media img { aspect-ratio: 4 / 3; }
.car-card .card-content { display: flex; flex-direction: column; padding: 20px; }
.car-card .card-year { order: 1; }
.car-card .card-title, .car-card h2.card-title { order: 2; min-height: 0; margin-top: 4px; }
.car-card .card-price { order: 3; font-size: 26px; line-height: 1.15; margin: 10px 0 2px; color: var(--color-foreground); }
.car-card .card-specs { order: 4; margin-top: 10px; }
.car-card .card-location { order: 5; }
.car-card .card-actions { order: 6; display: grid; grid-template-columns: 1fr 1fr 48px; gap: 8px; margin-top: 16px; }
.car-card .card-actions .btn { min-height: 48px; width: 100%; justify-content: center; }
.car-card .card-actions .card-wa { width: 48px; min-width: 48px; padding: 0; display: flex; align-items: center; justify-content: center; }
.car-card .compare-check { order: 7; }
.car-card .card-media { overflow: hidden; }

/* ---------- Cars for sale: larger cards, filter panel sticky on desktop only ---------- */
@media (min-width: 1001px) {
	.filter-sidebar { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow: auto; overscroll-behavior: contain; }
}
@media (max-width: 1000px) { .filter-sidebar { position: static; } }
@media (max-width: 1300px) and (min-width: 701px) { .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.listing-grid { gap: 24px; }
.results-toolbar > strong { font-size: 18px; letter-spacing: -.02em; }

/* ---------- Car page: gallery hero + sticky summary card ---------- */
.v2-vehicle .summary-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.v2-vehicle .vehicle-heading { display: block; margin: 0; }
.v2-vehicle .vehicle-heading h1 { font-size: clamp(1.45rem, 2vw, 1.85rem); line-height: 1.2; margin: 0; }
.v2-vehicle .vehicle-heading .eyebrow { margin-bottom: 8px; }
.v2-vehicle .summary-location { margin-top: 8px; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.v2-vehicle .summary-price { border-top: 1px solid var(--color-border); padding-top: 16px; }
.v2-vehicle .summary-price .vehicle-price { font-size: 38px; line-height: 1.1; }
.v2-vehicle .spec-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; border: 0; padding: 0; }
.v2-vehicle .spec-strip > div { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--color-background); display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; text-align: left; }
.v2-vehicle .spec-strip > div .icon { grid-row: 1 / span 2; }
.v2-vehicle .spec-strip span { font-size: 12px; }
.v2-vehicle .spec-strip strong { font-size: 14px; }
.v2-vehicle .summary-save { justify-self: start; }
.v2-vehicle .panel-confirm { margin: 0; }
.v2-vehicle .enquiry-panel { margin-top: 32px; padding: 28px; }
.v2-vehicle .enquiry-panel .finance-nudge { margin-top: 20px; }
.v2-vehicle .gallery-main { border-radius: var(--radius-lg); overflow: hidden; }
@media (min-width: 851px) {
	.v2-vehicle .vehicle-layout { grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "gallery summary" "main summary"; column-gap: 40px; row-gap: 0; }
	.v2-vehicle .v2-gallery { grid-area: gallery; min-width: 0; }
	.v2-vehicle .vehicle-main { grid-area: main; min-width: 0; }
	.v2-vehicle .v2-summary { grid-area: summary; position: sticky; top: calc(var(--header-h) + 16px); align-self: start; }
	.v2-vehicle .v2-summary.is-unstuck { position: static; }
	/* The phone bar's buttons, inside the card */
	.v2-vehicle .vehicle-mobile-cta { display: grid; grid-template-columns: minmax(0, 1fr); position: static; padding: 0; border: 0; box-shadow: none; background: none; gap: 10px; }
	.v2-vehicle .vehicle-mobile-cta > div { display: none; }
	.v2-vehicle .vehicle-mobile-cta .btn { min-height: 52px; width: 100%; justify-content: center; }
	.v2-vehicle .vehicle-mobile-cta .btn:not(.cta-wa) { order: -1; font-size: 16px; }
	.v2-vehicle .vehicle-mobile-cta .cta-wa { gap: 8px; }
}
@media (max-width: 1100px) and (min-width: 851px) { .v2-vehicle .vehicle-layout { grid-template-columns: minmax(0, 1fr) 340px; column-gap: 28px; } }
@media (max-width: 850px) {
	.v2-vehicle .v2-summary { margin-top: 20px; }
	.v2-vehicle .summary-card { box-shadow: var(--shadow-md); padding: 20px; }
}

/* ---------- Rent to own: slate full-width hero, sticky form card over it ---------- */
.rto-intro { background-color: var(--color-primary); border-image: linear-gradient(var(--color-primary) 0 0) fill 0 / / 0 100vmax; color: #fff; padding: 48px 0 44px; }
.rto-intro .eyebrow { color: var(--color-accent-on-dark); }
.rto-intro h1 { color: #fff; font-size: clamp(2.3rem, 4.2vw, 3.6rem); line-height: 1.05; letter-spacing: -.03em; }
.rto-layout { padding-top: 16px; }
.rto-intro .lede { color: var(--slate-text); font-size: 18px; line-height: 1.6; }
.rto-intro .hero-ticks li { color: #f1f5f9; font-weight: 600; }
.rto-intro .hero-ticks li::marker { color: var(--color-accent-on-dark); }
.rto-intro .hero-ticks li::before { color: var(--color-accent-on-dark); }
.rto-form .form-card { box-shadow: var(--shadow-xl); border-radius: var(--radius-lg); border: 1px solid var(--color-border); position: relative; z-index: 1; }
.rto-steps article { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 22px; }
.rto-steps .step-number { color: var(--color-accent); font-weight: 700; letter-spacing: .08em; }
.faq-list details { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 0 18px; margin-bottom: 10px; }
.faq-list details[open] { box-shadow: var(--shadow-md); }
.faq-list summary { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 650; }

/* ---------- Tablets ---------- */
@media (max-width: 1000px) {
	.v2-hero-photo { width: 100%; }
	.v2-hero-photo::after { background: rgba(30,41,59,.84); }
	.v2-home .v2-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.v2-hero .home-search { grid-template-columns: 1fr 1fr; }
	.v2-hero .home-search .btn[type=submit], .v2-hero .home-search .home-more { grid-column: 1 / -1; }
}
@media (max-width: 1000px) and (min-width: 701px) { .rto-intro { padding: 36px 0 32px; } }

/* ---------- Phones: the photo as a band above the copy ---------- */
@media (max-width: 700px) {
	:root { --header-h: 68px; }
	.v2-hero-photo { position: relative; inset: auto; width: 100%; height: auto; aspect-ratio: 2 / 1; z-index: 0; }
	.v2-hero-photo::after { background: linear-gradient(0deg, var(--color-primary) 0%, rgba(30,41,59,0) 55%); }
	.v2-hero-inner { padding-block: 0 28px; gap: 22px; margin-top: -28px; }
	.v2-hero .hero-slogan { font-size: 2.35rem; }
	.v2-hero .lede { font-size: 16px; margin-top: 14px; }
	.v2-hero .hero-trust { flex-direction: row; gap: 6px 14px; font-size: 13px; margin-top: 16px; }
	.v2-hero .home-search { grid-template-columns: 1fr; padding: 18px; }
	.v2-home .v2-tiles { gap: 10px; padding-top: 28px; font-size: 14px; }
	.v2-home .v2-tiles > span { font-size: 16px; }
	.v2-home .v2-tiles a { min-height: 96px; padding: 14px; gap: 12px; }
	.v2-home .v2-tiles .tile-icon { width: 26px; height: 26px; }
	.v2-featured { padding-top: 28px; }
	.car-card .card-price { font-size: 24px; }
	.rto-intro { padding: 28px 0 28px; }
	.rto-intro .lede { font-size: 16px; }
	.v2-vehicle .summary-price .vehicle-price { font-size: 32px; }
}
@media (max-width: 380px) { .v2-home .v2-tiles a { padding: 12px; font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { .desktop-nav a::after { transition: none; } }
/* Laptops 1001–1150 px: the menu stays on one line */
.desktop-nav a { white-space: nowrap; }
@media (max-width: 1150px) and (min-width: 851px) { .desktop-nav { gap: 16px; font-size: 13px; } .header-actions { gap: 10px; } .header .visit-button { padding-inline: 12px; } }
@media (min-width: 1001px) { :root { --header-h: 70px; } }
/* Short laptop screens (720–860 px high): a tighter summary card so it stays sticky */
@media (min-width: 851px) and (max-height: 860px) {
	.v2-vehicle .v2-summary { top: calc(var(--header-h) + 10px); }
	.v2-vehicle .summary-card { padding: 16px 20px; gap: 10px; }
	.v2-vehicle .vehicle-heading .eyebrow { margin-bottom: 4px; }
	.v2-vehicle .vehicle-heading h1 { font-size: 1.3rem; }
	.v2-vehicle .summary-location { margin-top: 4px; font-size: 13px; }
	.v2-vehicle .summary-price { padding-top: 10px; }
	.v2-vehicle .summary-price .price-label { margin: 0; font-size: 12px; }
	.v2-vehicle .summary-price .vehicle-price { font-size: 30px; }
	.v2-vehicle .panel-monthly { margin-top: 2px; font-size: 13px; }
	.v2-vehicle .spec-strip { gap: 6px; }
	.v2-vehicle .spec-strip > div { padding: 6px 10px; }
	.v2-vehicle .vehicle-mobile-cta { gap: 8px; }
	.v2-vehicle .vehicle-mobile-cta .btn { min-height: 46px; }
	.v2-vehicle .summary-save { min-height: 44px; }
	.v2-vehicle .panel-confirm { font-size: 12.5px; line-height: 1.45; }
}
/* Text enlarged to 200%: the header wraps onto a second line instead of scrolling the page sideways (one line at normal sizes). */
@media (min-width: 851px) { .header-row { flex-wrap: wrap; height: auto; min-height: var(--header-h); } }
