/* ============================================================
   New Street Autos – Main Stylesheet
   ============================================================ */

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
    --red:        #c0392b;
    --red-dark:   #a93226;
    --dark:       #1a1a2e;
    --dark-2:     #16213e;
    --mid:        #2d2d44;
    --light:      #f5f5f5;
    --white:      #ffffff;
    --text:       #333333;
    --text-light: #666666;
    --border:     #e0e0e0;
    --shadow:     0 2px 12px rgba(0,0,0,.10);
    --radius:     6px;
    --font:       'Inter', system-ui, sans-serif;
    --max-w:      1200px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
    font-size: 16px;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
address { font-style: normal; }

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

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background .2s, color .2s, border-color .2s;
    text-decoration: none;
}
.btn-primary  { background: var(--red);   color: var(--white); border-color: var(--red); }
.btn-primary:hover  { background: var(--red-dark); border-color: var(--red-dark); text-decoration: none; }
.btn-accent   { background: var(--white); color: var(--red);   border-color: var(--white); }
.btn-accent:hover   { background: var(--light); text-decoration: none; }
.btn-outline  { background: transparent; color: var(--red);   border-color: var(--red); }
.btn-outline:hover  { background: var(--red); color: var(--white); text-decoration: none; }
.btn-ghost    { background: transparent; color: var(--text-light); border-color: var(--border); }
.btn-ghost:hover    { background: var(--light); text-decoration: none; }
.btn-sm { padding: 8px 16px; font-size: .85rem; }

/* ── Header – Top Bar ────────────────────────────────────── */
.header-top {
    background: var(--dark-2);
    color: #aaa;
    font-size: .82rem;
    padding: 6px 0;
}
.header-top-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.header-contact { display: flex; gap: 20px; }
.header-contact a, .header-top a { color: #ccc; }
.header-contact a:hover { color: var(--white); }
.header-address { color: #888; }

/* ── Header – Main ───────────────────────────────────────── */
.header-main {
    background: var(--dark);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.header-main-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 90px;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.site-logo img {
    height: 86px;
    width: auto;
    display: block;
}
.site-logo-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.site-logo-img {
    height: 86px;
    width: auto;
    display: block;
}

/* Nav */
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
    color: #ccc;
    padding: 22px 16px;
    font-size: .9rem;
    font-weight: 500;
    display: inline-block;
    border-bottom: 3px solid transparent;
    transition: color .2s, border-color .2s;
    text-decoration: none;
}
.site-nav a:hover {
    color: var(--white);
    border-bottom-color: var(--red);
}

/* Mobile hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 4px 8px;
}

/* ── Page Content Wrapper ────────────────────────────────── */
.page-content { min-height: 60vh; }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
    background:
        linear-gradient(135deg, rgba(26,26,46,.88) 0%, rgba(192,57,43,.70) 100%),
        url('../images/cars/hero-bg.jpg') center/cover no-repeat;
    min-height: 480px;
    display: flex;
    align-items: center;
}
.hero-overlay { width: 100%; }
.hero-content { padding: 60px 20px; text-align: center; }
.hero-content h1 {
    color: var(--white);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 28px;
    line-height: 1.2;
}

/* Search bar inside hero */
.search-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(4px);
    padding: 16px;
    border-radius: var(--radius);
    max-width: 820px;
    margin: 0 auto;
    text-align: left;
}
.search-bar-main {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.search-bar-advanced {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.search-bar .search-select,
.search-bar .search-input {
    flex: 1 1 160px;
    padding: 12px 14px;
    border: none;
    border-radius: var(--radius);
    font-size: .95rem;
    background: var(--white);
    color: var(--text);
}
.search-bar .btn { flex: 0 0 auto; }
.hero-more-btn { background: var(--white); color: var(--red); border: 2px solid var(--white); }
.hero-more-btn:hover { background: var(--light); border-color: var(--light); text-decoration: none; }

/* ── USP Strip ───────────────────────────────────────────── */
.usp-strip { background: var(--red); padding: 16px 0; }
.usp-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 32px;
}
.usp-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    font-weight: 500;
    font-size: .9rem;
}
.usp-icon { font-size: 1.1rem; }

/* ── Section – Featured Cars ─────────────────────────────── */
.section-featured { padding: 64px 0; background: var(--light); }
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 32px;
    position: relative;
    padding-bottom: 12px;
}
.section-title::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 50px; height: 3px;
    background: var(--red);
    border-radius: 2px;
}
.section-cta { margin-top: 36px; text-align: center; }

/* ── Cars Grid ───────────────────────────────────────────── */
.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ── Car Card ────────────────────────────────────────────── */
.car-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s, box-shadow .2s;
}
.car-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.14); }

.car-card-image-wrap {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    display: block;
}
.car-card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.car-card:hover .car-card-image-wrap img { transform: scale(1.04); }

.badge {
    position: absolute;
    top: 10px; left: 10px;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.badge-featured { background: var(--red); color: var(--white); }

.car-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.car-card-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.car-card-title a { color: var(--dark); text-decoration: none; }
.car-card-title a:hover { color: var(--red); }

.car-card-specs {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.car-card-specs li {
    background: var(--light);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .8rem;
    color: var(--text-light);
}
.car-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}
.car-price { font-size: 1.25rem; font-weight: 700; color: var(--red); }

/* ── Panels ──────────────────────────────────────────────── */
.section-panels { padding: 0; }
.panels-grid { display: grid; grid-template-columns: 1fr 1fr; }

.panel { padding: 0; }
.panel-dark  { background: var(--dark); }
.panel-light { background: var(--dark-2); }

.panel-body {
    padding: 64px 48px;
    max-width: 540px;
}
.panel-body h2 {
    color: var(--white);
    font-size: 1.8rem;
    margin-bottom: 16px;
}
.panel-body p { color: #ccc; margin-bottom: 28px; line-height: 1.7; }

/* ── Find Us ─────────────────────────────────────────────── */
.section-find-us { padding: 64px 0; background: var(--light); }
.find-us-inner {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    align-items: start;
}
.find-us-details h2 { font-size: 1.6rem; margin-bottom: 16px; color: var(--dark); }
.find-us-details address { margin-bottom: 10px; line-height: 1.8; color: var(--text); }
.find-us-details p a { color: var(--red); font-weight: 600; }
.find-us-map { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

/* ── Page Hero (inner pages) ─────────────────────────────── */
.page-hero {
    padding: 48px 0 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 36px;
}
.page-hero h1 { font-size: 2rem; color: var(--dark); margin-bottom: 8px; }
.page-hero p { color: var(--text-light); }

/* ── Inventory Filters ───────────────────────────────────── */
.inventory-filters {
    background: var(--light);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}
.filter-row-advanced {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}
.filter-group { display: flex; flex-direction: column; gap: 6px; flex: 1 1 160px; }
.filter-group label { font-size: .85rem; font-weight: 600; color: var(--text); }
.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="number"] {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .9rem;
    background: var(--white);
}
.filter-group-mileage { flex: 1 1 220px; }
.mileage-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mileage-inputs input[type="number"] {
    flex: 1;
    min-width: 0;
}
.mileage-sep { color: var(--text-light); font-weight: 600; flex-shrink: 0; }
.filter-actions { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.more-filters-bar {
    width: 100%;
    background: var(--border);
    border: none;
    border-radius: var(--radius);
    padding: 8px 14px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: background .15s;
}
.more-filters-bar:hover { background: #d0d5dd; }
.advanced-toggle { white-space: nowrap; }
.toggle-arrow { font-size: .75rem; margin-left: 4px; display: inline-block; }

.results-count { margin-bottom: 20px; color: var(--text-light); font-size: .9rem; }
.no-results { padding: 48px; text-align: center; color: var(--text-light); }

/* ── Car Detail ──────────────────────────────────────────── */
.breadcrumb {
    font-size: .85rem;
    color: var(--text-light);
    padding: 20px 0 0;
    margin-bottom: 28px;
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--red); }

.car-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}
.car-detail-image img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    object-fit: cover;
}
.car-detail-info h1 { font-size: 1.7rem; margin-bottom: 8px; color: var(--dark); }
.detail-price { font-size: 2rem; font-weight: 700; color: var(--red); margin-bottom: 24px; }

.specs-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.specs-table th,
.specs-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}
.specs-table th { width: 40%; color: var(--text-light); font-weight: 600; }

.detail-description { margin-bottom: 24px; }
.detail-description h3 { font-size: 1rem; margin-bottom: 8px; color: var(--dark); }
.detail-description p { color: var(--text-light); line-height: 1.7; }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.back-link { margin-bottom: 48px; }
.back-link a { color: var(--text-light); font-size: .9rem; }
.back-link a:hover { color: var(--red); }

/* ── Forms ───────────────────────────────────────────────── */
.page-narrow { max-width: 900px; }
.contact-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    margin-bottom: 64px;
}
.valuation-form-wrap { max-width: 560px; margin-bottom: 64px; }

.form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-weight: 600; font-size: .9rem; color: var(--text); }
.form-group input,
.form-group select,
.form-group textarea {
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    font-family: var(--font);
    transition: border-color .2s, box-shadow .2s;
    background: var(--white);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(192,57,43,.12);
}
.form-group.has-error input,
.form-group.has-error textarea {
    border-color: #e74c3c;
}
.form-error { color: #e74c3c; font-size: .82rem; }

.contact-info h3 { font-size: 1.1rem; margin-bottom: 12px; color: var(--dark); }
.contact-details { list-style: none; display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }
.contact-details li { line-height: 1.8; font-size: .9rem; color: var(--text); }
.contact-details a { color: var(--red); }

.hours-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.hours-table td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.hours-table td:last-child { text-align: right; color: var(--text-light); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 28px;
    font-size: .95rem;
}
.alert-success { background: #eafaf1; border: 1px solid #27ae60; color: #1e8449; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer { background: var(--dark); color: #aaa; padding-top: 56px; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-about p { font-size: .88rem; line-height: 1.7; margin-top: 12px; }
.site-footer h3 { color: var(--white); font-size: 1.1rem; margin-bottom: 16px; }
.site-footer h4 { color: var(--white); font-size: .95rem; margin-bottom: 14px; }
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.site-footer ul a { color: #aaa; font-size: .88rem; }
.site-footer ul a:hover { color: var(--white); text-decoration: none; }
.footer-contact address { line-height: 1.8; font-size: .88rem; margin-bottom: 10px; }
.footer-contact a { color: #aaa; font-size: .88rem; }
.footer-contact a:hover { color: var(--white); }

.footer-bottom {
    padding: 18px 0;
    font-size: .82rem;
    color: #666;
}
.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { color: #666; }
.footer-legal a:hover { color: #aaa; text-decoration: none; }

/* ── Error Page ──────────────────────────────────────────── */
.error-page { padding: 80px 0; text-align: center; }
.error-page h1 { font-size: 2.5rem; color: var(--dark); margin-bottom: 16px; }

/* ── Carousel ────────────────────────────────────────────── */
.carousel {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    user-select: none;
}
.carousel-track {
    display: flex;
    transition: transform .35s ease;
}
.carousel-slide {
    min-width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
}
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.carousel.single .carousel-slide {
    aspect-ratio: 16/10;
}

/* Prev / Next buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.5);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    z-index: 10;
}
.carousel-btn:hover { background: rgba(192,57,43,.85); }
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }

/* Dots */
.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}
.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.7);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background .2s, border-color .2s;
}
.carousel-dot.active {
    background: var(--red);
    border-color: var(--red);
}

/* Thumbnails strip */
.carousel-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.carousel-thumb {
    width: 80px;
    height: 56px;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid var(--border);
    background: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color .2s;
}
.carousel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.carousel-thumb.active { border-color: var(--red); }
.carousel-thumb:hover  { border-color: var(--red-dark); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .panels-grid  { grid-template-columns: 1fr; }
    .car-detail-grid { grid-template-columns: 1fr; }
    .find-us-inner   { grid-template-columns: 1fr; }
    .contact-grid    { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .header-address { display: none; }
    .header-top-inner { justify-content: center; }

    .site-nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        position: absolute;
        top: 68px;
        left: 0; right: 0;
        background: var(--dark);
        border-top: 2px solid var(--red);
        z-index: 200;
        padding: 8px 0;
    }
    .site-nav.open { display: flex; }
    .site-nav a { padding: 14px 24px; border-bottom: 1px solid rgba(255,255,255,.06); }
    .nav-toggle { display: block; }

    .hero { min-height: 360px; }
    .search-bar { flex-direction: column; }
    .search-bar .search-select,
    .search-bar .search-input { flex: 1 1 auto; }

    .usp-grid { flex-direction: column; align-items: center; text-align: center; }

    .panel-body { padding: 40px 24px; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom .container { flex-direction: column; text-align: center; }
}
