/* --- Showcase & Info Section Styles --- */
.showcase-section, .content-wrapper {
    max-width: 1400px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
}

.showcase-section.featured {
    background-color: var(--background-card);
    padding-top: 60px;
    padding-bottom: 60px;
    max-width: none; /* Make it full-width */
}

/* Reuse vehicle-grid/card styles already defined above */
.showcase-section.featured .vehicle-grid {
    max-width: 1400px;
    margin: 0 auto;
}

/* Force single-column layout for featured cards like inventory */
.vehicle-grid.vehicle-grid--single {
    grid-template-columns: 1fr;
    gap: 24px;
}

.vehicle-grid.vehicle-grid--single .vehicle-card {
    display: grid;
    grid-template-columns: minmax(320px, 2fr) 3fr;
    grid-template-areas:
        "image content"
        "thumbs content";
    column-gap: 24px;
}
.vehicle-grid.vehicle-grid--single .card-image-container { grid-area: image; aspect-ratio: 16 / 9; }
.vehicle-grid.vehicle-grid--single .card-content { grid-area: content; }
.vehicle-grid.vehicle-grid--single .card-thumbs { grid-area: thumbs; grid-template-columns: repeat(6, 1fr); padding: 10px 0 0 0; }

@media (max-width: 900px) {
    .vehicle-grid.vehicle-grid--single .vehicle-card { display: block; }
}

.showcase-section h2, .content-wrapper h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: #666;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.info-section {
    max-width: 1400px;
    margin: 60px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.info-card {
    background-color: var(--background-card);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

.info-card h3 {
    margin-top: 0;
}

.info-card a {
    font-weight: 700;
    margin-top: 1rem;
    display: inline-block;
}

.placeholder-card {
    background-color: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}


/* --- Homepage Hero Section Styles --- */
.hero {
    text-align: center;
    padding: 100px 20px;
    background-color: #f8f9fa; /* Lighter grey for a softer look */
    /* In the future, we can add a background image here:
    background-image: url('/static/images/hero-background.jpg');
    background-size: cover;
    background-position: center;
    */
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.hero p {
    font-size: 1.25rem;
    color: #fff;
    line-height: 1.6;
}

.hero-button {
    display: inline-block;
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    background-color: var(--oxford-blue);
    color: white;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.hero-button:hover {
    background-color: #003366;
    color: var(--malachite-green);
    transform: translateY(-2px);
}

.hero .hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    filter: brightness(0.45);
}

/* --- Full-width New Vehicle Banners --- */
.new-banner {
    position: relative;
    width: 100%;
    height: clamp(320px, 45vw, 560px); /* Responsive height cap */
    margin: 28px 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}
.new-banner__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.72);
    /* Smooth blur-up + fade-in */
    transition: filter 0.5s ease, transform 0.5s ease, opacity 0.4s ease;
    opacity: 1;
}
/* LQIP blur for homepage visuals */
.new-banner__bg.lqip,
.vehicle-grid .card-image-container img.lqip {
    filter: brightness(0.72) blur(14px);
    transform: scale(1.02);
    opacity: 0.7;
}
.new-banner__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 20px clamp(16px, 4vw, 40px);
    color: #fff;
}
.new-banner__text h3 {
    margin: 0 0 6px 0;
    font-size: clamp(1.4rem, 3.2vw, 2.2rem);
    line-height: 1.15;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    color: #fff;
}
.new-banner__price {
    font-size: clamp(1rem, 2.6vw, 1.6rem);
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    color: #fff;
}
.new-banner__cta {
    align-self: flex-end;
    background: rgba(255,255,255,0.95);
    color: #111;
    text-decoration: none;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.new-banner__cta:hover {
    transform: translateY(-2px);
    background: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.28);
}

/* --- Showcase Section Styles --- */
.showcase-section {
    padding: 80px 20px;
    text-align: center;
}

.showcase-section.featured {
    background-color: var(--background-card); /* White background */
}

.showcase-section h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: #666;
    margin-bottom: 50px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.1rem;
}

.info-section {
    max-width: 1400px;
    margin: 80px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.info-card {
    background-color: var(--background-card);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    text-align: left; /* Better for readability */
}

.info-card h3 {
    margin-top: 0;
}

.info-card a {
    font-weight: 700;
    margin-top: 1.5rem;
    display: inline-block;
}

.placeholder-card {
    background-color: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}



/* --- Polished Vehicle Card --- */
.vehicle-card {
    background-color: var(--background-card);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    content-visibility: auto;
    contain-intrinsic-size: 600px; /* rough height placeholder to avoid jank */
}

.vehicle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1200px) {
    .vehicle-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .vehicle-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .vehicle-grid { grid-template-columns: 1fr; }
}

.card-image-container {
    width: 100%;
    aspect-ratio: 4 / 3; /* slightly shorter to reduce overall card height */
    overflow: hidden;
    background-color: #f0f0f0;
}

.card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease, opacity 0.3s ease;
}

.vehicle-card-link:hover .card-image-container img {
    transform: scale(1.05);
}

/* LQIP blur-up helper */
.card-image-container img.lqip,
.main-image img.lqip {
    filter: blur(14px);
    transform: scale(1.02);
}

.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
}

.card-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 10px 12px 0 12px;
}
.card-thumbs img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-thumbs img:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.card-top-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
    font-weight: 700;
}

.card-content h2 {
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: var(--text-dark);
}

.card-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.card-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
}

.card-price-analysis {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--malachite-green);
    background-color: rgba(11, 218, 81, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
}

/* --- Polished Filter Panel --- */
.filters {
    background-color: var(--background-card);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    align-self: start; 
    position: sticky;
    top: 100px; /* below fixed header */
}

.filters h3 {
    margin-top: 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.reset-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* --- Inventory: Sidebar + Single-Column Listings --- */
.container-with-sidebar {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 320px 1fr; /* Sidebar | Listings */
    gap: 24px;
    align-items: start;
}

.vehicle-listings .vehicle-grid {
    grid-template-columns: 1fr; /* Force single column for inventory */
    gap: 24px;
}

.vehicle-listings .vehicle-card-link { display: block; }

/* Inventory cards: image left, details right; gallery under image */
.vehicle-listings .vehicle-card {
    display: grid;
    grid-template-columns: minmax(320px, 2fr) 3fr;
    grid-template-areas:
        "image content"
        "thumbs content";
    column-gap: 24px;
}

.vehicle-listings .card-image-container { grid-area: image; aspect-ratio: 16 / 9; }
.vehicle-listings .card-content { grid-area: content; }
.vehicle-listings .card-thumbs { grid-area: thumbs; grid-template-columns: repeat(6, 1fr); padding: 10px 0 0 0; }

@media (max-width: 900px) {
    .container-with-sidebar {
        grid-template-columns: 1fr;
    }
    .vehicle-listings .vehicle-card {
        display: block; /* Stack image, thumbs, content vertically on small screens */
    }
    .filters { position: static; top: auto; }
}

/* Optional mobile filter toggle button (to be used in templates if desired) */
.filter-toggle {
    display: none;
    position: sticky;
    top: 84px;
    z-index: 800;
    margin: 0 0 10px 0;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}
@media (max-width: 900px) {
    .filter-toggle { display: inline-block; }
}

/* --- Infinite scroll helpers --- */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    color: #666;
    padding: 16px 0;
}
.loading-indicator .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-top-color: var(--oxford-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.end-of-list {
    text-align: center;
    color: #888;
    font-size: 0.95rem;
    padding: 16px 0 24px;
}

.load-more-btn {
    display: none; /* hidden unless used as fallback */
    margin: 12px auto 24px auto;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: var(--background-card);
    color: var(--text-dark);
    cursor: pointer;
}
.load-more-btn:hover {
    background: #f6f6f6;
}

/* --- Featured Vehicle Showcase --- */
.featured-vehicle {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto;
    text-align: left;
}

@media (min-width: 768px) {
    .featured-vehicle {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
}

.featured-image img {
    width: 100%;
    border-radius: 12px;
}

.featured-details h3 {
    font-size: 1.8rem;
    margin-top: 0;
}

.featured-price {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0;
}

.featured-description {
    color: #555;
    line-height: 1.6;
}

.featured-specs {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.featured-specs li {
    padding: 5px 0;
}