/*
 * Site público das lojas (home, estoque e contato). Complementa o
 * style.css do template da página do veículo, que já define
 * --brand-primary / --brand-secondary, .btn-brand, .header-default e .logo.
 */

body {
    background: #f6f7f9;
}

/* ======= ACESSIBILIDADE ======= */
/* Foco sempre visível no teclado (o Bootstrap tira o outline dos campos). */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
[role="button"]:focus-visible {
    outline: 3px solid var(--brand-primary);
    outline-offset: 2px;
}

.site-skip-link:focus {
    position: fixed;
    top: .5rem;
    left: .5rem;
    z-index: 2000;
    padding: .5rem 1rem;
    border-radius: .5rem;
    background: #fff;
    color: #111;
    box-shadow: 0 6px 20px rgba(16, 24, 40, .25);
}

/* Texto sobre a cor do tema: o resolver calcula preto ou branco pelo
   contraste (--brand-on-primary); cor clara no tema não some mais. */
.btn-brand,
.btn-brand:hover,
.btn-brand:focus {
    color: var(--brand-on-primary, #fff);
}

.site-nav {
    gap: 1.5rem;
}

.site-nav .nav-link {
    color: #1f2937;
    font-weight: 600;
    font-size: .9rem;
    padding: .25rem 0;
}

.site-nav .nav-link:hover,
.site-nav .nav-link.active {
    color: var(--brand-primary);
}

/* ======= HERO ======= */
.site-hero {
    background: linear-gradient(135deg, var(--brand-secondary) 0%, #1f2937 100%);
    color: #fff;
}

/* Texto pequeno na cor do tema sobre o fundo escuro ficava abaixo de 4,5:1;
   a cor do tema vai para o traço ao lado. */
.site-hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, .92);
    border-left: 3px solid var(--brand-primary);
    padding-left: .5rem;
    margin: 0;
}

.site-hero-title {
    font-size: clamp(1.9rem, 3vw + .5rem, 3rem);
    font-weight: 800;
    line-height: 1.1;
}

.site-hero-text {
    color: rgba(255, 255, 255, .75);
    max-width: 46ch;
}

.site-search .form-control,
.site-search .input-group-text {
    border: none;
    padding-top: .75rem;
    padding-bottom: .75rem;
}

.site-search .form-control:focus {
    box-shadow: none;
}

/* O campo não tem borda nem sombra no foco: o contorno vai no grupo. */
.site-search .input-group:focus-within {
    outline: 3px solid var(--brand-primary);
    outline-offset: 3px;
    border-radius: .5rem;
}

.site-chip {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-weight: 600;
    padding: .5rem .85rem;
    border-radius: 999px;
    text-decoration: none;
}

.site-chip:hover {
    background: var(--brand-primary);
    color: var(--brand-on-primary, #fff);
}

.site-chip-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .35);
}

.site-hero-card {
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.site-benefits li {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .6rem 0;
    font-size: .875rem;
    color: rgba(255, 255, 255, .75);
}

.site-benefits li + li {
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.site-benefits i {
    color: var(--brand-primary);
    font-size: 1.1rem;
    line-height: 1.4;
}

.site-benefits strong {
    color: #fff;
}

/* ======= SEÇÕES ======= */
.site-section-title {
    font-size: clamp(1.25rem, 1vw + 1rem, 1.75rem);
    font-weight: 700;
    color: var(--brand-secondary);
    margin: 0;
}

/* ======= CARD DE VEÍCULO ======= */
.vehicle-card {
    border: 1px solid #e9edf2;
    border-radius: 16px;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}

.vehicle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(16, 24, 40, .12);
}

.vehicle-card-media {
    position: relative;
    background: #eef1f5;
}

.vehicle-card-media img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.vehicle-card-badge {
    position: absolute;
    top: .75rem;
    left: .75rem;
    background: var(--brand-primary);
    color: var(--brand-on-primary, #fff);
    font-weight: 600;
}

.vehicle-card-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--brand-secondary);
    line-height: 1.3;
}

/* #939393 dava 3,07:1 sobre o branco; #6b7280 passa de 4,5:1. */
.vehicle-card-version {
    font-size: .78rem;
    font-weight: 600;
    color: #6b7280;
    min-height: 2.1em;
}

.vehicle-card-price {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--brand-secondary);
}

.vehicle-card-specs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem .75rem;
    font-size: .78rem;
    color: #6b7280;
}

.vehicle-card-specs li {
    display: flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
}

.vehicle-card-specs li span,
.vehicle-card-specs li {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vehicle-card-specs i {
    color: var(--brand-primary);
    flex: 0 0 auto;
}

/* ======= CATEGORIAS ======= */
.site-category {
    position: relative;
    display: block;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    background: #111;
    height: 148px;
}

.site-category img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .62;
    transition: opacity .15s ease, transform .15s ease;
}

.site-category:hover img {
    opacity: .5;
    transform: scale(1.03);
}

/* Degradê escuro atrás do texto: sobre foto clara o branco sumia. */
.site-category::after {
    content: "";
    position: absolute;
    inset: 40% 0 0 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .78) 100%);
    pointer-events: none;
}

.site-category-body {
    position: absolute;
    left: 1rem;
    bottom: .85rem;
    z-index: 1;
    color: #fff;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

.site-category-body strong {
    font-size: 1.05rem;
}

.site-category-body small {
    opacity: .8;
    font-size: .75rem;
}

/* ======= FILTROS ======= */
.site-filters {
    background: #fff;
    border: 1px solid #e9edf2;
    border-radius: 16px;
    padding: 1.25rem;
    position: sticky;
    top: 84px;
}

.site-filters .form-label {
    font-size: .78rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: .25rem;
}

/* ======= ESTADOS ======= */
.site-empty {
    background: #fff;
    border: 1px dashed #d7dde5;
    border-radius: 16px;
    padding: 3rem 1.5rem;
}

.site-empty i {
    font-size: 2.5rem;
    color: #c3cbd6;
}

/* ======= CTA ======= */
.site-cta {
    background: linear-gradient(135deg, var(--brand-secondary) 0%, #1f2937 100%);
    color: #fff;
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: center;
    justify-content: space-between;
}

/* ======= CONTATO ======= */
.site-contact-card {
    border: 1px solid #e9edf2;
    border-radius: 16px;
}

.site-map iframe {
    border: 0;
    border-radius: 16px;
}

/* Mapa sob demanda: o espaço fica reservado até a pessoa pedir. */
.site-map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    text-align: center;
    padding: 1.5rem;
    background: #eef1f5;
    border-radius: 16px;
    color: #374151;
}

.site-map-placeholder i {
    font-size: 2rem;
    color: var(--brand-primary);
}

.site-load-more {
    min-width: 12rem;
}

/* ======= RODAPÉ ======= */
.site-footer {
    background: var(--brand-secondary);
    color: #fff;
}

.footer-links li {
    margin-bottom: .5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, .7);
    text-decoration: none;
}

.footer-links a:hover {
    color: #fff;
}

/* ======= CONSENTIMENTO (LGPD) ======= */
.site-consent {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 1050;
    background: var(--brand-secondary);
    color: #fff;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.25rem;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 12px 30px rgba(16, 24, 40, .28);
    font-size: .85rem;
}

.site-consent-actions {
    display: flex;
    gap: .5rem;
    flex: 0 0 auto;
}

.site-consent a {
    color: #fff;
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    .site-consent {
        bottom: 5rem;
    }
}

/* ======= WHATSAPP FLUTUANTE ======= */
.whatsapp-float {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    /* Verde escuro do WhatsApp: o #25d366 com ícone branco dava 1,98:1. */
    background: #128c7e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 8px 20px rgba(16, 24, 40, .25);
    z-index: 1040;
    text-decoration: none;
}

.whatsapp-float:hover {
    color: #fff;
    filter: brightness(.95);
}

@media (max-width: 991.98px) {
    .site-filters {
        position: static;
    }
}

/* ======= AJUSTES DE LAYOUT ======= */

/* O cabeçalho é sticky: âncoras (#conteudo e links internos) paravam por baixo dele. */
html {
    scroll-padding-top: 4.5rem;
}

/* O <img> do card leva width/height (560x420) para reservar o espaço. Sem
   height: auto, a altura do atributo vencia, o aspect-ratio era ignorado e a
   foto saía em retrato, cortada pelo object-fit. */
.vehicle-card-media img {
    height: auto;
}

/* Poucos destaques (1 ou 2): card horizontal a partir do tablet, para a
   grade de 4 colunas não ficar com um card sozinho na primeira coluna. */
@media (min-width: 768px) {
    .vehicle-card--wide {
        flex-direction: row;
    }

    .vehicle-card--wide .vehicle-card-media {
        flex: 0 0 46%;
        max-width: 46%;
        min-height: 20rem;
    }

    /* A foto preenche a coluna inteira, qualquer que seja a altura do texto. */
    .vehicle-card--wide .vehicle-card-media img {
        position: absolute;
        inset: 0;
        height: 100%;
        aspect-ratio: auto;
    }

    /* min-width: 0 deixa o texto encolher; sem isso, dois cards lado a lado
       empurravam o botão "Tenho interesse" para fora do card. */
    .vehicle-card--wide .card-body {
        min-width: 0;
        padding: 1.75rem 2rem;
    }

    .vehicle-card--wide .vehicle-card-title {
        font-size: 1.35rem;
    }

    .vehicle-card--wide .vehicle-card-version {
        font-size: .9rem;
        min-height: 0;
    }

    .vehicle-card--wide .vehicle-card-price {
        font-size: 2rem;
    }

    .vehicle-card--wide .vehicle-card-specs {
        grid-template-columns: repeat(2, minmax(0, 14rem));
        gap: .5rem 1.5rem;
        font-size: .9rem;
    }

    .vehicle-card--wide .vehicle-card-actions {
        grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
        max-width: 30rem;
    }
}
