/* --- 1. VARIABILI E BASE --- */
:root {
    --primary: #2ecc71;
    --primary-dark: #27ae60;
    --dark: #2c3e50;
    --gray: #7f8c8d;
    --light-gray: #f4f7f6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    margin: 0; 
    background: #fafafa; 
    color: #333;
    line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- 2. HEADER (RESPONSIVE CON IMMAGINE) --- */
.main-header {
    position: relative;
    height: 60vh;
    display: flex; 
    align-items: center; 
    justify-content: center;
    overflow: hidden;
    color: white; 
    text-align: center;
}

.header-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.header-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center; /* Mantiene visibili i geometri come nell'originale */
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Sostituisce il vecchio gradiente fisso */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: -1;
}

.header-overlay h1 { font-size: 3rem; margin: 0; font-weight: 700; }
.header-overlay h1 span { color: var(--primary); }
.header-overlay p { font-size: 1.2rem; margin-top: 10px; opacity: 0.9; }

/* --- 3. NAVIGAZIONE --- */
nav { 
    background: var(--dark); 
    padding: 10px 0; 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav ul { 
    display: flex; 
    justify-content: center; 
    list-style: none; 
    gap: 30px; 
    margin: 0; 
    padding: 10px 0; 
}

nav a { 
    color: white; 
    text-decoration: none; 
    font-weight: bold; 
    text-transform: uppercase; 
    font-size: 0.9rem; 
    transition: 0.3s;
}

nav a:hover, nav a.active { color: var(--primary); }
#menu-toggle { display: none !important; }

/* --- 4. GRIGLIA SERVIZI --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 50px 0;
}

.service-card {
    background: white; 
    padding: 40px 30px; 
    border-radius: 8px;
    text-align: center; 
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    transition: 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.service-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
}

.service-card .icon { font-size: 2.8rem; margin-bottom: 20px; display: block; }
.service-card h4 { color: var(--dark); margin-bottom: 12px; font-size: 1.25rem; }
.service-card p { color: var(--gray); font-size: 0.95rem; margin-bottom: 15px; }
.service-card .read-more { 
    color: var(--primary); 
    text-decoration: none; 
    font-weight: bold; 
    font-size: 0.9rem;
}

/* --- 5. PULSANTE FINALE --- */
.cta-final-container { text-align: center; margin: 60px 0; }
.btn-cta-refined {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 14px 35px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    text-transform: uppercase;
    transition: 0.3s;
    letter-spacing: 0.5px;
}
.btn-cta-refined:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* --- 6. FOOTER --- */
footer { background: var(--dark); color: white; padding: 50px 0; text-align: center; }

/* --- 7. OTTIMIZZAZIONE MOBILE --- */
@media (max-width: 768px) {
    .main-header { height: 50vh; }
    .header-overlay h1 { font-size: 2.2rem; }
    .header-overlay p { font-size: 1rem; }
    .header-bg-img { object-position: center; } /* Centra l'immagine su mobile */
    nav ul { gap: 15px; }
    nav a { font-size: 0.8rem; }
    .services-grid { gap: 20px; }
}