/* ==========================================================================
   Apim Auto – vetrina auto usate (stesso stile del sito Apim)
   Palette Tamoil: #E73129 rosso, #0070BA blu, #000000 nero, #FFFFFF bianco
   ========================================================================== */

@font-face {
    font-family: "Inter Tight";
    src: url("fonts/inter-tight.woff2") format("woff2");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Manrope";
    src: url("fonts/manrope.woff2") format("woff2");
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --rosso: #e73129;
    --rosso-chiaro: #ff5246;
    --rosso-scuro: #c42017;
    --blu: #0070ba;
    --blu-chiaro: #2d93db;
    --blu-scuro: #00528a;
    --blu-profondo: #002b4d;
    --azzurro: #eef5fb;

    --nero: #000000;
    --nero-2: #111111;
    --nero-3: #1c1c1c;
    --bianco: #ffffff;
    --ghiaccio: #f4f4f4;
    --inchiostro: #000000;
    --grigio: #5f5f5f;
    --grigio-chiaro: #9d9d9d;
    --linea: #e4e4e4;
    --linea-scura: rgba(255, 255, 255, .1);
    --verde: #1f9d55;

    /* nomi usati anche dall'area riservata (admin.css) */
    --ambra: var(--blu);
    --carta: var(--ghiaccio);
    --asfalto: var(--nero);
    --asfalto-2: var(--nero-2);
    --asfalto-3: var(--nero-3);

    --filo: linear-gradient(90deg, var(--rosso) 0 50%, var(--blu) 50% 100%);
    --fascia: linear-gradient(var(--rosso) 0 55%, var(--blu) 55% 100%);

    --display: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
    --sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --larghezza: 1240px;
    --raggio: 20px;
    --curva: cubic-bezier(.2, .7, .2, 1);
    --ombra: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 32px -12px rgba(0, 0, 0, .14);
    --ombra-forte: 0 2px 4px rgba(0, 0, 0, .05), 0 34px 70px -30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--ghiaccio);
    color: var(--inchiostro);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, dl, dd, ul, ol { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.025em; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--rosso); color: #fff; }
:focus-visible { outline: 2px solid var(--blu); outline-offset: 3px; }

.contenitore { width: 100%; max-width: var(--larghezza); margin: 0 auto; padding: 0 32px; }

.occhiello {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #fff;
}
.occhiello::before {
    content: "";
    width: 32px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #fff 0 50%, rgba(255, 255, 255, .45) 50%);
}

/* ---------------------------------------------------------------- bottoni */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 15px 24px;
    border: 0;
    border-radius: 999px;
    font-family: var(--display);
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
    transition: transform .25s var(--curva), background-color .2s ease, border-color .2s ease, box-shadow .25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.btn--primario { background: var(--rosso); color: #fff; box-shadow: 0 14px 30px -12px rgba(231, 49, 41, .65); }
.btn--primario:hover { background: var(--rosso-scuro); }
.btn--whatsapp { background: #1fa855; color: #fff; box-shadow: 0 14px 30px -14px rgba(31, 168, 85, .6); }
.btn--contorno { background: transparent; border: 1.5px solid var(--linea); color: var(--inchiostro); }
.btn--contorno:hover { border-color: var(--blu); color: var(--blu); }
.btn--testo { background: none; color: var(--grigio); }
.btn--pericolo { background: transparent; border: 1.5px solid #f2c4c0; color: var(--rosso); }
.btn--piccolo { padding: 9px 16px; font-size: 14px; }

/* ---------------------------------------------------------------- barra */

.barra {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #000;
    color: #fff;
}
.barra::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 4px;
    background: var(--fascia);
}

.barra__dentro {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }

.logo__marchio {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: url("favicon.svg") center / cover;
}

.logo__nome {
    font-family: var(--display);
    font-weight: 800;
    font-size: 23px;
    letter-spacing: .06em;
}

.logo__sezione {
    padding: 4px 10px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .14);
    color: #fff;
    font-family: var(--display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a, .nav__esci {
    padding: 9px 14px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: rgba(255, 255, 255, .82);
    font-family: var(--display);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease;
}
.nav a:hover, .nav__esci:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav .nav__chiama { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; background: var(--rosso); color: #fff; }
.nav .nav__chiama:hover { background: var(--rosso-scuro); color: #fff; }
.nav .nav__chiama svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.nav .nav__accedi { display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(255, 255, 255, .22); }
.nav .nav__accedi svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }

/* ---------------------------------------------------------------- intro */

.intro {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: #fff;
    padding: 88px 0 150px;
    background:
        radial-gradient(70% 90% at 5% 0%, rgba(0, 112, 186, .55), transparent 65%),
        radial-gradient(45% 60% at 95% 100%, rgba(231, 49, 41, .18), transparent 70%),
        linear-gradient(165deg, var(--blu-profondo) 0%, #00182c 55%, #000 100%);
}
/* fascia rossa con filo bianco, come la livrea della stazione */
.intro::before, .intro::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: -30%;
    height: 170%;
    transform: rotate(24deg);
}
.intro::before { right: 9%; width: 58px; background: var(--rosso); }
.intro::after { right: calc(9% - 22px); width: 7px; background: rgba(255, 255, 255, .85); }

.intro h1 {
    margin-top: 24px;
    max-width: 12em;
    font-size: clamp(46px, 7vw, 96px);
    line-height: .95;
    letter-spacing: -.04em;
    font-weight: 250;
}
.intro h1 span { display: block; font-weight: 800; letter-spacing: -.038em; }

.intro__sotto { margin-top: 24px; max-width: 34em; font-size: 19px; color: rgba(255, 255, 255, .74); }

/* ---------------------------------------------------------------- elenco */

.elenco { position: relative; z-index: 2; margin-top: -88px; padding: 0 0 104px; }

.elenco__titolo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 8px 16px;
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--ombra);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
}
.elenco__titolo::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c26b;
}
.elenco__titolo--vendute { margin-top: 72px; color: var(--grigio); }
.elenco__titolo--vendute::before { background: var(--grigio-chiaro); }

.griglia {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}

.scheda {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: var(--raggio);
    background: var(--bianco);
    box-shadow: var(--ombra-forte);
    text-decoration: none;
    transition: transform .4s var(--curva), box-shadow .4s ease;
}
.scheda::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 5px;
    background: var(--fascia);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .5s var(--curva);
}
.scheda:hover { transform: translateY(-6px); }
.scheda:hover::after { transform: scaleX(1); }

.scheda__foto {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(160deg, var(--nero-3), var(--nero));
}
.scheda__foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--curva); }
.scheda:hover .scheda__foto img { transform: scale(1.05); }
.scheda__senza-foto {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    height: 100%;
    color: rgba(255, 255, 255, .55);
    font-family: var(--display);
    font-size: 14px;
    font-weight: 600;
}
.scheda__senza-foto::before {
    content: "";
    width: 56px;
    height: 56px;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%23ffffff' stroke-opacity='.45' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 30l5-11a5 5 0 0 1 4.6-3h16.8a5 5 0 0 1 4.6 3l5 11v8H6z'/%3E%3Cpath d='M6 30h36'/%3E%3Ccircle cx='14' cy='38' r='4'/%3E%3Ccircle cx='34' cy='38' r='4'/%3E%3C/svg%3E");
}

.scheda__testo { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 26px; }
.scheda h3 { font-size: 23px; line-height: 1.15; }
.scheda__versione { margin-top: 4px; color: var(--grigio); font-size: 15px; }

.scheda__dati { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.scheda__dati li {
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--azzurro);
    color: var(--blu-scuro);
    font-size: 12.5px;
    font-weight: 700;
}

.scheda__prezzo {
    margin-top: auto;
    padding-top: 20px;
    font-family: var(--display);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.scheda--venduta { box-shadow: var(--ombra); }
.scheda--venduta img { filter: grayscale(1); opacity: .8; }
.scheda--venduta .scheda__prezzo { color: var(--grigio); font-size: 18px; }

.bollino {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 13px;
    border-radius: 999px;
    font-family: var(--display);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.bollino--riservata { background: var(--blu); color: #fff; }
.bollino--venduta { background: var(--nero); color: #fff; }

.vuoto {
    padding: 56px 28px;
    border-radius: var(--raggio);
    background: var(--bianco);
    box-shadow: var(--ombra-forte);
    text-align: center;
}
.vuoto h1, .vuoto h2 { font-size: 28px; }
.vuoto p { margin: 10px auto 24px; max-width: 32em; color: var(--grigio); }
.vuoto--pagina { margin: 64px auto; max-width: 720px; }

/* ---------------------------------------------------------------- dettaglio */

.dettaglio { padding: 28px 0 104px; }

.indietro {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--ombra);
    color: var(--inchiostro);
    font-family: var(--display);
    font-size: 14.5px;
    font-weight: 700;
    text-decoration: none;
    transition: color .2s ease;
}
.indietro:hover { color: var(--blu); }

.dettaglio__griglia {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.galleria__grande {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: var(--raggio);
    background: linear-gradient(160deg, var(--nero-3), var(--nero));
    box-shadow: var(--ombra-forte);
}
.galleria__grande img { width: 100%; height: 100%; object-fit: cover; }
.galleria__vuota { display: grid; place-items: center; color: rgba(255, 255, 255, .55); font-family: var(--display); font-weight: 600; }

.galleria__conta {
    position: absolute;
    right: 14px;
    bottom: 14px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    font-family: var(--display);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.galleria__mini {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 4px;
}
.galleria__btn {
    flex: none;
    width: 96px;
    aspect-ratio: 4 / 3;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 12px;
    background: var(--nero-2);
    cursor: pointer;
    opacity: .65;
    transition: opacity .2s ease, border-color .2s ease;
}
.galleria__btn:hover { opacity: 1; }
.galleria__btn img { width: 100%; height: 100%; object-fit: cover; }
.galleria__btn.attivo { border-color: var(--rosso); opacity: 1; }

.riquadro {
    position: sticky;
    top: 96px;
    padding: 30px;
    border-radius: var(--raggio);
    background: var(--bianco);
    box-shadow: var(--ombra-forte);
    overflow: hidden;
}
.riquadro::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 5px;
    background: var(--fascia);
}
.riquadro h1 { font-size: clamp(28px, 3vw, 38px); line-height: 1.08; letter-spacing: -.03em; }
.riquadro__versione { margin-top: 6px; color: var(--grigio); }

.riquadro__prezzo {
    margin-top: 20px;
    font-family: var(--display);
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.riquadro__prezzo--venduta { color: var(--grigio); }
.riquadro__nota { margin-top: 8px; color: var(--grigio); font-size: 15px; }
.riquadro__riservata {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--azzurro);
    color: var(--blu-scuro);
    font-size: 15px;
    font-weight: 600;
}

.riquadro__chiave {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 24px 0;
}
.riquadro__chiave li {
    display: grid;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--ghiaccio);
    font-family: var(--display);
    font-size: 17px;
    font-weight: 700;
}
.riquadro__chiave span {
    font-family: var(--sans);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--blu);
}

.riquadro__azioni { display: grid; gap: 10px; }
.riquadro__dove { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--linea); font-size: 14px; color: var(--grigio); }

.dettaglio__info {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 20px 28px;
    margin-top: 28px;
}
.dettaglio__info > * { grid-column: 1; }

.blocco {
    padding: 30px;
    border-radius: var(--raggio);
    background: var(--bianco);
    box-shadow: var(--ombra);
}
.blocco h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 22px;
}
.blocco h2::before {
    content: "";
    width: 28px;
    height: 3px;
    border-radius: 2px;
    background: var(--filo);
}

.specifiche {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
}
.specifiche div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--linea);
}
.specifiche dt { color: var(--grigio); }
.specifiche dd { font-weight: 700; text-align: right; }

.testo { color: #2a2a2a; line-height: 1.7; }

.optional { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.optional li { position: relative; padding-left: 26px; }
.optional li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .3em;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--azzurro) center / 11px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%230070ba' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- piede */

.piede {
    position: relative;
    padding: 48px 0 40px;
    background: var(--nero);
    color: var(--grigio-chiaro);
    font-size: 14px;
}
.piede::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 9px;
    background: var(--fascia);
}
.piede__dentro { display: grid; gap: 6px; }
.piede__link { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-bottom: 18px; padding-bottom: 20px; border-bottom: 1px solid var(--linea-scura); }
.piede__link a { color: rgba(255, 255, 255, .82); font-family: var(--display); font-size: 15px; font-weight: 600; text-decoration: none; }
.piede__link a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--rosso); text-underline-offset: 4px; }
.piede strong { color: #fff; }
.piede a { color: rgba(255, 255, 255, .82); }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 900px) {
    .dettaglio__griglia { grid-template-columns: 1fr; }
    .riquadro { position: static; }
    .dettaglio__info { grid-template-columns: 1fr; }
    .intro::before { right: -2%; }
    .intro::after { right: calc(-2% - 22px); }
}

@media (max-width: 560px) {
    body { font-size: 16px; }
    .contenitore { padding: 0 16px; }
    .barra__dentro { height: 64px; }
    .intro { padding: 56px 0 120px; }
    .intro h1 { font-size: 50px; }
    .intro__sotto { font-size: 17px; }
    .intro::before { width: 36px; right: -8%; }
    .intro::after { right: calc(-8% - 16px); width: 5px; }
    .griglia { grid-template-columns: 1fr; gap: 16px; }
    .specifiche, .optional { grid-template-columns: 1fr; }
    .riquadro, .blocco { padding: 22px; }
    .riquadro__prezzo { font-size: 40px; }
    .logo__sezione { display: none; }
    .barra--pubblica .nav a:not(.nav__chiama):not(.nav__accedi) { display: none; }
    .nav .nav__accedi { padding: 9px 12px; }
    .galleria__grande { margin: 0 -16px; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
