/*
 * Shared styles for every brand. This file is the complete default look.
 *
 * Components only use the named values below, never a fixed colour.
 * A brand file in css/site/brands/ changes these values and nothing else.
 *
 * In a brand file:
 *   [data-brand="x"]                    applies to light and dark
 *   [data-brand="x"][data-mode="light"] applies to light only
 *   [data-brand="x"][data-mode="dark"]  applies to dark only
 *
 * Page and card colours such as --color-bg must go in the light and dark
 * blocks. Placed in the first block, they would override dark mode too.
 */


/* Values shared by light and dark
   ========================================================================== */

:root {
    --font-heading: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Buttons, the menu and small labels. A brand can give them a font of their own. */
    --font-label: var(--font-heading);
    --eyebrow-tracking: 0.1em;

    --heading-weight: 700;
    --heading-line: 1.15;
    --heading-tracking: -0.01em;
    --heading-transform: none;

    /* The page title. Unless a brand sets these, it matches the other headings. */
    --heading-1-weight: var(--heading-weight);
    --heading-1-tracking: var(--heading-tracking);
    --heading-1-transform: var(--heading-transform);

    --text-sm: 0.875rem;
    --text-md: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.375rem;
    --text-2xl: clamp(1.625rem, 1.35rem + 1.2vw, 2.25rem);
    --text-3xl: clamp(2.125rem, 1.6rem + 2.4vw, 3.5rem);

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4.5rem;

    --radius-button: 8px;
    --radius-card: 12px;
    --radius-field: 8px;
    --radius-badge: 999px;
    --radius-play: 50%;

    --button-weight: 600;
    --button-tracking: 0;
    --button-transform: none;
    --button-clip: none;

    --header-height: 72px;

    /* Suits a wide wordmark. A taller badge logo needs more height to read. */
    --logo-height: 20px;

    /* Pages run edge to edge. A brand can set 1200px for a centred layout. */
    --page-max-width: 100vw;
    --page-gutter: clamp(1rem, 3.5vw, 4rem);
    --page-edge: max(var(--page-gutter), calc((100vw - var(--page-max-width)) / 2 + var(--page-gutter)));

    /* Bike photos are JPGs on white, so this stays white in both modes. */
    --color-media: #FFFFFF;

    /* The footer is a dark band in both modes. */
    --color-footer-text: #F4F4F5;
    --color-footer-muted: #B4B4BC;
    --color-footer-border: #3A3A41;
    --color-footer-focus: #7FB0FF;
    --color-footer-accent: #F4F4F5;

    /* The page hero is a dark band in both modes. */
    --color-hero-text: #FFFFFF;
    --color-hero-chip: rgb(255 255 255 / 0.16);
    --color-hero-line: rgb(255 255 255 / 0.2);
    --hero-media-clip: none;

    /* The divider between parts of a page, when a brand turns it on (divider in its config). */
    --divider-color: var(--color-primary);
    --divider-thickness: 3px;
    --divider-tilt: 0deg;

    /* Keeps text readable when it sits on top of a moving video. */
    --hero-scrim: linear-gradient(to right, rgb(0 0 0 / 0.78), rgb(0 0 0 / 0.35) 60%, rgb(0 0 0 / 0.15));
    --hero-scrim-small: rgb(0 0 0 / 0.62);
    --hero-text-shadow: 0 1px 2px rgb(0 0 0 / 0.45), 0 4px 22px rgb(0 0 0 / 0.55);

    /* The same job on the model hero, where the text sits low on the left. */
    --hero-scrim-corner:
        radial-gradient(115% 90% at 6% 84%, rgb(0 0 0 / 0.9), rgb(0 0 0 / 0.62) 34%, rgb(0 0 0 / 0.18) 60%, transparent 76%),
        linear-gradient(to bottom, transparent 58%, rgb(0 0 0 / 0.42) 86%, rgb(0 0 0 / 0.8));
    --hero-scrim-foot: linear-gradient(to bottom, rgb(0 0 0 / 0.05) 20%, rgb(0 0 0 / 0.6) 45%, rgb(0 0 0 / 0.9) 75%, rgb(0 0 0 / 0.96));
}


/* Light mode
   ========================================================================== */

:root,
[data-mode="light"] {
    color-scheme: light;

    --color-bg: #F6F6F7;
    --color-surface: #FFFFFF;
    --color-surface-raised: #EFEFF1;
    --color-border: #DEDEE2;
    --color-border-strong: #84848D;

    --color-text: #18181B;
    --color-text-muted: #55555D;

    --color-primary: #27272A;
    --color-primary-hover: #000000;
    --color-on-primary: #FFFFFF;
    --color-accent-text: #27272A;

    --color-focus: #2563EB;
    --color-success: #157F3B;
    --color-warning: #9A5B00;
    --color-danger: #C81E1E;

    --color-footer-bg: #18181B;

    --shadow-card: 0 1px 2px rgb(0 0 0 / 0.05), 0 4px 14px rgb(0 0 0 / 0.05);
    --shadow-card-hover: 0 2px 4px rgb(0 0 0 / 0.06), 0 12px 28px rgb(0 0 0 / 0.1);
    --card-hover-border: var(--color-border-strong);
}


/* Dark mode
   ========================================================================== */

[data-mode="dark"] {
    color-scheme: dark;

    --color-bg: #111113;
    --color-surface: #1A1A1D;
    --color-surface-raised: #242428;
    --color-border: #303036;
    --color-border-strong: #7C7C86;

    --color-text: #F4F4F5;
    --color-text-muted: #ABABB3;

    --color-primary: #F4F4F5;
    --color-primary-hover: #FFFFFF;
    --color-on-primary: #18181B;
    --color-accent-text: #F4F4F5;

    --color-focus: #7FB0FF;
    --color-success: #4ADE80;
    --color-warning: #FBBF24;
    --color-danger: #FF8A8A;

    --color-footer-bg: #0A0A0B;

    --shadow-card: none;
    --shadow-card-hover: 0 12px 28px rgb(0 0 0 / 0.45);
}


/* Page basics
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--text-md);
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
.heading-1,
.heading-2,
.heading-3,
.heading-4 {
    margin: 0;
    color: var(--color-text);
    font-family: var(--font-heading);
    font-weight: var(--heading-weight);
    line-height: var(--heading-line);
    letter-spacing: var(--heading-tracking);
    text-transform: var(--heading-transform);
}

h1,
.heading-1 {
    font-size: var(--text-3xl);
    font-weight: var(--heading-1-weight);
    letter-spacing: var(--heading-1-tracking);
    text-transform: var(--heading-1-transform);
}

h2, .heading-2 { font-size: var(--text-2xl); }
h3, .heading-3 { font-size: var(--text-xl); }
h4, .heading-4 { font-size: var(--text-lg); }

p {
    margin: 0;
}

a {
    color: var(--color-accent-text);
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

.container {
    width: 100%;
    max-width: var(--page-max-width);
    margin-inline: auto;
    padding-inline: var(--page-gutter);
}

.text-muted {
    color: var(--color-text-muted);
}

.eyebrow {
    color: var(--color-accent-text);
    font-family: var(--font-label);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: var(--eyebrow-tracking);
    text-transform: uppercase;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 200;
    padding: var(--space-2) var(--space-4);
    background: var(--color-primary);
    color: var(--color-on-primary);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}


/* Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 48px;
    padding: var(--space-2) var(--space-5);
    border: 2px solid transparent;
    border-radius: var(--radius-button);
    background: transparent;
    font-family: var(--font-label);
    font-size: var(--text-md);
    font-weight: var(--button-weight);
    line-height: 1.2;
    letter-spacing: var(--button-tracking);
    text-align: center;
    text-decoration: none;
    text-transform: var(--button-transform);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn--primary {
    background: var(--color-primary);
    color: var(--color-on-primary);
    clip-path: var(--button-clip);
}

.btn--primary:hover {
    background: var(--color-primary-hover);
}

.btn--secondary {
    border-color: var(--color-text);
    color: var(--color-text);
}

.btn--secondary:hover {
    background: var(--color-text);
    color: var(--color-bg);
}

.btn--ghost {
    color: var(--color-accent-text);
}

.btn--ghost:hover {
    background: var(--color-surface-raised);
}

.btn--sm {
    min-height: 40px;
    padding: var(--space-1) var(--space-4);
    font-size: var(--text-sm);
}

.btn--lg {
    min-height: 56px;
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-lg);
}

/* A clipped shape would cut the focus ring off. */
.btn:focus-visible {
    clip-path: none;
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
}


/* Badges
   ========================================================================== */

.badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-badge);
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-family: var(--font-label);
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: var(--button-tracking);
    text-transform: var(--button-transform);
}

.badge--quiet {
    background: var(--color-surface-raised);
    color: var(--color-text);
}


/* Form fields
   ========================================================================== */

.field {
    display: grid;
    gap: var(--space-2);
    align-content: start;
}

.field__label {
    font-size: var(--text-sm);
    font-weight: 600;
}

.field__input {
    width: 100%;
    min-height: 48px;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-field);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
}

.field__input::placeholder {
    color: var(--color-text-muted);
    opacity: 1;
}

textarea.field__input {
    min-height: 128px;
    resize: vertical;
}

.field__help {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.field__error {
    color: var(--color-danger);
    font-size: var(--text-sm);
    font-weight: 500;
}

.field--error .field__input {
    border-color: var(--color-danger);
    box-shadow: inset 0 0 0 1px var(--color-danger);
}

.check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: var(--text-sm);
    cursor: pointer;
}

.check input {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    accent-color: var(--color-primary);
}


/* Header
   The bar and the parts every screen shares, then the phone and tablet menu,
   then the desktop layout at the end of this section.
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.site-header__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    min-height: var(--header-height);
}

.site-header__logo {
    flex: none;
}

.site-header__logo img {
    width: auto;
    height: var(--logo-height);
}

.site-header__burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-inline-end: calc(var(--space-3) * -1);
    border: 0;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
}

/* The three lines fold into a cross around the middle of the icon. */
.site-header__burger path {
    transform-origin: 12px 12px;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.site-header__burger[aria-expanded="true"] .site-header__burger-top {
    transform: rotate(45deg) translateY(6px);
}

.site-header__burger[aria-expanded="true"] .site-header__burger-middle {
    opacity: 0;
}

.site-header__burger[aria-expanded="true"] .site-header__burger-bottom {
    transform: rotate(-45deg) translateY(-6px);
}

.site-nav__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__link {
    display: block;
    color: var(--color-text);
    font-family: var(--font-label);
    font-size: var(--text-md);
    font-weight: var(--button-weight);
    letter-spacing: var(--button-tracking);
    text-decoration: none;
    text-transform: var(--button-transform);
    transition: color 0.2s ease;
}

.site-nav__link:hover,
.site-nav__item.is-open .site-nav__link {
    color: var(--color-accent-text);
}

.site-nav__expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-text);
    line-height: inherit;
    cursor: pointer;
}

.site-nav__expand svg {
    flex: none;
    transition: transform 0.25s ease;
}

.site-nav__item.is-open .site-nav__expand svg {
    transform: rotate(180deg);
}

/* Open, a menu takes its visibility from the menu around it, so it hides with the phone menu. */
.site-nav__panel {
    visibility: hidden;
}

.site-nav__item.is-open > .site-nav__panel {
    visibility: inherit;
}

.nav-links {
    display: grid;
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-links a {
    display: block;
    padding: var(--space-2) var(--space-3);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    text-decoration: none;
}

/* In the menu an arrow slides in beside the link being pointed at. */
.site-nav .nav-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    color: var(--color-text);
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.site-nav .nav-links a::after {
    content: "→";
    color: var(--color-accent-text);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.site-nav .nav-links a:hover {
    background: var(--color-surface-raised);
    color: var(--color-text);
}

.site-nav .nav-links a:hover::after,
.site-nav .nav-links a:focus-visible::after {
    opacity: 1;
    transform: none;
}

.site-nav .nav-links--footer {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
}

.site-nav .nav-links--footer a {
    color: var(--color-accent-text);
    font-weight: 600;
}

.site-nav .nav-links--footer a::after {
    opacity: 1;
    transform: none;
}

/* The More menu's two lists, the About pages and then the rest, with a line between. */
.site-nav .nav-links + .nav-links {
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-border);
}

/* Bike menus: a grid of bike cards, in one list whatever their category. */
.nav-range__grid {
    display: grid;
}

.nav-range__group[hidden],
.nav-range__item[hidden] {
    display: none;
}

.nav-range__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 2px;
    height: 100%;
    color: var(--color-text);
    font-size: var(--text-sm);
    line-height: 1.25;
    text-decoration: none;
}

.nav-card__thumb {
    display: block;
    overflow: hidden;
    aspect-ratio: 3 / 2;
    margin-bottom: var(--space-2);
    border-radius: var(--radius-card);
    background: var(--color-media);
}

.nav-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.35s ease;
}

.nav-card:hover .nav-card__thumb img {
    transform: scale(1.06);
}

.nav-card__name {
    font-weight: 600;
}

.nav-card__price {
    color: var(--color-accent-text);
    font-size: 0.8125rem;
    font-weight: 700;
}

.nav-card__badge,
.nav-range__preview-badge {
    grid-column: 1 / -1;
    margin-top: var(--space-2);
    padding: 3px var(--space-2);
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-family: var(--font-label);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.35;
    text-transform: uppercase;
}

/* Two lines at most on a card. The full offer is on the bike's page, and in the desktop preview. */
.nav-card__badge {
    display: -webkit-box;
    overflow: hidden;
    margin-top: var(--space-1);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

@keyframes site-nav-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

/* Phone and tablet menu
   The burger unrolls the menu from the bar. A row with more in it opens that menu,
   which slides in over the main list with a Back button, while the main list drifts
   away to the left. On a tablet the menu is a sheet at the side of the page.
   -------------------------------------------------------------------------- */

@media (max-width: 1199.98px) {
    .site-header {
        --nav-ease: cubic-bezier(0.32, 0.72, 0, 1);
        --nav-head: 56px;
    }

    .menu-open {
        overflow: hidden;
    }

    /* Hidden rather than removed, so it can unroll and roll back up. */
    .site-nav {
        position: fixed;
        inset: calc(var(--header-height) + 1px) 0 0;
        overflow: hidden;
        background: var(--color-surface);
        visibility: hidden;
        clip-path: inset(0 0 100% 0);
        transition: clip-path 0.4s var(--nav-ease), visibility 0s linear 0.4s;
    }

    .site-nav.is-open {
        visibility: visible;
        clip-path: inset(0);
        transition: clip-path 0.5s var(--nav-ease);
    }

    /* The main list scrolls on its own. Each menu is placed over the whole of .site-nav,
       outside this box, so it neither scrolls with it nor is cut off by it. */
    .site-nav__main {
        display: flex;
        flex-direction: column;
        gap: var(--space-6);
        height: 100%;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: var(--space-3) var(--page-gutter) calc(var(--space-7) + env(safe-area-inset-bottom));
    }

    /* Big rows. A row with a menu opens it, so its own link waits inside the menu. */
    .site-nav__item.site-nav__item--parent > .site-nav__link {
        display: none;
    }

    .site-nav__item > .site-nav__link,
    .site-nav__expand {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-3);
        width: 100%;
        height: auto;
        min-height: 64px;
        padding: var(--space-2) 0;
        text-align: start;
    }

    .site-nav__item .site-nav__link {
        font-size: clamp(1.25rem, 1.05rem + 1vw, 1.5rem);
        line-height: 1.2;
    }

    .site-nav__expand .site-nav__link {
        display: inline-flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--space-1) var(--space-3);
    }

    .site-nav__count {
        min-width: 2em;
        padding: 3px var(--space-2);
        border-radius: var(--radius-badge);
        background: var(--color-surface-raised);
        color: var(--color-text-muted);
        font-family: var(--font-body);
        font-size: 0.75rem;
        font-weight: 600;
        line-height: 1.3;
        letter-spacing: 0;
        text-align: center;
        text-transform: none;
    }

    /* The arrow on the right of each row: it points onward, and fills in when touched. */
    .site-nav__expand svg,
    .site-nav__item > .site-nav__link .icon,
    .site-nav__item:not(.site-nav__mobile) > .site-nav__link::after {
        flex: none;
        box-sizing: content-box;
        width: 16px;
        height: 16px;
        padding: 10px;
        border-radius: var(--radius-badge);
        background: var(--color-surface-raised);
        color: var(--color-text);
        transition: transform 0.25s var(--nav-ease), background-color 0.2s ease, color 0.2s ease;
    }

    .site-nav__expand svg,
    .site-nav__item.is-open .site-nav__expand svg {
        transform: rotate(-90deg);
    }

    /* A plain link's arrow is text, in the same box as the others. */
    .site-nav__item:not(.site-nav__mobile) > .site-nav__link::after {
        content: "→";
        display: grid;
        place-items: center;
        font-family: var(--font-body);
        font-size: 1rem;
        font-weight: 600;
        line-height: 1;
        letter-spacing: 0;
    }

    .site-nav__expand:hover svg,
    .site-nav__expand:active svg,
    .site-nav__item > .site-nav__link:hover .icon,
    .site-nav__item > .site-nav__link:active .icon,
    .site-nav__item > .site-nav__link:hover::after,
    .site-nav__item > .site-nav__link:active::after {
        background-color: var(--color-primary);
        color: var(--color-on-primary);
    }

    .site-nav__expand:hover svg,
    .site-nav__expand:active svg {
        transform: rotate(-90deg) translateY(3px);
    }

    .site-nav__expand:hover .site-nav__link {
        color: var(--color-accent-text);
    }

    /* The rows come in one after another as the menu unrolls. site.js numbers them. */
    .site-nav.is-open .site-nav__item > :not(.site-nav__panel),
    .site-nav.is-open .site-nav__dealer {
        animation: site-nav-in 0.5s var(--nav-ease) backwards;
        animation-delay: calc(var(--i, 0) * 40ms + 100ms);
    }

    .site-nav__item > :not(.site-nav__panel),
    .site-nav__dealer {
        transition: translate 0.45s var(--nav-ease), opacity 0.3s ease, color 0.2s ease, visibility 0s;
    }

    .site-nav.has-sub .site-nav__item > :not(.site-nav__panel),
    .site-nav.has-sub .site-nav__dealer {
        opacity: 0;
        translate: -30% 0;
        visibility: hidden;
        transition: translate 0.45s var(--nav-ease), opacity 0.3s ease, color 0.2s ease, visibility 0s linear 0.45s;
    }

    /* A menu slides in from the right and covers the main list. */
    .site-nav__panel {
        position: absolute;
        inset: 0;
        z-index: 1;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--color-surface);
        translate: 100% 0;
        transition: translate 0.45s var(--nav-ease), visibility 0s linear 0.45s;
    }

    .site-nav__item.is-open > .site-nav__panel {
        translate: 0 0;
        transition: translate 0.45s var(--nav-ease);
    }

    /* The Back button stays in sight as the menu scrolls. */
    .site-nav__panel-head {
        position: sticky;
        top: 0;
        z-index: 2;
        display: flex;
        align-items: center;
        height: var(--nav-head);
        padding-inline: var(--page-gutter);
        border-bottom: 1px solid var(--color-border);
        background: var(--color-surface);
    }

    .site-nav__back {
        display: inline-flex;
        align-items: center;
        gap: var(--space-1);
        min-height: 44px;
        margin-inline-start: calc(var(--space-2) * -1);
        padding: 0 var(--space-3) 0 var(--space-1);
        border: 0;
        border-radius: var(--radius-button);
        background: transparent;
        color: var(--color-text);
        font: inherit;
        font-weight: 600;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .site-nav__back:hover {
        background: var(--color-surface-raised);
    }

    .site-nav__panel-inner {
        padding: var(--space-5) var(--page-gutter) calc(var(--space-7) + env(safe-area-inset-bottom));
    }

    .site-nav__panel-title {
        margin: 0 0 var(--space-4);
        color: var(--color-text);
        font-family: var(--font-heading);
        font-size: var(--text-2xl);
        font-weight: var(--heading-1-weight);
        line-height: 1.1;
        letter-spacing: var(--heading-1-tracking);
        text-transform: var(--heading-1-transform);
    }

    /* A menu's own links and bikes come in one after another. site.js numbers them. */
    .site-nav__item.is-open .site-nav__panel-inner li {
        animation: site-nav-in 0.5s var(--nav-ease) backwards;
        animation-delay: calc(min(var(--i, 0), 10) * 35ms + 150ms);
    }

    /* A menu of links: big rows, each with its arrow. */
    .site-nav .nav-links {
        gap: 0;
    }

    .site-nav .nav-links a {
        min-height: 56px;
        padding: var(--space-2) 0;
        border-bottom: 1px solid var(--color-border);
        font-size: var(--text-lg);
        font-weight: 600;
        line-height: 1.3;
    }

    .site-nav .nav-links a::after {
        color: var(--color-text-muted);
        opacity: 1;
        transform: none;
    }

    .site-nav .nav-links a:hover {
        background: none;
        color: var(--color-accent-text);
    }

    .site-nav .nav-links a:hover::after {
        color: var(--color-accent-text);
        transform: translateX(4px);
    }

    /* Each row already has its line beneath, so the second list only needs a gap. */
    .site-nav .nav-links + .nav-links {
        margin-top: var(--space-6);
        padding-top: 0;
        border-top: 0;
    }

    /* Under the bikes: View all as a button, and the next link beside or under it. */
    .site-nav .nav-links--footer {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
        gap: var(--space-3);
        margin-top: var(--space-6);
        padding-top: 0;
        border-top: 0;
    }

    .site-nav .nav-links--footer a {
        justify-content: center;
        min-height: 48px;
        padding: var(--space-2) var(--space-4);
        border: 1px solid var(--color-primary);
        border-radius: var(--radius-button);
        color: var(--color-text);
        font-family: var(--font-label);
        font-size: var(--text-sm);
        font-weight: var(--button-weight);
        letter-spacing: var(--button-tracking);
        text-align: center;
        text-transform: var(--button-transform);
        transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    }

    .site-nav .nav-links--footer li:first-child a {
        background: var(--color-primary);
        color: var(--color-on-primary);
    }

    .site-nav .nav-links--footer li:first-child a:hover {
        border-color: var(--color-primary-hover);
        background: var(--color-primary-hover);
    }

    .site-nav .nav-links--footer a::after {
        content: none;
    }

    /* Bike menus: category chips in a row that scrolls sideways and stays under the Back bar. */
    .nav-range__search,
    .nav-range__preview {
        display: none;
    }

    .nav-range__bar {
        position: sticky;
        top: var(--nav-head);
        z-index: 1;
        margin: calc(var(--space-2) * -1) calc(var(--page-gutter) * -1) var(--space-4);
        padding-block: var(--space-2) var(--space-3);
        background: var(--color-surface);
    }

    .nav-range__tabs {
        display: flex;
        gap: var(--space-2);
        overflow-x: auto;
        overscroll-behavior-x: contain;
        padding-inline: var(--page-gutter);
        scroll-padding-inline: var(--page-gutter);
        scrollbar-width: none;
        mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
    }

    .nav-range__tabs::-webkit-scrollbar {
        display: none;
    }

    .nav-range__tab {
        display: inline-flex;
        flex: none;
        align-items: center;
        gap: 6px;
        min-height: 40px;
        padding: 0 var(--space-4);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-badge);
        background: var(--color-surface);
        color: var(--color-text);
        font: inherit;
        font-size: var(--text-sm);
        font-weight: 600;
        white-space: nowrap;
        cursor: pointer;
        transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    }

    .nav-range__tab span {
        color: var(--color-text-muted);
        font-size: 0.75rem;
        font-weight: 500;
    }

    .nav-range__tab--offers {
        color: var(--color-accent-text);
    }

    .nav-range__tab[aria-pressed="true"] {
        border-color: var(--color-primary);
        background: var(--color-primary);
        color: var(--color-on-primary);
    }

    .nav-range__tab[aria-pressed="true"] span {
        color: inherit;
        opacity: 0.75;
    }

    /* Two bikes a row on a phone, more on a wider screen. Each category's name heads its bikes. */
    .nav-range__grid {
        grid-template-columns: repeat(auto-fill, minmax(min(150px, 50% - var(--space-3) / 2), 1fr));
        gap: var(--space-5) var(--space-3);
    }

    .nav-range__group,
    .nav-range__list {
        display: contents;
    }

    .nav-range__title {
        display: flex;
        grid-column: 1 / -1;
        align-items: center;
        justify-content: space-between;
        margin: var(--space-2) 0 calc(var(--space-2) * -1);
        padding-bottom: var(--space-2);
        border-bottom: 1px solid var(--color-border);
        color: var(--color-text);
        font-family: var(--font-label);
        font-size: var(--text-sm);
        font-weight: 700;
        letter-spacing: var(--eyebrow-tracking);
        text-decoration: none;
        text-transform: uppercase;
    }

    .nav-range__group:first-child .nav-range__title {
        margin-top: 0;
    }

    a.nav-range__title::after {
        content: "→";
        color: var(--color-accent-text);
        letter-spacing: 0;
    }

    .nav-range__empty {
        grid-column: 1 / -1;
        color: var(--color-text-muted);
    }

    /* The photos are on white, so a thin frame keeps their edge on a white menu. */
    .nav-card__thumb {
        border: 1px solid var(--color-border);
    }

    .nav-card__name {
        font-size: var(--text-md);
    }

    /* The dealer search at the foot of the main list. */
    .site-nav__dealer {
        display: grid;
        gap: var(--space-3);
        margin-top: auto;
        padding: var(--space-5);
        border-radius: var(--radius-card);
        background: var(--color-surface-raised);
    }

    .site-nav__dealer-title {
        color: var(--color-text);
        font-family: var(--font-heading);
        font-size: var(--text-lg);
        font-weight: var(--heading-weight);
        line-height: 1.2;
        letter-spacing: var(--heading-tracking);
        text-transform: var(--heading-transform);
    }

    .site-nav__dealer-field {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        padding: 4px 4px 4px var(--space-4);
        border: 1px solid var(--color-border-strong);
        border-radius: var(--radius-field);
        background: var(--color-surface);
        color: var(--color-text-muted);
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    /* The box shows focus, so the field inside it needs no ring of its own. */
    .site-nav__dealer-field:focus-within {
        border-color: var(--color-focus);
        box-shadow: 0 0 0 2px var(--color-focus);
    }

    .site-nav__dealer-field .icon {
        flex: none;
    }

    .site-nav__dealer-field input {
        flex: 1;
        min-width: 0;
        height: 44px;
        padding: 0;
        border: 0;
        outline: 0;
        background: none;
        color: var(--color-text);
        font: inherit;
        font-size: 1rem;
        text-transform: uppercase;
    }

    .site-nav__dealer-field input::placeholder {
        color: var(--color-text-muted);
        opacity: 1;
        text-transform: none;
    }

    .site-nav__dealer-field button {
        display: grid;
        flex: none;
        place-items: center;
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: var(--radius-button);
        background: var(--color-primary);
        color: var(--color-on-primary);
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .site-nav__dealer-field button:hover {
        background: var(--color-primary-hover);
    }
}

/* On a tablet the menu is a sheet at the side, over a dimmed page. A tap on the page closes it. */
@media (min-width: 640px) and (max-width: 1199.98px) {
    .site-nav {
        left: auto;
        width: 480px;
        border-inline-start: 1px solid var(--color-border);
        box-shadow: -24px 0 48px rgb(0 0 0 / 0.12);
        clip-path: none;
        translate: 100% 0;
        transition: translate 0.45s var(--nav-ease), visibility 0s linear 0.45s;
    }

    .site-nav.is-open {
        clip-path: none;
        translate: 0 0;
        transition: translate 0.5s var(--nav-ease);
    }

    .site-header::after {
        content: "";
        position: fixed;
        inset: calc(var(--header-height) + 1px) 0 0;
        z-index: -1;
        background: rgb(0 0 0 / 0.4);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    }

    .menu-open .site-header::after {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.3s ease;
    }
}

@media (min-width: 1200px) {
    /* The menu sits in the middle of the bar. Where the logo leaves too little room,
       it moves right of the logo instead of running into it.
       The header, not this box, holds the bike menus, so they centre under the whole bar. */
    .site-header__inner {
        position: static;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
    }

    .site-header__logo {
        justify-self: start;
    }

    .site-header__burger {
        display: none;
    }

    .site-nav {
        grid-column: 2;
    }

    .site-nav__list {
        display: flex;
        align-items: center;
        gap: var(--space-3);
    }

    .site-nav__item {
        position: relative;
        display: flex;
        align-items: center;
        min-height: var(--header-height);
    }

    .site-nav__item--mega {
        position: static;
    }

    /* A bar slides in under the name, and stays while its menu is open. */
    .site-nav__link {
        position: relative;
        padding-block: var(--space-2);
        font-size: 0.9375rem;
        white-space: nowrap;
    }

    .site-nav__link::after {
        content: "";
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        height: 2px;
        background: var(--color-primary);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 0.25s ease;
    }

    .site-nav__item:hover .site-nav__link::after,
    .site-nav__item.is-open .site-nav__link::after {
        transform: scaleX(1);
    }

    .site-nav__expand {
        width: 22px;
        height: 32px;
    }

    .site-nav__expand--label {
        gap: var(--space-1);
        width: auto;
        padding: 0;
    }

    /* Fades and drops into place, and fades away when the pointer leaves. */
    .site-nav__panel {
        position: absolute;
        top: 100%;
        left: calc(var(--space-3) * -1);
        z-index: 1;
        min-width: 270px;
        border: 1px solid var(--color-border);
        border-top: 2px solid var(--color-primary);
        background: var(--color-surface);
        box-shadow: 0 18px 40px rgb(0 0 0 / 0.16);
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
    }

    .site-nav__item.is-open > .site-nav__panel {
        opacity: 1;
        transform: none;
        transition: opacity 0.22s ease, transform 0.25s ease;
    }

    .site-nav__panel-inner {
        padding: var(--space-2);
    }

    .site-nav__item:last-child .site-nav__panel {
        right: calc(var(--space-3) * -1);
        left: auto;
    }

    /* A box under the bar, centred on the page and only as tall as its bikes need. */
    .site-nav__panel--mega {
        left: 50%;
        width: min(1240px, 100vw - 2 * var(--page-gutter));
        translate: -50% 0;
    }

    .site-nav__panel--mega .site-nav__panel-inner {
        padding: 0;
    }

    .nav-range__bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-3) var(--space-5);
        padding: var(--space-3) var(--space-4);
        border-bottom: 1px solid var(--color-border);
    }

    .nav-range__tabs {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-1);
    }

    /* The chosen tab's underline grows from the left. */
    .nav-range__tab {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 40px;
        padding: 0 var(--space-3);
        border: 0;
        background: linear-gradient(var(--color-primary), var(--color-primary)) no-repeat left bottom / 0 2px;
        color: var(--color-text-muted);
        font: inherit;
        font-size: var(--text-sm);
        font-weight: 600;
        cursor: pointer;
        transition: background-size 0.25s ease, background-color 0.2s ease, color 0.2s ease;
    }

    .nav-range__tab span {
        font-size: 0.75rem;
        font-weight: 500;
    }

    .nav-range__tab:hover {
        background-color: var(--color-surface-raised);
        color: var(--color-text);
    }

    .nav-range__tab[aria-pressed="true"] {
        background-size: 100% 2px;
        color: var(--color-text);
    }

    .nav-range__tab--offers {
        color: var(--color-accent-text);
    }

    .nav-range__search {
        position: relative;
        flex: 0 1 240px;
    }

    .nav-range__search input {
        width: 100%;
        min-height: 40px;
        padding: 0 40px 0 var(--space-3);
        border: 1px solid var(--color-border-strong);
        border-radius: var(--radius-field);
        background: var(--color-surface);
        color: var(--color-text);
        font: inherit;
        font-size: var(--text-sm);
    }

    .nav-range__search input::placeholder {
        color: var(--color-text-muted);
        opacity: 1;
    }

    .nav-range__search svg {
        position: absolute;
        top: 50%;
        right: var(--space-3);
        color: var(--color-text-muted);
        translate: 0 -50%;
        pointer-events: none;
    }

    .nav-range__body {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 280px;
    }

    /* Every card sits in one grid, whatever its category. The grid scrolls, not the page. */
    .nav-range__grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        align-content: start;
        gap: var(--space-3);
        max-height: min(470px, 100vh - var(--header-height) - 190px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: var(--space-4);
    }

    .nav-range__group,
    .nav-range__list {
        display: contents;
    }

    .nav-range__title {
        display: none;
    }

    .nav-range__empty {
        grid-column: 1 / -1;
        color: var(--color-text-muted);
    }

    /* On a desktop the cards are framed, and rise under the pointer. */
    .nav-card {
        align-items: start;
        padding: var(--space-2) var(--space-2) var(--space-3);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-card);
        background: var(--color-surface);
        transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    }

    .nav-card:hover {
        box-shadow: var(--shadow-card-hover);
        transform: translateY(-2px);
    }

    .nav-card:hover,
    .nav-card.is-previewed {
        border-color: var(--color-primary);
    }

    .nav-range__preview {
        display: grid;
        align-content: start;
        justify-items: start;
        gap: var(--space-1);
        padding: var(--space-5);
        border-inline-start: 1px solid var(--color-border);
        background: var(--color-surface-raised);
    }

    .nav-range__preview-thumb {
        display: block;
        width: 100%;
        overflow: hidden;
        aspect-ratio: 3 / 2;
        margin-bottom: var(--space-3);
        border-radius: var(--radius-card);
        background: var(--color-media);
    }

    .nav-range__preview-thumb img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        transition: opacity 0.25s ease, transform 0.35s ease;
    }

    /* The old bike fades out and the next one settles in. */
    .nav-range__preview.is-changing img {
        opacity: 0;
        transform: scale(0.96);
    }

    .nav-range__preview-type {
        color: var(--color-accent-text);
        font-family: var(--font-label);
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: var(--eyebrow-tracking);
        text-transform: uppercase;
    }

    .nav-range__preview-name {
        font-family: var(--font-heading);
        font-size: var(--text-xl);
        font-weight: var(--heading-weight);
        line-height: 1.15;
        letter-spacing: var(--heading-tracking);
        text-transform: var(--heading-transform);
    }

    .nav-range__preview-line {
        color: var(--color-text-muted);
        font-size: var(--text-sm);
    }

    .nav-range__preview-price {
        margin-top: var(--space-2);
        font-family: var(--font-heading);
        font-size: var(--text-lg);
        font-weight: 700;
    }

    .nav-range__preview p:empty {
        display: none;
    }

    .nav-range__preview-link {
        margin-top: var(--space-3);
    }

    .site-nav .site-nav__panel--mega .nav-links--footer {
        margin: 0;
        padding: var(--space-3) var(--space-4);
    }

    .site-nav .nav-links--footer {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-2) var(--space-6);
        margin-top: var(--space-6);
        padding-top: var(--space-4);
    }

    .site-nav .nav-links--footer a {
        justify-content: flex-start;
        padding-inline: 0;
    }

    .site-nav .nav-links--footer a:hover {
        background: none;
    }

    /* Dims the page beneath an open menu. Below the header, so the bar stays bright. */
    .site-header::after {
        content: "";
        position: fixed;
        inset: calc(var(--header-height) + 1px) 0 0;
        z-index: -1;
        background: rgb(0 0 0 / 0.35);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0s linear 0.25s;
    }

    .site-header.has-panel::after {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.25s ease;
    }

    /* Last, so it wins over .site-nav__item above. */
    .site-nav__mobile {
        display: none;
    }
}

/* The bike cards come in one after another as the menu opens. */
@media (min-width: 1200px) and (prefers-reduced-motion: no-preference) {
    .nav-range__item {
        opacity: 0;
        transform: translateY(10px);
        transition: opacity 0.3s ease, transform 0.35s ease;
    }

    .site-nav__item.is-open .nav-range__item {
        opacity: 1;
        transform: none;
        transition-delay: min(calc(var(--i, 0) * 18ms + 60ms), 400ms);
    }
}

/* Moving from one menu to the next swaps them at once. site.js sets this for a moment. */
[data-nav-instant],
[data-nav-instant] * {
    transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .site-header *,
    .site-header::after {
        transition: none !important;
        animation: none !important;
    }
}


/* Footer
   ========================================================================== */

.site-footer {
    --color-focus: var(--color-footer-focus);

    background: var(--color-footer-bg);
    color: var(--color-footer-text);
}

.site-footer__main {
    display: grid;
    gap: var(--space-6);
    padding-block: var(--space-7);
}

.site-footer__logo {
    display: inline-block;
}

.site-footer__logo img {
    width: auto;
    height: var(--logo-height);
}

.site-footer__text {
    max-width: 38ch;
    margin-top: var(--space-4);
    color: var(--color-footer-muted);
    font-size: var(--text-sm);
}

.site-footer__social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-top: var(--space-3);
    margin-inline-start: -11px;
    color: var(--color-footer-text);
}

.site-footer__heading {
    margin-bottom: var(--space-3);
    color: var(--color-footer-text);
    font-size: var(--text-md);
}

.site-footer .nav-links a {
    padding: var(--space-1) 0;
    color: var(--color-footer-muted);
}

.site-footer .nav-links a:hover {
    background: none;
    color: var(--color-footer-text);
    text-decoration: underline;
}

.site-footer__bottom {
    border-top: 1px solid var(--color-footer-border);
    color: var(--color-footer-muted);
    font-size: var(--text-sm);
}

.site-footer__bottom-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-1) var(--space-5);
    padding-block: var(--space-4);
}

@media (min-width: 640px) {
    .site-footer__main {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .site-footer__brand {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1000px) {
    .site-footer__main {
        grid-template-columns: 2fr repeat(3, minmax(0, 1fr));
    }

    .site-footer__brand {
        grid-column: auto;
    }
}


/* Page hero
   ========================================================================== */

/* Text and photo sit side by side, so a headline never covers the bike. */
.page-hero {
    --color-text: var(--color-hero-text);
    --color-bg: var(--color-footer-bg);
    --color-focus: var(--color-footer-focus);

    position: relative;
    display: grid;
    background: var(--color-footer-bg);
    color: var(--color-hero-text);
}

/* On the seam under the band, half over it and half over what comes next.
   Two classes, so it wins over the divider's own rules in sections.css. */
.page-hero > .page-hero__divider {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    margin: 0;
    translate: 0 50%;
}

.page-hero__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
}

.page-hero__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-hero__inner {
    display: grid;
    align-content: center;
    justify-items: start;
    gap: var(--space-3);
    padding: var(--space-6) var(--page-gutter) var(--space-7);
}

.page-hero h1,
.page-hero h2 {
    color: inherit;
}

.page-hero__eyebrow {
    font-family: var(--font-label);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: var(--eyebrow-tracking);
    text-transform: uppercase;
}

.page-hero__lede {
    max-width: 34rem;
    font-size: var(--text-lg);
}

.page-hero__facts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-2) 0 0;
    padding: 0;
    list-style: none;
}

.page-hero__facts li {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-button);
    background: var(--color-hero-chip);
    font-size: var(--text-sm);
}

.page-hero__dealer {
    margin-top: var(--space-3);
    font-size: var(--text-sm);
}

.page-hero__dealer h2 {
    margin-bottom: var(--space-1);
    font-size: var(--text-lg);
}

.page-hero__dealer a {
    color: inherit;
}

@media (min-width: 900px) {
    .page-hero {
        min-height: clamp(380px, 32vw, 620px);
    }

    /* With no picture the band only holds a title, so it needn't be tall. */
    .page-hero--short {
        min-height: 0;
    }

    .page-hero:has(.page-hero__media) {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    }

    .page-hero__media {
        grid-row: 1;
        grid-column: 2;
        aspect-ratio: auto;
        clip-path: var(--hero-media-clip);
    }

    .page-hero__inner {
        grid-row: 1;
        grid-column: 1;
        padding-block: var(--space-7);
        padding-inline: var(--page-edge) var(--space-6);
    }
}


/* Listing pages: filters, grid and page numbers
   ========================================================================== */

/* Filter links jump here, so the filters must clear the sticky header. */
.listing {
    padding-block: var(--space-6) var(--space-8);
    scroll-margin-top: var(--header-height);
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 40px;
    padding: var(--space-1) var(--space-4);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-button);
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-label);
    font-size: var(--text-sm);
    font-weight: var(--button-weight);
    letter-spacing: var(--button-tracking);
    text-decoration: none;
    text-transform: var(--button-transform);
    cursor: pointer;
}

.pill:hover {
    border-color: var(--color-text);
}

/* A link to the current filter, or a button that filters on the page. */
.pill[aria-current="true"],
.pill[aria-pressed="true"] {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.pill--removable {
    border-color: var(--color-border);
    background: var(--color-surface-raised);
}

.card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-5);
}

@media (min-width: 640px) {
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1440px) {
    .card-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Short grids: show only full rows, so a screen never ends on a gap. These
   only hide the extra cards, so every kind of card keeps its own layout. */
@media (max-width: 1023.98px) {
    .card-grid--two-rows > :nth-child(n+5),
    .card-grid--one-row > :nth-child(n+3) {
        display: none;
    }
}

@media (min-width: 1024px) and (max-width: 1439.98px) {
    .card-grid--two-rows > :nth-child(n+7),
    .card-grid--one-row > :nth-child(n+4) {
        display: none;
    }
}

@media (min-width: 1440px) {
    .card-grid--two-rows > :nth-child(n+9),
    .card-grid--one-row > :nth-child(n+5) {
        display: none;
    }
}

.listing__empty {
    display: grid;
    justify-items: start;
    gap: var(--space-3);
    padding-block: var(--space-6);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-6);
}

.pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
}

a.pagination__link:hover {
    border-color: var(--color-text);
}

.pagination__link.is-current {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.pagination__link.is-disabled {
    color: var(--color-text-muted);
}

.brand-intro {
    padding-block: var(--space-7);
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.brand-intro__inner {
    display: grid;
    gap: var(--space-5);
}

.brand-intro__inner > div {
    max-width: 52rem;
}

.brand-intro__title {
    margin-block: var(--space-2) var(--space-3);
    font-weight: 600;
}

.is-clamped {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.brand-intro__more {
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-accent-text);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}


/* Finance example popup
   The content comes from livewire/finance-modal, which the old pages share,
   so the Bootstrap class names it uses are styled here.
   ========================================================================== */

.finance-dialog {
    width: min(100% - 2rem, 760px);
    max-height: calc(100dvh - 2rem);
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-surface);
    color: var(--color-text);
}

.finance-dialog::backdrop {
    background: rgb(0 0 0 / 0.6);
}

.finance-dialog .modal-header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: flex-end;
    background: var(--color-surface);
}

.finance-dialog .btn-close {
    position: relative;
    width: 48px;
    height: 48px;
    border: 0;
    background: none;
    color: var(--color-text);
    cursor: pointer;
}

.finance-dialog .btn-close::before,
.finance-dialog .btn-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 2px;
    background: currentColor;
    transform: translate(-50%, -50%) rotate(45deg);
}

.finance-dialog .btn-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.finance-dialog .modal-body {
    padding: 0 var(--space-5) var(--space-5);
}

.finance-dialog br {
    display: none;
}

.finance-dialog .text-center {
    text-align: center;
}

.finance-dialog .text-primary {
    color: var(--color-accent-text);
}

.finance-dialog .modal-title {
    margin: 0 0 var(--space-3);
}

.finance-dialog .mb-4 {
    margin-bottom: var(--space-5);
}

.finance-dialog .mb-3 {
    margin-bottom: var(--space-4);
}

.finance-dialog .table {
    width: 100%;
    margin-bottom: var(--space-4);
    border-collapse: collapse;
}

.finance-dialog .table td {
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    text-align: center;
    vertical-align: middle;
}

.finance-dialog .spinner-grow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary);
    opacity: 0.6;
}


/* Model card
   ========================================================================== */

.model-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.model-card:hover {
    border-color: var(--card-hover-border);
    box-shadow: var(--shadow-card-hover);
}

.model-card:has(a:focus-visible) {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

.model-card__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 2;
    background: var(--color-media);
}

.model-card__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Sits above the link that covers the card, so a swipe moves the photos. */
.card-gallery {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.card-gallery__track {
    display: flex;
    height: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    cursor: grab;
}

.card-gallery__track::-webkit-scrollbar {
    display: none;
}

.card-gallery__track a {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

.card-gallery__track.is-dragging {
    scroll-snap-type: none;
    cursor: grabbing;
    user-select: none;
}

.card-gallery__arrow {
    position: absolute;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-top: -18px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    opacity: 0;
}

.card-gallery__arrow--prev {
    left: var(--space-2);
}

.card-gallery__arrow--next {
    right: var(--space-2);
}

.model-card:hover .card-gallery__arrow,
.card-gallery__arrow:focus-visible {
    opacity: 1;
}

/* Touch screens swipe instead. */
@media (hover: none) {
    .card-gallery__arrow {
        display: none;
    }
}

.card-gallery__count {
    position: absolute;
    right: var(--space-2);
    bottom: var(--space-2);
    padding: 2px var(--space-2);
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    font-size: 0.75rem;
    font-weight: 600;
    pointer-events: none;
}

.model-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.model-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
}

.model-card__title a {
    color: inherit;
    text-decoration: none;
}

/* Makes the whole card one link. */
.model-card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.model-card__title a:focus-visible {
    outline: none;
}

.model-card__specs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
    margin: 0;
    padding: 0;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    list-style: none;
}

/* The minimum height keeps this line level across a row when a bike has no finance. */
.model-card__footer {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: 4.25rem;
    margin-top: auto;
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

.model-card__price {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--heading-weight);
    line-height: 1.2;
}

.model-card__finance {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

/* Sits above the link that covers the card. */
.model-card__info {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-block: -6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
}

.model-card__info:hover {
    color: var(--color-accent-text);
}

.model-card__dealer {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

/* A used bike is photographed where it stands, so its photo fills the frame. */
.model-card--photo .model-card__media img {
    object-fit: cover;
}

.model-card--photo .model-card__media .model-card__logo {
    padding: 18%;
    object-fit: contain;
}

.model-card__was {
    margin-left: var(--space-1);
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 400;
}

.model-card__more {
    flex: none;
    align-self: flex-end;
    color: var(--color-accent-text);
    font-family: var(--font-label);
    font-size: var(--text-sm);
    font-weight: var(--button-weight);
    letter-spacing: var(--button-tracking);
    text-transform: var(--button-transform);
}

@media (prefers-reduced-motion: no-preference) {
    .model-card__media img {
        transition: transform 0.3s;
    }

    .model-card:hover .model-card__media > img {
        transform: scale(1.03);
    }
}
