/* Vetrina pubblica immobili — Palmieri Immobiliare
   Brand: navy #003578, azzurro #00adef, rosso #ec111b */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy: #003578;
    --azzurro: #00adef;
    --rosso: #ec111b;
    --bg: #f4f6f9;
    --bg-white: #ffffff;
    --border: #e2e8f0;
    --text: #1f2d3d;
    --text-muted: #64748b;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(0, 53, 120, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 53, 120, 0.14);
}

body {
    font-family: 'Inter', -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- HEADER --- */
.vt-header {
    background: linear-gradient(165deg, var(--navy) 0%, #002a60 100%);
    padding: 14px 24px;
}
.vt-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.vt-logo {
    display: inline-flex;
    background: #ffffff;
    border-radius: 10px;
    padding: 8px 18px;
}
.vt-logo img { height: 64px; display: block; }
.vt-torna-sito {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}
.vt-torna-sito:hover { color: #fff; }

/* --- MAIN --- */
.vt-main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 20px 50px;
}

.vt-titolo-pagina {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 6px;
}
.vt-sottotitolo {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

/* --- GRIGLIA IMMOBILI --- */
.vt-griglia {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.vt-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid var(--border);
}
.vt-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}
.vt-card-foto {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #dde4ec;
    object-fit: cover;
    display: block;
}
.vt-card-foto-vuota {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #dde4ec, #eef1f5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}
.vt-card-body { padding: 16px; }
.vt-card-prezzo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--navy);
}
.vt-card-zona {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: 4px 0 10px;
}
.vt-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.8rem;
}
.vt-tag {
    background: #eef4fb;
    color: var(--navy);
    border-radius: 6px;
    padding: 3px 8px;
    font-weight: 600;
}

.vt-vuoto {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.vt-vuoto-icona { font-size: 3rem; margin-bottom: 12px; }

/* --- DETTAGLIO IMMOBILE --- */
.vt-torna-elenco {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}
.vt-torna-elenco:hover { text-decoration: underline; }

.vt-dett-galleria { position: relative; margin-bottom: 24px; }
.vt-dett-galleria img { width: 100%; display: block; cursor: pointer; }
.vt-dett-galleria-principale {
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--radius);
}
/* Striscia con TUTTE le foto: scorre di lato, non manda a capo, così l'altezza
   della pagina non esplode su un immobile che ha settanta foto. */
.vt-dett-galleria-striscia {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}
.vt-dett-galleria-striscia img {
    width: 116px;
    flex: 0 0 auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 8px;
    scroll-snap-align: start;
    opacity: 0.82;
    transition: opacity 0.15s;
}
.vt-dett-galleria-striscia img:hover { opacity: 1; }
.vt-dett-galleria-conta {
    position: absolute; top: 12px; right: 12px;
    background: rgba(0,53,120,0.78); color: #fff;
    font-size: 0.78rem; font-weight: 600;
    padding: 4px 10px; border-radius: 999px;
    pointer-events: none;
}

.vt-dett-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
}
/* Senza questo le colonne non si stringono sotto la larghezza minima del loro
   contenuto (`min-width: auto` è il valore di partenza delle celle di griglia):
   la tabella delle superfici allargava la pagina a 341px, e su uno schermo da
   320px la scheda scorreva di lato. Con min-width:0 l'overflow-x della tabella
   fa finalmente il suo mestiere e scorre lei, da sola. */
.vt-dett-layout > * { min-width: 0; }
@media (max-width: 800px) {
    .vt-dett-layout { grid-template-columns: 1fr; }
    .vt-dett-galleria-striscia img { width: 96px; }
}

.vt-dett-titolo { font-size: 1.4rem; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.vt-dett-zona { color: var(--text-muted); margin-bottom: 18px; }
.vt-dett-prezzo-box {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}
.vt-dett-prezzo { font-size: 1.9rem; font-weight: 800; color: var(--navy); }
.vt-dett-contatti {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.vt-dett-contatti h3 { color: var(--navy); font-size: 1rem; margin-bottom: 10px; }
.vt-dett-contatti a {
    display: block;
    text-align: center;
    background: var(--azzurro);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
}
.vt-dett-contatti a:hover { background: var(--navy); }

.vt-caratteristiche {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}
.vt-car-item { font-size: 0.85rem; }
.vt-car-label { color: var(--text-muted); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.03em; }
.vt-car-value { font-weight: 700; color: var(--text); font-size: 1rem; }

.vt-descrizione {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    line-height: 1.6;
    white-space: pre-line;
}

.vt-dotazioni { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* --- LIGHTBOX FOTO --- */
.vt-lightbox {
    position: fixed; inset: 0; background: rgba(0,0,0,0.9);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; cursor: zoom-out;
}
.vt-lightbox img { max-width: 86vw; max-height: 86vh; object-fit: contain; cursor: default; }
.vt-lightbox-close {
    position: absolute; top: 18px; right: 24px;
    color: #fff; font-size: 2rem; cursor: pointer; background: none; border: none;
}
.vt-lightbox-prec, .vt-lightbox-succ {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.14); border: none; color: #fff;
    font-size: 2.4rem; line-height: 1;
    width: 52px; height: 72px; border-radius: 8px;
    cursor: pointer;
}
.vt-lightbox-prec:hover, .vt-lightbox-succ:hover { background: rgba(255,255,255,0.28); }
.vt-lightbox-prec { left: 16px; }
.vt-lightbox-succ { right: 16px; }
.vt-lightbox-conta {
    position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,0.85); font-size: 0.9rem;
}
.vt-lightbox-singola .vt-lightbox-prec,
.vt-lightbox-singola .vt-lightbox-succ,
.vt-lightbox-singola .vt-lightbox-conta { display: none; }
@media (max-width: 600px) {
    .vt-lightbox-prec, .vt-lightbox-succ { width: 40px; height: 60px; font-size: 1.8rem; }
    .vt-lightbox-prec { left: 6px; }
    .vt-lightbox-succ { right: 6px; }
}

/* --- SEZIONI DELLA SCHEDA: VIDEO, SUPERFICI, PLANIMETRIE --- */
.vt-sezione {
    font-size: 1.05rem; font-weight: 700; color: var(--navy);
    margin: 28px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--azzurro);
}

/* Il player tiene le proporzioni 16:9 a qualunque larghezza */
.vt-video {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow);
}
.vt-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vt-video-link {
    display: inline-block; padding: 10px 16px;
    background: var(--navy); color: #fff; border-radius: 8px;
    text-decoration: none; font-weight: 600;
}

/* La tabella scorre da sola sul telefono: la pagina non deve mai scorrere
   di lato (è già successo una volta con la scheda immobile). */
.vt-tabella-wrap { overflow-x: auto; }
.vt-tabella {
    width: 100%; border-collapse: collapse;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.vt-tabella th, .vt-tabella td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.vt-tabella thead th { background: #f8fafc; color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.vt-tabella .vt-num { text-align: right; white-space: nowrap; }
.vt-tabella tfoot td { font-weight: 700; color: var(--navy); border-bottom: none; }
.vt-nota { font-size: 0.78rem; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }

.vt-planimetrie { display: flex; flex-wrap: wrap; gap: 12px; }
.vt-plan {
    display: block; width: 168px;
    border: 1px solid var(--border); border-radius: 10px;
    overflow: hidden; background: var(--bg-white);
    text-decoration: none; color: var(--text);
}
.vt-plan:hover { box-shadow: var(--shadow-hover); }
.vt-plan img { width: 100%; aspect-ratio: 4/3; object-fit: contain; display: block; background: #fff; }
.vt-plan-nome {
    display: block; padding: 8px 10px; font-size: 0.8rem; font-weight: 600;
    border-top: 1px solid var(--border); overflow-wrap: anywhere;
}

/* --- CONDIVIDI / STAMPA --- */
.vt-azioni { display: flex; gap: 10px; margin-top: 16px; }
.vt-azione {
    flex: 1;
    padding: 11px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit; font-weight: 600; color: var(--navy);
    cursor: pointer;
}
.vt-azione:hover { border-color: var(--azzurro); box-shadow: var(--shadow); }

.vt-avviso {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
    background: var(--navy); color: #fff;
    padding: 11px 18px; border-radius: 10px;
    font-size: 0.88rem; z-index: 1100;
    box-shadow: var(--shadow-hover);
    max-width: 90vw; overflow-wrap: anywhere;
}

/* Bollino "video" sulla card dell'elenco */
.vt-card-media { position: relative; }
.vt-card-video {
    position: absolute; left: 10px; bottom: 10px;
    background: rgba(0,53,120,0.85); color: #fff;
    font-size: 0.72rem; font-weight: 700;
    padding: 4px 9px; border-radius: 999px;
}

/* --- STAMPA DELLA SCHEDA PUBBLICA --- */
/* Su carta non servono l'intestazione del sito, i tasti, il player del video
   né la striscia delle miniature: resta la scheda con la foto grande. */
@media print {
    /* Via l'intestazione del sito, i tasti e il player: su carta non servono.
       I recapiti dell'agenzia nel piè di pagina RESTANO: un foglio stampato
       senza il numero di telefono non serve a niente. */
    .vt-header, .vt-azioni, .vt-torna-elenco,
    .vt-dett-galleria-striscia, .vt-dett-galleria-conta,
    .vt-video, .vt-video-link, .vt-dett-contatti { display: none !important; }
    .vt-footer { background: #fff !important; color: #333 !important; border-top: 1px solid #ccc; }
    .vt-footer strong { color: #000 !important; }
    body { background: #fff; }
    .vt-main { max-width: none; padding: 0; }
    .vt-dett-layout { grid-template-columns: 1fr; }
    .vt-tabella, .vt-plan { break-inside: avoid; }
    .vt-sezione { break-after: avoid; }
}

/* --- FOOTER --- */
.vt-footer {
    background: var(--navy);
    color: rgba(255,255,255,0.8);
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
    line-height: 1.6;
}
.vt-footer strong { color: #fff; }

.vt-loading { text-align: center; padding: 60px; color: var(--text-muted); }

/* --- OPEN HOUSE: bollino sulla card e riquadro "Prenota il tuo posto" --- */
.vt-card-oh {
    position: absolute; left: 10px; top: 10px;
    background: var(--rosso); color: #fff;
    font-size: 0.72rem; font-weight: 800;
    padding: 4px 9px; border-radius: 999px;
}
.vt-oh-box {
    background: var(--bg-white);
    border: 2px solid var(--rosso);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
}
.vt-oh-etichetta {
    display: inline-block;
    background: var(--rosso); color: #fff;
    font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 4px 10px; border-radius: 999px; margin-bottom: 8px;
}
.vt-oh-quando { font-weight: 700; color: var(--navy); line-height: 1.4; }
.vt-oh-prenota {
    display: block; margin-top: 12px; padding: 12px;
    background: var(--rosso); color: #fff;
    border-radius: 10px; font-weight: 700; text-decoration: none;
}
.vt-oh-prenota:hover { background: #c50e17; }
.vt-oh-nota { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }
.vt-oh-esaurito { margin-top: 10px; color: var(--text-muted); font-size: 0.9rem; }
@media print { .vt-oh-prenota, .vt-oh-nota { display: none !important; } }
