/**
 * High-end dealership UI — homepage, inventory, vehicle detail
 * Palette: primary #C8102E · bg #0B0B0C · secondary #1A1A1D · text #FFF · accent #E5E5E5
 */

/* -------------------------------------------------------------------------
   Typography rhythm — dealer pages
   ------------------------------------------------------------------------- */

.home-featured .section-header,
.home-trust .section-header,
.home-contact .section-header,
section.section-dark .section-header {
    margin-bottom: clamp(3.25rem, 8vw, 5.75rem);
}

.home-featured .section-title,
.home-trust .section-title,
.home-contact .section-title,
section.section-dark .section-title {
    font-size: clamp(2.5rem, 5.5vw, 4rem);
    letter-spacing: -0.042em;
    line-height: 1.02;
}

.home-featured .section-tag,
.home-trust .section-tag,
.home-contact .section-tag,
section.section-dark .section-tag {
    letter-spacing: 0.38em;
    margin-bottom: 1.5rem;
}

.home-featured .section-subtitle,
.home-trust .section-subtitle,
.home-contact .section-subtitle,
section.section-dark .section-subtitle {
    font-size: 1.125rem;
    line-height: 1.75;
    max-width: 38rem;
    font-weight: 400;
}

.home-featured .section-line,
.home-trust .section-line,
.home-contact .section-line,
section.section-dark .section-line {
    width: 88px;
    height: 2px;
    margin-bottom: 2.5rem;
}

section.section-dark .testimonial-card {
    border-radius: 20px;
    border-color: rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, #1e1e24 0%, #18181c 100%);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

section.section-dark .testimonial-card:hover {
    background: linear-gradient(180deg, #222228 0%, #1A1A1D 100%);
}

.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;
}

/* -------------------------------------------------------------------------
   Homepage — hero (showroom)
   ------------------------------------------------------------------------- */

.hero.hero--showroom {
    min-height: 100svh;
    min-height: 100vh;
    padding: clamp(6rem, 12vh, 8rem) 0 clamp(4rem, 8vh, 6rem);
}

.hero.hero--showroom::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 120% 80% at 50% 0%, rgba(200, 16, 46, 0.14) 0%, transparent 50%),
        radial-gradient(ellipse 90% 60% at 80% 100%, rgba(200, 16, 46, 0.08) 0%, transparent 45%),
        linear-gradient(180deg, rgba(11, 11, 12, 0.15) 0%, rgba(11, 11, 12, 0.55) 45%, rgba(11, 11, 12, 0.92) 100%);
}

.hero.hero--showroom::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse 70% 90% at 50% 50%, transparent 30%, rgba(11, 11, 12, 0.75) 100%);
}

.hero.hero--showroom .hero-bg {
    filter: saturate(1.08) contrast(1.05);
    animation: heroZoom 28s ease-in-out infinite alternate;
    background-color: #080809;
    background-image:
        radial-gradient(ellipse 100% 75% at 50% 100%, rgba(200, 16, 46, 0.2) 0%, transparent 52%),
        radial-gradient(ellipse 130% 100% at 50% 40%, transparent 38%, rgba(11, 11, 12, 0.88) 100%),
        linear-gradient(165deg, rgba(11, 11, 12, 0.2) 0%, rgba(11, 11, 12, 0.75) 48%, rgba(11, 11, 12, 0.96) 100%),
        url('https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?w=1920&q=80');
    background-size: cover;
    background-position: center;
}

.hero.hero--showroom .hero-bg[style] {
    background-size: cover !important;
    background-position: center !important;
}

.hero.hero--showroom .hero-content {
    position: relative;
    z-index: 2;
    max-width: 56rem;
    padding-left: var(--space-page-x);
    padding-right: var(--space-page-x);
}

.hero.hero--showroom .hero-tag {
    margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
    padding: 0.65rem 1.75rem;
    letter-spacing: 0.32em;
    font-size: 0.625rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 100px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero.hero--showroom .hero-title {
    font-size: clamp(3rem, 9.5vw, 5.75rem);
    font-weight: 800;
    letter-spacing: -0.048em;
    line-height: 0.96;
    margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
    text-wrap: balance;
    text-shadow:
        0 2px 2px rgba(0, 0, 0, 0.4),
        0 8px 48px rgba(0, 0, 0, 0.65),
        0 0 80px rgba(0, 0, 0, 0.35);
}

.hero.hero--showroom .hero-title em {
    color: var(--color-gold-light);
    font-style: normal;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .hero.hero--showroom .hero-title em {
        background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.92) 35%, var(--color-gold-light) 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }
}

.hero.hero--showroom .hero-description {
    font-size: clamp(1.0625rem, 2vw, 1.3125rem);
    font-weight: 500;
    color: rgba(229, 229, 229, 0.9);
    max-width: 36rem;
    margin: 0 auto clamp(2.25rem, 4vw, 3.25rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
}

.hero.hero--showroom .hero-buttons {
    gap: 1rem 1.25rem;
}

.hero.hero--showroom .hero-buttons .btn {
    border-radius: 999px;
    min-width: 12rem;
    min-height: 3.25rem;
    justify-content: center;
    padding-left: 2rem;
    padding-right: 2rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.hero.hero--showroom .hero-buttons .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
}

.hero.hero--showroom .scroll-indicator {
    z-index: 2;
    bottom: clamp(2rem, 5vh, 3.5rem);
    opacity: 0.85;
}

.stats-bar--dealer {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: linear-gradient(180deg, #151518 0%, #0c0c0e 40%, #0B0B0C 100%);
    padding-top: clamp(3rem, 6vw, 4.5rem);
    padding-bottom: clamp(3rem, 6vw, 4.5rem);
}

.stats-bar--dealer .stat-number {
    font-variant-numeric: tabular-nums;
    font-size: clamp(2.5rem, 5vw, 3.35rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .stats-bar--dealer .stat-number {
        background: linear-gradient(180deg, #ffffff 0%, rgba(229, 229, 229, 0.82) 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        text-shadow: none;
    }
}

.stats-bar--dealer .stat-label {
    margin-top: 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(229, 229, 229, 0.5);
}

.home-featured {
    padding: clamp(6rem, 12vw, 9rem) var(--space-page-x);
    background: var(--color-bg-primary);
}

.home-featured .section-subtitle {
    color: rgba(229, 229, 229, 0.68);
}

.home-featured .vehicles-grid {
    align-items: stretch;
    gap: clamp(1.75rem, 3.5vw, 2.75rem);
}

.home-trust {
    padding: clamp(6rem, 12vw, 9rem) var(--space-page-x);
    background: linear-gradient(180deg, #121215 0%, #1A1A1D 50%, #16161a 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.home-trust__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(1.25rem, 2.5vw, 2rem);
    max-width: 1240px;
    margin: 0 auto;
}

.home-trust__card {
    position: relative;
    padding: 2.25rem 1.75rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: linear-gradient(165deg, rgba(26, 26, 29, 0.95) 0%, rgba(11, 11, 12, 0.65) 100%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: transform 0.5s var(--ease-out-expo), border-color 0.5s var(--ease-out-expo), box-shadow 0.5s var(--ease-out-expo);
    overflow: hidden;
}

.home-trust__card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200, 16, 46, 0.45), transparent);
    opacity: 0.9;
}

.home-trust__card:hover {
    transform: translateY(-8px);
    border-color: rgba(200, 16, 46, 0.28);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(200, 16, 46, 0.12);
}

.home-trust__icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    background: linear-gradient(145deg, rgba(200, 16, 46, 0.18) 0%, rgba(200, 16, 46, 0.06) 100%);
    border: 1px solid rgba(200, 16, 46, 0.28);
    color: var(--color-gold-light);
    box-shadow: 0 8px 24px rgba(200, 16, 46, 0.12);
}

.home-trust__icon svg {
    width: 26px;
    height: 26px;
}

.home-trust__title {
    font-family: var(--font-heading);
    font-size: 1.1875rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.625rem;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.home-trust__text {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: rgba(229, 229, 229, 0.72);
}

.home-contact {
    padding: clamp(6rem, 12vw, 9rem) var(--space-page-x);
    background: var(--color-bg-primary);
}

.home-contact .section-subtitle {
    color: rgba(229, 229, 229, 0.68);
}

/* Vehicle cards — dealer variant (luxury) */
.vehicle-card--dealer {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: linear-gradient(180deg, #1c1c21 0%, #121214 48%, #0e0e10 100%);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.35),
        0 28px 56px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    overflow: hidden;
    transition: transform 0.55s var(--ease-out-expo), box-shadow 0.55s var(--ease-out-expo), border-color 0.45s ease;
}

.vehicle-card--dealer:hover {
    transform: translateY(-10px) scale(1.01);
    border-color: rgba(200, 16, 46, 0.35);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.4),
        0 40px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(200, 16, 46, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.vehicle-card--dealer .vehicle-card__media {
    display: block;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
}

.vehicle-card--dealer .vehicle-card-image {
    aspect-ratio: 16 / 10;
    background: #080809;
}

.vehicle-card--dealer .vehicle-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 25%, rgba(11, 11, 12, 0.4) 65%, rgba(11, 11, 12, 0.92) 100%);
}

.vehicle-card--dealer .vehicle-card-image img {
    transition: transform 1.1s var(--ease-out-expo);
}

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

.vehicle-card--dealer .vehicle-card-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 1.875rem 1.75rem 1.75rem;
}

.vehicle-card--dealer .vehicle-year {
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    font-weight: 700;
    color: rgba(229, 229, 229, 0.45);
    margin-bottom: 0.375rem;
}

.vehicle-card--dealer .vehicle-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 0.625rem;
}

.vehicle-card--dealer .vehicle-specs {
    font-size: 0.8125rem;
    color: rgba(229, 229, 229, 0.62);
    margin-bottom: 1.375rem;
    line-height: 1.65;
}

.vehicle-card--dealer .vehicle-card-footer {
    margin-top: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 1.125rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.vehicle-card--dealer .vehicle-price {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.vehicle-card--dealer .vehicle-card-btn {
    display: none;
}

.vehicle-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.vehicle-card-actions .btn {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 0.75rem 0.875rem;
    border-radius: 999px;
    justify-content: center;
}

/* -------------------------------------------------------------------------
   Inventory
   ------------------------------------------------------------------------- */

.inventory-page {
    background: var(--color-bg-primary);
}

.inventory-hero {
    padding: clamp(6rem, 14vw, 8.5rem) var(--space-page-x) clamp(2.5rem, 5vw, 3.5rem);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(200, 16, 46, 0.12) 0%, transparent 55%),
        linear-gradient(180deg, #18181c 0%, #0B0B0C 100%);
}

.inventory-hero__eyebrow {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.36em;
    text-transform: uppercase;
    color: var(--color-gold-light);
    margin-bottom: 1.25rem;
}

.inventory-hero__title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5.5vw, 3.75rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.042em;
    line-height: 1.02;
    margin-bottom: 1rem;
}

.inventory-hero__lead {
    font-size: 1.125rem;
    color: rgba(229, 229, 229, 0.68);
    max-width: 38rem;
    margin: 0 auto;
    line-height: 1.7;
    font-weight: 400;
}

.inventory-section--dealer {
    padding: clamp(3rem, 6vw, 4rem) var(--space-page-x) clamp(5rem, 10vw, 7rem);
}

.filter-bar--dealer {
    display: grid;
    grid-template-columns: minmax(200px, 1.4fr) repeat(4, minmax(140px, 1fr));
    gap: 1rem;
    align-items: stretch;
    margin-bottom: clamp(2.5rem, 5vw, 3.75rem);
    padding: 1.5rem 1.75rem;
    background: linear-gradient(180deg, #222228 0%, #1A1A1D 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.filter-bar--dealer .search-input-wrapper {
    min-width: 0;
}

.filter-bar--dealer .search-input-wrapper input {
    border-radius: 999px;
    background: #0B0B0C;
    border-color: rgba(255, 255, 255, 0.1);
}

.filter-bar--dealer .form-group {
    margin: 0;
    min-width: 0;
}

.filter-bar--dealer select {
    width: 100%;
    border-radius: 999px;
    padding: 0.875rem 1.125rem;
    background: #0B0B0C;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8125rem;
    font-weight: 600;
}

.inventory-grid--dealer {
    display: grid;
    align-items: stretch;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: clamp(1.75rem, 3.5vw, 2.5rem);
}

.inventory-grid--dealer .vehicle-card {
    border-radius: 20px;
}

.inventory-grid--dealer .vehicle-card:hover {
    transform: translateY(-10px) scale(1.01);
}

.inventory-count--dealer {
    text-align: center;
    margin-top: 2.5rem;
    font-size: 0.875rem;
    color: rgba(229, 229, 229, 0.5);
    font-weight: 500;
}

.inventory-empty--dealer {
    text-align: center;
    padding: 4rem 2rem;
}

@media (max-width: 1100px) {
    .filter-bar--dealer {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-bar--dealer .search-input-wrapper {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .home-trust__grid {
        grid-template-columns: 1fr;
    }

    .filter-bar--dealer {
        grid-template-columns: 1fr;
    }

    .vehicle-card-actions {
        grid-template-columns: 1fr;
    }
}

/* -------------------------------------------------------------------------
   Vehicle detail
   ------------------------------------------------------------------------- */

.vehicle-detail--dealer {
    padding-top: var(--nav-height);
    background: var(--color-bg-primary);
}

.vehicle-detail--dealer .vehicle-detail-container {
    padding: 1.5rem var(--space-page-x) 4rem;
}

.vehicle-detail--dealer .vehicle-layout {
    grid-template-columns: 1fr minmax(280px, 400px);
    gap: clamp(1.5rem, 3vw, 2.5rem);
}

.vehicle-specs-highlight {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.875rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.vehicle-specs-highlight__item {
    padding: 1.125rem 1.25rem;
    background: linear-gradient(180deg, #222228 0%, #1A1A1D 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.vehicle-specs-highlight__label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(229, 229, 229, 0.5);
    margin-bottom: 0.35rem;
}

.vehicle-specs-highlight__value {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.vehicle-sidebar--dealer .vehicle-sidebar-header {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1.25rem;
}

.vehicle-sidebar--dealer .vehicle-sidebar-price {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
}

.vehicle-cta--dealer .cta-buttons-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}

.vehicle-cta--dealer .btn {
    border-radius: 999px;
    justify-content: center;
}

.vehicle-cta--dealer > .btn + .btn,
.vehicle-cta--dealer > a.btn + a.btn {
    margin-top: 0.5rem;
}

.vehicle-cta--dealer .btn-buy-now {
    margin-top: 0.75rem;
}

.vehicle-related {
    margin-top: clamp(3rem, 6vw, 5rem);
    padding-top: clamp(2.5rem, 5vw, 4rem);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.vehicle-related__header {
    text-align: center;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.vehicle-related__title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 2.875rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.038em;
    line-height: 1.08;
}

.vehicle-related__grid {
    display: grid;
    align-items: stretch;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.25rem, 2.5vw, 2rem);
}

.vehicle-related__grid .vehicle-card--dealer .vehicle-card-actions {
    grid-template-columns: 1fr;
}

/* Vehicle page mobile: explicit section order (gallery → title/CTAs → chips → tabs → inquiry).
   Matches display:contents flattening from style.css ≤1200px; does not apply above 1200px. */
@media (max-width: 1200px) {
    .vehicle-detail--dealer .vehicle-layout {
        display: grid !important;
        grid-template-columns: 1fr !important;
        /* Override global 3-row rule so five template areas each get a row */
        grid-template-rows: repeat(5, minmax(0, auto)) !important;
        grid-template-areas:
            'gallery'
            'sidebar'
            'specs'
            'content'
            'inquiry' !important;
        gap: clamp(1.5rem, 3vw, 2.5rem) !important;
        align-items: start;
    }

    .vehicle-detail--dealer .vehicle-main {
        display: contents !important;
    }

    .vehicle-detail--dealer .vehicle-gallery {
        grid-area: gallery !important;
    }

    .vehicle-detail--dealer .vehicle-sidebar {
        grid-area: sidebar !important;
        position: static !important;
    }

    .vehicle-detail--dealer .vehicle-specs-highlight {
        grid-area: specs !important;
        margin-top: 0;
    }

    .vehicle-detail--dealer .vehicle-content {
        grid-area: content !important;
    }

    .vehicle-detail--dealer .vehicle-inquiry {
        grid-area: inquiry !important;
    }
}

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

/* Footer polish */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
