/* =========================================================================
   Medway Cars — Public site design system
   Navy/gold from the client logo, paired with a warm cream (not the cool
   grey used in the admin tool) so the public site feels less "back office"
   and more showroom. Space Grotesk carries headline personality; Plus
   Jakarta Sans handles everything else.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --navy: #011E3F;
    --navy-deep: #010B1A;
    --navy-mid: #0A3260;
    --gold: #C2941C;
    --gold-light: #E0B24A;
    --cream: #F8F6F1;
    --white: #FFFFFF;
    --charcoal: #14171C;
    --slate: #5C6470;
    --line: #E7E3DA;
    --success: #1E7A46;
    --success-bg: #E7F4EC;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    --container: 1240px;
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow: 0 2px 8px rgba(1, 30, 63, 0.06);
    --shadow-md: 0 8px 24px rgba(1, 30, 63, 0.10);
    --shadow-lg: 0 24px 60px rgba(1, 30, 63, 0.18);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--charcoal);
    background: var(--white);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--navy);
    line-height: 1.12;
    margin: 0 0 0.5em;
    letter-spacing: -0.01em;
}

h1 { font-weight: 700; }
h2 { font-weight: 700; }
h3, h4 { font-weight: 600; }

p { margin: 0 0 1em; max-width: 62ch; }

.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.4em; max-width: 62ch; }
.prose li { margin-bottom: 0.5em; }
.prose h2 { font-size: 24px; margin-top: 1.6em; }
.prose h3 { font-size: 17px; margin-top: 1.4em; }
.prose p { color: var(--charcoal); }
.prose strong { color: var(--navy); }
.prose a { color: var(--navy); text-decoration: underline; }


a { color: inherit; text-decoration: none; }

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

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 640px) {
    .container { padding: 0 18px; }
}

section { position: relative; }

.section-pad { padding: 88px 0; }
@media (max-width: 768px) { .section-pad { padding: 56px 0; } }

.bg-cream { background: var(--cream); }
.bg-navy { background: var(--navy); color: var(--white); }
.bg-navy h2, .bg-navy h3 { color: var(--white); }

.eyebrow-free-heading { font-size: 38px; }
@media (max-width: 768px) { .eyebrow-free-heading { font-size: 28px; } }

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.section-head p { color: var(--slate); margin: 10px 0 0; }

.lede { font-size: 18px; color: var(--slate); }

/* ---------------------------------------------------------------------
   Buttons — gold gets a subtle shine-sweep on hover, a small premium
   touch that fits a car-showroom brand without being everywhere.
   --------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 999px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
    white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-gold {
    background: var(--gold);
    color: var(--navy);
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(194, 148, 28, 0.35);
}

.btn-gold::before {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 40%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.55), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}

.btn-gold:hover::before { left: 130%; }
.btn-gold:hover { box-shadow: 0 10px 28px rgba(194, 148, 28, 0.45); transform: translateY(-1px); }

.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-mid); transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 1.5px solid rgba(255,255,255,0.5);
}
.btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.08); }

.btn-outline-navy {
    background: transparent;
    color: var(--navy);
    border: 1.5px solid var(--line);
}
.btn-outline-navy:hover { border-color: var(--navy); }

.btn-whatsapp {
    background: #25D366;
    color: #fff;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}
.btn-whatsapp:hover { background: #20bd5a; transform: translateY(-1px); }

.btn-block { width: 100%; }
.btn-sm { padding: 10px 18px; font-size: 13.5px; }

/* ---------------------------------------------------------------------
   Header — sticky, condenses on scroll, mobile slide-in menu.
   --------------------------------------------------------------------- */

.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    padding: 12px 0;
    transition: padding 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
    background: rgba(1, 30, 63, 0.96);
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

/* Only pages with a dark hero directly behind the header (currently just
   the homepage) get the transparent-until-scrolled treatment. Every other
   page defaults straight to solid navy — a transparent header with white
   nav text was invisible against a plain white/cream page (confirmed by
   screenshot: the Finance page rendered with no header background at all
   and unreadable nav links). */
body.has-hero .site-header {
    padding: 22px 0;
    background: transparent;
    box-shadow: none;
}

.site-header.solid {
    padding: 12px 0;
    background: rgba(1, 30, 63, 0.96);
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

/* Without this, body.has-hero .site-header (specificity 0,2,1) beats
   .site-header.solid (0,2,0) on the homepage specifically, so scrolling
   never actually turned the header solid there — confirmed by screenshot:
   scrolled past the hero, header stayed transparent over white content.
   This forces .solid to always win once JS adds it, hero page or not. */
body.has-hero .site-header.solid {
    padding: 12px 0;
    background: rgba(1, 30, 63, 0.96);
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-logo {
    display: flex;
    align-items: center;
    animation: logoIn 0.7s var(--ease) both;
}
.site-logo img { height: 38px; transition: height 0.3s var(--ease); }
body.has-hero .site-logo img { height: 46px; }
.site-header.solid .site-logo img { height: 38px; }

@keyframes logoIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.main-nav { display: flex; align-items: center; gap: 4px; }

.main-nav a {
    color: var(--white);
    font-weight: 600;
    font-size: 14.5px;
    padding: 10px 16px;
    border-radius: 999px;
    transition: background 0.2s;
}
.main-nav a:hover { background: rgba(255,255,255,0.12); }
.main-nav a.active { color: var(--gold-light); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    width: 40px; height: 40px;
    position: relative;
    cursor: pointer;
    z-index: 210;
}
.nav-toggle span {
    position: absolute;
    left: 8px; right: 8px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 26px; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
    .main-nav {
        position: fixed;
        top: 0; right: -320px;
        width: 300px; height: 100vh;
        background: var(--navy-deep);
        flex-direction: column;
        align-items: stretch;
        padding: 100px 28px 28px;
        gap: 6px;
        transition: right 0.35s var(--ease);
        z-index: 205;
    }
    .main-nav.open { right: 0; }
    .main-nav a { padding: 14px 16px; font-size: 16px; }
    .nav-toggle { display: block; }
    .header-actions .btn-outline { display: none; }
}

.nav-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(1,11,26,0.6);
    z-index: 150;
}
.nav-backdrop.visible { display: block; }

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */

.hero {
    position: relative;
    min-height: 92vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: var(--navy-deep);
}

.hero-media {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    animation: heroZoom 16s ease-out forwards;
}

@keyframes heroZoom {
    from { transform: scale(1.12); }
    to { transform: scale(1); }
}

.hero-scrim {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(1,11,26,0.35) 0%, rgba(1,11,26,0.25) 35%, rgba(1,11,26,0.92) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding-bottom: 64px;
    color: var(--white);
}

.hero-content h1 {
    color: var(--white);
    font-size: clamp(36px, 6vw, 68px);
    max-width: 15ch;
    opacity: 0;
    animation: heroRise 0.8s var(--ease) 0.15s forwards;
}

.hero-content .lede {
    color: rgba(255,255,255,0.85);
    font-size: 19px;
    max-width: 46ch;
    opacity: 0;
    animation: heroRise 0.8s var(--ease) 0.32s forwards;
}

.hero-ctas {
    display: flex;
    gap: 14px;
    margin-top: 28px;
    flex-wrap: wrap;
    opacity: 0;
    animation: heroRise 0.8s var(--ease) 0.46s forwards;
}

@keyframes heroRise {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-media { animation: none; }
    .hero-content h1, .hero-content .lede, .hero-ctas, .site-logo { animation: none; opacity: 1; }
}

/* Quick-search bar — styled with a nod to a UK number plate: a blue GB
   strip on the left edge, set on a plate-yellow surface. One deliberate
   signature detail rather than decoration scattered everywhere. */

.plate-search {
    position: relative;
    margin-top: 40px;
    background: #F7C947;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    overflow: hidden;
    max-width: 780px;
    opacity: 0;
    animation: heroRise 0.8s var(--ease) 0.6s forwards;
}

.plate-search-flag {
    background: #003399;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 46px;
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.plate-search form {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
}

.plate-search input[type="text"] {
    flex: 1;
    min-width: 160px;
    border: none;
    background: transparent;
    padding: 18px 18px;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--navy);
    text-transform: uppercase;
}
.plate-search input[type="text"]::placeholder { color: rgba(1,30,63,0.45); text-transform: none; font-weight: 500; }
.plate-search input:focus { outline: none; }

.plate-search button {
    border: none;
    background: var(--navy);
    color: var(--white);
    font-weight: 700;
    padding: 0 30px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s;
}
.plate-search button:hover { background: var(--navy-mid); }

@media (max-width: 560px) {
    .plate-search { flex-wrap: wrap; }
    .plate-search-flag { width: 100%; height: 22px; flex-direction: row; gap: 6px; }
    .plate-search form { width: 100%; }
    .plate-search button { width: 100%; padding: 14px; }
}

/* ---------------------------------------------------------------------
   Stats band
   --------------------------------------------------------------------- */

.stats-band {
    background: var(--navy);
    background-image: radial-gradient(circle at 15% 20%, rgba(194,148,28,0.12), transparent 40%);
    color: var(--white);
    padding: 56px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 32px;
    text-align: center;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 44px;
    font-weight: 700;
    color: var(--gold-light);
}

.stat-label { color: rgba(255,255,255,0.7); font-size: 14px; margin-top: 4px; }

/* ---------------------------------------------------------------------
   Vehicle cards
   --------------------------------------------------------------------- */

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}

.vehicle-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    display: flex;
    flex-direction: column;
}

.vehicle-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.vehicle-card-media { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--cream); }
.vehicle-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.vehicle-card:hover .vehicle-card-media img { transform: scale(1.08); }

.vehicle-card-badge {
    position: absolute;
    top: 12px; left: 12px;
    background: var(--gold);
    color: var(--navy);
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
}

.vehicle-card-body { padding: 18px 18px 20px; flex: 1; display: flex; flex-direction: column; }

.vehicle-card h3 { font-size: 18px; margin-bottom: 2px; }
.vehicle-card .variant { color: var(--slate); font-size: 13.5px; margin-bottom: 12px; }

.vehicle-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 13px;
    color: var(--slate);
    margin-bottom: 14px;
}
.vehicle-specs span { display: flex; align-items: center; gap: 5px; }

.vehicle-card-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.vehicle-card-actions { display: flex; gap: 8px; align-items: center; }
.vehicle-card-actions .btn { flex: 1; padding: 10px 14px; font-size: 13.5px; }

.vehicle-price { font-family: var(--font-display); font-size: 21px; font-weight: 700; color: var(--navy); }
.vehicle-price small { display: block; font-size: 11.5px; font-weight: 500; color: var(--slate); font-family: var(--font-body); }

.icon-btn {
    width: 40px; height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    color: var(--navy);
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
}
.icon-btn:hover { transform: scale(1.08); }
.icon-btn.whatsapp { background: #25D366; color: #fff; }
.icon-btn.whatsapp:hover { background: #20bd5a; }

/* ---------------------------------------------------------------------
   Scroll-reveal utility (IntersectionObserver toggles .in-view)
   --------------------------------------------------------------------- */

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

.reveal-stagger > * {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal-stagger.in-view > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.in-view > *:nth-child(1) { transition-delay: 0.03s; }
.reveal-stagger.in-view > *:nth-child(2) { transition-delay: 0.09s; }
.reveal-stagger.in-view > *:nth-child(3) { transition-delay: 0.15s; }
.reveal-stagger.in-view > *:nth-child(4) { transition-delay: 0.21s; }
.reveal-stagger.in-view > *:nth-child(5) { transition-delay: 0.27s; }
.reveal-stagger.in-view > *:nth-child(6) { transition-delay: 0.33s; }

@media (prefers-reduced-motion: reduce) {
    .reveal, .reveal-stagger > * { opacity: 1; transform: none; transition: none; }
}

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */

.site-footer { background: var(--navy-deep); color: rgba(255,255,255,0.75); padding: 64px 0 0; }

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-grid h4 { color: var(--white); font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 18px; }
.footer-grid img { height: 42px; margin-bottom: 16px; }
.footer-grid a { display: block; color: rgba(255,255,255,0.7); padding: 6px 0; font-size: 14.5px; transition: color 0.2s; }
.footer-grid a:hover { color: var(--gold-light); }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 0;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 10px;
}
.footer-bottom a { color: rgba(255,255,255,0.6); }
.footer-bottom a:hover { color: var(--white); }

/* ---------------------------------------------------------------------
   Sticky mobile action bar (vehicle detail page)
   --------------------------------------------------------------------- */

.mobile-action-bar {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--white);
    border-top: 1px solid var(--line);
    padding: 12px 16px;
    gap: 10px;
    z-index: 150;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.08);
}
@media (max-width: 760px) { .mobile-action-bar { display: flex; } }
.mobile-action-bar .btn { flex: 1; padding: 13px 10px; font-size: 13.5px; }

/* The mobile action bar is fixed to the viewport bottom, so anything with
   one needs matching bottom padding or it overlaps the footer content
   underneath it (confirmed with a real mobile screenshot, not assumed). */
body:has(.mobile-action-bar) { padding-bottom: 74px; }
@media (min-width: 761px) { body:has(.mobile-action-bar) { padding-bottom: 0; } }

/* Vehicle detail page: two columns on desktop, stacked on mobile.
   Previously this was an inline style with no responsive override at all —
   confirmed by screenshot that it was cramming both columns side by side
   on a 390px viewport instead of stacking. */
.vehicle-detail-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 44px;
    align-items: start;
}
.vehicle-price-panel { position: sticky; top: 110px; }

@media (max-width: 900px) {
    .vehicle-detail-grid { grid-template-columns: 1fr; gap: 32px; }
    .vehicle-price-panel { position: static; }
}

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }

/* ---------------------------------------------------------------------
   Public forms (contact, part-exchange, sell-your-car)
   --------------------------------------------------------------------- */

.form-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 15px;
    background: var(--white);
    color: var(--charcoal);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    outline: none; border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(194,148,28,0.18);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.form-alert-success { background: var(--success-bg); color: var(--success); padding: 14px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 14.5px; }
.form-alert-error { background: #FBEAEA; color: #B23B3B; padding: 14px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 14.5px; }

.honeypot-field { position: absolute; left: -9999px; opacity: 0; height: 0; }

