/* ---------------------------------- */
/* 1. VARIABILI E RESET GLOBALE       */
/* ---------------------------------- */

:root {
    /* Palette Colori */
    --clr-porpora-dark: #581845; /* Base Porpora (Usato per icone e fallback) */
    --clr-porpora-light: #9067b5; 
    --clr-verde-dark: #38761d;   /* Base Verde */
    --clr-azzurro: #4a91a8;      /* Base Azzurro */

    /* Colori di Contenuto */
    --clr-background: #ffffff;
    --clr-surface-light: #f7f7f7;
    --clr-text-dark: #333333;

    /* Font */
    --font-primary: 'Poppins', sans-serif;
}

/* SCROLL LISCIO */
html {
    scroll-behavior: smooth; 
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    background-color: var(--clr-background);
    color: var(--clr-text-dark);
}

/* MODIFICA PER IL FULL WIDTH */
.container {
    width: 100%; /* Usa la larghezza completa */
    /* max-width: 1200px; <-- Rimosso per estendere il contenuto */
    margin: 0 auto;
    padding: 0 30px; /* Aggiunto un padding laterale di sicurezza */
}

/* ---------------------------------- */
/* 2. HEADER E NAVIGAZIONE            */
/* ---------------------------------- */

.header {
    background-color: var(--clr-background);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    /* Aggiunto z-index per navigazione fissa sopra tutto */
    position: sticky;
    top: 0;
    z-index: 10; 
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    /* FALLBACK: colore solido per browser non supportati */
    color: #6A1B9A; 

    font-size: 1.8em;
    font-weight: 700;
    
    /* Applicazione del Gradiente al Testo del Logo */
    background-image: linear-gradient(to right, #6A1B9A, #42A5F5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent; /* Rende il testo trasparente per far vedere la sfumatura */
}

.nav-menu a {
    color: var(--clr-text-dark);
    text-decoration: none;
    margin-left: 25px;
    font-weight: 600;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #6A1B9A; /* Hover sul porpora del gradiente */
}

/* NUOVO: Stile per il link attivo nel menu durante lo scroll */
.nav-menu a.active-link {
    color: #6A1B9A; 
    border-bottom: 2px solid #6A1B9A;
}

/* Gradiente applicato al Link CTA nella Navigazione */
.cta-link {
    color: white !important;
    border: none; 
    padding: 8px 15px;
    border-radius: 5px;
    background-image: linear-gradient(to right, #6A1B9A, #42A5F5);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--clr-porpora-dark);
}

/* ---------------------------------- */
/* 3. BOTTONI E CTA                   */
/* ---------------------------------- */

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: background-image 0.3s, transform 0.2s, box-shadow 0.3s;
    border: none;
}

/* Gradiente applicato al Pulsante Primario */
.btn-primary {
    background-image: linear-gradient(to right, #6A1B9A, #42A5F5);
    background-color: transparent; 
    color: var(--clr-background);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    /* Gradiente invertito su hover */
    background-image: linear-gradient(to left, #6A1B9A, #42A5F5);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.btn-secondary {
    /* Il secondario rimane Azzurro per contrasto */
    background-color: var(--clr-azzurro);
    color: var(--clr-background);
}

.btn-secondary:hover {
    background-color: #3b7c8f;
}

/* ---------------------------------- */
/* 4. SEZIONI PRINCIPALI              */
/* ---------------------------------- */

section {
    padding: 80px 0;
    text-align: center;
}

/* Gradiente applicato al Testo dei Titoli (h2, h3) */
h2, h3 {
    margin-bottom: 20px;
    font-weight: 700;
    
    /* FALLBACK: colore solido per browser non supportati */
    color: #6A1B9A; 

    /* Applicazione del Gradiente al Testo */
    background-image: linear-gradient(to right, #6A1B9A, #42A5F5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent; /* Rende il testo trasparente per far vedere la sfumatura */
}


/* Hero Section con Immagine di Sfondo e Gradiente (Parallasse) */
.hero-section {
    /* Immagine di Sfondo visibile con Gradiente come Overlay (Opacità 0.85) */
    background-image: 
        linear-gradient(to right, rgba(106, 27, 154, 0.85), rgba(66, 165, 245, 0.85)), 
        url('assets/images/hero-bg.png'); 
    
    background-color: transparent; 
    
    /* MANTIENE L'EFFETTO PARALLASSE */
    background-attachment: fixed; 
    
    /* Posiziona l'immagine in alto a sinistra (per il logo) */
    background-position: center; 
    
    /* IMPEDISCE LA RIPETIZIONE */
    background-repeat: no-repeat;
    
    /* Ridimensionamento più piccolo rispetto a 'cover' */
    background-size: cover; 
    
    padding: 150px 0; 
    color: white; 
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5); 
}

/* Sovrascrivi il gradiente del testo per renderlo bianco su sfondo colorato */
.hero-section h2, .hero-section p {
    color: white; 
    /* Reset della clip per non avere problemi di visualizzazione */
    background-image: none;
    -webkit-background-clip: unset;
    background-clip: unset;
}

.hero-section h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

/* Services Section */
.services-section {
    background-color: var(--clr-background);
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* STILI PER L'ANIMAZIONE DEI BLOCCHI SERVIZI (Scroll Reveal) */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-item {
    padding: 30px;
    background-color: var(--clr-surface-light);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    /* Transizioni di base */
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;

    /* Stato iniziale nascosto per l'animazione JS */
    opacity: 0; 
    transform: translateY(20px);
}

.service-item.animate {
    /* La classe 'animate' viene aggiunta da JS */
    animation: fadeIn 0.8s ease-out forwards;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.service-icon {
    font-size: 3em;
    margin-bottom: 15px;
}
/* Colori icone rimangono come variabili per accenti */
.service-icon.purple { color: var(--clr-porpora-dark); }
.service-icon.green { color: var(--clr-verde-dark); }
.service-icon.blue { color: var(--clr-azzurro); }


/* ---------------------------------- */
/* 5. SEZIONE DETTAGLI PRODOTTI       */
/* ---------------------------------- */

.detail-grid {
    background-color: var(--clr-surface-light);
}

.detail-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
    text-align: left;
}

.detail-item {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 5px solid var(--clr-azzurro); /* Linea di accento */
}

.detail-item i {
    font-size: 2em;
    /* Anche le icone usano un porpora solido per contrasto su sfondo bianco */
    color: var(--clr-porpora-dark); 
    margin-bottom: 10px;
}

.detail-item h4 {
    color: var(--clr-text-dark);
    margin: 5px 0 10px;
    font-size: 1.2em;
}

.detail-item p {
    font-size: 0.9em;
    color: #555;
}


/* ---------------------------------- */
/* 6. CONTACT SECTION E PRIVACY       */
/* ---------------------------------- */

/* Gradiente applicato alla Sezione Contatti */
.contact-section {
    background-image: linear-gradient(to right, #6A1B9A, #42A5F5);
    background-color: transparent; 
    color: white;
}

/* Sovrascrivi il gradiente del testo per renderlo bianco su sfondo colorato */
.contact-section h3 {
    color: white;
    background-image: none;
    -webkit-background-clip: unset;
    background-clip: unset;
}

.contact-form {
    max-width: 600px;
    margin: 30px auto 0;
    text-align: left;
}

.contact-form input[type="text"], 
.contact-form input[type="email"], 
.contact-form textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: none;
    border-radius: 5px;
    font-family: var(--font-primary);
}

.contact-form textarea {
    resize: vertical;
}

/* Stili Checkbox Privacy */
.privacy-consent {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.privacy-consent input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.privacy-consent label {
    font-size: 0.9em;
    color: white;
}

.privacy-consent a {
    color: var(--clr-surface-light); /* Colore chiaro per il link privacy */
    text-decoration: underline;
}

/* ---------------------------------- */
/* 7. FOOTER                          */
/* ---------------------------------- */

.footer {
    background-color: var(--clr-porpora-dark);
    color: white;
    padding: 20px 0;
    font-size: 0.9em;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links a {
    color: white;
    font-size: 1.2em;
    margin-left: 15px;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--clr-azzurro);
}

/* ---------------------------------- */
/* 8. RESPONSIVE (Desktop First)      */ 
/* ---------------------------------- */

@media (max-width: 768px) {
    
    /* Header/Navigazione Mobile */
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 60px; /* Altezza dell'header */
        left: 0;
        background-color: var(--clr-background);
        box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
        z-index: 100;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        margin: 10px 20px;
        padding: 5px 0;
        border-bottom: 1px solid var(--clr-surface-light);
    }
    
    .nav-menu a:last-child {
        border-bottom: none;
    }

    .cta-link {
        border: none;
        padding: 0;
    }

    .nav-toggle {
        display: block;
    }

    /* Sezioni */
    .hero-section {
        padding: 100px 0; /* Ridotto padding in mobile */
    }
    
    /* Responsive per la nuova sezione prodotti */
    .detail-grid-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .detail-item {
        border-left: none;
        border-bottom: 5px solid var(--clr-azzurro);
        padding-bottom: 30px;
        margin-bottom: 15px;
    }

    .footer .container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .social-links {
        order: -1;
    }
}