/* STILI BASE ED ELEMENTI GRAFICI INTEGRATI (DALLA TUA BOZZA) */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background-color: #f8fafc; color: #334155; line-height: 1.5; display: flex; flex-direction: column; min-height: 100vh; }

/* HEADER E NAVIGAZIONE */
header { position: sticky; top: 0; z-index: 50; background-color: rgba(255, 255, 255, 0.98); box-shadow: 0 1px 4px rgba(0,0,0,0.05); border-bottom: 1px solid #e2e8f0; }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; height: 90px; }

/* LOGO ORIGINALE RECUPERATO DAL SITO */
.logo-container img { height: 55px; width: auto; display: block; }

/* NAVIGAZIONE E GESTIONE DROP DOWN COMPLETA */
nav { display: flex; align-items: center; }
.nav-item { position: relative; display: inline-block; }

nav a { text-decoration: none; color: #475569; font-size: 14px; font-weight: 600; margin-left: 24px; transition: color 0.2s; text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 0; }
nav a:hover { color: #1e3a8a; }
nav a.active { color: #1e3a8a; border-bottom: 3px solid #1e3a8a; padding-bottom: 6px; }

/* STRUTTURA DEL SOTTOMENU A TENDINA */
.has-dropdown { position: relative; }
.dropdown-menu { 
    display: none; 
    position: absolute; 
    top: 100%; 
    left: 24px; 
    background-color: #ffffff; 
    min-width: 200px; 
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05); 
    border-radius: 8px; 
    border: 1px solid #e2e8f0; 
    padding: 8px 0; 
    z-index: 999;
}

/* MOSTRA LA TENDINA QUANDO SI PASSA IL MOUSE */
.has-dropdown:hover .dropdown-menu { display: block; }

.dropdown-menu a { 
    display: block; 
    color: #475569; 
    padding: 10px 20px; 
    margin-left: 0; 
    font-size: 13px; 
    text-transform: uppercase; 
    border-bottom: none !important;
    transition: background 0.2s;
}

.dropdown-menu a:hover { 
    background-color: #f1f5f9; 
    color: #1e3a8a; 
}

.btn-header { background-color: #1e3a8a; color: white; padding: 10px 20px; border-radius: 6px; font-size: 14px; font-weight: 600; text-decoration: none; transition: background 0.2s; text-transform: uppercase; }
.btn-header:hover { background-color: #172554; }

/* INTEGRAZIONE SELETTORE LINGUE NEL NAV ORIGINALE */
.lang-switcher-container { display: flex; align-items: center; margin-left: 24px; padding-left: 16px; border-left: 1px solid #e2e8f0; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.lang-switcher-container a { margin-left: 0; color: #94a3b8; text-decoration: none; padding: 2px 4px; transition: color 0.2s; }
.lang-switcher-container a.active, .lang-switcher-container a:hover { color: #1e3a8a; }

/* MAIN CONTENT SPACER */
.main-content { flex: 1; width: 100%; }

/* SEZIONE HERO */
.hero { position: relative; background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); color: white; padding: 100px 20px; text-align: center; }
.hero-badge { display: inline-block; padding: 6px 16px; background-color: rgba(255, 255, 255, 0.1); color: #93c5fd; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 50px; font-size: 12px; font-weight: 600; margin-bottom: 24px; text-transform: uppercase; letter-spacing: 1px; }
.hero h1 { font-size: 46px; font-weight: 800; max-width: 900px; margin: 0 auto 24px auto; line-height: 1.2; letter-spacing: -0.5px; }
.hero h1 span { color: #38bdf8; }
.hero p { font-size: 18px; color: #cbd5e1; max-width: 700px; margin: 0 auto 40px auto; font-weight: 300; }
.hero-buttons { display: flex; justify-content: center; gap: 16px; }
.btn-primary { background-color: #38bdf8; color: #0f172a; padding: 14px 28px; border-radius: 6px; font-weight: 700; text-decoration: none; transition: background 0.2s; text-transform: uppercase; font-size: 14px; }
.btn-primary:hover { background-color: #0ea5e9; }
.btn-secondary { background-color: transparent; color: white; padding: 14px 28px; border-radius: 6px; font-weight: 600; text-decoration: none; border: 2px solid #475569; transition: all 0.2s; text-transform: uppercase; font-size: 14px; }
.btn-secondary:hover { background-color: white; color: #0f172a; border-color: white; }

/* SEZIONE CHI SIAMO */
.azienda-section { max-width: 1200px; margin: 0 auto; padding: 90px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.azienda-content h2 { font-size: 32px; font-weight: 800; color: #0f172a; margin-bottom: 8px; text-transform: uppercase; letter-spacing: -0.5px; }
.azienda-content .sub { font-size: 18px; color: #1e3a8a; font-weight: 600; margin-bottom: 20px; }
.azienda-content p { color: #475569; font-size: 15px; line-height: 1.7; margin-bottom: 16px; }
/* ALLINEAMENTO PERFETTO COLLAGE FOTO CHI SIAMO */
.azienda-image-grid { 
    display: flex; 
    gap: 16px; 
    align-items: stretch; /* Forza la colonna destra ad avere la stessa identica altezza della foto a sinistra */
}

.foto-principale { 
    width: 50%; 
    height: auto; 
    object-fit: contain; /* Garantisce che Bertoli si veda intero senza tagli di testa/piedi */
    border-radius: 12px; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); 
    border: 4px solid white; 
}

.azienda-colonna-laterale {
    width: 50%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: space-between; /* Spinge le due foto alle estremità (top e bottom) */
}

.azienda-colonna-laterale img {
    width: 100%;
    /* Calcola esattamente il 50% dell'altezza disponibile, sottraendo la metà del gap */
    height: calc(50% - 8px); 
    border-radius: 12px; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); 
    border: 4px solid white; 
    display: block;
}

.logo-storico {
    object-fit: contain; /* Il vecchio logo non viene deformato né tagliato */
    background-color: white; 
    padding: 15px;
}

.foto-secondaria { 
    object-fit: cover; /* Questa foto si adatta e riempie la sua metà al millimetro, allineandosi perfettamente */
}

/* Regole Responsive per Smartphone */
@media (max-width: 768px) {
    .azienda-image-grid {
        flex-direction: column; /* Incolonna gli elementi sui telefoni */
    }
    .foto-principale, 
    .azienda-colonna-laterale {
        width: 100%;
    }
    .azienda-colonna-laterale img {
        height: auto; /* Annulla il calcolo del 50% sui telefoni per evitare schiacciamenti */
        max-height: 220px; 
    }
    .foto-secondaria {
        object-fit: cover;
    }
}

/* GRIGLIA PRODOTTI E SERVIZI REALI */
.section-products { background-color: #f1f5f9; padding: 90px 20px; }
.products-container { max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: 60px; }
.section-title h2 { font-size: 32px; font-weight: 800; color: #0f172a; margin-bottom: 12px; text-transform: uppercase; }
.section-title p { color: #64748b; font-size: 16px; max-width: 600px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }
.card { background-color: white; border: 1px solid #e2e8f0; padding: 35px; border-radius: 12px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02); display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.2s; }
.card:hover { transform: translateY(-4px); }
.card-icon { width: 50px; height: 50px; background-color: #e0f2fe; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 24px; color: #0369a1; }
.card h3 { font-size: 20px; font-weight: 700; color: #0f172a; margin-bottom: 12px; }
.card p { color: #64748b; font-size: 14px; line-height: 1.6; margin-bottom: 24px; }
.card-link { color: #1e3a8a; text-decoration: none; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; text-transform: uppercase; }

/* FOOTER */
footer { background-color: #0f172a; color: #94a3b8; padding: 60px 20px 40px 20px; font-size: 13px; border-top: 4px solid #1e3a8a; }
.footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col h4 { color: white; text-transform: uppercase; font-size: 13px; letter-spacing: 1px; margin-bottom: 16px; font-weight: 700; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: #94a3b8; text-decoration: none; }
.footer-col ul li a:hover { color: #38bdf8; }
.footer-bottom { max-width: 1200px; margin: 0 auto; padding-top: 30px; border-top: 1px solid #334155; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; color: #64748b; }

/* STILE DEL PULSANTE HAMBURGER SU DESKTOP (INVISIBILE) */
.menu-toggle { display: none; }

/* RESPONSIVE DESIGN AVANZATO E CORRETTO PER SMARTPHONE */
@media (max-width: 992px) { 
    .azienda-section { grid-template-columns: 1fr; gap: 40px; } 
}

@media (max-width: 768px) {
    .nav-container { height: 80px; padding: 0 20px; position: relative; display: flex; justify-content: space-between; align-items: center; }
    
    /* Disegna le 3 linee dell'hamburger in alto a destra */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 26px;
        height: 18px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 1001;
    }
    .menu-toggle span {
        width: 100%;
        height: 2.5px;
        background-color: #1e3a8a;
        transition: all 0.3s ease;
    }
    
    /* Trasforma l'hamburger in una X quando è cliccato */
    .menu-toggle.is-active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.is-active span:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* Nasconde la barra di navigazione sopra lo schermo */
    .nav-container nav {
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        box-shadow: 0 10px 15px rgba(0,0,0,0.05);
        border-top: 1px solid #e2e8f0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 20px 0;
        transform: translateY(-200%);
        opacity: 0;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
        z-index: 999;
    }
    
    /* Fa scendere la tendina quando si preme l'hamburger */
    .nav-container nav.is-open {
        transform: translateY(0);
        opacity: 1;
    }

    .nav-item { width: 100%; text-align: center; }
    nav a { margin-left: 0; display: block; padding: 8px 0; font-size: 15px; }
    nav a.active { border-bottom: none; padding-bottom: 8px; }
    
    /* Nasconde il bottone Scrivici per non intascare spazio utile */
    .btn-header { display: none; } 

    /* Sottomenu di Storia compresso piatto ed elegante */
    .dropdown-menu { 
        position: relative; 
        left: 0; 
        top: 0; 
        box-shadow: none; 
        border: none; 
        background: #f1f5f9; 
        width: 100%; 
        display: block; 
        padding: 5px 0;
        margin-top: 5px;
    }
/* STILE PER L'IMMAGINE SINGOLA NELLA PAGINA AZIENDA.PHP */
.azienda-image img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    border: 4px solid white !important;
}