/* ==========================================================================
   International Cars — stile custom sopra Bootstrap 5
   Palette chiara (§4): bianco/grigio chiarissimo, testo antracite,
   un solo accento rosso (dal logo), card con ombre leggere.
   ========================================================================== */

:root {
    --ic-accent: #b0182a;          /* rosso desaturato dal logo */
    --ic-accent-dark: #8e1322;
    --ic-accent-soft: #fbeef0;
    --ic-ink: #2b2f33;             /* antracite, non nero puro */
    --ic-ink-soft: #5b6167;
    --ic-bg: #f7f8fa;
    --ic-card-shadow: 0 1px 3px rgba(20, 24, 30, .06), 0 6px 20px rgba(20, 24, 30, .07);
    --ic-card-shadow-hover: 0 4px 10px rgba(20, 24, 30, .1), 0 14px 34px rgba(20, 24, 30, .12);
}

body {
    color: var(--ic-ink);
    background: var(--ic-bg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

a { color: var(--ic-accent); }
a:hover { color: var(--ic-accent-dark); }

/* --- Bottoni accento (unico colore CTA) --- */
.btn-accent {
    --bs-btn-bg: var(--ic-accent);
    --bs-btn-border-color: var(--ic-accent);
    --bs-btn-hover-bg: var(--ic-accent-dark);
    --bs-btn-hover-border-color: var(--ic-accent-dark);
    --bs-btn-active-bg: var(--ic-accent-dark);
    --bs-btn-active-border-color: var(--ic-accent-dark);
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
}
.btn-outline-accent {
    --bs-btn-color: var(--ic-accent);
    --bs-btn-border-color: var(--ic-accent);
    --bs-btn-hover-bg: var(--ic-accent);
    --bs-btn-hover-border-color: var(--ic-accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--ic-accent);
    --bs-btn-active-color: #fff;
}
.btn-whatsapp {
    --bs-btn-bg: #25d366;
    --bs-btn-border-color: #25d366;
    --bs-btn-hover-bg: #1eb457;
    --bs-btn-hover-border-color: #1eb457;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #1eb457;
    --bs-btn-active-color: #fff;
}

/* --- Header --- */
.topbar { background: #fff; border-bottom: 1px solid #eef0f2; }
.topbar-link { color: var(--ic-ink-soft); text-decoration: none; font-size: .875rem; }
.topbar-link:hover { color: var(--ic-accent); }
.topbar-link.wa i { color: #25d366; }
.navbar .nav-link { color: var(--ic-ink); font-weight: 500; }
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--ic-accent); }

/* --- Badge recensioni Google (topbar/footer) --- */
.google-rating-badge {
    display: inline-flex; align-items: center; gap: .35rem;
    color: var(--ic-ink-soft); text-decoration: none; font-size: .8125rem;
}
a.google-rating-badge:hover { color: var(--ic-ink); }
.google-rating-badge > .bi-google { color: #4285f4; font-size: .9em; }
.google-rating-badge .grb-stars { color: #fbbc04; letter-spacing: -1px; font-size: .7rem; }
.google-rating-badge strong { color: var(--ic-ink); }
.google-rating-badge .grb-count { color: var(--ic-ink-soft); }
.site-footer .google-rating-badge,
.site-footer .google-rating-badge strong { color: #cfd4d9; }
.site-footer a.google-rating-badge:hover { color: #fff; }

/* --- Hero --- */
.hero {
    position: relative;
    background: #14181d;
    color: #fff;
    overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center 65%;
    opacity: .55;
}
.hero-content { position: relative; padding: 5.5rem 0; }
@media (max-width: 767px) { .hero-content { padding: 3.5rem 0; } }
.hero h1 { font-weight: 700; text-shadow: 0 2px 14px rgba(0,0,0,.45); }
.hero p { text-shadow: 0 1px 8px rgba(0,0,0,.5); }

/* --- Barra ricerca rapida --- */
.search-bar {
    background: #fff;
    border-radius: .75rem;
    box-shadow: var(--ic-card-shadow);
}

/* --- Card veicolo --- */
.vehicle-card {
    background: #fff;
    border: 0;
    border-radius: .75rem;
    overflow: hidden;
    box-shadow: var(--ic-card-shadow);
    transition: box-shadow .18s ease, transform .18s ease;
    height: 100%;
}
.vehicle-card:hover { box-shadow: var(--ic-card-shadow-hover); transform: translateY(-3px); }
.vehicle-card .card-img-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #e9ecef;
    overflow: hidden;
}
.vehicle-card .card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-card .price { color: var(--ic-accent); font-weight: 700; font-size: 1.25rem; }
.vehicle-card .list-price { color: var(--ic-ink-soft); text-decoration: line-through; font-size: .875rem; }
.vehicle-card .specs { color: var(--ic-ink-soft); font-size: .8125rem; }
.vehicle-card .specs i { width: 1.1rem; text-align: center; color: var(--ic-accent); }
.vehicle-card .specs svg { width: .95rem; height: .95rem; color: var(--ic-accent); vertical-align: -0.15em; }
.vehicle-card a.stretched { text-decoration: none; color: inherit; }

.badge-status {
    position: absolute; top: .75rem; left: .75rem;
    font-size: .75rem; font-weight: 600;
    padding: .35rem .6rem; border-radius: .375rem;
}
.badge-status.nuova   { background: var(--ic-ink); color: #fff; }
.badge-status.km0     { background: #fff; color: var(--ic-ink); }
.badge-status.offerta { background: var(--ic-accent); color: #fff; }
.badge-status.venduto { background: #dc3545; color: #fff; }
.badge-photos {
    position: absolute; bottom: .6rem; right: .6rem;
    background: rgba(20,24,29,.7); color: #fff;
    font-size: .75rem; padding: .2rem .5rem; border-radius: .375rem;
}

/* --- Sidebar filtri --- */
.filter-card {
    background: #fff; border-radius: .75rem;
    box-shadow: var(--ic-card-shadow);
}
.filter-card .form-label { font-size: .8125rem; font-weight: 600; color: var(--ic-ink-soft); margin-bottom: .25rem; }

/* --- Scheda veicolo: galleria pattern TirCar (§5.3.1) --- */
.gallery-main {
    position: relative;
    border-radius: .75rem;
    overflow: hidden;
    background: #14181d;
    aspect-ratio: 4 / 3;
    cursor: zoom-in;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-counter {
    position: absolute; bottom: .75rem; right: .75rem;
    background: rgba(20,24,29,.75); color: #fff;
    font-size: .875rem; font-weight: 600;
    padding: .25rem .7rem; border-radius: 2rem;
}
.gallery-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,.85); border: 0;
    width: 2.6rem; height: 2.6rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; color: var(--ic-ink);
    transition: background .15s;
}
.gallery-nav:hover { background: #fff; }
.gallery-nav.prev { left: .75rem; }
.gallery-nav.next { right: .75rem; }
.thumbs-strip {
    display: flex; gap: .5rem;
    overflow-x: auto; padding: .65rem .1rem;
    scrollbar-width: thin;
}
.thumbs-strip .thumb {
    flex: 0 0 auto; width: 96px; aspect-ratio: 4 / 3;
    border-radius: .5rem; overflow: hidden;
    border: 2px solid transparent; cursor: pointer;
    opacity: .75; transition: opacity .15s, border-color .15s;
    padding: 0; background: #e9ecef;
}
.thumbs-strip .thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumbs-strip .thumb.active { border-color: var(--ic-accent); opacity: 1; }
.thumbs-strip .thumb:hover { opacity: 1; }

/* Lightbox fullscreen */
.lightbox {
    position: fixed; inset: 0; z-index: 1080;
    background: rgba(10, 12, 15, .96);
    display: flex; align-items: center; justify-content: center;
}
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; }
.lightbox .gallery-counter { top: 1rem; right: auto; left: 50%; transform: translateX(-50%); bottom: auto; }
.lightbox-close {
    position: absolute; top: 1rem; right: 1rem;
    background: transparent; border: 0; color: #fff; font-size: 2rem; line-height: 1;
}

/* --- Dati rapidi a icone (§5.3 punto 4) --- */
.quick-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: .5rem;
}
.quick-fact {
    background: #fff; border-radius: .6rem;
    box-shadow: var(--ic-card-shadow);
    text-align: center; padding: .8rem .4rem;
}
.quick-fact i { font-size: 1.3rem; color: var(--ic-accent); }
.quick-fact svg { width: 1.55rem; height: 1.55rem; color: var(--ic-accent); vertical-align: -0.55em; }
.quick-fact .qf-label { font-size: .6875rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ic-ink-soft); }
.quick-fact .qf-value { font-size: .875rem; font-weight: 600; }

/* --- Scheda tecnica --- */
.tech-table th { width: 45%; font-weight: 500; color: var(--ic-ink-soft); }
.optional-badge {
    display: inline-block;
    background: #fff; border: 1px solid #e6e8eb;
    border-radius: 2rem; padding: .3rem .75rem;
    font-size: .8125rem; margin: 0 .35rem .5rem 0;
}
.optional-badge i { color: var(--ic-accent); }

/* --- CTA persistente mobile (§5.3 punto 9) --- */
.sticky-cta {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030;
    background: #fff; border-top: 1px solid #e6e8eb;
    padding: .6rem .75rem;
    box-shadow: 0 -4px 16px rgba(20,24,30,.08);
    transition: transform .25s ease;
}
/* nasconde la barra quando il footer è visibile (altrimenti lo copre / lo rende
   illeggibile): la mostra di nuovo se si risale prima di raggiungere il footer */
.sticky-cta.sticky-cta--hidden { transform: translateY(100%); }
@media (min-width: 992px) { .sticky-cta { display: none; } }
body.has-sticky-cta { padding-bottom: 72px; }
@media (min-width: 992px) { body.has-sticky-cta { padding-bottom: 0; } }

/* --- Sezioni home --- */
.section-title { font-weight: 700; }
.section-title::after {
    content: ""; display: block; width: 56px; height: 4px;
    background: var(--ic-accent); border-radius: 2px; margin-top: .5rem;
}
.service-card {
    background: #fff; border-radius: .75rem;
    box-shadow: var(--ic-card-shadow);
    padding: 1.5rem; height: 100%;
    transition: box-shadow .18s, transform .18s;
}
.service-card:hover { box-shadow: var(--ic-card-shadow-hover); transform: translateY(-3px); }
.service-card i { font-size: 1.9rem; color: var(--ic-accent); }

.permuta-section { background: #fff; }

/* --- Footer --- */
.site-footer { background: #191d22; color: #cfd4d9; }
.site-footer a { color: #cfd4d9; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-title { color: #fff; font-size: .875rem; text-transform: uppercase; letter-spacing: .05em; }

/* --- Orari di apertura giorno per giorno (footer, contatti, chi siamo) --- */
.opening-hours-list {
    display: grid; grid-template-columns: auto 1fr;
    column-gap: 1rem; row-gap: .2rem;
    font-size: .8125rem;
}
.opening-hours-list dt { font-weight: 600; margin: 0; }
.opening-hours-list dd { margin: 0; text-align: right; }
.site-footer .opening-hours-list dt { color: #fff; }

/* --- Cookie banner --- */
.cookie-banner {
    position: fixed; bottom: 1rem; left: 1rem; z-index: 1090;
    max-width: 420px; width: calc(100% - 2rem);
}
.cookie-banner-inner {
    background: #fff; border-radius: .75rem; padding: 1.1rem 1.25rem;
}

/* --- Paginazione --- */
.pagination .page-link { color: var(--ic-ink); }
.pagination .page-item.active .page-link {
    background: var(--ic-accent); border-color: var(--ic-accent); color: #fff;
}

/* --- Breadcrumb --- */
.breadcrumb a { text-decoration: none; }

/* --- Carosello "Altri veicoli segmento" (scheda veicolo) --- */
.carousel-nav-btn {
    width: 2.5rem; height: 2.5rem; border-radius: 50%;
    background: #fff; border: 1px solid #e6e8eb; color: var(--ic-ink);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--ic-card-shadow); transition: background .15s;
}
.carousel-nav-btn:hover { background: var(--ic-bg); }
.similar-track {
    display: flex; gap: 1rem;
    overflow-x: auto; scroll-snap-type: x proximity;
    padding: .25rem .25rem 1rem;
    scrollbar-width: thin;
}
.similar-item {
    flex: 0 0 auto; width: 280px; scroll-snap-align: start;
}
@media (max-width: 575px) {
    .similar-item { width: 82vw; }
}

/* --- Carosello recensioni (home) --- */
.reviews-track {
    display: flex; gap: 1rem;
    overflow-x: auto; scroll-snap-type: x proximity;
    padding: .25rem .25rem 1rem;
    scrollbar-width: thin;
}
.review-item { flex: 0 0 auto; width: 320px; scroll-snap-align: start; }
@media (max-width: 575px) {
    .review-item { width: 85vw; }
}
.review-card {
    background: #fff; border-radius: .75rem; height: 100%;
    box-shadow: var(--ic-card-shadow); padding: 1.5rem;
}
.review-card .review-stars { color: #fbbc04; font-size: .9rem; letter-spacing: 1px; }
.review-card .review-date { color: var(--ic-ink-soft); font-size: .8125rem; }
.review-card .review-body {
    font-size: .9375rem; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
}
.review-card .review-body-full {
    display: block; -webkit-line-clamp: unset; overflow: visible;
}

[x-cloak] { display: none !important; }
