/* Structural safeguards loaded after each dealer template stylesheet. */
body.dealer-public[data-site-template][data-template-font="inter"] {
    --dealer-font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body.dealer-public[data-site-template][data-template-font="system"] {
    --dealer-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body.dealer-public[data-site-template][data-template-font="geometric"] {
    --dealer-font-family: "Avenir Next", "Century Gothic", Futura, "Segoe UI", sans-serif;
}

body.dealer-public[data-site-template][data-template-font="humanist"] {
    --dealer-font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

body.dealer-public[data-site-template][data-template-font="technical"] {
    --dealer-font-family: Bahnschrift, "DIN Alternate", "Arial Narrow", Arial, sans-serif;
}

body.dealer-public[data-site-template][data-template-font="condensed"] {
    --dealer-font-family: "Arial Narrow", "Roboto Condensed", Bahnschrift, Arial, sans-serif;
}

body.dealer-public[data-site-template][data-template-font="impact"] {
    --dealer-font-family: Impact, Haettenschweiler, "Arial Black", sans-serif;
}

body.dealer-public[data-site-template][data-template-font="rounded"] {
    --dealer-font-family: "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", sans-serif;
}

body.dealer-public[data-site-template][data-template-font="georgia"] {
    --dealer-font-family: Georgia, "Times New Roman", serif;
}

body.dealer-public[data-site-template][data-template-font="classic"] {
    --dealer-font-family: "Palatino Linotype", Palatino, Georgia, serif;
}

body.dealer-public[data-site-template][data-template-font="slab"] {
    --dealer-font-family: Rockwell, "Roboto Slab", "Courier New", Georgia, serif;
}

body.dealer-public[data-site-template][data-template-font="helvetica"] {
    --dealer-font-family: Helvetica, Arial, sans-serif;
}

body.dealer-public[data-site-template][data-template-font="baskerville"] {
    --dealer-font-family: Baskerville, "Baskerville Old Face", "Times New Roman", serif;
}

body.dealer-public[data-site-template][data-template-font="garamond"] {
    --dealer-font-family: Garamond, "Adobe Garamond Pro", Georgia, serif;
}

body.dealer-public[data-site-template][data-template-font="monospace"] {
    --dealer-font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
}

body.dealer-public[data-site-template][data-template-font="handwritten"] {
    --dealer-font-family: "Segoe Script", "Brush Script MT", cursive;
}

body.dealer-public[data-site-template][data-template-font] {
    font-family: var(--dealer-font-family);
    --dealer-theme-action: var(--dealer-accent, var(--dealer-primary, #155eef));
    --dealer-theme-action-contrast: var(--dealer-accent-contrast, #111827);
}

/* Dealer-selected hero copy color wins over template-specific headline and
   supporting-copy treatments without changing hero button colors. */
.dealer-public .dealer-hero-public .dealer-hero-copy > .text-uppercase,
.dealer-public .dealer-hero-public .dealer-hero-copy > h1,
.dealer-public .dealer-hero-public .dealer-hero-copy > h1 *,
.dealer-public .dealer-hero-public .dealer-hero-copy > .lead,
.dealer-public .dealer-hero-public .dealer-hero-copy > .lead * {
    color: var(--dealer-hero-text-color, #ffffff) !important;
}

/* Color safeguards for shared components that sit on light surfaces. Template
   colors remain intact; readable variants are generated server-side. */
.dealer-public .dealer-price,
.dealer-public .dealer-vdp-price,
.dealer-public .dealer-feature-section-kicker,
.dealer-public .apex-centered-heading > .dealer-feature-section-kicker,
.dealer-public .dealer-feature-section-heading > a,
.dealer-public .dealer-testimonials-heading > a,
.dealer-public .text-primary {
    color: var(--dealer-readable-primary, #0b4db8) !important;
}

.dealer-public .dealer-quick-link-card,
.dealer-public .dealer-quick-link-card:hover {
    color: #101828 !important;
}

.dealer-public .dealer-quick-link-label,
.dealer-public .dealer-quick-link-title {
    color: #25324a !important;
}

.dealer-public .dealer-quick-link-meta,
.dealer-public .dealer-quick-link-icon,
.dealer-public .dealer-quick-link-arrow,
.dealer-public .dealer-body-style-view-all,
.dealer-public .horizon-body-style-link {
    color: var(--dealer-readable-accent, #0b4db8) !important;
}

.dealer-public .btn-dealer,
.dealer-public [data-consent-accept] {
    border-color: var(--dealer-theme-action) !important;
    background: var(--dealer-theme-action) !important;
    color: var(--dealer-theme-action-contrast) !important;
}

.dealer-public .btn-outline-primary,
.dealer-public .btn-outline-secondary,
.dealer-public [data-compare] {
    border-color: var(--dealer-readable-primary, #0b4db8) !important;
    color: var(--dealer-readable-primary, #0b4db8) !important;
}

.dealer-public .btn-light {
    border-color: #68768a !important;
    background: #ffffff !important;
    color: #1f2937 !important;
}

.dealer-public .dealer-home-story .btn-dark {
    border-color: #212529 !important;
    background: #212529 !important;
    color: #ffffff !important;
}

.dealer-public .btn-check:checked + .btn-outline-primary {
    border-color: var(--dealer-theme-action) !important;
    background: var(--dealer-theme-action) !important;
    color: var(--dealer-theme-action-contrast) !important;
}

.dealer-public .dealer-badge-featured,
.dealer-public .dealer-badge-certified {
    background: var(--dealer-theme-action) !important;
    color: var(--dealer-theme-action-contrast) !important;
}

.dealer-public .dealer-vehicle-card .text-secondary,
.dealer-public .dealer-card-specs strong,
.dealer-public .dealer-testimonials-heading p,
.dealer-public .dealer-testimonials-heading span,
.dealer-public .dealer-testimonial-card small,
.dealer-public .dealer-home-story .h3,
.dealer-public .horizon-question strong,
.dealer-public .horizon-question small {
    color: #4f5d72 !important;
}

.dealer-public .dealer-footer .text-secondary,
.dealer-public .dealer-footer .btn-link.text-secondary {
    color: #d7e0ec !important;
}

.dealer-public .pas-consent-banner,
.dealer-public .pas-consent-banner p,
.dealer-public .pas-consent-banner strong {
    color: #25324a !important;
}

.dealer-public.template-aspen .dealer-navbar .nav-link.is-active {
    color: var(--dealer-readable-accent, #066aa3) !important;
}

.dealer-public.template-coastline .coastline-header-cta {
    color: #111827 !important;
}

.dealer-public.template-midnight .horizon-benefits-grid small {
    color: #59677d !important;
}

.dealer-public.template-revolt .revolt-section-heading p,
.dealer-public.template-revolt .revolt-section-heading a {
    color: #a33d00 !important;
}

.dealer-public.template-wanderlust .wanderlust-section-heading p {
    color: #96480f !important;
}

.dealer-public.template-wanderlust .dealer-navbar .nav-link.is-active {
    color: #f28b3b !important;
}

.dealer-public.template-revolt .dealer-public-alert,
.dealer-public.template-revolt .dealer-public-alert strong,
.dealer-public.template-revolt .dealer-public-alert span,
.dealer-public.template-velocity .dealer-public-alert,
.dealer-public.template-velocity .dealer-public-alert strong,
.dealer-public.template-velocity .dealer-public-alert span {
    color: #111827 !important;
}

/* Public notices must keep a stable high-contrast action regardless of the
   selected template's generic Bootstrap button overrides. */
.dealer-public .dealer-public-alert .dealer-alert-cta,
.dealer-public .dealer-public-alert .dealer-alert-cta:hover,
.dealer-public .dealer-public-alert .dealer-alert-cta:focus-visible {
    border-color: #0f172a !important;
    background: #0f172a !important;
    color: #ffffff !important;
}

/* The footer privacy reset is a link-styled button. Keep it on the same
   accessible dark-footer palette as the surrounding legal copy instead of
   Bootstrap's generic link tint. */
body.dealer-public .dealer-footer button.btn.btn-link.text-secondary[data-consent-reset] {
    color: #d7e0ec !important;
}

/* Exotiq intentionally uses dark cards and content bands, so its shared
   components need the inverse side of the accessible palette. */
.dealer-public.template-exotiq .dealer-feature-section-kicker,
.dealer-public.template-exotiq .dealer-feature-section-heading a,
.dealer-public.template-exotiq .dealer-testimonials-heading a {
    color: var(--dealer-accent, #c8ff00) !important;
}

.dealer-public.template-exotiq .dealer-vehicle-image > span:first-child {
    color: #4f5d72 !important;
}

.dealer-public.template-exotiq .dealer-vehicle-card .dealer-price,
.dealer-public.template-exotiq .dealer-vehicle-card .btn-outline-secondary,
.dealer-public.template-exotiq .dealer-vehicle-card [data-compare] {
    border-color: #cbd5e1 !important;
    color: #f7f8f8 !important;
}

.dealer-public.template-exotiq .dealer-vehicle-card .text-secondary,
.dealer-public.template-exotiq .dealer-testimonials-heading p,
.dealer-public.template-exotiq .dealer-testimonials-heading span,
.dealer-public.template-exotiq .dealer-testimonial-card small {
    color: #cbd5e1 !important;
}

body.dealer-public[data-template-hero-font="inter"] { --dealer-hero-font-family: Inter, "Segoe UI", Arial, sans-serif; }
body.dealer-public[data-template-hero-font="system"] { --dealer-hero-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
body.dealer-public[data-template-hero-font="geometric"] { --dealer-hero-font-family: "Avenir Next", "Century Gothic", Futura, "Segoe UI", sans-serif; }
body.dealer-public[data-template-hero-font="humanist"] { --dealer-hero-font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif; }
body.dealer-public[data-template-hero-font="technical"] { --dealer-hero-font-family: Bahnschrift, "DIN Alternate", "Arial Narrow", Arial, sans-serif; }
body.dealer-public[data-template-hero-font="condensed"] { --dealer-hero-font-family: "Arial Narrow", "Roboto Condensed", Bahnschrift, Arial, sans-serif; }
body.dealer-public[data-template-hero-font="impact"] { --dealer-hero-font-family: Impact, Haettenschweiler, "Arial Black", sans-serif; }
body.dealer-public[data-template-hero-font="rounded"] { --dealer-hero-font-family: "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", sans-serif; }
body.dealer-public[data-template-hero-font="georgia"] { --dealer-hero-font-family: Georgia, "Times New Roman", serif; }
body.dealer-public[data-template-hero-font="classic"] { --dealer-hero-font-family: "Palatino Linotype", Palatino, Georgia, serif; }
body.dealer-public[data-template-hero-font="slab"] { --dealer-hero-font-family: Rockwell, "Roboto Slab", "Courier New", Georgia, serif; }
body.dealer-public[data-template-hero-font="helvetica"] { --dealer-hero-font-family: Helvetica, Arial, sans-serif; }
body.dealer-public[data-template-hero-font="baskerville"] { --dealer-hero-font-family: Baskerville, "Baskerville Old Face", "Times New Roman", serif; }
body.dealer-public[data-template-hero-font="garamond"] { --dealer-hero-font-family: Garamond, "Adobe Garamond Pro", Georgia, serif; }
body.dealer-public[data-template-hero-font="monospace"] { --dealer-hero-font-family: "Cascadia Mono", Consolas, "Courier New", monospace; }
body.dealer-public[data-template-hero-font="handwritten"] { --dealer-hero-font-family: "Segoe Script", "Brush Script MT", cursive; }

body.dealer-public[data-template-hero-font] .dealer-hero-public h1,
body.dealer-public[data-template-hero-font] .vweb-hero h1 {
    font-family: var(--dealer-hero-font-family, var(--dealer-font-family));
}

.dealer-public .dealer-saved-nav-heart,
.dealer-public .dealer-saved-nav-heart svg {
    display: block;
    width: 22px !important;
    height: 22px !important;
    max-width: 22px;
    max-height: 22px;
    flex: 0 0 22px;
}

.dealer-public .dealer-navbar .navbar-brand,
.dealer-public .dealer-navbar .navbar-collapse,
.dealer-public .dealer-navbar .navbar-nav {
    min-width: 0;
}

.dealer-public .dealer-navbar .nav-link {
    max-width: 100%;
}

.dealer-public:not(.has-template-mobile-nav) .dealer-template-mobile-actions,
.dealer-public:not(.has-template-mobile-nav) .dealer-template-mobile-nav {
    display: none !important;
}

@media (max-width: 991.98px) {
    .dealer-public:not(.has-template-mobile-nav) .dealer-navbar > .container,
    .dealer-public:not(.has-template-mobile-nav) .dealer-navbar > .container-fluid {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: .75rem;
    }

    .dealer-public:not(.has-template-mobile-nav) .dealer-navbar .navbar-brand {
        order: 0;
        min-width: 0;
        margin-right: auto;
    }

    .dealer-public:not(.has-template-mobile-nav) .dealer-navbar .dealer-logo {
        width: auto !important;
        max-width: min(220px, calc(100vw - 100px)) !important;
        max-height: 64px !important;
        object-fit: contain;
    }

    .dealer-public:not(.has-template-mobile-nav) .dealer-navbar .navbar-toggler {
        order: 1;
        width: 44px;
        min-width: 44px;
        height: 44px;
        margin-left: auto;
    }

    .dealer-public:not(.has-template-mobile-nav) .dealer-navbar #dealerNav {
        order: 2;
        width: 100%;
        flex-basis: 100%;
    }

    .dealer-public .dealer-hero-slide h1,
    .dealer-public .dealer-hero-slide h1 > span {
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 430px) {
    .dealer-public .dealer-saved-nav-heart,
    .dealer-public .dealer-saved-nav-heart svg {
        width: 20px !important;
        height: 20px !important;
        max-width: 20px;
        max-height: 20px;
        flex-basis: 20px;
    }
}
