/* --- Global Styles & Variables --- */
:root {
    --primary-color: #007bff;
    --secondary-color: #343a40;
    --accent-color: #ffc107;
    --text-color: #f8f9fa;
    --text-color-dark: #212529;
    --border-color: #495057;
    --font-primary: 'Roboto', sans-serif;
    --font-secondary: 'Montserrat', sans-serif;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
}

body {
    margin: 0;
    font-family: var(--font-primary);
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

h1, h2, h3 {
    font-family: var(--font-secondary);
    font-weight: 700;
    color: var(--accent-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

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

/* --- Header & Navigation --- */
.site-header {
    background-color: rgba(20, 20, 20, 0.9);
    padding: 1rem 0;
    border-bottom: 2px solid var(--accent-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    font-family: var(--font-secondary);
    font-size: 1.8rem;
    color: #fff;
    font-weight: 700;
    z-index: 1001;
}

.logo strong {
    color: var(--accent-color);
}

.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-nav a {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.header-contact span {
    color: var(--accent-color);
    font-weight: 700;
}

/* --- Hero Section --- */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://placehold.co/1920x1080/1a202c/333333?text=Car+Dealership') no-repeat center center/cover;
    height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* --- Buttons --- */
.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: #0056b3;
    color: #fff;
}

.btn-secondary {
    background-color: var(--accent-color);
    color: var(--text-color-dark);
}

.btn-secondary:hover {
    background-color: #d39e00;
    color: var(--text-color-dark);
}

/* --- Content Sections --- */
.featured-vehicles, .inventory-list {
    padding: 4rem 0;
}

.featured-vehicles h2, .inventory-list h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 320px);
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
}

.vehicle-card {
    background-color: #2c343f;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.vehicle-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
}

.sold-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: var(--font-secondary);
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.vehicle-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.card-bottom-info {
    display: flex;
    justify-content: space-between; /* Pushes items to opposite ends */
    align-items: baseline; /* Aligns them nicely on their text baseline */
    margin-top: auto; /* Pushes this whole row to the bottom of the card */
}
/* Remove default margins from the paragraphs inside the new container */
.card-bottom-info .price,
.card-bottom-info .mileage {
    margin: 0;
}

.vehicle-card-content {
    min-height: 170px; 
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.vehicle-card h3 {
    margin-top: 0;
    font-size: 1.4rem;
    color: #fff;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0.5rem 0;
}

.mileage {
    color: #adb5bd;
    margin-bottom: 1.5rem;
}

/* --- Footer --- */
.site-footer {
    background-color: #1a202c;
    color: #adb5bd;
    padding: 3rem 0 1rem;
    border-top: 2px solid var(--accent-color);
}

/* --- Page Header --- */
.page-header {
    background-color: #1a202c;
    padding: 3rem 0;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    margin: 0;
}

/* --- Vehicle Detail Page --- */
.vehicle-detail-page {
    padding: 4rem 0;
}

.vehicle-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: flex-start;
}

.vehicle-info .detail-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.specs-table {
    margin-bottom: 2rem;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
}

.spec-label {
    font-weight: 700;
    color: #adb5bd;
}

.spec-value {
    word-break: break-word; /* This allows long words like "TransmissionContinuously..." to break and wrap */
    text-align: right; /* This aligns the value to the right for a clean look */
}


.features-list {
    list-style: '✓ ';
    padding-left: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 2rem;
}

.features-list li {
    margin-bottom: 0.5rem;
}

.sold-price-banner {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--danger-color);
    text-align: center;
    padding: 1rem 0;
    border: 2px solid var(--danger-color);
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.vehicle-card.is-sold img,
.main-image-container.is-sold img {
    filter: grayscale(100%);
    -webkit-filter: grayscale(100%);
}

.main-image-container img {
    transition: filter 0.3s ease;
}

.thumbnail-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.thumbnail-image {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.3s ease, opacity 0.3s;
    opacity: 0.7;
}

.thumbnail-image:hover {
    opacity: 1;
    border-color: var(--primary-color);
}

.description-section, .features-section {
    grid-column: 1 / -1; 
    margin-top: 2rem;
}

/* Styles for the Markdown content */
.markdown-content {
    line-height: 1.7;
    color: #f8f9fa;
}

.markdown-content h1, .markdown-content h2, .markdown-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.markdown-content p {
    margin-bottom: 1rem;
}

.markdown-content ul, .markdown-content ol {
    padding-left: 20px;
    margin-bottom: 1rem;
}

.markdown-content li {
    margin-bottom: 0.5rem;
}

.markdown-content a {
    color: var(--primary-color);
}

.markdown-content a:hover {
    text-decoration: underline;
}


/* --- Responsive Design --- */

.nav-toggle {
    display: none; /* Hidden by default on desktop */
    padding: 0.5em;
    background: transparent;
    border: 0;
    cursor: pointer;
    position: absolute;
    right: 1em;
    top: 1.5em;
    z-index: 1001;
}

.hamburger {
    display: block;
    position: relative;
    background: white;
    width: 2em;
    height: 3px;
    transition: transform 250ms ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    background: white;
    height: 3px;
    transition: transform 250ms ease-in-out;
}

.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }


/* --- Media Queries for Mobile --- */
@media (max-width: 768px) {
    /* Show the hamburger button */
    .nav-toggle {
        display: block;
    }

    /* Hide the desktop navigation */
    .main-nav {
        visibility: hidden;
        height: 0;
        position: absolute;
    }

    /* Styles for the visible mobile navigation */
    .nav--visible {
        visibility: visible;
        height: auto;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(20, 20, 20, 0.98);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .main-nav ul {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .main-nav a {
        font-size: 1.5rem;
    }

    /* Hide header contact info on mobile */
    .header-contact {
        display: none;
    }

    /* Make vehicle grids single-column */
    .vehicle-grid,
    .vehicle-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .features-list {
        grid-template-columns: 1fr;
    }
}



@media (max-width: 992px) {
    .vehicle-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .site-header .container, .main-nav, .main-nav ul {
        flex-direction: column;
        text-align: center;
    }
    .main-nav ul {
        gap: 1rem;
        margin-top: 1rem;
    }
    .header-contact {
        display: none;
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
    /* Make features list single column on smaller screens */
    .features-list {
        grid-template-columns: 1fr;
    }
}

