/* =========================================
   1. RESET E VARIABILI
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary-blue: #0b228b;
    --hero-bg: #132eab; /* Il tuo colore corretto */
    --header-h: 80px;
    --white: #ffffff;
}

html { scroll-behavior: smooth; }
body { font-family: sans-serif; overflow-x: hidden; width: 100%; color: #333; }

/* =========================================
   2. HEADER FISSO
   ========================================= */
.site-header {
    width: 100%; height: var(--header-h); background: var(--white);
    position: fixed; top: 0; left: 0; z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); display: flex; align-items: center;
}
.header-container { width: 100%; max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; }
.logo img { height: 55px; width: auto; object-fit: contain; }

/* DESKTOP NAV */
.nav-desktop ul { display: flex; list-style: none; gap: 25px; }
.nav-desktop a { 
    text-decoration: none; color: #333; font-weight: 700; 
    text-transform: uppercase; font-size: 0.9rem; padding: 10px 0;
    position: relative; transition: 0.3s;
}

/* STILE CLASSE ACTIVE (DESKTOP) */
.nav-desktop a.active { color: var(--primary-blue); }
.nav-desktop a.active::after {
    content: ""; position: absolute; bottom: 0; left: 0;
    width: 100%; height: 3px; background: var(--primary-blue);
}

/* NASCONDI MOBILE SU PC */
.hamburger { display: none !important; }
.nav-mobile { display: none !important; }

/* =========================================
   3. HERO SECTION (CONTENITORE ADERENTE AL 100%)
   ========================================= */
.hero-visual {
    width: 100%;
    height: auto !important; /* L'OPZIONE NUCLEARE: annulla ogni altezza sbagliata nell'HTML */
    margin-top: var(--header-h);
    background-color: var(--hero-bg);
    display: block; 
    line-height: 0; 
    overflow: hidden;
}

.hero-img {
    width: 100%;
    height: auto !important; /* L'immagine scala in modo naturale */
    display: block;
}

.hero-content { 
    padding: 60px 20px; 
    text-align: center; 
    background: var(--white); 
    line-height: 1.5; 
}

.hero-content h1 { 
    font-size: 2.8rem; 
    color: var(--primary-blue); 
    margin-bottom: 15px; 
    font-weight: 800; 
}

/* OTTIMIZZAZIONE MOBILE (TESTO) */
@media (max-width: 900px) {
    .hero-content {
        padding: 40px 20px; 
    }
    .hero-content h1 {
        font-size: 1.8rem;
    }
}

/* BOTTONI BEN DISTANZIATI */
.hero-btns { display: flex; justify-content: center; gap: 20px; margin-top: 50px; flex-wrap: wrap; }
.btn { padding: 16px 35px; border-radius: 8px; text-decoration: none; font-weight: bold; color: #fff; transition: 0.3s; font-size: 1.1rem; }
.btn-blue { background: var(--primary-blue); }
.btn-green { background: #25D366; }

/* =========================================
   4. RESPONSIVE MOBILE (< 900px)
   ========================================= */
@media (max-width: 900px) {
    .nav-desktop { display: none !important; }

    /* HAMBURGER VISIBILE */
    .hamburger {
        display: flex !important; flex-direction: column; justify-content: space-between;
        width: 30px; height: 21px; background: none; border: none; cursor: pointer; z-index: 10001;
    }
    .hamburger .bar { width: 100%; height: 3px; background-color: var(--primary-blue); border-radius: 4px; transition: 0.4s; }

    /* ANIMAZIONE X */
    .hamburger.active .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* =========================================
       MENU LATERALE MOBILE (Side Drawer a Quadrati)
       ========================================= */
    .nav-mobile {
        display: block !important; 
        position: fixed; 
        top: 0; 
        right: -100%; /* Parte da destra, fuori dallo schermo */
        left: auto;   /* Sovrascrive vecchie regole se presenti */
        width: 85%;   /* Non occupa tutto lo schermo, lascia spazio a sinistra */
        max-width: 360px; /* Limite massimo per smartphone grandi */
        height: 100vh; 
        background: #f5f7fa; /* Sfondo grigio chiarissimo elegante */
        box-shadow: -10px 0 30px rgba(0,0,0,0.15); /* Ombra laterale per staccarlo dal sito */
        padding: 100px 20px 40px; /* Spazio sopra per non coprire il tasto X */
        transition: 0.5s cubic-bezier(0.77,0.2,0.05,1.0); 
        z-index: 10000;
        overflow-y: auto; /* Permette di scorrere se i quadrati sono tanti */
    }
    
    .nav-mobile.active { right: 0; } /* Quando si clicca, entra da destra */

    /* 1. ELIMINIAMO I PUNTINI E CREIAMO LA GRIGLIA */
    .nav-mobile ul {
        list-style: none; /* RIMUOVE I PUNTINI */
        padding: 0;
        margin: 0;
        display: flex;
        flex-wrap: wrap; /* Permette di andare a capo */
        gap: 15px;       /* Distanza tra i quadrati */
    }

    /* 2. LARGHEZZA DI OGNI ELEMENTO (2 per riga) */
    .nav-mobile li {
        width: calc(50% - 7.5px); /* Calcola esattamente metà spazio meno il gap */
    }

    /* 3. STILE DEI QUADRATI (Le voci del menu) */
    .nav-mobile a { 
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        width: 100%; 
        aspect-ratio: 1 / 1;       /* TRUCCO MAGICO: Crea un quadrato perfetto automaticamente */
        background-color: #ffffff; /* Sfondo bianco puro */
        border: 1px solid #e0e4e8; 
        border-radius: 16px;       /* Stile icona App */
        text-decoration: none; 
        font-size: 0.95rem;        /* Testo bilanciato per il quadrato */
        font-weight: 800; 
        color: #333; 
        text-transform: uppercase; 
        letter-spacing: 1px; 
        box-shadow: 0 4px 15px rgba(0,0,0,0.04); 
        transition: all 0.3s ease; 
    }
    
    /* EFFETTO AL TOCCO / PAGINA ATTIVA */
    .nav-mobile a:hover,
    .nav-mobile a.active { 
        color: #ffffff; 
        background-color: var(--hero-bg); /* Colore Blu */
        border-color: var(--hero-bg);
        transform: translateY(-4px); 
        box-shadow: 0 10px 20px rgba(19, 46, 171, 0.25); 
    }

    .hero-content h1 { font-size: 2rem; }
}

/* =========================================
   SEZIONE INFO DETTAGLI SEO
   ========================================= */
.info-details-section {
    padding: 60px 20px;
    background-color: #ffffff;
}

.info-grid {
    display: flex; flex-direction: column; gap: 40px;
    max-width: 900px; margin: 0 auto; text-align: left;
}

.info-block { padding: 20px 0; border-bottom: 1px solid #f0f0f0; }
.info-block:last-child { border-bottom: none; }

.info-block h2 { font-size: 1.6rem; color: var(--primary-blue); margin-bottom: 15px; font-weight: 700; line-height: 1.3; }
.info-block p { font-size: 1.05rem; color: #4a5568; line-height: 1.8; }
.info-block p strong { color: #1a202c; font-weight: 600; }

@media (max-width: 900px) {
    .info-block h2 { font-size: 1.4rem; }
    .info-block p { font-size: 1rem; }
}

/* =========================================
   SEZIONE SERVIZI - VERSIONE LIGHT
   ========================================= */
.services-section { padding: 100px 20px; background-color: #f5f7fa; text-align: center; }
.section-title { font-size: 2rem; color: var(--primary-blue); margin-bottom: 60px; font-weight: 800; text-transform: uppercase; }

.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; max-width: 1200px; margin: 0 auto; }

.service-card { background: #ffffff; padding: 40px; border: 1px solid #e0e4e8; text-align: left; display: flex; flex-direction: column; position: relative; border-radius: 0; }
.card-number { position: absolute; top: 25px; right: 30px; font-size: 0.8rem; font-weight: 700; color: #cbd5e0; }
.service-card h3 { font-size: 1.25rem; color: #1a202c; margin-bottom: 15px; font-weight: 700; text-transform: uppercase; }
.card-line { width: 30px; height: 4px; background-color: var(--hero-bg); margin-bottom: 20px; }
.service-card p { color: #4a5568; font-size: 0.95rem; line-height: 1.6; margin-bottom: 25px; }

.service-btn { text-decoration: none; color: var(--hero-bg); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; margin-top: auto; display: inline-block; }
.service-btn:hover { text-decoration: underline; }
.service-card:hover { border-color: var(--hero-bg); box-shadow: 0 10px 25px rgba(0,0,0,0.05); }

/* =========================================
   SEZIONE ZONE - MINIMALISMO ELEGANTE
   ========================================= */
.zones-section { padding: 100px 20px; background-color: #ffffff; text-align: center; }
.zones-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; max-width: 1200px; margin: 0 auto; }

.zone-card { background: #fdfdfd; padding: 40px; border: 1px solid #eee; text-align: left; display: flex; flex-direction: column; border-radius: 0; transition: all 0.3s ease; }
.zone-card h3 { font-size: 1.25rem; color: #1a202c; margin-bottom: 15px; font-weight: 700; text-transform: uppercase; }
.zone-card p { color: #555; font-size: 0.95rem; line-height: 1.6; margin-bottom: 25px; }
.zone-card:hover { border-color: var(--hero-bg); background: #fff; box-shadow: 0 10px 25px rgba(0,0,0,0.03); }

/* =========================================
   SEZIONE GUASTI - MARCHI SPECIALIZZATI
   ========================================= */
.guasti-section { padding: 100px 20px; background-color: #f5f7fa; text-align: center; }
.guasti-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; max-width: 1200px; margin: 0 auto; }

.guasti-card { background: #ffffff; padding: 50px 40px; border: 1px solid #e0e4e8; text-align: left; display: flex; flex-direction: column; border-radius: 0; transition: all 0.3s ease; position: relative; }
.guasti-card h3 { font-size: 1.3rem; color: #1a202c; margin-bottom: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.guasti-card p { color: #4a5568; font-size: 0.95rem; line-height: 1.7; margin-bottom: 30px; }
.guasti-card:hover { border-color: var(--hero-bg); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05); }

.guasti-footer-text { max-width: 800px; margin: 60px auto 0; padding: 30px; border-top: 1px solid #e0e4e8; }
.guasti-footer-text p { font-size: 1.1rem; color: #4a5568; font-style: italic; line-height: 1.7; }

/* =========================================
   SESSIONE CTA FINALE - BLU ELEGANTE
   ========================================= */
.cta-final-section { padding: 100px 20px; background-color: var(--hero-bg); text-align: center; color: #ffffff; }
.cta-box { max-width: 850px; margin: 0 auto; }
.cta-final-section h2 { font-size: 2.2rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 20px; line-height: 1.2; }
.cta-line { width: 60px; height: 4px; background-color: #ffffff; margin: 0 auto 30px; }
.cta-final-section p { font-size: 1.15rem; line-height: 1.8; margin-bottom: 50px; opacity: 0.95; }
.cta-contacts { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }

.btn-cta-phone, .btn-cta-email { background-color: #ffffff; color: var(--hero-bg) !important; padding: 18px 40px; border-radius: 4px; text-decoration: none; font-weight: 800; text-transform: uppercase; font-size: 1rem; transition: all 0.3s ease; border: 2px solid #ffffff; }
.btn-cta-phone:hover, .btn-cta-email:hover { background-color: transparent; color: #ffffff !important; }

@media (max-width: 900px) {
    .cta-final-section { padding: 80px 20px; }
    .cta-final-section h2 { font-size: 1.8rem; }
    .cta-contacts { flex-direction: column; }
    .btn-cta-phone, .btn-cta-email { width: 100%; }
}

/* =========================================
   SEZIONE FAQ (SEO & AI ORIENTED)
   ========================================= */
.faq-section { padding: 100px 20px; background-color: #ffffff; }
.faq-container { max-width: 800px; margin: 0 auto; text-align: left; }
.faq-item { margin-bottom: 40px; border-left: 3px solid var(--hero-bg); padding-left: 25px; }
.faq-item h3 { font-size: 1.2rem; color: #1a202c; margin-bottom: 10px; font-weight: 700; }
.faq-item p { font-size: 1rem; color: #4a5568; line-height: 1.6; }

/* =========================================
   FOOTER A 4 COLONNE - ALLINEAMENTO TOP
   ========================================= */
.site-footer { padding: 80px 20px; background-color: #0b1a5e; color: #ffffff; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; max-width: 1200px; margin: 0 auto; align-items: start; }

.footer-col h4 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; color: #00a8ff; margin-top: 0; margin-bottom: 25px; font-weight: 700; }

.footer-logo { height: 100px; width: auto; display: block; margin-top: -40px; margin-bottom: 25px; filter: brightness(0) invert(1); transition: opacity 0.3s ease; }
.footer-logo:hover { opacity: 0.8; }
.footer-slogan { line-height: 1.4; opacity: 0.8; margin-top: -40px; padding-top: 0; }

.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col a { color: #ffffff; text-decoration: none; opacity: 0.8; transition: 0.3s; }
.footer-col a:hover { opacity: 1; color: #00a8ff; }

.footer-social { display: flex; flex-direction: column; gap: 12px; margin-top: 5px; }
.social-title { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; color: #00a8ff; letter-spacing: 1px; margin-bottom: 5px; }

/* =========================================
   RESPONSIVE FOOTER (Allineamento Sinistra)
   ========================================= */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .footer-grid { 
        grid-template-columns: 1fr; 
        text-align: left; /* Allinea il testo a sinistra */
        gap: 35px;
    }
    
    .footer-logo {
        height: 70px; 
        margin-top: -20px;   /* Proporzionato per il mobile */
        margin-bottom: 15px; 
        margin-left: 0;      /* Assicura che resti a sinistra */
        margin-right: 0; 
    }

    .footer-slogan {
        margin-top: -15px;   
    }

    .footer-social {
        align-items: flex-start; /* Allinea a sinistra la colonna social */
    }
}

/* =========================================
   STICKY CALL BUTTON MOBILE (Pulsante e Animazione)
   ========================================= */

/* Nascosto su schermi grandi (Desktop) */
.sticky-call-mobile {
    display: none; 
}

/* Animazione "Battito" (Pulse) */
@keyframes pulse-blue {
    0% {
        box-shadow: 0 0 0 0 rgba(19, 46, 171, 0.7); /* L'anello parte visibile e attaccato al bordo */
    }
    70% {
        box-shadow: 0 0 0 20px rgba(19, 46, 171, 0); /* L'anello si espande di 20px e diventa trasparente */
    }
    100% {
        box-shadow: 0 0 0 0 rgba(19, 46, 171, 0); /* Pausa invisibile prima di ricominciare */
    }
}

/* Mostra solo su schermi fino a 900px (Mobile e piccoli Tablet) */
@media (max-width: 900px) {
    .sticky-call-mobile {
        display: flex !important; /* Forza la visualizzazione */
        justify-content: center;  /* Centra orizzontalmente l'icona */
        align-items: center;      /* Centra verticalmente l'icona */
        position: fixed;
        bottom: 20px;             /* Distanza dal basso */
        right: 30px;              /* Distanza da destra */
        width: 60px;              /* Larghezza del cerchio */
        height: 60px;             /* Altezza del cerchio */
        background-color: #132eab; /* Il tuo blu (#132eab) */
        border-radius: 50%;       /* Forma perfettamente circolare */
        z-index: 99999;           /* Assicura che sia sempre in primo piano */
        animation: pulse-blue 2s infinite; /* Applica l'animazione in loop (2 secondi) */
        text-decoration: none;    /* Rimuove eventuali sottolineature dai link */
        transition: transform 0.2s ease; /* Transizione fluida al tocco */
    }
    
    /* Stile dell'icona SVG (Cornetta) */
    .sticky-call-mobile svg {
        width: 32px;              /* Dimensione dell'icona */
        height: 32px;
        fill: #ffffff;            /* Colore dell'icona (Bianco) */
    }

    /* Effetto quando il bottone viene premuto (touch) */
    .sticky-call-mobile:active {
        transform: scale(0.9);    /* Il bottone si rimpicciolisce leggermente al tocco */
    }
}

/* =========================================
   PAGINA CONTATTI E MODULO
   ========================================= */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1000px;
    margin: 0 auto;
}

.quick-contacts {
    background: #ffffff;
    padding: 30px;
    border: 1px solid #e0e4e8;
    border-radius: 8px;
}

.qc-item {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.qc-item:last-child {
    margin-bottom: 0;
}

.qc-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 700;
    margin-left: 10px;
}

.qc-link:hover {
    text-decoration: underline;
}

.contact-form-wrapper {
    background: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    color: #333;
    background-color: #f8fafc;
    transition: all 0.3s ease;
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(11, 34, 139, 0.1);
}

@media (max-width: 900px) {
    .contact-grid {
        grid-template-columns: 1fr; /* Mette modulo e contatti in colonna su mobile */
        gap: 40px;
    }
}