/* platform.css - vehicle platform landing page (platform.cfm), the
   "Popular vehicles" module (includes/popular.vehicles.cfm) and the
   vehicles.cfm hub.

   Built on css/foundations.css - colours, spacing, radii, type sizes and the
   card/grid/button primitives all come from there. Nothing in this file should
   invent a value that belongs in the token set; if it needs one, add it to
   foundations.

   Alignment is handled ONCE by .oct-page on the container (see foundations),
   not by a text-align on each component - that scattering is what made the
   first cut read as half-centred. */

/* ------------------------------------------------------------------ hero
   Default background: a Porsche 911 in a tunnel, from the Milltek supplier
   photography (Suppliers/Milltek/photos/DSC01240-Enhanced-NR.jpg), resized to
   2000px / q72. A per-platform Octane_Platforms.HeroImage overrides it inline.

   The photo is already very dark and the subject sits centre, so the overlay
   is much lighter than a flat panel would need - the previous 0.92/0.68/0.45
   ramp was tuned for solid --oct-ink and would have crushed the car to black.
   It still has to be dark enough on the LEFT for white text, hence the ramp
   rather than a flat wash. */
.pf-hero {
    position: relative;
    background-color: var(--oct-ink);
    background-image: url("../images/backgrounds/vehicles.hero.jpg");
    background-size: cover;
    background-position: center 58%;   /* keeps the tail lights in the band */
    background-repeat: no-repeat;
    color: #fff;
    padding: var(--oct-space-7) 0 var(--oct-space-6);
    margin-bottom: var(--oct-space-6);
    text-align: left;
}
.pf-hero::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(90deg,
                rgba(17,23,31,.86) 0%,
                rgba(17,23,31,.62) 42%,
                rgba(17,23,31,.30) 72%,
                rgba(17,23,31,.42) 100%);
}
/* A platform with its own Octane_Platforms.HeroImage supplies it as an inline
   style on the element, which beats any rule here - including the mobile
   override below - so no extra CSS is needed for that case. */
.pf-hero .oct-page { position: relative; z-index: 1; }

@media (max-width: 900px) {
    /* smaller file, and a flatter wash because there is no room for the
       subject to breathe beside the text at this width */
    .pf-hero { background-image: url("../images/backgrounds/vehicles.hero.mobile.jpg"); }
    .pf-hero::before {
        background: linear-gradient(90deg, rgba(17,23,31,.88) 0%, rgba(17,23,31,.62) 100%);
    }
}

.pf-hero h1, .pf-hero .oct-h1 { color: #fff; margin: var(--oct-space-2) 0 var(--oct-space-3); }

.pf-crumb { font-size: var(--oct-text-sm); color: rgba(255,255,255,.72); }
.pf-crumb a { color: rgba(255,255,255,.86); text-decoration: underline; }
.pf-crumb a:hover { color: #fff; }
.pf-crumb span { margin: 0 var(--oct-space-1); }

.pf-sub { margin: 0; display: flex; flex-wrap: wrap; gap: var(--oct-space-2); }
/* hero chips sit on a dark ground, so they override .oct-chip's light surface */
.pf-hero .oct-chip {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.22);
    color: #fff;
}

/* --------------------------------------------------------------- content */
.pf-note  { color: var(--oct-ink-soft); margin: var(--oct-space-2) 0 var(--oct-space-4); }
.pf-empty { font-size: var(--oct-text-md); padding: var(--oct-space-5) 0 var(--oct-space-6); }

/* ------------------------------------------------------------------ brands */
.pf-brand-list {
    list-style: none; margin: var(--oct-space-3) 0 0; padding: 0;
    display: flex; flex-wrap: wrap; gap: var(--oct-space-2);
}
.pf-brand-list li {
    display: flex;
    border: 1px solid var(--oct-line);
    border-radius: var(--oct-radius-sm);
    background: var(--oct-surface);
}
/* The whole chip is a link to brand.platform.cfm. Styling stopped at the <li>
   while the markup gained an <a> inside it, so the anchor fell through to the
   global link rule and every brand rendered as underlined blue text sitting in
   a box that still looked like a button. The padding lives on the anchor, not
   the li, so the hit area is the whole chip rather than just the words. */
.pf-brand-list li > a {
    display: flex; align-items: center; gap: var(--oct-space-2);
    padding: var(--oct-space-2) var(--oct-space-3);
    border-radius: inherit;
    color: var(--oct-ink);
    text-decoration: none;
}
.pf-brand-list li:hover { border-color: var(--oct-accent); }
.pf-brand-list li > a:hover { color: var(--oct-accent); text-decoration: none; }
.pf-brand-list li > a:hover .pf-brand-count { color: var(--oct-ink-soft); }
.pf-brand-list li > a:focus-visible { outline: 2px solid var(--oct-accent); outline-offset: 2px; }

.pf-brand-name  { font-weight: 600; }
.pf-brand-count {
    background: var(--oct-surface-alt);
    border-radius: var(--oct-radius-pill);
    padding: 2px 9px;
    font-size: var(--oct-text-sm);
    color: var(--oct-ink-mute);
}

/* ------------------------------------------------------------- product grid */
.pf-grid { margin: var(--oct-space-5) 0 var(--oct-space-3); }

.pf-card { overflow: hidden; }                 /* .oct-card supplies the rest */
.pf-card:hover { transform: translateY(-2px); }
.pf-card > a {
    display: block;
    padding: var(--oct-space-3);
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.pf-card-img {
    height: 168px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: var(--oct-space-3);
}
.pf-card-img img { max-width: 100%; max-height: 168px; object-fit: contain; }

.pf-card-cat {
    display: inline-block;
    background: var(--oct-surface-alt);
    color: var(--oct-ink-soft);
    font-size: var(--oct-text-xs);
    letter-spacing: .02em; text-transform: uppercase;
    border-radius: var(--oct-radius-sm);
    padding: 3px 8px;
    margin-bottom: var(--oct-space-2);
}
.pf-card-title  { font-size: var(--oct-text-base); font-weight: 600; line-height: 1.35; margin-bottom: var(--oct-space-1); }
.pf-card-meta   { font-size: var(--oct-text-sm); color: var(--oct-ink-mute); margin-bottom: var(--oct-space-2); }
.pf-card-stock  { font-size: var(--oct-text-sm); color: var(--oct-ink-soft); margin: 0 0 var(--oct-space-2); line-height: 1.35; }
.pf-card-price  { font-size: 1.1rem; font-weight: 700; }
.pf-card-noprice { font-size: var(--oct-text-base); font-weight: 600; color: var(--oct-plum); }

/* The .pf-card rules above are still used by includes/homepage.bestsellers.cfm.
   platform.cfm's own product grid now renders searchresults.card.cfm (styled by
   includes/searchresults.styles.cfm), so nothing here styles it. */

/* the in-basket badge sits top-left over the image, so keep the image clear */
.pf-card.in-basket .pf-card-img { padding-top: var(--oct-space-2); }

/* ---------------------------------------------------------------- variants */
.pf-variants {
    list-style: none; margin: 0 0 var(--oct-space-3); padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: var(--oct-space-2);
}
.pf-variants a {
    display: block;
    padding: var(--oct-space-3) var(--oct-space-4);
    border: 1px solid var(--oct-line);
    border-radius: var(--oct-radius-sm);
    text-decoration: none; color: inherit;
    background: var(--oct-surface);
}
.pf-variants a:hover { border-color: var(--oct-ink); background: var(--oct-surface-alt); }
.pf-var-name { display: block; font-size: var(--oct-text-base); font-weight: 600; }
.pf-var-meta { display: block; font-size: var(--oct-text-sm); color: var(--oct-ink-mute); margin-top: 3px; }

/* ----------------------------------------------------------------- related */
.pf-related { list-style: none; margin: var(--oct-space-4) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--oct-space-2); }

.pf-allvehicles { margin: var(--oct-space-7) 0 var(--oct-space-8); }

/* ============================================================ POPULAR VEHICLES */
.pv-block { margin: var(--oct-space-7) 0; }

/* The heading row carries the rule, NOT the .oct-h2 inside it. .oct-h2's own
   border-bottom would only span the flex item's content width - a short
   underline floating under the words, which is not what it does everywhere
   else on the page. */
.pv-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--oct-space-2);
    padding-bottom: var(--oct-space-2);
    border-bottom: 2px solid var(--oct-line-soft);
}
.pv-head > div   { min-width: 0; }
.pv-head .oct-h2 { margin: 0; padding-bottom: 0; border-bottom: 0; }
.pv-all   { font-size: var(--oct-text-base); font-weight: 600; text-decoration: underline; white-space: nowrap; }
.pv-lead  { margin: var(--oct-space-1) 0 var(--oct-space-4); }

.pv-seg { margin-top: var(--oct-space-5); }

.pv-card {
    display: block;
    padding: var(--oct-space-4);
    text-decoration: none;
    color: inherit;
}
.pv-card:hover { border-color: var(--oct-ink); }

/* spans inside an inline <a> - these MUST be blocks or make, name, years and
   meta all run together on one line */
.pv-card-make  { display: block; font-size: var(--oct-text-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--oct-ink-faint); }
.pv-card-name  { display: block; font-size: 1.08rem; font-weight: 700; line-height: 1.3; margin: 3px 0 2px; }
.pv-card-years { display: block; font-size: var(--oct-text-sm); color: var(--oct-ink-soft); font-variant-numeric: tabular-nums; margin-bottom: var(--oct-space-2); }
.pv-card-meta  { display: block; font-size: var(--oct-text-sm); color: var(--oct-ink-mute); }

/* the customer's own saved/selected vehicle, promoted / flagged */
.pv-card.is-yours { border-color: var(--oct-accent); border-width: 2px; }
.pv-yours-flag {
    display: inline-block;
    background: var(--oct-accent); color: #fff;
    font-size: var(--oct-text-xs); font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
    border-radius: 3px; padding: 2px 7px; margin-bottom: var(--oct-space-1);
}

/* ------------------------------------------------------------------ mobile */
@media (max-width: 640px) {
    .pf-hero { padding: var(--oct-space-6) 0 var(--oct-space-5); margin-bottom: var(--oct-space-5); }
    .pf-grid { --oct-grid-min: 150px; gap: var(--oct-space-3); }
    .pf-card-img { height: 128px; }
    .pf-card-img img { max-height: 128px; }
    .pf-variants { grid-template-columns: 1fr; }
    .pv-grid { --oct-grid-min: 160px; }
}

/* --------------------------------------------------------------------------
   Platform x category navigation (platform.cfm?slug=...&cat=...)
   Present on the hub as the route into the category pages, and on a category
   page so it is not a leaf. Deliberately plain links, not JS chips: these are
   real addresses and the crawler has to see them as such.
   -------------------------------------------------------------------------- */
.pf-cats { margin: 2rem 0 2.5rem; }

.pf-cat-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.pf-cat-list li { margin: 0; }

.pf-cat-list a,
.pf-cat-list li.is-current span {
  display: inline-block;
  padding: 0.6rem 0.95rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  font-size: 1rem;
  line-height: 1.2;
}

.pf-cat-list a:hover { border-color: #555; }

.pf-cat-list li.is-current span {
  background: #141414;
  color: #fff;
  border-color: #141414;
  font-weight: 600;
}

.pf-cat-n { opacity: 0.6; font-size: 0.875rem; margin-left: 0.3rem; }

/* --------------------------------------------------------------------------
   2026-08: platform-page layout pass.
   - The trade export button sits in the DARK hero, where .oct-btn--ghost's
     ink text disappeared entirely: give hero buttons hero colours.
   - The intro prose was a lone 68ch column with dead space to its right;
     .pf-intro pairs it with an at-a-glance facts card on desktop.
   - Brand links upgraded from text chips to logo tiles (same logo file
     convention as the header brand menu; a missing logo hides itself and
     the tile reads as text).
   -------------------------------------------------------------------------- */

.pf-hero .oct-btn {
    color: #fff;
    border-color: rgba(255,255,255,.55);
    background: rgba(255,255,255,.08);
}
.pf-hero .oct-btn:hover,
.pf-hero .oct-btn:focus-visible {
    color: var(--oct-ink);
    background: #fff;
    border-color: #fff;
}

.pf-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: var(--oct-space-5);
    align-items: start;
}
.pf-intro-copy { max-width: 75ch; }
@media (max-width: 900px) {
    .pf-intro { grid-template-columns: 1fr; }
}

.pf-facts {
    border: 1px solid var(--oct-line);
    border-radius: var(--oct-radius);
    background: var(--oct-surface-alt);
    padding: var(--oct-space-3) var(--oct-space-4) var(--oct-space-4);
}
.pf-facts-h {
    margin: 0 0 var(--oct-space-2);
    font-size: var(--oct-text-base);
    font-weight: 700;
    color: var(--oct-ink);
}
.pf-facts-list { margin: 0; }
.pf-facts-list > div {
    display: flex;
    justify-content: space-between;
    gap: var(--oct-space-3);
    padding: 7px 0;
    border-bottom: 1px solid var(--oct-line-soft);
    font-size: var(--oct-text-sm);
}
.pf-facts-list > div:last-child { border-bottom: 0; }
.pf-facts-list dt { color: var(--oct-ink-soft); margin: 0; }
.pf-facts-list dd { color: var(--oct-ink); font-weight: 700; margin: 0; }
.pf-facts-link {
    display: inline-block;
    margin-top: var(--oct-space-2);
    font-size: var(--oct-text-sm);
    color: var(--oct-ink);
}

/* brand logo tiles (override the earlier chip rules) */
.pf-brand-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: var(--oct-space-3);
}
.pf-brand-list li { display: block; }
.pf-brand-list li > a {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: var(--oct-space-3) var(--oct-space-4);
    height: 100%;
    box-sizing: border-box;
}
.pf-brand-logo {
    height: 34px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    object-position: left center;
}
.pf-brand-count { align-self: flex-start; }
