/* Import Font Moderni (Montserrat per titoli, Open Sans per testo) */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;800&family=Open+Sans:wght@400;600&display=swap');

/* Reset e Variabili */
:root {
    /* Palette ispirata al design "Nature" */
    --color-primary: #008080; /* Teal / Verde Acqua scuro */
    --color-primary-light: #20b2aa; /* Light Sea Green */
    --color-accent: #8bc34a; /* Verde Foglia */
    --color-accent-hover: #7cb342;
    
    --color-text-dark: #2d3436; /* Grigio scuro quasi nero */
    --color-text-light: #636e72; /* Grigio medio */
    --color-white: #ffffff;
    
    --color-bg-body: #f4fcfc; /* Sfondo chiarissimo con tocco di ciano */
    --color-bg-footer: #004d40; /* Teal molto scuro per footer */
    
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    
    --shadow-soft: 0 10px 40px rgba(0, 128, 128, 0.1);
    --shadow-card: 0 5px 15px rgba(0,0,0,0.05);
    
    --radius-card: 15px;
    --radius-btn: 50px;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-body);
    color: var(--color-text-dark);
    line-height: 1.8;
    font-weight: 400;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-card);
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* --- TOP BAR --- */
.top-bar {
    background-color: var(--color-white);
    color: var(--color-text-light);
    padding: 8px 0;
    font-size: 0.75rem;
    font-weight: 600;
    border-bottom: 1px solid #eee;
}

.top-bar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Permette il wrap su schermi molto piccoli */
    gap: 10px;
}

/* --- HEADER --- */
header {
    background-color: var(--color-white);
    padding: 15px 0; /* Ridotto leggermente padding base */
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: padding 0.3s ease;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Logo Styles Corretti */
.logo a {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 60px; /* Ottimizzato */
    width: auto;
    border-radius: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
}

.company {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--color-text-dark);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-primary);
    text-transform: uppercase;
}

/* Navigazione Desktop Standard */
nav {
    margin-left: auto;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
}

nav a {
    color: var(--color-text-dark);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

nav a:hover, nav a.active {
    color: var(--color-primary);
}

nav li:last-child {
    margin-left: 10px;
}

nav li:last-child a {
    background-color: var(--color-primary);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-btn);
    box-shadow: 0 4px 10px rgba(0, 128, 128, 0.2);
}

nav li:last-child a:hover {
    background-color: var(--color-primary-light);
    transform: translateY(-2px);
}

/* Pulsante Hamburger (Nascosto su Desktop) */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-primary);
    padding: 5px;
}

/* --- HERO SECTION --- */
.hero-wrapper {
    position: relative;
    width: 100%;
    /* Altezza dinamica per adattarsi meglio a diverse viewport */
    min-height: 600px; 
    height: 70vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-bottom: 60px;
    border-bottom-left-radius: 50% 10%;
    border-bottom-right-radius: 50% 10%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,77,64,0.6));
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    padding: 40px 20px;
}

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 20px;
    line-height: 1.1;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    font-weight: 600;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Bottoni Moderni */
.btn-primary {
    background: linear-gradient(45deg, var(--color-primary), var(--color-primary-light));
    color: white;
    padding: 15px 30px; /* Reduced side padding slightly */
    border-radius: var(--radius-btn);
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(0, 128, 128, 0.3);
    display: inline-block;
    border: none;
    cursor: pointer;
    white-space: normal; /* FIX: Allow text to wrap */
    text-align: center; /* FIX: Center text if it wraps */
    max-width: 100%; /* FIX: Prevent overflow */
    line-height: 1.2;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(0, 128, 128, 0.4);
    background: linear-gradient(45deg, var(--color-primary-light), var(--color-primary));
}

/* --- LAYOUT GENERALE --- */
.main-container {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
    display: flex;
    gap: 50px;
    position: relative;
    z-index: 10;
}

.content {
    flex: 2;
}

.content h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--color-text-dark);
    margin-bottom: 25px;
    font-weight: 800;
    line-height: 1.2;
}

.content h1::after {
    content: '';
    display: block;
    width: 80px;
    height: 5px;
    background: var(--color-accent);
    margin-top: 15px;
    border-radius: 5px;
}

.content h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--color-primary);
    margin-top: 40px;
    margin-bottom: 20px;
    font-weight: 700;
}

.content p {
    margin-bottom: 20px;
    color: var(--color-text-light);
    font-size: 1rem;
}

.hero-image-inner {
    width: 100%;
    height: 400px;
    object-fit: cover;
    margin-bottom: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s;
    border-bottom: 5px solid transparent;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-bottom-color: var(--color-accent);
}

.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--color-text-dark);
}

.feature-card .link-action {
    display: inline-block;
    margin-top: 15px;
    font-weight: 700;
    color: var(--color-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
}

aside {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 20px;
}

.sidebar-box {
    background: var(--color-white);
    padding: 35px;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.sidebar-box h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--color-text-dark);
    margin-bottom: 20px;
    font-weight: 800;
    text-transform: uppercase;
}

.sidebar-box.highlight {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    border: 2px solid #e0f2f1;
}

.sidebar-box.highlight h3 {
    color: var(--color-primary);
}

.sidebar-box.highlight .btn-primary {
    width: 100%;
    text-align: center;
    margin-top: 20px;
    background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-primary) 100%);
}

.info-badge {
    background-color: rgba(0, 128, 128, 0.1);
    color: var(--color-primary);
    padding: 10px 15px;
    border-radius: 10px;
    font-weight: 700;
    margin-bottom: 15px;
    display: inline-block;
}

footer {
    background-color: var(--color-bg-footer);
    color: #b2dfdb;
    text-align: center;
    padding: 80px 20px;
    margin-top: 80px;
    clip-path: polygon(0 10%, 100% 0, 100% 100%, 0% 100%); 
}

footer p {
    margin-bottom: 15px;
    font-size: 1rem;
}

footer strong {
    color: var(--color-white);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    display: block;
    margin-bottom: 10px;
}

/* --- MEDIA QUERIES & MOBILE OPTIMIZATIONS --- */
@media (max-width: 900px) {
    /* Top Bar */
    .top-bar .container {
        justify-content: center;
        text-align: center;
    }
    
    .top-social {
        display: none; /* Risparmio spazio in alto su mobile */
    }

    /* Header */
    .header-container {
        justify-content: space-between; /* Mantiene logo a sx, burger a dx */
        padding: 5px 20px;
    }
    
    .logo-img {
        height: 50px;
    }

    /* Hamburger Toggle */
    .menu-toggle {
        display: block;
    }

    /* Navigation Mobile */
    nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--color-white);
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        z-index: 999;
    }

    nav.active {
        max-height: 500px; /* Abbastanza alto per contenere il menu */
    }

    nav ul {
        flex-direction: column;
        padding: 20px 0;
        gap: 0;
    }

    nav li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid #f0f0f0;
    }
    
    nav li:last-child {
        margin-left: 0;
        border-bottom: none;
        margin-top: 15px;
    }

    nav a {
        display: block;
        padding: 15px 0;
        font-size: 0.95rem;
    }

    /* Hero Section Mobile */
    .hero-wrapper {
        min-height: 500px;
        height: auto;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .hero-content h1 {
        font-size: 2rem; /* Testo più piccolo */
    }
    
    .hero-content p {
        font-size: 1rem;
    }

    /* Layout Generale */
    .main-container {
        flex-direction: column;
        gap: 40px;
    }
    
    .content h1 {
        font-size: 2rem;
    }
    
    /* Button Tweaks on Mobile */
    .btn-primary {
        padding: 15px 20px; /* More reasonable padding on mobile */
        width: 100%; /* Ensure full width on mobile for touch targets */
    }

    /* Griglie */
    .feature-card {
        margin-bottom: 20px;
    }
    
    /* Forza 1 colonna nelle griglie che usano grid */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    /* Flexbox che diventano colonne */
    div[style*="display: flex"] {
        flex-direction: column;
    }
    
    /* Eccezioni per elementi piccoli come icone/numeri */
    .top-contact, 
    .logo a, 
    .logo-text,
    .header-container {
        flex-direction: row !important;
    }
    
    /* Rimuove flex column da elementi specifici interni */
    div[style*="align-items: flex-start"] {
        flex-direction: row !important;
    }

    /* Footer */
    footer {
        clip-path: none; /* Rimuove taglio diagonale su mobile per pulizia */
        padding: 50px 20px;
    }
}
