/* ==========================================================================
   Harris Cars Design System
   ========================================================================== */

/* --- CSS Variables --- */
:root {
    /* Brand Colors (Derived from Logo) */
    --brand-blue: #13529b;
    /* Royal/Navy blue from the logo */
    --brand-blue-dark: #0a2f5c;
    /* Darker shade of the blue for contrast */
    --brand-gold: #b39136;
    /* Metallic gold/bronze from the logo */
    --brand-gold-light: #d1b15c;
    --brand-gold-dark: #8f7226;

    /* Neutrals */
    --color-white: #ffffff;
    --color-light: #f8f9fa;
    --color-gray-100: #f1f5f9;
    --color-gray-200: #e2e8f0;
    --color-gray-400: #94a3b8;
    --color-gray-600: #475569;
    --color-gray-800: #1e293b;
    --color-black: #0f172a;
    --midnight: #050b14;
    /* Deep dark background */

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-gold: 0 4px 14px 0 rgba(179, 145, 54, 0.39);

    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* Offset for the fixed .navbar so #anchor jumps don't hide the
       target heading underneath it. Tuned to navbar height (~80px)
       plus a little breathing room. */
    scroll-padding-top: clamp(88px, 12vh, 112px);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-gray-800);
    background-color: var(--color-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-black);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--space-4);
}

a {
    color: var(--brand-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--brand-gold);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Layout & Utilities --- */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--space-8);
    }
}

.text-center {
    text-align: center;
}

.text-navy {
    color: var(--brand-blue-dark);
}

.text-gold {
    color: var(--brand-gold);
}

.text-muted {
    color: var(--color-gray-600);
}

.bg-light {
    background-color: var(--color-light);
}

.bg-dark {
    background-color: var(--midnight);
    color: var(--color-white);
}

.bg-dark h1,
.bg-dark h2,
.bg-dark h3 {
    color: var(--color-white);
}

.py-10 {
    padding-top: var(--space-10);
    padding-bottom: var(--space-10);
}

.py-20 {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-4 {
    gap: var(--space-4);
}

.gap-8 {
    gap: var(--space-8);
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.divider {
    height: 3px;
    width: 60px;
    background-color: var(--brand-gold);
    margin: var(--space-4) auto var(--space-6);
}

/* --- Components --- */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    /* Slight rounding for a sleek look */
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--brand-gold);
    color: var(--color-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--brand-gold-light);
    color: var(--color-white);
    box-shadow: var(--shadow-gold);
    transform: translateY(-2px);
}

.btn-outline-light {
    background-color: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
}

.btn-outline-light:hover {
    background-color: var(--color-white);
    color: var(--brand-blue-dark);
}

.btn-outline-navy {
    background-color: transparent;
    color: var(--brand-blue-dark);
    border-color: var(--brand-blue-dark);
}

.btn-outline-navy:hover {
    background-color: var(--brand-blue-dark);
    color: var(--color-white);
}

/* Cards */
.card {
    background: var(--color-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(5, 11, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Specific Sections --- */

/* Hero */
.hero {
    position: relative;
    height: 90vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--midnight);
    /* We will replace this with a generated luxury car image later */
    background-image: url('https://images.unsplash.com/photo-1493238792000-8113da705763?q=80&w=2670&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(5, 11, 20, 0.9), rgba(10, 47, 92, 0.6));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--color-white);
    max-width: 800px;
}

.hero-content h1 {
    color: var(--color-white);
    font-size: 3rem;
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
}

@media (min-width: 768px) {
    .hero-content h1 {
        font-size: 4.5rem;
    }
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: var(--space-8);
    color: var(--color-gray-200);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
}

/* --- Animations --- */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s var(--transition-slow) forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all var(--transition-normal);
    padding: var(--space-4) 0;
    background: transparent;
}

.navbar.scrolled {
    background: var(--color-white);
    padding: var(--space-3) 0;
    box-shadow: var(--shadow-md);
}

.navbar.scrolled .brand-text {
    color: var(--brand-blue-dark);
}

.navbar.scrolled .nav-link {
    color: var(--color-gray-800);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
}

.brand-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-white);
    letter-spacing: 0.1em;
    transition: color var(--transition-normal);
}

/* --- Site logo lockup (brand mark) --- */
.site-logo-lockup {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    line-height: 1;
}

.site-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.site-logo-lockup--nav .site-logo {
    height: clamp(40px, 6vw, 56px);
    /* Soft shadow keeps the navy crest legible on the transparent
       dark-hero navbar; cleared once the navbar transitions to white. */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
    transition: filter var(--transition-normal);
}

.navbar.scrolled .site-logo-lockup--nav .site-logo {
    filter: none;
}

.site-logo-lockup--footer {
    display: inline-flex;
    margin-bottom: var(--space-4);
}

.site-logo-lockup--footer .site-logo {
    height: clamp(56px, 8vw, 80px);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

/* Visually hidden helper (used to retain "HARRIS CARS" for screen readers) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nav-links {
    display: none;
}

@media (min-width: 992px) {
    .nav-links {
        display: flex;
        align-items: center;
        gap: var(--space-6);
    }
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-white);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    text-decoration: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--brand-gold);
    transition: width var(--transition-normal);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--brand-gold);
}

.nav-divider {
    width: 1px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.3);
}

.navbar.scrolled .nav-divider {
    background-color: var(--color-gray-200);
}

.secondary-links {
    display: flex;
    gap: var(--space-4);
}

.nav-link-secondary {
    font-size: 0.85rem;
    color: var(--brand-gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
}

.mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    color: var(--color-white);
    cursor: pointer;
    z-index: 1001;
}

.navbar.scrolled .mobile-menu-toggle {
    color: var(--brand-blue-dark);
}

@media (min-width: 992px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* Prevent body scroll when mobile menu is open */
body.menu-open {
    overflow: hidden;
}

/* Mobile Menu Active State */
.nav-links.active {
    display: flex;
    flex-direction: column;
    position: fixed; /* Changed from absolute to fixed */
    top: 70px; /* Height of navbar */
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: var(--color-white);
    padding: var(--space-6) var(--space-4);
    box-shadow: var(--shadow-md);
    animation: slideDown var(--transition-normal);
    overflow-y: auto;
    z-index: 999;
}

.nav-links.active .nav-link,
.nav-links.active .brand-text {
    color: var(--brand-blue-dark);
}

/* Improve mobile menu link spacing */
.nav-links.active .nav-link {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-gray-100);
    width: 100%;
    text-align: center;
}

.nav-links.active .nav-link:last-child {
    border-bottom: none;
}

.nav-links.active .nav-divider {
    display: none;
}

.nav-links.active .secondary-links {
    flex-direction: column;
    align-items: center;
    margin-top: var(--space-4);
    width: 100%;
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-gray-200);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Footer --- */
.footer {
    padding-top: var(--space-16);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-12);
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
    }
}

.footer h3,
.footer h4 {
    margin-bottom: var(--space-6);
}

.footer h4 {
    font-size: 1.1rem;
    color: var(--color-white);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer ul li {
    margin-bottom: var(--space-3);
}

.footer ul li a {
    color: var(--color-gray-400);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.footer ul li a:hover {
    color: var(--brand-gold);
    padding-left: var(--space-2);
}

.footer-contact p {
    color: var(--color-gray-400);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.footer-contact p i {
    margin-top: 0;
}

.social-links {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.social-links a,
.social-links .social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color-white);
    transition: all var(--transition-normal);
    text-decoration: none;
}

.social-links a:hover {
    background-color: var(--brand-gold);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-6) 0;
}

/* --- Footer trust strip (e.g. ASE certified badge) --- */
.footer-bottom .footer-trust {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
}

/* --- Trust badge (generic, brand-styled) ---
   NOTE: This is our own brand-styled trust card. The official ASE Blue
   Seal of Excellence(R) and ASE Certified marks are trademarked and
   require written authorization from ASE (ase.com/logos). When the
   client provides authorized artwork, swap the inner markup of
   .trust-badge--ase with the official asset (keep the wrapper sizing). */
.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    background: rgba(13, 47, 87, 0.06);
    border: 1px solid rgba(13, 47, 87, 0.18);
    color: var(--brand-blue-dark);
    text-decoration: none;
    line-height: 1.2;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.trust-badge:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    background: rgba(13, 47, 87, 0.1);
}

.trust-badge__icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--brand-blue);
    color: var(--color-white);
    flex-shrink: 0;
}

.trust-badge__icon i,
.trust-badge__icon svg {
    width: 22px;
    height: 22px;
}

.trust-badge__text {
    display: flex;
    flex-direction: column;
}

.trust-badge__title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-blue-dark);
}

.trust-badge__sub {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-gray-600);
    margin-top: 2px;
}

/* Compact dark variant for use on the dark footer */
.trust-badge--dark {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--color-gray-400);
    padding: 0.4rem 0.75rem;
}

.trust-badge--dark:hover {
    background: rgba(255, 255, 255, 0.08);
}

.trust-badge--dark .trust-badge__icon {
    width: 30px;
    height: 30px;
    background: var(--brand-gold);
    color: var(--brand-blue-dark);
}

.trust-badge--dark .trust-badge__icon i,
.trust-badge--dark .trust-badge__icon svg {
    width: 18px;
    height: 18px;
}

.trust-badge--dark .trust-badge__title {
    color: var(--color-white);
    font-size: 0.78rem;
}

.trust-badge--dark .trust-badge__sub {
    color: var(--color-gray-400);
    font-size: 0.65rem;
}

/* --- Credentials section (about page hero strip for certifications) --- */
.credentials-section {
    padding: var(--space-16) 0;
    background: linear-gradient(135deg, var(--color-white) 0%, #f7f9fc 100%);
}

.credentials-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    align-items: stretch;
}

@media (min-width: 768px) {
    .credentials-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        /* row-gap stays compact on rare wrap; column-gap scales generously
           with viewport so the credential card and explanatory copy each
           breathe at desktop widths. */
        row-gap: var(--space-8);
        column-gap: clamp(3rem, 7vw, 6rem);
        align-items: center;
    }
}

.credential-card {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-6);
    background: var(--color-white);
    border-radius: 12px;
    border: 1px solid var(--color-gray-200);
    box-shadow: var(--shadow-md);
}

.credential-card__seal {
    flex-shrink: 0;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--brand-blue), var(--brand-blue-dark));
    display: grid;
    place-items: center;
    color: var(--brand-gold);
    box-shadow: 0 6px 18px rgba(13, 47, 87, 0.25), inset 0 0 0 3px var(--brand-gold);
}

.credential-card__seal i,
.credential-card__seal svg {
    width: 44px;
    height: 44px;
    stroke-width: 2;
}

.credential-card__body h3 {
    font-size: 1.25rem;
    color: var(--brand-blue-dark);
    margin-bottom: 0.35rem;
}

.credential-card__body .eyebrow {
    color: var(--brand-gold);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.credential-card__body p {
    color: var(--color-gray-600);
    line-height: 1.6;
    margin: 0;
}

.icon-sm {
    width: 18px;
    height: 18px;
    margin-top: 4px;
}

.footer-contact i {
    align-self: center;
    margin-top: 0;
}

/* --- Vehicle Cards --- */
.vehicle-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.vehicle-card .card-img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: #f8f9fa;
}

.vehicle-card .card-body {
    padding: var(--space-6);
    flex: 1;
    /* allow it to grow */
    display: flex;
    flex-direction: column;
}

.vehicle-card-title {
    font-size: 1.25rem;
    margin-bottom: var(--space-1);
    color: var(--color-black);
}

.vehicle-card-meta {
    font-size: 0.875rem;
    color: var(--color-gray-600);
    margin-bottom: var(--space-6);
}

.vehicle-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--color-gray-200);
    padding-top: var(--space-4);
    margin-top: auto;
    /* push to bottom */
}

.vehicle-card-price {
    font-family: var(--font-heading);
    color: var(--brand-blue-dark);
    font-weight: 700;
    font-size: 1.25rem;
}

.vehicle-card-link {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--brand-gold);
}

.vehicle-card-link:hover {
    color: var(--brand-blue);
}
/* --- SKELETON LOADERS --- */
.skeleton {
    background: #e2e8f0;
    background: linear-gradient(110deg, #e2e8f0 8%, #f1f5f9 18%, #e2e8f0 33%);
    background-size: 200% 100%;
    animation: 1.5s shine linear infinite;
    border-radius: 4px;
}

@keyframes shine {
    to {
        background-position-x: -200%;
    }
}

.skeleton-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--color-white);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    min-height: 320px;
}

.skeleton-card .skeleton-img {
    width: 100%;
    height: 220px;
    border-radius: 0;
}

.skeleton-card .skeleton-body {
    padding: var(--space-6);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.skeleton-card .skeleton-line {
    height: 1rem;
    border-radius: 4px;
    width: 80%;
}

.skeleton-card .skeleton-line.short {
    width: 50%;
}

/* --- MICRO-INTERACTIONS --- */
.vehicle-card {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.vehicle-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.btn {
    transition: all var(--transition-normal);
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* --- INVENTORY LAYOUT --- */
.page-header {
    padding: 120px 0 40px;
    background-color: var(--midnight);
    color: var(--color-white);
    text-align: center;
}

.page-header h1 {
    color: var(--color-white);
    margin-bottom: var(--space-2);
}

.inv-section {
    background: var(--color-light);
    padding: 0 0 4rem;
    min-height: 70vh;
}

.inv-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 992px) {
    .inv-layout {
        grid-template-columns: 260px 1fr;
    }
}

.inv-sidebar {
    background: var(--color-white);
    padding: 1.5rem;
    border-right: 1px solid var(--color-gray-200);
}

@media (min-width: 992px) {
    .inv-sidebar {
        position: sticky;
        top: 70px;
        align-self: start;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-blue-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group {
    margin-bottom: 1.25rem;
}

.filter-group-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-gray-600);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.filter-select {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--color-gray-200);
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    background: var(--color-white);
    color: var(--color-gray-800);
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--brand-gold);
    outline: none;
}

.filter-divider {
    border: none;
    border-top: 1px solid var(--color-gray-200);
    margin: 1.25rem 0;
}

.filter-clear-btn {
    width: 100%;
    padding: 0.55rem 1rem;
    border: 1px solid var(--color-gray-200);
    border-radius: 5px;
    background: var(--color-white);
    color: var(--color-gray-600);
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.filter-clear-btn:hover {
    background: var(--color-gray-100);
    color: var(--brand-blue-dark);
    border-color: var(--brand-blue);
}

.inv-main {
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .inv-main {
        padding: 1.5rem 2rem;
    }
}

.inv-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.inv-count {
    font-family: var(--font-heading);
    color: var(--color-gray-800);
}

.inv-count span {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--brand-gold);
}

.inv-count small {
    font-size: 0.9rem;
    color: var(--color-gray-600);
    margin-left: 0.25rem;
}

.inv-sort select {
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--color-gray-200);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    background: var(--color-white);
    color: var(--color-gray-800);
    cursor: pointer;
}

.inv-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .inv-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .inv-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.inv-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: var(--color-white);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

.inv-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.inv-card-img {
    width: 100%;
    height: 260px;
    object-fit: contain;
    background: #f8f9fa;
    display: block;
}

.inv-card-carfax {
    position: absolute;
    bottom: 52px;
    right: 0;
    background: rgba(255,255,255,0.95);
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #c00;
    letter-spacing: 0.02em;
    border-radius: 4px 0 0 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.inv-card-price {
    position: absolute;
    bottom: 55px;
    left: 0;
    background: rgba(10, 47, 92, 0.9);
    color: var(--color-white);
    padding: 0.4rem 0.8rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.inv-card-title {
    background: var(--color-white);
    color: var(--color-gray-800);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-top: 1px solid var(--color-gray-200);
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-gray-600);
    font-size: 1.1rem;
}

/* --- VDP LAYOUT --- */
.vdp-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    padding-top: var(--space-8);
    padding-bottom: var(--space-16);
}

@media (min-width: 992px) {
    .vdp-layout {
        grid-template-columns: 500px 1fr;
    }
}

.gallery-card {
    background: var(--color-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.gallery-main-img {
    width: 100%;
    height: 460px;
    object-fit: contain;
    background: #f8f9fa;
    display: block;
}

.gallery-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: var(--color-gray-100);
    border-top: 1px solid var(--color-gray-200);
}

.gallery-nav span {
    font-size: 0.9rem;
    color: var(--color-gray-600);
}

.gallery-nav-btn {
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    color: var(--color-gray-800);
    transition: all var(--transition-fast);
}

.gallery-nav-btn:hover {
    background: var(--brand-blue);
    color: var(--color-white);
    border-color: var(--brand-blue);
}

.price-block {
    padding: var(--space-6);
}

.price-label {
    font-size: 0.85rem;
    color: var(--color-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.price-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-gray-400);
    text-decoration: line-through;
}

.price-offer {
    display: inline-block;
    margin-top: var(--space-3);
    padding: 0.6rem 1.5rem;
    background: var(--brand-gold);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 50px;
}

.price-fine {
    font-size: 0.8rem;
    color: var(--color-gray-600);
    margin-top: var(--space-2);
}

.vdp-cta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--brand-blue);
    font-weight: 600;
    padding: var(--space-2) 0;
    transition: color var(--transition-fast);
}

.vdp-cta:hover {
    color: var(--brand-gold);
}

.share-section {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-gray-200);
}

.share-section p {
    font-size: 0.85rem;
    color: var(--color-gray-600);
    margin-bottom: var(--space-2);
}

.share-btns {
    display: flex;
    gap: var(--space-2);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    color: var(--color-white);
    font-size: 0.85rem;
    text-decoration: none;
    transition: transform var(--transition-fast);
}
.share-btn:hover {
    transform: translateY(-2px);
}

.share-btn.fb {
    background: #1877F2;
}

.share-btn.tw {
    background: #1DA1F2;
}

.share-btn.pin {
    background: #E60023;
}

/* --- GALLERY LIGHTBOX (NOR-358) --- */
#gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.93);
}

.lb-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 1500px;
    margin: 0 auto;
}

.lb-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 3.5rem;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lb-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-close {
    position: absolute;
    right: 1rem;
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: background 0.2s, border-color 0.2s;
}

.lb-close:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
}

.lb-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0.5rem;
    padding: 0.75rem;
}

.lb-main {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
}

.lb-main-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

.lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    z-index: 10;
}

.lb-arrow:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: #fff;
}

.lb-prev { left: 0.6rem; }
.lb-next { right: 0.6rem; }

.lb-counter {
    position: absolute;
    bottom: 0.6rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.82rem;
    background: rgba(0, 0, 0, 0.55);
    padding: 2px 12px;
    border-radius: 20px;
    pointer-events: none;
}

.lb-thumbnails {
    width: 230px;
    flex-shrink: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.lb-thumbnails::-webkit-scrollbar {
    width: 4px;
}

.lb-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
}

.lb-thumb {
    aspect-ratio: 1;
    width: 100%;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.55;
    border: 2px solid transparent;
    border-radius: 3px;
    display: block;
    transition: opacity 0.15s, border-color 0.15s;
}

.lb-thumb:hover {
    opacity: 0.85;
}

.lb-thumb.lb-thumb-active {
    opacity: 1;
    border-color: var(--brand-gold);
}

@media (max-width: 767px) {
    .lb-body {
        flex-direction: column;
    }

    .lb-thumbnails {
        width: 100%;
        height: 86px;
        flex-shrink: 0;
        overflow-x: auto;
        overflow-y: hidden;
        grid-template-columns: unset;
        grid-auto-flow: column;
        grid-auto-columns: 80px;
        align-content: unset;
        gap: 4px;
    }

    .lb-thumb {
        width: 80px;
        height: 80px;
        aspect-ratio: unset;
    }
}

.details-panel {
    background: var(--color-white);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.details-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-6);
    border-bottom: 1px solid var(--color-gray-200);
    background: var(--color-gray-100);
}

.details-toolbar a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 0.85rem;
    color: var(--color-gray-600);
}

.details-toolbar a:hover {
    color: var(--brand-gold);
}

.details-heading {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    padding: var(--space-4) var(--space-6);
    border-bottom: 2px solid var(--brand-blue);
    color: var(--brand-blue-dark);
    font-weight: 700;
    margin-bottom: 0;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0 var(--space-6);
}

@media (min-width: 768px) {
    .details-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.detail-item {
    display: flex;
    flex-direction: column;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-gray-100);
}

.detail-label {
    font-size: 0.8rem;
    color: var(--color-gray-600);
}

.detail-value {
    font-weight: 600;
    color: var(--color-gray-800);
}

.carfax-section {
    padding: var(--space-6);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-6);
    border-top: 1px solid var(--color-gray-200);
}

.carfax-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    color: var(--brand-blue-dark);
}

.carfax-badge .badge-icon {
    width: 28px;
    height: 28px;
    background: #4CAF50;
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.location-section {
    padding: var(--space-6);
    border-top: 1px solid var(--color-gray-200);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/* Typography scale */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

/* Responsive typography */
@media (min-width: 768px) {
    .md\:text-4xl { font-size: 2.25rem; }
    .md\:text-5xl { font-size: 3rem; }
}

/* Spacing utilities */
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

/* Button consistency */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Form styles standardization */
.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-2);
    color: var(--color-gray-800);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-gray-200);
    border-radius: 4px;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(19, 82, 155, 0.1);
}

/* Form error states */
.form-control.error {
    border-color: #dc2626;
}

.form-control.error:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.has-error .form-label {
    color: #dc2626;
}

/* Card consistency */
.card {
    background: var(--color-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card-body {
    padding: var(--space-6);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--color-black);
}

/* ==========================================================================
   Skeleton Loading Animations
   ========================================================================== */

/* Skeleton loading animations */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton {
    background: linear-gradient(90deg,
        var(--color-gray-100) 25%,
        var(--color-gray-200) 50%,
        var(--color-gray-100) 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: 4px;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text-sm {
    height: 0.75rem;
}

.skeleton-image {
    width: 100%;
    height: 220px;
    border-radius: 8px 8px 0 0;
}

.skeleton-card {
    background: var(--color-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.skeleton-card-body {
    padding: var(--space-6);
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-gray-200);
    border-radius: 50%;
    border-top-color: var(--brand-gold);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Asset fallback styles */
.asset-fallback {
    border: 2px dashed rgba(179, 146, 54, 0.3);
    padding: 4px;
}

.asset-fallback-bg {
    position: relative;
}

.asset-fallback-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px dashed rgba(179, 146, 54, 0.3);
    pointer-events: none;
}
