/* --- STILI GLOBALI E VARIABILI --- */
:root {
    --color-primary: #0a2e5d; /* Blu Scuro (professionale) */
    --color-secondary: #d4a01d; /* Un oro/giallo per i CTA */
    --color-light-gray: #f4f4f4; /* Grigio chiaro per sfondi */
    --color-dark-gray: #333;
    --color-text: #555;
    --color-white: #ffffff;
    
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Lato', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    color: var(--color-text);
    line-height: 1.6;
    background-color: var(--color-white);
    /* Spazio per l'header fisso su desktop (Top Bar + Main Nav) */
    padding-top: 140px; 
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    color: var(--color-primary);
    margin-bottom: 1rem;
    font-weight: 700;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: var(--color-primary);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-secondary);
}

img {
    max-width: 100%;
    height: auto;
}

/* --- UTILITIES E BOTTONI --- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 5px;
    font-family: var(--font-primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--color-secondary);
    color: var(--color-white);
    border-color: var(--color-secondary);
}
.btn-primary:hover {
    background-color: #b98d1a;
    border-color: #b98d1a;
    color: var(--color-white);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
}
.btn-secondary:hover {
    background-color: var(--color-white);
    color: var(--color-primary);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* --- ANIMAZIONI FADE-IN (su scroll) --- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- HEADER (Top Bar + Main Nav) --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* 1. Top Bar */
.top-bar {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 8px 0;
    font-size: 0.85rem;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar .contact-info span {
    margin-right: 20px;
}

.top-bar .contact-info i {
    color: var(--color-secondary);
    margin-right: 5px;
}

.top-bar .social-icons a {
    color: var(--color-white);
    margin-left: 15px;
    font-size: 0.9rem;
}
.top-bar .social-icons a:hover {
    color: var(--color-secondary);
}

/* 2. Main Navigation */
.main-nav {
    background-color: var(--color-white);
    padding: 15px 0;
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}
.logo:hover {
    color: var(--color-primary);
    transform: translateY(-2px);
}
.logo i {
    transition: transform 0.3s ease;
}
.logo:hover i {
    transform: rotate(-10deg) scale(1.1);
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    font-family: var(--font-primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-secondary);
    border-bottom-color: var(--color-secondary);
}

.hamburger-menu {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-primary);
}

/* --- SLIDER/CAROSELLO (Nuova Hero Section) --- */
.slider-container {
    position: relative;
    width: 100%;
    height: 80vh; /* Altezza della hero */
    overflow: hidden; 
    display: flex; 
    align-items: center;
    justify-content: center;
    background-color: #000; 
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Mantiene l'effetto parallasse */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    
    /* 🔑 IMPOSTAZIONE TRANSIZIONE: 1.5 SECONDI con effetto fade elegante */
    opacity: 0;
    transition: opacity 1.5s ease-in-out; 
    
    /* Gradiente per migliorare il contrasto del testo */
    background-blend-mode: overlay;
    background-color: rgba(0, 0, 0, 0.4); 
}

/* Solo la slide attiva è visibile */
.slide.active {
    opacity: 1;
}

/* Stili per il contenuto (riutilizzati dalla vecchia hero) */
.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 10;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: var(--color-white);
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.hero-content .btn {
    margin: 0 10px;
}

/* Controlli (Frecce) */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 16px;
    color: var(--color-white);
    font-weight: bold;
    font-size: 22px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.5);
    border: none;
    z-index: 20;
}
.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}
.prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.8);
}


/* --- VETRINA SECTION (Homepage) --- */
.vetrina-section {
    padding: 80px 0 60px 0;
    text-align: center;
}

.vetrina-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.car-card {
    background: var(--color-white);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.car-card img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    object-position: top;
    display: block;
}

.car-card-content {
    padding: 20px;
}

.car-card h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.car-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-secondary);
    margin-bottom: 15px;
}

.car-specs {
    list-style: none;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #777;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-light-gray);
    margin-bottom: 15px;
}

/* --- LIFESTYLE SECTION (Homepage) --- */
.lifestyle-section {
    background-color: var(--color-light-gray);
    padding: 60px 0;
}

.lifestyle-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 40px;
}

.lifestyle-image img {
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* --- PAGE HEADER (Per pagine interne) --- */
.page-header {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 40px 0;
    text-align: center;
}

.page-header h1 {
    color: var(--color-white);
    font-size: 2.8rem;
}

.content-section {
    padding: 60px 0;
}

/* --- PAGINA CHI SIAMO --- */
.about-us-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-image img {
    border-radius: 8px;
}

.about-text ul {
    list-style: none;
    padding-left: 0;
}

.about-text ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
}

.about-text ul li::before {
    content: '\f00c'; 
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--color-secondary);
    position: absolute;
    left: 0;
    top: 4px;
}

/* --- PAGINA COMPRA (Processo) --- */
.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.step-card {
    background: var(--color-light-gray);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #ddd;
}

.step-icon {
    font-size: 2.5rem;
    color: var(--color-secondary);
    margin-bottom: 15px;
}

/* --- CTA SECTION --- */
.cta-section {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 50px 0;
    text-align: center;
}

.cta-section h2 {
    color: var(--color-white);
    font-size: 2.2rem;
}

.cta-section .btn {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

.cta-section .btn:hover {
    background-color: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-white);
}


/* --- PAGINA CONTATTI --- */
.contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.contact-form-container h3,
.contact-info-container h3 {
    margin-bottom: 20px;
    font-size: 1.6rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
    color: var(--color-dark-gray);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--font-secondary);
    font-size: 1rem;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 5px rgba(10, 46, 93, 0.3);
}

.contact-info-container p {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.contact-info-container i {
    color: var(--color-secondary);
    font-size: 1.1rem;
    width: 25px;
    margin-top: 4px;
}

.map-container {
    margin-top: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
}

/* --- FOOTER --- */
.footer {
    background-color: var(--color-dark-gray);
    color: #aaa;
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
}

.footer-col {
    padding-right: 20px;
}

.footer-col .logo {
    color: var(--color-white);
    font-size: 1.8rem;
    margin-bottom: 15px;
    display: inline-block;
}

.footer-col h4 {
    color: var(--color-white);
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    position: relative;
}
.footer-col h4::after {
    content: '';
    width: 50px;
    height: 2px;
    background-color: var(--color-secondary);
    position: absolute;
    left: 0;
    bottom: -5px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul a {
    color: #aaa;
    transition: padding-left 0.3s ease; 
}
.footer-col ul a:hover {
    color: var(--color-white);
    padding-left: 5px;
}

.footer-col p {
    margin-bottom: 10px;
}

.footer-col p i {
    color: var(--color-secondary);
    margin-right: 5px;
    width: 20px;
}

.social-icons-footer a {
    color: var(--color-white);
    background-color: #555;
    width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}
.social-icons-footer a:hover {
    background-color: var(--color-secondary);
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid #555;
    font-size: 0.9rem;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 992px) {
    .vetrina-grid {
        grid-template-columns: 1fr 1fr;
    }
    .process-steps {
        grid-template-columns: 1fr 1fr;
    }
    .lifestyle-content {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    /* 1. ELIMINA COMPLETAMENTE LA STRISCIA BIANCA - padding-top rimosso con !important */
    * {
        box-sizing: border-box;
    }
    
    body {
        padding-top: 0 !important; 
        margin: 0 !important;
        padding: 0 !important;
    }
    
    html {
        margin: 0;
        padding: 0;
    }
    
    /* Rimuove TUTTI i margini del main */
    main {
        margin-top: 0 !important;
        padding-top: 0 !important;
        margin: 0;
    }
    
    .top-bar {
        display: none !important; 
    }
    
    .header {
        padding: 0 !important;
        margin: 0 !important;
        position: fixed;
        top: 0 !important;
        left: 0;
        width: 100%;
        z-index: 1000;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .main-nav {
        padding: 12px 0;
        margin: 0;
    }
    
    /* Slider con piccolo spazio sotto l'header (non attaccato) */
    .slider-container {
        margin-top: 60px;
        padding-top: 0 !important;
        position: relative;
    }
    
    /* Altre pagine - aggiunge spazio sotto l'header */
    .page-header {
        margin-top: 60px !important;
        padding-top: 40px;
    }
    
    .content-section {
        margin-top: 0;
        padding-top: 20px;
    }

    .main-nav .container {
        position: relative;
    }

    .hamburger-menu {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 65px; /* Altezza della main-nav */
        left: 0;
        background-color: var(--color-white);
        width: 100%;
        flex-direction: column;
        padding: 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        
        /* Completamente nascosto di default - nessuna traccia */
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        padding-top: 0;
        padding-bottom: 0;
        margin: 0;
        transition: max-height 0.4s ease-out, opacity 0.3s ease-out, visibility 0.3s ease-out;
    }
    
    .nav-links.active {
        max-height: 400px; /* Mostra il menu */
        opacity: 1;
        visibility: visible;
        padding: 20px;
    }

    .nav-links li {
        margin: 10px 0;
        text-align: center;
    }
    
    /* Regola il logo su mobile per evitare che vada a capo */
    .logo {
        font-size: 1.2rem;
        white-space: nowrap;
    }
    /* Nasconde l'icona dell'auto su mobile per evitare che il testo vada a capo */
    .logo i {
        display: none;
    }
    
    /* Regola il contenitore dello slider in mobile - altezza e dimensioni */
    .slider-container {
        height: 70vh;
        min-height: 500px;
        padding: 0;
    }
    .slide {
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center center;
        background-attachment: scroll !important;
        transform: none !important;
    }
    /* Seconda slide (fam.jpeg) - posizionamento a sinistra su mobile */
    .slide-fam {
        background-position: left center;
    }
    .hero-content {
        padding: 20px;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .hero-content p {
        font-size: 1rem;
    }
    .hero-content {
        padding-top: 0; /* Lo slider centra automaticamente */
    }

    .vetrina-grid {
        grid-template-columns: 1fr;
    }
    .process-steps {
        grid-template-columns: 1fr;
    }
    .about-us-content {
        grid-template-columns: 1fr;
    }
    .about-image {
        order: -1; /* Immagine sopra su mobile */
        margin-bottom: 20px;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
}