/* ============================================================================
   Direction A - what the real pages need on top of css/design/variant-a.css.

   variant-a.css is shared with the /design/a mockup and stays untouched, so the
   mockup and the site cannot drift apart. Only additions live here.
   ============================================================================ */

/* The browser's default 8px body margin. The /design pages lose it through switcher.css,
   which the real layout does not load. */
body.v-a { margin: 0; }

/* Section shortcuts under the hero. */
.sections {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 28px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sections__item {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 600;
    font-size: 14.5px;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: border-color .15s, color .15s;
}

.sections__item i {
    font-style: normal;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    background: var(--canvas);
    border-radius: 999px;
    padding: 1px 8px;
}

.sections__item:hover { border-color: var(--action); color: var(--action-ink); }

/* Home page stock rows. */
.home { max-width: 1280px; margin: 0 auto; padding: 8px 28px 58px; }

.home__block { padding-top: 30px; }

.home__head {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.home__head h2 { font-size: 24px; text-transform: uppercase; letter-spacing: .02em; }

.home__head a {
    margin-left: auto;
    font-size: 14px;
    font-weight: 600;
    color: var(--structure);
    text-decoration: none;
}

.home__head a:hover { color: var(--action-ink); }

.finder select option[hidden] { display: none; }

/* Admin-controlled promo popup on the home page. */
.promo-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.promo-overlay.show { display: flex; }

.promo-box { position: relative; max-width: 600px; width: 100%; max-height: 90vh; }

.promo-box img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.promo-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--action);
    color: #fff;
    border: 2px solid #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
}

.promo-close:hover { background: var(--action-ink); }

@media (max-width: 640px) {
    .sections, .home { padding-left: 16px; padding-right: 16px; }
    .home__head { flex-wrap: wrap; }
    .home__head a { margin-left: 0; }
    .promo-box { max-width: 92vw; }
    .promo-close { top: -10px; right: -10px; width: 32px; height: 32px; font-size: 16px; }
}

/* ---------------------------------------------------------------------------
   Listing, section and detail pages
   --------------------------------------------------------------------------- */

/* Page banner (the mockup's .pagehead): a line under the heading, and room before the
   content that follows. */
.pagehead__count { margin: 6px 0 0; color: #d3d6d9; font-size: 14.5px; text-shadow: 0 1px 10px rgba(0, 0, 0, .6); }
.pagehead + .listing, .pagehead + .home { padding-top: 26px; }

/* Filter rail additions. */
.rail__clear { text-decoration: underline; }

.check__children { padding: 2px 0 6px 22px; border-left: 1px solid var(--line); margin-left: 7px; }
.check__children[hidden] { display: none; }
.check--child { font-size: 13.5px; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 0 2px; }

.pair select,
.pair input {
    width: 100%;
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    background: var(--surface);
    font: 400 14px/1.2 var(--sans);
    color: var(--text);
}

.facet__note { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }

.rail__apply {
    width: 100%;
    margin: 12px 0 4px;
    padding: 11px 14px;
    border: 0;
    border-radius: var(--r);
    background: var(--ink);
    color: #fff;
    font: 600 14px/1 var(--sans);
    cursor: pointer;
}

.rail__apply:hover { background: var(--action); }

/* Chips are links here (remove = follow the link), not buttons. */
a.chip { text-decoration: none; }
a.chip span {
    display: inline-grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: rgba(168, 4, 4, .13);
    font-size: 13px;
    line-height: 1;
}
a.chip:hover span { background: var(--action); color: #fff; }

.empty {
    padding: 40px 24px;
    text-align: center;
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: var(--r-lg);
    color: var(--body);
}

.empty p { margin: 0 0 10px; }
.empty a { color: var(--action-ink); font-weight: 600; }

.pager { flex-wrap: wrap; }
.pager__gap { padding: 0 4px; color: var(--muted); }
.pager__prev { margin-right: 6px; }

/* Bargain Corner index tiles. */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; padding-top: 18px; }

.tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 170px;
    padding: 22px 24px;
    background: var(--ink);
    color: #fff;
    border-radius: var(--r-lg);
    text-decoration: none;
    box-shadow: var(--shadow);
    border-bottom: 4px solid var(--action);
    transition: transform .15s, box-shadow .15s;
}

.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.tile__label { font-family: var(--cond); font-size: 34px; font-weight: 700; text-transform: uppercase; }
.tile__go { font-size: 14px; font-weight: 600; color: #f3b1b1; }

.back { margin: 26px 0 0; font-size: 14px; }
.back a, a.back { color: var(--structure); font-weight: 600; text-decoration: none; }
.back a:hover, a.back:hover { color: var(--action-ink); }
.back--rail { display: block; padding: 4px 2px; font-size: 14px; }

/* Detail gallery: the highlighted thumbnail follows the photograph on show. */
.thumbs img { cursor: pointer; }
.thumbs img:first-child { outline: 0; }
.thumbs img.is-on { outline: 2px solid var(--action); outline-offset: 2px; }

/* The mockup hides the navigation on narrow screens; the site cannot, so it becomes a
   scrolling row under the logo. */
@media (max-width: 900px) {
    .site__bar { flex-wrap: wrap; }
    .nav {
        display: flex;
        order: 3;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 6px;
    }
    .nav::-webkit-scrollbar { display: none; }
    .nav a { white-space: nowrap; }
}

@media (max-width: 560px) {
    .pagehead__inner { padding-left: 16px; padding-right: 16px; }
    .similar { padding-left: 16px; padding-right: 16px; }
}

/* Wide screens: the mockup caps everything at 1280px, which leaves room for only three
   cards beside the filter rail. From 1480px the content widens and the cards narrow, so a
   listing shows five or more across. The home page keeps the mockup's 1280px. */
@media (min-width: 1480px) {
    body.v-a:not(.is-home) :is(
        .site__strip__inner,
        .site__bar,
        .pagehead__inner,
        .home,
        .listing,
        .detail,
        .similar,
        .foot__inner) { max-width: 1760px; }

    .results .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
    .similar .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Steynsvlei in the main menu: the new branch, picked out in the action red. */
.nav a.nav__branch { background: var(--action); color: #fff; }
.nav a.nav__branch:hover { background: var(--action-ink); color: #fff; }
.nav a.nav__branch.is-on { box-shadow: inset 0 -2px 0 #fff; }

/* Trucks listing: the body-type drawings as a faint repeating pattern behind the stock
   grid - every type once per tile, staggered, in hairline strokes. */
.listing--trucks {
    background: url("/img/bodies/pattern.svg") repeat 0 0 / 885px auto;
}

/* Trailers listing: the same treatment with the trailer drawings - side tipper, drop side,
   flat deck, tautliner, diesel tanker, Copelyn and sloper. */
.listing--trailers {
    background: url("/img/bodies/pattern-trailers.svg") repeat 0 0 / 1180px auto;
}

/* ---------------------------------------------------------------------------
   Contact and Trade in or Sell
   --------------------------------------------------------------------------- */

.page { max-width: 1280px; margin: 0 auto; padding: 30px 28px 58px; }

.page__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; align-items: start; }

.info,
.form-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: 22px 24px 24px;
}

.info h2,
.form-card h2 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin: 22px 0 10px;
}

.info h2:first-of-type { margin-top: 18px; }
.form-card h2 { margin-top: 0; }

.info__lead { margin: 0 0 10px; color: var(--body); font-size: 15.5px; }
.info__note { margin: 0; font-size: 14px; color: var(--action-ink); }
.info .spec-table a { color: var(--text); text-decoration: none; }
.info .spec-table a:hover { color: var(--action-ink); }
.info__mail { color: var(--structure); font-weight: 600; text-decoration: none; }
.info__mail:hover { color: var(--action-ink); }

.branches { display: grid; gap: 8px; }

.branch {
    display: grid;
    gap: 2px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--action);
    border-radius: var(--r);
    text-decoration: none;
    color: var(--text);
}

.branch span { font-size: 13.5px; color: var(--body); }
.branch:hover { border-color: var(--line-strong); border-left-color: var(--action); background: var(--canvas); }

/* Forms */
.form-card--narrow { max-width: 820px; margin: 0 auto; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form[hidden] { display: none; }

.form__section {
    margin: 10px 0 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
}

.field { display: grid; gap: 5px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }

.field > span:first-child { font-size: 12.5px; font-weight: 600; color: var(--body); letter-spacing: .01em; }

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    background: var(--surface);
    font: 400 15px/1.35 var(--sans);
    color: var(--text);
}

.field textarea { resize: vertical; }

.field :where(input, select, textarea):focus {
    outline: 2px solid var(--action);
    outline-offset: 1px;
    border-color: transparent;
}

.field__error { font-size: 12.5px; color: var(--action-ink); }
.field__error:empty { display: none; }

.form__send { grid-column: 1 / -1; justify-self: start; padding: 13px 30px; border: 0; cursor: pointer; font: 600 15px/1 var(--sans); }

.notice { margin: 0 0 16px; padding: 11px 14px; border-radius: var(--r); font-size: 14.5px; }
.notice ul { margin: 0; padding-left: 18px; }
.notice--ok { background: #e8f5ee; color: #155a33; border: 1px solid #bfe3cf; }
.notice--warn { background: var(--action-tint); color: var(--action-ink); border: 1px solid #f3c4c4; }
.notice--warn.validation-summary-valid { display: none; }

/* What are you selling? */
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }

.choice__item {
    position: relative;
    display: grid;
    place-items: center;
    padding: 16px 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    font: 700 18px/1 var(--cond);
    text-transform: uppercase;
    cursor: pointer;
}

.choice__item input { position: absolute; opacity: 0; }
.choice__item:hover { border-color: var(--ink); }
.choice__item:has(input:checked) { border-color: var(--action); background: var(--action-tint); color: var(--action-ink); }
.choice__item:has(input:focus-visible) { outline: 2px solid var(--action); outline-offset: 2px; }

/* Maps under the contact page. */
.maps { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
.maps figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.maps iframe { display: block; width: 100%; height: 320px; border: 0; }
.maps figcaption { padding: 10px 14px; font-weight: 600; font-size: 14px; }

@media (max-width: 900px) {
    .page__grid, .maps { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .page { padding-left: 16px; padding-right: 16px; }
    .form { grid-template-columns: 1fr; }
    .choice__item { font-size: 15px; padding: 13px 6px; }
}

/* ---------------------------------------------------------------------------
   Finance: estimate under the price, the estimate card, and the calculator popup
   --------------------------------------------------------------------------- */

.buy__est {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: -6px 0 16px;
    font-size: 14px;
    color: var(--body);
}

.buy__est b { color: var(--text); font-variant-numeric: tabular-nums; }

.recalc {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border: 1px solid var(--action);
    border-radius: var(--r);
    background: var(--action-tint);
    color: var(--action-ink);
    font: 600 13px/1 var(--sans);
    cursor: pointer;
}

.recalc svg { width: 16px; height: 16px; }
.recalc:hover { background: var(--action); color: #fff; }

.buy--calc .btn + .btn { margin-top: 8px; }
.buy--calc button.btn { width: 100%; cursor: pointer; font: inherit; font-weight: 600; }

/* The popup. A native <dialog>: focus is trapped and Escape closes it without script. */
.fin {
    width: min(1100px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    border: 0;
    border-radius: var(--r-lg);
    background: var(--canvas);
    color: var(--text);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
    overflow: auto;
}

.fin::backdrop { background: rgba(16, 16, 16, .6); }

.fin__head { display: flex; align-items: center; padding: 16px 22px; background: var(--ink); color: #fff; }
.fin__head h2 { font-size: 20px; }

.fin__close {
    margin-left: auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #2a2d31;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.fin__close:hover { background: var(--action); }

.fin__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding: 20px 22px 24px; }

.fin__inputs,
.fin__results {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 6px 18px 16px;
}

.fin__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14.5px;
}

.fin__row > span:first-child { flex: 1; }

.fin__input {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 175px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    background: var(--canvas);
}

.fin__input i { font-style: normal; color: var(--muted); }

.fin__input input {
    width: 100%;
    min-width: 0;
    padding: 9px 0;
    border: 0;
    background: none;
    font: 500 15px/1.2 var(--sans);
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.fin__input:focus-within { outline: 2px solid var(--action); outline-offset: 1px; }
.fin__input input:focus { outline: none; }

.fin__row--terms { display: grid; gap: 10px; border-bottom: 0; padding-bottom: 0; }

.fin__terms { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }

.fin__terms label { position: relative; }
.fin__terms input { position: absolute; opacity: 0; }

.fin__terms span {
    display: block;
    padding: 9px 0;
    text-align: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    font-weight: 600;
    cursor: pointer;
}

.fin__terms label:has(input:checked) span { border-color: var(--action); background: var(--action-tint); color: var(--action-ink); }
.fin__terms label:has(input:focus-visible) span { outline: 2px solid var(--action); outline-offset: 2px; }

.fin__results { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; }

.fin__monthly {
    display: flex;
    align-items: baseline;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    font-weight: 600;
}

.fin__monthly b { margin-left: auto; font: 700 30px/1 var(--cond); color: var(--action); font-variant-numeric: tabular-nums; }

.fin__totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.fin__totals div {
    display: grid;
    gap: 4px;
    padding: 14px 10px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}

.fin__totals span { font-size: 13px; color: var(--body); }
.fin__totals b { font: 700 18px/1.1 var(--cond); font-variant-numeric: tabular-nums; }

.fin__disclaimer {
    margin: auto 0 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--muted);
}

.fin__disclaimer b { color: var(--body); }

@media (max-width: 800px) {
    .fin__body { grid-template-columns: 1fr; padding: 14px; }
    .fin__terms { grid-template-columns: repeat(3, 1fr); }
    .fin__input { width: 140px; }
}

@media (max-width: 480px) {
    .fin__totals { grid-template-columns: 1fr; }
}
