/*
|--------------------------------------------------------------------------
| Vans-for-sale listing pages — hero + inventory grid
|--------------------------------------------------------------------------
| Used by /vans-for-sale and /used-vans-for-sale only (the per-van detail
| pages keep src/styles/vans-for-sale.css). Follows the models.php redesign
| language: an editorial hero over the darkened photo (eyebrow → title with
| the red accent bar → lead → glass pill actions), a flowing near-black page
| gradient, and a card grid docked into the hero's bottom edge on the same
| glass-card recipe as the model lineup cards (models-bg.css).
|
| Card markup comes from includes/vfs-card.php.
*/

:root {
    /* How far the inventory dock pulls up into the hero photo. */
    --vfs-dock-overlap: clamp(3.25rem, 8vw, 5.5rem);
    /* First stop of .vfs-flow-bg's gradient — the hero's bottom fade ends on
       this exact colour so the two surfaces meet without a seam. */
    --vfs-flow-top: #101013;
}

/* =========================================================
   HERO
   .header.vfs-hero out-specifies the legacy .header rules in
   m072224.css (100vh grid + 6vw inset, 95vh at ≤1200px) at
   every breakpoint, so everything layout-critical is set here.
   ========================================================= */

.header.vfs-hero {
    position: relative;
    /* auto (not the legacy 999 set at ≤1200px) so the docked grid below —
       later in the DOM — paints over the hero's bottom fade. */
    z-index: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: min(92vh, 52rem);
    min-height: min(92svh, 52rem);
    padding: calc(var(--nav-h, 3.3rem) + clamp(2.5rem, 6vh, 4rem))
        clamp(1rem, 3vw, 2rem)
        calc(var(--vfs-dock-overlap) + clamp(2.75rem, 5vw, 4.25rem));
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #0a0a0c;
}

/* Page photos — the pre-darkened greyscale banners these pages already own. */
.header.vfs-hero--new {
    background-image:
        repeating-radial-gradient(transparent, rgba(0, 0, 0, 0.593)),
        url(/assets/images/models-bg-10.jpg);
}

.header.vfs-hero--used {
    background-image:
        repeating-radial-gradient(transparent, rgba(0, 0, 0, 0.593)),
        url(/assets/images/models-bg-11.jpg);
}

/* Bottom fade — reuses the header's existing full-bleed overlay
   (.header::after, z-index 1) exactly like models-header-img does: clear
   through the upper hero, darkening to the content's top colour at the
   bottom edge so the photo melts into the flowing background — and so the
   docked cards sit on legible dark. The radial layer mirrors the flow
   background's top light-spill at the seam. */
.header.vfs-hero::after {
    --hero-fade-start: 24rem;
    background:
        radial-gradient(
            125% var(--hero-fade-start) at 50% 100%,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0) 72%
        ),
        linear-gradient(
            to top,
            var(--vfs-flow-top) 0%,
            var(--vfs-flow-top) 1.5rem,
            rgba(16, 16, 19, 0) var(--hero-fade-start)
        );
}

@media (max-width: 768px) {
    .header.vfs-hero::after {
        --hero-fade-start: 16rem;
    }
}

/* =========================================================
   HERO CONTENT
   ========================================================= */

.vfs-hero__content {
    position: relative;
    z-index: 2;
    width: min(100%, 62rem);
    margin: 0 auto;
    text-align: center;
}

.vfs-hero__eyebrow {
    margin: 0 0 1.1rem;
    font-size: clamp(0.72rem, 1vw, 0.82rem);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--theme-text-muted);
}

.vfs-hero__title {
    position: relative;
    margin: 0;
    padding-bottom: clamp(0.9rem, 1.35vw, 1.15rem);
    font-size: clamp(2.3rem, 5.6vw, 4.75rem);
    font-weight: 300;
    line-height: 1.04;
    letter-spacing: -0.035em;
    text-transform: uppercase;
    text-wrap: balance;
    color: var(--theme-text-strong);
    text-shadow: var(--theme-shadow-title);
}

/* Red line centered under the title (models/service hero recipe). */
.vfs-hero__title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: clamp(6rem, 10vw, 9rem);
    height: 0.24rem;
    border-radius: var(--theme-radius-pill);
    background: linear-gradient(
        90deg,
        var(--theme-accent) 0%,
        var(--theme-accent-deep) 58%,
        transparent 100%
    );
    box-shadow: 0 10px 24px var(--theme-accent-box-24);
}

.vfs-hero__lead {
    margin: clamp(1.1rem, 2vw, 1.5rem) auto 0;
    max-width: 44rem;
    font-size: clamp(1rem, 1.35vw, 1.16rem);
    font-weight: 300;
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: var(--theme-text-muted);
}

/* Action row — glass pill links (service-hero support-link recipe), plus an
   optional non-link availability chip in the success tint. */
.vfs-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    margin-top: clamp(1.5rem, 2.75vw, 2.1rem);
}

.vfs-hero__pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.6rem;
    padding: 0.65rem 1.05rem;
    border: 1px solid var(--theme-surface-white-08);
    border-radius: var(--theme-radius-pill);
    background: var(--theme-surface-white-045);
    color: var(--theme-text-muted);
    font-size: 0.86rem;
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
    backdrop-filter: var(--theme-blur-sm);
    -webkit-backdrop-filter: var(--theme-blur-sm);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease;
}

.vfs-hero__pill:hover {
    transform: translateY(-1px);
    color: var(--theme-white);
    text-decoration: none;
    border-color: var(--theme-border-strong);
    background: var(--theme-surface-white-08);
}

.vfs-hero__pill--stat,
.vfs-hero__pill--stat:hover {
    transform: none;
    cursor: default;
    color: var(--theme-success-text);
    border-color: var(--theme-success-border);
    background: rgba(8, 14, 10, 0.5);
}

.vfs-hero__pill--stat::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 9px currentColor;
}

/* =========================================================
   FLOWING PAGE BACKGROUND
   Same greyscale flow as .models-flow-bg; flow-root stops the
   dock's negative margin collapsing through <main> so the grid
   overlaps the hero photo instead of dragging the gradient up.
   ========================================================= */

.vfs-flow-bg {
    display: flow-root;
    background-color: #020203;
    background-image:
        radial-gradient(
            125% 32% at 50% 0%,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0) 72%
        ),
        linear-gradient(180deg, #101013 0%, #0a0a0c 34%, #060607 68%, #020203 100%);
    background-repeat: no-repeat;
}

/* =========================================================
   INVENTORY SECTION — heading + docked card grid
   ========================================================= */

.vfs-inventory {
    padding: 0 clamp(1rem, 2vw, 2rem) clamp(3rem, 6vw, 5rem);
}

.vfs-inventory__dock {
    position: relative;
    z-index: 2;
    max-width: 86rem;
    margin: calc(-1 * var(--vfs-dock-overlap)) auto 0;
}

/* Section heading flanked by tapered glass rods (models-intro recipe). */
.vfs-inventory__heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.85rem, 2vw, 1.5rem);
    margin: 0 0 0.6rem;
    font-size: clamp(1rem, 1.5vw, 1.35rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--theme-text-strong);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.vfs-inventory__heading::before,
.vfs-inventory__heading::after {
    content: "";
    flex: 1 1 auto;
    height: 4px;
    -webkit-clip-path: polygon(0% 25%, 100% 0%, 100% 100%, 0% 75%);
    clip-path: polygon(0% 25%, 100% 0%, 100% 100%, 0% 75%);
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0.15) 45%,
        rgba(255, 255, 255, 0.3) 100%
    );
    -webkit-mask-image: linear-gradient(to right, transparent, #000);
    mask-image: linear-gradient(to right, transparent, #000);
}

.vfs-inventory__heading::after {
    -webkit-clip-path: polygon(0% 0%, 100% 25%, 100% 75%, 0% 100%);
    clip-path: polygon(0% 0%, 100% 25%, 100% 75%, 0% 100%);
    -webkit-mask-image: linear-gradient(to left, transparent, #000);
    mask-image: linear-gradient(to left, transparent, #000);
}

.vfs-inventory__meta {
    margin: 0 0 clamp(1.25rem, 2.5vw, 1.9rem);
    text-align: center;
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.06em;
    color: var(--theme-text-muted);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* Flex (not grid) so wrapped rows stay centered and every card keeps one
   uniform width — 3-up on wide screens, 2-up mid, single column small. */
.vfs-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: clamp(1rem, 1.6vw, 1.6rem);
}

.vfs-grid .vfs-card {
    flex: 0 0 min(26rem, 100%);
}

/* Below the 2-up threshold a lone 26rem card reads lost — widen the single
   column to a comfortable measure before collapsing to full width. */
@media (max-width: 920px) {
    .vfs-grid .vfs-card {
        flex-basis: min(34rem, 100%);
    }
}

/* =========================================================
   LISTING CARD
   Glass surface + hover lift shared with the model lineup
   cards (.s-options .option in models-bg.css).
   ========================================================= */

.vfs-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(
        160deg,
        rgba(255, 255, 255, 0.075) 0%,
        rgba(255, 255, 255, 0.028) 46%,
        rgba(255, 255, 255, 0.015) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.05) inset,
        0 18px 40px rgba(0, 0, 0, 0.45);
    transition:
        transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.4s ease,
        box-shadow 0.4s ease,
        background 0.4s ease;
}

.vfs-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.22);
    background: linear-gradient(
        160deg,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0.045) 46%,
        rgba(255, 255, 255, 0.02) 100%
    );
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.1) inset,
        0 30px 60px rgba(0, 0, 0, 0.6);
}

/* Photo — fixed 3:2 box so every card lines up; only the photo zooms. */
.vfs-card__media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 3 / 2;
    border-radius: 15px 15px 0 0;
    background-color: #0a0a0c;
}

.vfs-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.4s ease;
}

.vfs-card:hover .vfs-card__media img {
    transform: scale(1.05);
}

/* Sold listings keep their photo but step back — colour returns on hover. */
.vfs-card--sold .vfs-card__media img {
    filter: grayscale(0.45) brightness(0.8);
}

.vfs-card--sold:hover .vfs-card__media img {
    filter: grayscale(0.15) brightness(0.92);
}

/* Status ribbons over the photo — same corner-ribbon recipe as the nav
   menu's NEW/USED ribbon (.dropdown-link__ribbon in nav.css): a flat band
   across the photo's top-left corner, both ends overshooting so the media
   box's overflow:hidden slices them at the edges and the band reads as
   wrapping around the card. SOLD is brand red; AVAILABLE is green and sits
   a little deeper in the corner because its label is longer. */
.vfs-card__badge {
    position: absolute;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    transform: rotate(-40deg);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.vfs-card__badge--available {
    top: 18px;
    left: -53px;
    width: 180px;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    background: linear-gradient(
        90deg,
        #166534 0%,
        #15803d 26%,
        #15803d 74%,
        #166534 100%
    );
}

.vfs-card__badge--sold {
    top: 12px;
    left: -50px;
    width: 160px;
    background: linear-gradient(
        90deg,
        var(--theme-accent-darker) 0%,
        var(--theme-accent) 26%,
        var(--theme-accent) 74%,
        var(--theme-accent-darker) 100%
    );
}

/* =========================================================
   CARD BODY
   ========================================================= */

.vfs-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.35rem 1.4rem 1.45rem;
}

.vfs-card__name {
    margin: 0;
    font-size: 1.28rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.vfs-card__name a {
    color: var(--theme-text-strong);
    text-decoration: none;
    transition: color 0.2s ease;
}

.vfs-card__name a:hover {
    color: var(--theme-white);
    text-decoration: underline;
    text-underline-offset: 0.3rem;
    text-decoration-thickness: 1px;
}

.vfs-card__chassis {
    margin: 0.35rem 0 0;
    font-size: 0.86rem;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--theme-text-soft);
}

/* Spec sheet — label / value rows split by hairlines. */
.vfs-card__specs {
    margin: 1.1rem 0 0;
    padding: 0;
    list-style: none;
}

.vfs-card__specs li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.52rem 0.1rem;
    border-bottom: 1px solid var(--theme-border-soft);
}

.vfs-card__specs li:first-child {
    border-top: 1px solid var(--theme-border-soft);
}

.vfs-card__specs span {
    flex: 0 0 auto;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--theme-text-soft);
}

.vfs-card__specs b {
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.01em;
    text-align: right;
    color: var(--theme-text-main-soft-2);
}

/* Price + CTA row pinned to the card bottom so rows align across cards. */
.vfs-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.25rem;
}

.vfs-card__price {
    display: grid;
    gap: 0.3rem;
}

.vfs-card__price-label {
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--theme-text-soft);
}

.vfs-card__price b {
    font-size: 1.34rem;
    font-weight: 650;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--theme-text-strong);
}

.vfs-card--sold .vfs-card__price b {
    color: var(--theme-text-muted);
}

.vfs-card__cta {
    flex: 0 0 auto;
}

/* =========================================================
   END-CAP — next-step panel under the grid
   Shares the detail pages' glass panel recipe (--vfs-card-*
   values from vans-for-sale.css, inlined here since that
   sheet isn't loaded on the listing pages).
   ========================================================= */

.vfs-endcap {
    width: min(100%, 46rem);
    margin: clamp(2.5rem, 5vw, 4rem) auto 0;
    padding: clamp(1.75rem, 3vw, 2.5rem);
    text-align: center;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.15rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 18px 40px rgba(0, 0, 0, 0.3);
}

.vfs-endcap h2 {
    margin: 0;
    font-size: clamp(1.15rem, 1.8vw, 1.45rem);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    color: var(--theme-text-strong);
}

.vfs-endcap p {
    margin: 0.8rem auto 0;
    max-width: 34rem;
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: var(--theme-text-muted);
}

.vfs-endcap__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.vfs-endcap__actions .tv-cta {
    min-width: 13rem;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 650px) {
    .header.vfs-hero {
        min-height: min(84vh, 44rem);
        min-height: min(84svh, 44rem);
    }

    .vfs-card__body {
        padding: 1.2rem 1.15rem 1.3rem;
    }
}

@media (max-width: 520px) {
    .vfs-hero__actions {
        width: 100%;
    }

    .vfs-hero__pill,
    .vfs-hero__actions .tv-cta {
        flex: 1 1 auto;
        justify-content: center;
    }

    /* Price above a full-width CTA once the row gets cramped. */
    .vfs-card__foot {
        flex-direction: column;
        align-items: stretch;
        gap: 1.1rem;
    }

    .vfs-card__price {
        justify-items: center;
        text-align: center;
    }

    .vfs-endcap__actions .tv-cta {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vfs-card,
    .vfs-card__media img,
    .vfs-hero__pill {
        transition: none;
    }

    .vfs-card:hover,
    .vfs-hero__pill:hover {
        transform: none;
    }

    .vfs-card:hover .vfs-card__media img {
        transform: none;
    }
}
