:root {
    --primary-charcoal: #1E2327;
    --primary-graphite: #2b3137;
    --primary-metallic: #8395a7;
    --bg-offwhite: #f8f9fa;
    --accent-red: #d90429;
    --text-dark: #1E2327;
    --text-light: #ffffff;
    --font-heading: 'Manrope', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-offwhite);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: var(--font-heading);
    font-weight: 700;
}

/* Navbar */
.navbar {
    background-color: var(--primary-charcoal);
    padding: 1rem 2rem;
}
.navbar-brand {
    color: var(--text-light) !important;
    font-size: 1.5rem;
    letter-spacing: 1px;
}
.navbar-brand span {
    color: var(--accent-red);
}
.nav-link {
    color: #ccc !important;
    font-weight: 500;
    transition: color 0.3s;
}
.nav-link:hover, .nav-link.active {
    color: var(--text-light) !important;
}

/* Buttons */
.btn-primary {
    background-color: var(--accent-red);
    border-color: var(--accent-red);
    border-radius: 4px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
}
.btn-primary:hover {
    background-color: #b00320;
    border-color: #b00320;
}
.btn-outline-primary {
    color: var(--accent-red);
    border-color: var(--accent-red);
}
.btn-outline-primary:hover {
    background-color: var(--accent-red);
    color: var(--text-light);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(30, 35, 39, 0.8), rgba(30, 35, 39, 0.8)), url('/images/hero-bg.jpg') center/cover;
    height: 70vh;
    display: flex;
    align-items: center;
    color: var(--text-light);
}
.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}
.hero-subtitle {
    font-size: 1.25rem;
    color: #ccc;
    margin-bottom: 2rem;
}

/* Card Styling */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    background-color: #ffffff;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}
.card-title {
    color: var(--primary-charcoal);
    font-weight: 700;
}

/* Price formatting */
.price-tag {
    color: var(--accent-red);
    font-weight: 700;
    font-size: 1.25rem;
}

/* Footer */
.footer {
    background-color: var(--primary-charcoal);
    color: #ccc;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}
.footer h4 {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}
.footer a {
    color: #ccc;
    text-decoration: none;
}
.footer a:hover {
    color: var(--accent-red);
}

/* Utility */
.section-padding {
    padding: 5rem 0;
}
.bg-graphite {
    background-color: var(--primary-graphite);
    color: var(--text-light);
}

/* Spinny-Inspired Spin-offs */
.badge-soft-success { background-color: #d1e7dd; color: #0f5132; }
.badge-soft-warning { background-color: #fff3cd; color: #664d03; }
.badge-soft-info { background-color: #cff4fc; color: #055160; }
.badge-soft-danger { background-color: #f8d7da; color: #842029; }

.hover-shadow { transition: box-shadow 0.2s ease, transform 0.2s ease; }
.hover-shadow:hover { box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important; transform: translateY(-2px); }

/* Shortlist Heart */
.btn-favourite {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    border: none;
}
.btn-favourite:hover { color: var(--accent-red); transform: scale(1.1); }
.btn-favourite.active { color: var(--accent-red); }

/* Sticky Mobile CTA */
.sticky-mobile-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1030;
    padding: 10px 15px;
    display: flex;
    gap: 10px;
}
@media (min-width: 992px) {
    .sticky-mobile-cta { display: none !important; }
}
@media (max-width: 991px) {
    body { padding-bottom: 70px; } /* Prevent footer overlap */
}

/* Filter Drawer (Mobile) */
.filter-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 300px;
    height: 100vh;
    background: white;
    z-index: 1050;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}
.filter-drawer.open { left: 0; }
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
    display: none;
}
.filter-overlay.open { display: block; }
@media (min-width: 992px) {
    .filter-drawer {
        position: static;
        width: 100%;
        height: auto;
        box-shadow: none;
        overflow-y: visible;
    }
    .filter-drawer .drawer-header { display: none; }
    .filter-overlay { display: none !important; }
}

/* Multi-Step Wizard */
.wizard-step { display: none; }
.wizard-step.active { display: block; }
.step-indicator {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 30px;
}
.step-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #e9ecef;
    z-index: 1;
}
.step-item {
    position: relative;
    z-index: 2;
    background: #e9ecef;
    color: #6c757d;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
.step-item.active { background: var(--accent-red); color: white; }
.step-item.completed { background: #198754; color: white; }

/* Image Gallery */
.gallery-main { width: 100%; height: 400px; object-fit: cover; border-radius: 8px; }
.gallery-thumb { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; cursor: pointer; opacity: 0.6; transition: opacity 0.2s; }
.gallery-thumb:hover, .gallery-thumb.active { opacity: 1; border: 2px solid var(--accent-red); }

/* Sold State CSS */
.vehicle-card.is-sold .vehicle-image img,
.vehicle-card.is-sold .card-img-top {
    filter: brightness(0.6) grayscale(30%);
}
.vehicle-sold-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background-color: rgba(220, 53, 69, 0.85);
    color: white;
    padding: 10px 40px;
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.5);
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
}

/* Hero Tabs Override */
.hero-tabs .nav-link.active {
    background-color: var(--accent-red) !important;
    color: white !important;
    box-shadow: 0 4px 6px rgba(227, 0, 43, 0.2) !important;
    border: 1px solid var(--accent-red) !important;
}
.hero-tabs .nav-link {
    background-color: #f8f9fa !important;
    color: var(--primary-charcoal) !important;
    border: 1px solid transparent !important;
    transition: all 0.3s ease;
}
.hero-tabs .nav-link:hover:not(.active) {
    border-color: var(--accent-red) !important;
    background-color: #ffffff !important;
}

/* Browse by Choice Tabs */
.choice-tab {
    color: #6b7280 !important;
    opacity: 1 !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}
.choice-tab.active {
    color: var(--primary-charcoal) !important;
    font-weight: 700 !important;
    border-bottom: 3px solid var(--accent-red) !important;
}
.choice-tab:hover {
    color: var(--accent-red) !important;
}

/* Button overrides for focus/active */
.btn-primary:focus, .btn-primary:active {
    box-shadow: 0 0 0 0.25rem rgba(227, 0, 43, 0.5) !important;
    background-color: #b00320 !important;
    border-color: #b00320 !important;
}

.cargates-navbar-logo {
    display: block;
    width: auto;
    height: 44px;
    max-width: 220px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .cargates-navbar-logo {
        height: 34px;
        max-width: 170px;
    }
}

.cargates-navbar-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    
}
@media (max-width: 767.98px) {
    .hero {
        height: auto;
        min-height: auto;
        padding-top: 32px;
        padding-bottom: 40px;
    }
}

@media (max-width: 575.98px) {
    .hero .row.g-4.mt-2 {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 16px;
        width: 100%;
        margin-top: 1rem !important;
    }
    
    .happy-customers-section {
        padding-top: 36px;
        padding-bottom: 36px;
    }
}

.happy-customers-section {
    position: relative;
    clear: both;
    padding-top: 48px;
    padding-bottom: 48px;
}

.happy-customers-title {
    position: relative;
    z-index: 2;
    margin-bottom: 24px;
    text-align: center;
    line-height: 1.2;
}

.hero .card {
    position: relative;
    height: auto !important;
    min-height: 140px;
    overflow: visible;
    z-index: 1;
}

.hero .card::before, .hero .card::after {
    z-index: 0;
}

.hero .card .card-body {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    overflow-wrap: anywhere;
    position: relative;
    z-index: 1;
}

.happy-customer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.happy-customer-image-wrap {
    height: auto;
}

.happy-customer-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Tablet View */
@media (min-width: 768px) and (max-width: 991.98px) {
    .happy-customer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .happy-customer-image-wrap {
        width: 100%;
        height: 260px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        background: #111;
    }

    .happy-customer-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }
}

/* Desktop View */
@media (min-width: 992px) {
    .happy-customer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .happy-customer-image-wrap {
        width: 100%;
        height: 360px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        background: #111;
    }

    .happy-customer-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }
}

@media (max-width: 575.98px) {
    .hero .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}
