/* ── Base ─────────────────────────────────────────────────────────────── */
body {
    background-color: #0f1117;
    color: #e0e0e0;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .font-display {
    font-family: 'Oswald', sans-serif;
}

/* ── Navbar ───────────────────────────────────────────────────────────── */
.navbar {
    background-color: rgba(10,12,18,.97) !important;
    border-bottom: 1px solid #2a2a3a;
    transition: box-shadow .3s, backdrop-filter .3s;
}
.navbar-brand img { height: 36px; }
.nav-link {
    color: #aaa !important;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .15em;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}
.nav-link:hover, .nav-link.active { color: #e63946 !important; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn-primary {
    background-color: #e63946;
    border-color: #e63946;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: .15em;
}
.btn-primary:hover { background-color: #c1121f; border-color: #c1121f; }
.btn-outline-primary {
    color: #e63946;
    border-color: #e63946;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: .15em;
}
.btn-outline-primary:hover { background-color: #e63946; border-color: #e63946; color: #fff; }
.btn-outline-secondary { color: #aaa; border-color: #2a2a3a; }
.btn-outline-secondary:hover { background: #2a2a3a; color: #e0e0e0; border-color: #2a2a3a; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-control,
.form-select {
    background-color: #1a1d27;
    border-color: #2a2a3a;
    color: #e0e0e0;
    font-family: 'Inter', sans-serif;
}
.form-control:focus,
.form-select:focus {
    background-color: #1a1d27;
    border-color: #e63946;
    color: #e0e0e0;
    box-shadow: 0 0 0 .2rem rgba(230,57,70,.2);
}
.form-control::placeholder { color: rgba(170,170,170,.4); }
.form-select option { background-color: #1a1d27; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
    background-color: #1a1d27;
    border-color: #2a2a3a;
    transition: border-color .3s;
}
.card-img-top { height: 200px; object-fit: cover; }
.card-title { font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: .05em; }

/* Car card hover */
.car-card:hover { border-color: rgba(230,57,70,.4) !important; }
.car-card:hover img { transform: scale(1.04); }
.car-card:hover .car-card-cta { background: #e63946 !important; border-color: #e63946 !important; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.table { color: #e0e0e0; }
.table-dark { --bs-table-bg: #1a1d27; --bs-table-border-color: #2a2a3a; }

/* ── Badges ───────────────────────────────────────────────────────────── */
.badge-fuel  { background-color: rgba(230,57,70,.15); color: #e63946; }
.badge-year  { background-color: #2a2a3a; color: #aaa; }

/* ── Misc overrides ───────────────────────────────────────────────────── */
.text-primary { color: #e63946 !important; }
.hero { background: linear-gradient(to bottom, #0a0c12, #0f1117); min-height: 100vh; }

/* ── Footer ───────────────────────────────────────────────────────────── */
footer { background-color: #0a0c12; border-top: 1px solid #2a2a3a; }
footer a { color: #aaa; text-decoration: none; }
footer a:hover { color: #e63946; }

/* ── Catalogue ────────────────────────────────────────────────────────── */
#catalog-results { transition: opacity .2s; }

/* ── Gallery (car detail) ─────────────────────────────────────────────── */
#gallery .carousel-control-prev,
#gallery .carousel-control-next {
    opacity: 0;
    transition: opacity .2s;
}
#gallery:hover .carousel-control-prev,
#gallery:hover .carousel-control-next { opacity: 1; }
#gallery .thumb-active { border-color: #e63946 !important; }

/* ── Cookie banner ────────────────────────────────────────────────────── */
#cookie-banner { display: none; }

/* ── Car Card — componente ────────────────────────────────────────────── */
.car-card-img-wrap {
    aspect-ratio: 4/3;
    background: #000;
    overflow: hidden;
    position: relative;
}
.car-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
}
.car-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #12141e;
    color: rgba(255,255,255,.25);
    font-size: 3rem;
}
.car-card-badge-wrap {
    position: absolute;
    top: .75rem;
    left: .75rem;
    z-index: 2;
}
.car-card-badge {
    font-size: .55rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-family: 'Oswald', sans-serif;
    background: rgba(230,57,70,.9);
    color: #fff;
    padding: .2rem .5rem;
    border-radius: .25rem;
    font-weight: 700;
}
.car-card-title {
    font-size: 1.3rem;
    letter-spacing: .03em;
    line-height: 1.1;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    font-weight: 700;
    color: #fff;
    margin-bottom: .25rem;
}
.car-card-model { font-size: 1rem; line-height: 1; }
.car-card-price {
    font-size: 1.1rem;
    font-family: 'Oswald', sans-serif;
    font-weight: 900;
    color: #fff;
}
.car-card-year {
    font-size: .55rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: .2rem;
}
.car-card-specs {
    border-top: 1px solid rgba(255,255,255,.07);
}
.car-card-spec-label {
    font-size: .5rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 700;
    color: #9ca3af;
    margin-bottom: .2rem;
}
.car-card-spec-value {
    font-size: .7rem;
    font-weight: 500;
    color: #fff;
}
.car-card-cta {
    font-size: .65rem;
    letter-spacing: .2em;
    font-family: 'Oswald', sans-serif;
    background: #1a1d27;
    border: 1px solid #2a2a3a;
    transition: background .2s, border-color .2s, color .2s;
}

/* ── Favorites ────────────────────────────────────────────────────────── */
.fav-btn {
    position: absolute;
    top: .6rem; right: .6rem;
    z-index: 3;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(10,12,18,.72);
    backdrop-filter: blur(4px);
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s, color .2s, transform .2s;
    font-size: .9rem;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}
.fav-btn:hover { background: rgba(10,12,18,.92); color: #e63946; transform: scale(1.1); }
.fav-btn--active { color: #e63946 !important; }
.fav-btn--active:hover { color: #c1121f !important; }

/* Badge do navbar */
.fav-nav-link .fav-count {
    font-family: 'Inter', sans-serif;
}

/* ── Show page ────────────────────────────────────────────────────────── */

/* Título da viatura (h1 coluna direita) */
.car-show-title {
    font-size: 1.8rem;
    line-height: 1.1;
    letter-spacing: .03em;
    font-weight: 900;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: .75rem;
}

/* Cabeçalho de secção dos cards de detalhes */
.card-section-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .15em;
    color: #e63946;
    margin-bottom: .75rem;
}

/* Label de spec (Ano, Km, etc.) */
.spec-label {
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    color: #9ca3af;
    margin-bottom: .25rem;
}

/* Caixa de preço */
.price-box {
    background: #0f1117;
    border-radius: .375rem;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
}
.price-box .price-label {
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    color: #9ca3af;
    margin-bottom: .25rem;
}
.price-box .price-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    font-family: monospace;
    margin-bottom: .2rem;
}
.price-box .price-note { font-size: .65rem; color: #9ca3af; margin: 0; }

/* Trust icons (garantia / financiamento) */
.trust-icon-wrap {
    padding: .5rem;
    border-radius: .375rem;
    background: rgba(230,57,70,.1);
    color: #e63946;
    flex-shrink: 0;
}

/* Feature list bullet */
.feature-dot {
    width: 6px;
    height: 6px;
    flex-shrink: 0;
    background: #e63946;
    border-radius: 50%;
    display: inline-block;
}

/* Gallery thumbs bar */
.gallery-thumbs {
    background: #12141e;
    overflow-x: auto;
}
.gallery-thumb {
    width: 64px;
    height: 48px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: border-color .2s;
}

/* Back to catalogue link */
.back-link {
    letter-spacing: .08em;
    color: #9ca3af;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* ── WhatsApp Floating Button ─────────────────────────────────────────── */
.wa-float {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10500;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: #25D366;
    color: #fff;
    border-radius: 50px;
    padding: .75rem 1.25rem .75rem .9rem;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(37,211,102,.3);
    transition: background .2s, box-shadow .2s, bottom .3s ease, transform .2s;
    animation: wa-enter .45s cubic-bezier(.34,1.56,.64,1) both;
    animation-delay: .6s; /* espera que a página carregue antes de entrar */
    opacity: 0;           /* começa invisível — a animação faz o fade-in */
}
.wa-float:hover, .wa-float:focus-visible {
    background: #1ebe5d;
    box-shadow: 0 6px 28px rgba(37,211,102,.45);
    color: #fff;
    transform: translateY(-3px);
    outline: none;
}
.wa-float__label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-family: 'Oswald', sans-serif;
    white-space: nowrap;
}
/* Move acima do cookie banner quando este está visível */
.wa-float--lifted { bottom: 6.5rem; }

/* Mobile: apenas ícone circular */
@media (max-width: 575px) {
    .wa-float { padding: .85rem; border-radius: 50%; }
    .wa-float__label { display: none; }
}

@keyframes wa-enter {
    from { opacity: 0; transform: scale(.5) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Price Range Slider ───────────────────────────────────────────────── */
.price-range-widget { user-select: none; }

.price-slider-wrap {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
}
.price-slider-track {
    position: absolute;
    left: 0; right: 0;
    height: 4px;
    background: #2a2a3a;
    border-radius: 2px;
    pointer-events: none;
}
.price-slider-fill {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 100%;
    background: #e63946;
    border-radius: 2px;
}
.price-slider-wrap input[type="range"] {
    position: absolute;
    width: 100%; left: 0;
    top: 50%; transform: translateY(-50%);
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    margin: 0;
    height: 28px;
    outline: none;
}
.price-slider-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid #e63946;
    cursor: pointer;
    pointer-events: auto;
    position: relative; z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
    transition: transform .15s, box-shadow .15s;
}
.price-slider-wrap input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.18);
    box-shadow: 0 2px 8px rgba(230,57,70,.4);
}
.price-slider-wrap input[type="range"]::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid #e63946;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.price-slider-wrap input[type="range"]::-webkit-slider-runnable-track { background: transparent; }
.price-slider-wrap input[type="range"]::-moz-range-track { background: transparent; }

/* ── Scrollbar ────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

/* ── Toast notifications ──────────────────────────────────────────────── */
.app-toast {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    background: #1a1d27;
    border: 1px solid #2a2a3a;
    border-radius: .5rem;
    padding: 1rem 1.1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,.45);
    pointer-events: all;
    animation: toast-in .3s cubic-bezier(.21,1.02,.73,1) forwards;
    border-left-width: 4px;
}
.app-toast.toast-success { border-left-color: #22c55e; }
.app-toast.toast-warning { border-left-color: #f59e0b; }
.app-toast.toast-error   { border-left-color: #ef4444; }
.app-toast.toast-out     { animation: toast-out .25s ease-in forwards; }
.app-toast .toast-icon   { font-size: 1.15rem; flex-shrink: 0; margin-top: .05rem; }
.app-toast.toast-success .toast-icon { color: #22c55e; }
.app-toast.toast-warning .toast-icon { color: #f59e0b; }
.app-toast.toast-error   .toast-icon { color: #ef4444; }
.app-toast .toast-body   { flex: 1; }
.app-toast .toast-title  { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .2rem; }
.app-toast.toast-success .toast-title { color: #22c55e; }
.app-toast.toast-warning .toast-title { color: #f59e0b; }
.app-toast.toast-error   .toast-title { color: #ef4444; }
.app-toast .toast-msg    { font-size: .8rem; color: #c8cad8; line-height: 1.5; margin: 0; }
.app-toast .toast-close  { background: none; border: none; color: #555; font-size: .9rem; cursor: pointer; padding: 0; flex-shrink: 0; line-height: 1; transition: color .15s; }
.app-toast .toast-close:hover { color: #aaa; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(8px) scale(.96); } }

/* ── Descrição Quill — conteúdo HTML renderizado no site público ──────── */
.car-description {
    font-size: .9rem;
    line-height: 1.75;
}
.car-description p  { margin-bottom: .6rem; }
.car-description strong { color: #e0e0e0; font-weight: 700; }
.car-description em     { font-style: italic; }
.car-description s      { text-decoration: line-through; opacity: .75; }
.car-description u      { text-decoration: underline; }
.car-description ul,
.car-description ol {
    padding-left: 1.4rem;
    margin-bottom: .6rem;
}
.car-description li { margin-bottom: .25rem; }

/* ── Share bar — página de detalhe do carro ───────────────────────────── */
.share-bar {
    border-top: 1px solid #2a2a3a;
    padding-top: .75rem;
}
.share-bar-label {
    font-size: .55rem;
    text-transform: uppercase;
    letter-spacing: .15em;
    font-weight: 700;
    color: #6c757d;
    margin-bottom: .5rem;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    flex: 1;
    justify-content: center;
    padding: .45rem .5rem;
    border-radius: .375rem;
    font-size: .65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}
.share-btn-facebook {
    background: rgba(24,119,242,.1);
    border-color: rgba(24,119,242,.25);
    color: #4a90d9;
}
.share-btn-facebook:hover {
    background: rgba(24,119,242,.2);
    border-color: rgba(24,119,242,.5);
    color: #4a90d9;
}
.share-btn-whatsapp {
    background: rgba(37,211,102,.1);
    border-color: rgba(37,211,102,.25);
    color: #25d366;
}
.share-btn-whatsapp:hover {
    background: rgba(37,211,102,.2);
    border-color: rgba(37,211,102,.5);
    color: #25d366;
}
.share-btn-copy {
    background: rgba(255,255,255,.05);
    border-color: rgba(255,255,255,.1);
    color: #adb5bd;
}
.share-btn-copy:hover {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.2);
    color: #fff;
}
.share-btn-copy.copied {
    background: rgba(37,211,102,.1);
    border-color: rgba(37,211,102,.3);
    color: #25d366;
}

/* ── Share bar — responsive ──────────────────────────────────────────── */
@media (max-width: 575px) {
    /* Mobile: botões com só ícone + label curto */
    .share-btn span { display: none; }
    .share-btn { padding: .5rem; flex: 1; }
}
@media (min-width: 576px) and (max-width: 991px) {
    /* Tablet: reduz padding para caber os 3 botões */
    .share-btn { padding: .4rem .4rem; font-size: .6rem; }
}
