:root {
    --ferrari-red: #DC0000;
    --ferrari-dark-red: #8B0000;
    --ferrari-black: #0A0A0A;
    --ferrari-gray: #1A1A1A;
    --ferrari-light-gray: #D4D4D4;
    --ferrari-white: #FAFAFA;
    --ferrari-gold: #C5A572;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--ferrari-black);
    color: var(--ferrari-white);
    overflow-x: hidden;
    line-height: 1.6;
}


/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--ferrari-black);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.mallia-logo-loader {
    margin-bottom: 3rem;
    animation: logoFadeIn 1.5s ease;
}


/* Gestisce il contenitore delle due immagini */
.auto-sagome {
    display: flex;
    justify-content: center;
    gap: 15px; /* Spazio tra le due auto */
    margin-bottom: -10px; /* Avvicina le auto alla scritta SVG */
}

/* Regola la grandezza delle immagini PNG */
.img-auto {
    width: 80px; /* Regola questa larghezza in base ai tuoi gusti */
    height: auto;
    object-fit: contain;
}

/* Assicurati che l'SVG non sia troppo grande */
.mallia-logo-loader svg {
    width: 100%;
    max-width: 400px;
}

.auto-sagome img:last-child {
    transform: scaleX(-1); /* Specchia l'immagine orizzontalmente */
}

@keyframes logoFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.mallia-logo-loader svg {
    width: 300px;
    height: auto;
}

.logo-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 0.15em;
    fill: var(--ferrari-red);
    filter: drop-shadow(0 0 20px rgba(220, 0, 0, 0.5));
    animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(220, 0, 0, 0.5));
    }
    50% {
        opacity: 0.8;
        filter: drop-shadow(0 0 30px rgba(220, 0, 0, 0.8));
    }
}

.loading-bar {
    width: 300px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--ferrari-red) 0%,
        var(--ferrari-dark-red) 50%,
        var(--ferrari-red) 100%
    );
    width: 0%;
    animation: loadingProgress 2s ease-in-out forwards;
    box-shadow: 0 0 10px var(--ferrari-red);
}

@keyframes loadingProgress {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}


/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(10,10,10,0.95), rgba(10,10,10,0));
    backdrop-filter: blur(10px);
    padding: 1.5rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

nav.scrolled {
    background: rgba(10,10,10,0.98);
    padding: 1rem 4rem;
}

.logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.0rem;
    font-weight: 300;
    color: var(--ferrari-red);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(220, 0, 0, 0.5);
}

.nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
}

.nav-links a {
    color: var(--ferrari-white);
    text-decoration: none;
    font-weight: 300;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--ferrari-red);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--ferrari-red);
}

/* Hero Section with Video */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.video-container video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(10, 10, 10, 0.4) 0%,
        rgba(10, 10, 10, 0.6) 50%,
        rgba(10, 10, 10, 0.8) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem;
    animation: fadeInUp 1.2s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 7rem;
    font-weight: 700;
    color: var(--ferrari-white);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.1;
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--ferrari-light-gray);
    font-weight: 200;
    letter-spacing: 0.3em;
    margin-bottom: 3rem;
    animation: fadeInUp 1.4s ease;
}

.cta-button {
    display: inline-block;
    padding: 1.2rem 3rem;
    background: var(--ferrari-red);
    color: var(--ferrari-white);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: all 0.4s ease;
    border: 2px solid var(--ferrari-red);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1.6s ease;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--ferrari-dark-red);
    transition: left 0.4s ease;
    z-index: -1;
}

.cta-button:hover::before {
    left: 0;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(220, 0, 0, 0.5);
}





/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.scroll-indicator span {
    display: block;
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--ferrari-white));
    animation: scrollDown 2s infinite;
}

@keyframes scrollDown {
    0%, 100% {
        transform: translateY(0);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(20px);
    }
}

/* Featured Model Section */
.featured-model {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.featured-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.featured-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.featured-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(10, 10, 10, 0.9) 0%,
        rgba(10, 10, 10, 0.6) 50%,
        rgba(10, 10, 10, 0.3) 100%
    );
}

.featured-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
    padding: 4rem;
    margin-left: 8rem;
}

.featured-label {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--ferrari-red);
    color: var(--ferrari-white);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.featured-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
    line-height: 1.1;
}

.featured-description {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--ferrari-light-gray);
    line-height: 1.8;
    margin-bottom: 2rem;
}

/* Models Section */
.models {
    padding: 8rem 4rem;
    background: var(--ferrari-black);
}

.section-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ferrari-white);
}

.section-subtitle {
    text-align: center;
    color: var(--ferrari-light-gray);
    font-weight: 200;
    letter-spacing: 0.2em;
    margin-bottom: 5rem;
    font-size: 1rem;
}

.models-grid {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

.model-card {
    position: relative;
    overflow: hidden;
    background: var(--ferrari-gray);
    cursor: pointer;
    transition: transform 0.5s ease;
    border: 1px solid rgba(220, 0, 0, 0.1);
}

.model-card:hover {
    transform: translateY(-10px);
}

.model-image {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    position: relative;
    overflow: hidden;
    transition: transform 0.5s ease;
}

.model-card:hover .model-image {
    transform: scale(1.05);
}

.model-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Cormorant Garamond', serif;
    font-size: 3rem;
    font-weight: 700;
}

.model-info {
    padding: 2rem;
    background: linear-gradient(to bottom, var(--ferrari-gray), var(--ferrari-black));
}

.model-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--ferrari-white);
}

.model-specs {
    color: var(--ferrari-light-gray);
    font-size: 0.9rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.model-link {
    color: var(--ferrari-red);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.model-link:hover {
    gap: 1rem;
}

/* Heritage Section */
.heritage {
    padding: 8rem 4rem;
    background: linear-gradient(135deg, var(--ferrari-gray) 0%, var(--ferrari-black) 100%);
    position: relative;
}

.heritage-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.heritage-text h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.heritage-text p {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--ferrari-light-gray);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.heritage-year {
    font-family: 'Cormorant Garamond', serif;
    font-size: 8rem;
    font-weight: 700;
    color: var(--ferrari-red);
    opacity: 0.2;
    line-height: 1;
}

/* Racing Video Section */
.racing-video {
    position: relative;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.racing-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.racing-video-container video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.racing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top,
        rgba(10, 10, 10, 0.8) 0%,
        rgba(10, 10, 10, 0.5) 50%,
        rgba(10, 10, 10, 0.3) 100%
    );
}

.racing-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem;
    max-width: 800px;
}

.racing-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.racing-description {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--ferrari-light-gray);
    line-height: 1.8;
}

/* Stats Section */
.stats {
    padding: 6rem 4rem;
    background: var(--ferrari-black);
    border-top: 1px solid rgba(220, 0, 0, 0.2);
    border-bottom: 1px solid rgba(220, 0, 0, 0.2);
}

.stats-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    text-align: center;
}

.stat-item {
    padding: 2rem;
}

.stat-number {
    font-family: 'Cormorant Garamond', serif;
    font-size: 4rem;
    font-weight: 700;
    color: var(--ferrari-red);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--ferrari-light-gray);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* Footer */
footer {
    padding: 4rem 4rem 2rem;
    background: var(--ferrari-black);
    border-top: 1px solid rgba(220, 0, 0, 0.2);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--ferrari-red);
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.footer-description {
    color: var(--ferrari-light-gray);
    font-weight: 300;
    line-height: 1.8;
    font-size: 0.95rem;
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    color: var(--ferrari-light-gray);
    text-decoration: none;
    font-weight: 300;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--ferrari-red);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(220, 0, 0, 0.1);
    color: var(--ferrari-light-gray);
    font-size: 0.85rem;
    font-weight: 300;
}

/* Scroll animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
/* --- RESPONSIVE GLOBALE --- */
/* --- STILE HAMBURGER --- */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.hamburger span {
    width: 30px;
    height: 3px;
    background-color: var(--ferrari-red);
    transition: all 0.3s ease;
}

/* --- RESPONSIVE GLOBALE --- */
@media (max-width: 968px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    nav {
        padding: 1rem 1.5rem;
        height: 70px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .logo {
        font-size: 1.5rem;
        white-space: nowrap;
    }

    .hamburger {
        display: flex;
        z-index: 9999;
        position: relative;
        margin-top: 5px;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -7px);
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--ferrari-black);
        padding-top: 100px;
        transition: right 0.4s ease-in-out;
        z-index: 999;
        border-left: 1px solid var(--ferrari-red);
        align-items: center;
        justify-content: center;
        gap: 2rem;
    }

    .nav-links.active {
        right: 0;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .featured-content {
        margin-left: 1rem;
        padding: 2rem;
    }

    .models-grid {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        padding: 0 1.5rem;
    }

    .model-card {
        width: 100%;
        margin-bottom: 1rem;
    }

    .model-image {
        height: 300px;
    }

    .model-imageBackground {
        display: none; /* ✅ Nasconde l'immagine su mobile */
    }

    .heritage-content,
    .footer-content {
        grid-template-columns: 1fr;
    }

    .heritage-year {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hero-title,
    .racing-title,
    .section-title,
    .heritage-text h2 {
        font-size: 2.2rem;
        line-height: 1.1;
        text-align: center;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .models-grid {
        gap: 25px;
        padding: 0 1rem;
    }

    .model-card {
        width: 100%;
    }

    .model-image {
        height: 220px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .stat-number {
        font-size: 3rem;
    }

    .mallia-logo-loader svg {
        width: 250px;
    }

    .img-auto {
        width: 60px;
    }

    .auto-sagome {
        gap: 10px;
    }
}