/* =========================================================
   White Horse Automotive – site styles
   Palette taken from the logo banner: black, white, brand red
   ========================================================= */
:root {
    --black: #0b0b0b;
    --black-2: #161616;
    --black-3: #232323;
    --white: #ffffff;
    --red: #a3343a;        /* banner border red */
    --red-dark: #681a1a;   /* banner shadow red */
    --red-light: #c2454c;
    --gray-50: #f5f5f4;
    --gray-100: #ebebea;
    --gray-300: #cfcfcd;
    --gray-500: #7a7a78;
    --gray-700: #3d3d3b;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 18px rgba(0,0,0,.08);
    --shadow-hover: 0 4px 10px rgba(0,0,0,.10), 0 16px 32px rgba(0,0,0,.14);
    --font-display: "Oswald", "Arial Narrow", Impact, sans-serif;
    --font-body: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

/* Leave DevExpress controls (image gallery, full-screen photo viewer, popups)
   with the box model and animations they were built for. */
[class*="dxig"], [class*="dxig"] *, [class*="dxig"] *::before, [class*="dxig"] *::after,
[class*="dxpc"], [class*="dxpc"] *,
[class*="dxsl"], [class*="dxsl"] * { box-sizing: content-box; }

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

body {
    margin: 0;
    background: var(--gray-50);
    color: var(--black-3);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
}

.car-body img, .details-html img, .footer img { max-width: 100%; }
a { color: var(--red); }
a:hover { color: var(--red-dark); }

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 2px solid transparent;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s, transform .15s;
    white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px); }

.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: var(--red-light); color: var(--white); }

.btn-outline { border-color: rgba(255,255,255,.55); color: var(--white); background: transparent; }
.btn-outline:hover { border-color: var(--white); background: var(--white); color: var(--black); }

.btn-dark { background: var(--black); color: var(--white); }
.btn-dark:hover { background: var(--black-3); color: var(--white); }

.btn-ghost { border-color: var(--gray-300); color: var(--black-3); background: var(--white); }
.btn-ghost:hover { border-color: var(--black); color: var(--black); }

.btn-block { width: 100%; }

/* ---------- Top bar (mirrors the logo banner) ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--black);
    border-bottom: 3px solid var(--red);
    box-shadow: 0 2px 0 var(--red-dark);
}
.topbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    text-decoration: none;
}
.brand:hover { color: var(--white); }
.brand img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid var(--white);
    object-fit: cover;
}
.brand-name {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 500;
    letter-spacing: .02em;
    text-transform: uppercase;
    line-height: 1;
}
.brand-name small {
    font-size: .78em;
    font-weight: 400;
    margin-left: 6px;
}
.topnav {
    display: flex;
    align-items: center;
    gap: 22px;
}
.topnav a:not(.btn) {
    color: rgba(255,255,255,.82);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 15px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.topnav a:not(.btn):hover { color: var(--white); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    background:
        radial-gradient(1200px 400px at 85% -10%, rgba(163,52,58,.35), transparent 60%),
        linear-gradient(180deg, var(--black) 0%, var(--black-2) 100%);
    color: var(--white);
    overflow: hidden;
}
.hero .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px 32px;
    padding-top: 24px;
    padding-bottom: 26px;
}
.hero-fb {
    width: 340px;
    min-height: 160px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 0 0 2px var(--red);
}
.hero-fb iframe { display: block; }
/* Fallback shown if Facebook can't load (blocked, offline, etc.) */
.hero-fb blockquote { margin: 0; height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; }
.hero-fb blockquote a { color: var(--red); font-family: var(--font-display); font-size: 18px; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
.hero-logo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: block;
}
.eyebrow {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 14px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--red-light);
    margin-bottom: 4px;
}
.hero h1 {
    margin: 0 0 6px;
    font-family: var(--font-display);
    font-size: clamp(26px, 2.8vw, 40px);
    font-weight: 500;
    line-height: 1.02;
    text-transform: uppercase;
    letter-spacing: .01em;
}
.hero p.lead {
    margin: 0 0 14px;
    color: rgba(255,255,255,.75);
    font-size: 16px;
    max-width: 680px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.contact-strip {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin-top: 0;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.12);
    font-size: 15px;
    color: rgba(255,255,255,.8);
}
.contact-strip a { color: var(--white); text-decoration: none; }
.contact-strip a:hover { color: var(--red-light); }
.contact-strip .item { display: inline-flex; align-items: center; gap: 8px; }
.contact-strip svg { width: 16px; height: 16px; color: var(--red-light); flex: none; }
.contact-strip .label { color: rgba(255,255,255,.5); font-size: 13px; }

/* ---------- Section headings ---------- */
.section { padding: 36px 0 48px; }
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.section-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--black);
}
.section-title::after {
    content: "";
    display: block;
    width: 56px;
    height: 4px;
    margin-top: 6px;
    background: var(--red);
    border-radius: 2px;
}
.section-sub { margin: 0; color: var(--gray-500); font-size: 14px; }

/* ---------- Inventory (DevExpress CardView overrides) ---------- */
.inventory .cv,
.inventory .cv > tbody > tr > td,
.inventory table.cv {
    width: 100% !important;
    border: 0 !important;
    background: transparent !important;
}

/* Search panel */
.inventory .cv input[type="text"] {
    font-family: var(--font-body) !important;
    font-size: 16px !important;
    height: 44px !important;
}
.inventory .cv .dxeEditArea_Moderno,
.inventory .cv input[type="text"] {
    color: var(--black-3) !important;
}
.inventory .cv [class*="dxcvSearchPanel"] {
    background: transparent !important;
    border: 0 !important;
    padding: 0 0 18px !important;
}
.inventory .cv [class*="dxcvSearchPanel"] table[class*="dxeButtonEdit"],
.inventory .cv [class*="dxcvSearchPanel"] [class*="dxeTextBox"] {
    width: 100% !important;
    max-width: 520px;
    border: 1px solid var(--gray-300) !important;
    border-radius: 999px !important;
    background: var(--white) !important;
    padding: 0 14px !important;
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* Lay the flow cards out as a responsive grid (modern browsers),
   with an inline-block fallback for older ones. */
.inventory .cv .vcard {
    display: inline-block !important;
    vertical-align: top !important;
    width: 215px !important;
    height: auto !important;
    margin: 0 16px 16px 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    float: none !important;
}
@supports selector(:has(*)) {
    .inventory .cv *:has(> .vcard) {
        display: grid !important;
        /* as many columns as fit (min 215px each), never more than 6 */
        grid-template-columns: repeat(auto-fill, minmax(max(215px, calc((100% - 5 * 20px) / 6)), 1fr));
        gap: 20px;
        width: 100% !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }
    .inventory .cv *:has(> .vcard) > :not(.vcard) { grid-column: 1 / -1; }
    .inventory .cv .vcard { width: auto !important; margin: 0 !important; }
}
.inventory .cv [class*="dxcvEmptyHiddenCard"] { display: none !important; }

/* Vehicle card */
.car {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease;
    text-align: left;
}
.car:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

/* Thumbnails are shown at their native size (120px tall) so they stay sharp.
   The black frame hugs the photo with an even border on all sides. */
.car-photo {
    position: relative;
    display: block;
    width: -moz-fit-content;
    width: fit-content;
    min-width: 176px;   /* keeps a proper frame if a photo is missing */
    min-height: 136px;
    max-width: calc(100% - 32px);
    margin: 16px auto 0;
    padding: 8px;
    background: var(--black);
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}
.car-photo img {
    /* never enlarged: max 120px tall; extra-wide images (e.g. "Coming Soon")
       shrink proportionally to fit the frame instead of being cut off */
    height: auto !important;
    width: auto !important;
    max-height: 120px !important;
    max-width: 100% !important;
    display: block;
    margin: 0 auto;
    border-radius: 3px;
    transition: opacity .2s ease;
}
.car:hover .car-photo img { opacity: .9; }
.car-photo .sold-badge { line-height: 1.5; }

.sold-badge {
    position: absolute;
    top: 14px;
    left: -36px;
    width: 140px;
    padding: 4px 0;
    transform: rotate(-35deg);
    background: var(--red);
    color: var(--white);
    font-family: var(--font-display);
    font-size: 15px;
    letter-spacing: .18em;
    text-align: center;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0,0,0,.35);
    z-index: 2;
}
.car.is-sold .car-photo img { filter: grayscale(.6) brightness(.8); }

.car-body {
    flex: 1;
    white-space: normal !important;
    padding: 16px 18px 8px;
    font-size: 14.5px;
    color: var(--gray-700);
    overflow-wrap: anywhere;
}
.car-body table { width: 100% !important; }
.car-body img { height: auto; }

.car-foot {
    padding: 8px 18px 18px;
}
.inventory .cv a.car-link,
.car-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
    color: var(--red) !important;
    font-family: var(--font-display);
    font-size: 15px;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none !important;
}
.car-link:hover { color: var(--red-dark) !important; }
.car-link svg { width: 18px; height: 18px; transition: transform .15s; }
.car-link:hover svg { transform: translateX(3px); }

/* ---------- Financing band ---------- */
.finance-band {
    background: var(--red);
    background: linear-gradient(90deg, var(--red-dark) 0%, var(--red) 100%);
    color: var(--white);
}
.finance-band .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 28px;
    padding-bottom: 28px;
}
.finance-band h2 {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 28px;
    text-transform: uppercase;
}
.finance-band p { margin: 0; color: rgba(255,255,255,.85); }
.finance-band .btn { background: var(--white); color: var(--red-dark); }
.finance-band .btn:hover { background: var(--black); color: var(--white); }

/* ---------- Footer ---------- */
.footer {
    background: var(--black);
    color: rgba(255,255,255,.75);
    border-top: 3px solid var(--red);
    padding: 40px 0 24px;
    font-size: 15px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr;
    gap: 32px;
}
.footer h3 {
    margin: 0 0 12px;
    color: var(--white);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 18px;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.footer a { color: var(--white); text-decoration: none; }
.footer a:hover { color: var(--red-light); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 8px; }
.footer .muted { color: rgba(255,255,255,.5); font-size: 13px; }
.footer-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.footer-brand img { width: 72px; height: 72px; border-radius: 50%; }
.footer .fb-wrap { background: var(--white); border-radius: 8px; overflow: hidden; max-width: 340px; }
.footer-bottom {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.1);
    font-size: 11px;
    font-family: Arial, sans-serif;
}
.footer-bottom a { color: rgba(255,255,255,.45); }

/* ---------- Mobile action bar ---------- */
.mobile-bar { display: none; }

/* ---------- Vehicle details page ---------- */
.details-head {
    background: var(--black);
    color: var(--white);
    padding: 18px 0;
}
.details-head .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 28px;
    border-radius: 999px;
    background: var(--red);
    color: var(--white);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    box-shadow: 0 4px 14px rgba(163,52,58,.45);
    transition: background-color .15s, transform .15s;
}
.back-link:hover { background: var(--red-light); color: var(--white); transform: translateY(-1px); }
.back-link svg { width: 22px; height: 22px; transition: transform .15s; }
.back-link:hover svg { transform: translateX(-3px); }

.details-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
    padding-top: 28px;
    padding-bottom: 48px;
}
.panel {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}
.panel + .panel { margin-top: 24px; }
.panel-title {
    margin: 0 0 16px;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 22px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--black);
    display: flex;
    align-items: center;
    gap: 10px;
}
.panel-title::before {
    content: "";
    width: 4px;
    height: 22px;
    background: var(--red);
    border-radius: 2px;
}
.details-html {
    font-size: 16px;
    color: var(--gray-700);
    overflow-wrap: anywhere;
}
.details-html table { max-width: 100%; }
.details-html img { height: auto; }

/* Image gallery overrides */
.gallery-hint { margin: -6px 0 14px; color: var(--gray-500); font-size: 13px; }

.contact-card { position: sticky; top: 88px; }
.contact-card .stack { display: grid; gap: 10px; }
.contact-card .addr {
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
    font-size: 14px;
    color: var(--gray-500);
}
.contact-card .addr strong { color: var(--black-3); display: block; }
.contact-card .addr a { color: var(--gray-700); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
    .hero .container { grid-template-columns: auto 1fr; }
    .fb-card { grid-column: 1 / -1; justify-self: center; }
}

@media (max-width: 960px) {
    .details-layout { grid-template-columns: 1fr; }
    .contact-card { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .topnav a:not(.btn) { display: none; }
    .brand-name { font-size: 19px; }
    .brand-name small { display: block; margin: 3px 0 0; font-size: .7em; }
    .hero .container { grid-template-columns: 1fr; text-align: center; gap: 14px; padding-top: 20px; padding-bottom: 24px; }
    .hero-logo { width: 110px; height: 110px; margin: 0 auto; }
    .fb-card { max-width: 100%; }
    .hero p.lead { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .contact-strip { justify-content: center; text-align: left; }
    .section { padding: 26px 0 36px; }
    .section-title { font-size: 26px; }
    .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
    .inventory .cv .vcard { width: 100% !important; margin-right: 0 !important; }
    .finance-band .container { text-align: center; justify-content: center; }
    .footer-grid { grid-template-columns: 1fr; }
    .panel { padding: 18px; }
    .back-link { width: 100%; }

    /* Sticky call / text / email bar on phones */
    body { padding-bottom: 68px; }
    .mobile-bar {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 200;
        background: var(--black);
        border-top: 3px solid var(--red);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .mobile-bar a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-height: 60px;
        color: var(--white);
        text-decoration: none;
        font-family: var(--font-display);
        font-size: 12px;
        letter-spacing: .1em;
        text-transform: uppercase;
    }
    .mobile-bar a + a { border-left: 1px solid rgba(255,255,255,.12); }
    .mobile-bar a:active { background: var(--red); }
    .mobile-bar svg { width: 20px; height: 20px; }
}

@media (max-width: 420px) {
    .container { padding: 0 16px; }
    .topbar .btn { padding: 8px 12px; font-size: 13px; }
}

/* ---------- Phones: minimal banner ----------
   The top bar already shows the logo and the bottom bar has Call / Text / Email,
   so the banner shrinks to a headline + two buttons + the address. */
@media (max-width: 600px) {
    .hero-logo,
    .fb-card,
    .hero .eyebrow,
    .hero p.lead,
    .contact-strip .item:not(:first-child) { display: none !important; }
    .hero .container { gap: 10px; padding-top: 14px; padding-bottom: 14px; }
    .hero h1 { font-size: 24px; margin-bottom: 10px; }
    .hero-actions { flex-wrap: nowrap; gap: 8px; }
    .hero-actions .btn { flex: 1 1 0; min-height: 40px; padding: 8px 10px; font-size: 13px; }
    .contact-strip { padding-top: 10px; font-size: 13px; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    /* only our own elements – the photo viewer needs its transitions to show images */
    .btn, .car, .car-photo img, .car-link svg, .back-link, .back-link svg { transition: none !important; }
}

/* Inventory uses a wider page so up to 6 cars fit per row */
.inventory .container { max-width: 1560px; }

/* Facebook timeline in the footer */
.footer-fb {
    width: 100%;
    max-width: 340px;
    min-height: 120px;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
}
.footer-fb blockquote { margin: 0; padding: 16px; }

/* Facebook card in the banner (our own markup - no Facebook script) */
.fb-card {
    width: 320px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 0 0 2px var(--red), 0 10px 30px rgba(0,0,0,.35);
    padding: 16px;
    color: var(--black-3);
    text-align: left;
}
.fb-card-head { display: flex; align-items: center; gap: 12px; }
.fb-card-head img { width: 56px; height: 56px; border-radius: 50%; flex: none; }
.fb-card-head strong {
    display: block;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 19px;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--black);
    line-height: 1.15;
}
.fb-card-label {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; font-weight: 600; color: #1877f2;
    text-transform: uppercase; letter-spacing: .08em;
}
.fb-card-label svg { width: 13px; height: 13px; }
.fb-card-sub { display: block; font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.fb-card-actions { display: flex; gap: 8px; margin-top: 14px; }
.fb-card-actions .btn { flex: 1; min-height: 40px; padding: 8px 12px; font-size: 14px; }
