/* --- VARIABILI & RESET --- */
:root {
    --primary-color: #d32f2f; /* Rosso Urgenza */
    --primary-dark: #b71c1c;
    --secondary-color: #1a3c5e; /* Blu Professionale */
    --text-color: #333333;
    --bg-light: #f4f6f8;
    --white: #ffffff;
    --max-width: 1200px;
    --header-height: 80px;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    padding-bottom: 0; /* Mobile fix */
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* --- UTILITY CLASSES --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.bg-light { background-color: var(--bg-light); }
.section-padding { padding: 60px 0; }
.section-title { text-align: center; margin-bottom: 40px; font-size: 2rem; color: var(--secondary-color); }

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 5px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    text-decoration: none; /* Importante per i link */
    transition: background-color 0.3s, color 0.3s; /* Aggiunge fluidità all'hover */
}

.btn-urgent {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.4);
    animation: pulse 2s infinite;
}
.btn-urgent:hover { background-color: var(--primary-dark); }

.btn-outline {
    border: 2px solid var(--white);
    color: var(--white);
    /* margin-left: 10px;  <-- RIMOSSO: Ora lo gestisce .hero-buttons */
}
.btn-outline:hover { background-color: var(--white); color: var(--secondary-color); }

.full-width { width: 100%; }

/* --- CONTENITORE BOTTONI (Gestisce lo spazio Desktop e Mobile) --- */
.hero-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Permette di andare a capo su mobile */
    gap: 20px;       /* Spazio VERTICALE e ORIZZONTALE automatico */
    margin-top: 30px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* --- HEADER & TOP BAR --- */
.top-bar { background-color: var(--secondary-color); color: var(--white); font-size: 0.9rem; padding: 8px 0; }
.top-bar-content { display: flex; justify-content: space-between; }
.top-info { display: flex; gap: 20px; }

header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 100%; }
/* --- BRAND LOGO (IMG + TESTO) --- */
.brand-logo {
    display: flex;          /* Mette img e testo sulla stessa riga */
    align-items: center;    /* Li centra verticalmente */
    gap: 12px;              /* Crea lo spazio tra l'icona e la scritta */
    text-decoration: none;  /* Rimuove sottolineature */
    height: 100%;
}

/* Stile dell'Immagine */
.brand-logo img {
    height: 55px;           /* Altezza ottimale per l'header */
    width: auto;            /* Mantiene le proporzioni */
    object-fit: contain;
}

/* Stile del Testo (Ereditato dal vecchio design) */
.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: -1px;
    line-height: 1;         /* Evita spazi extra sopra/sotto il testo */
}

.logo-text span {
    color: var(--primary-color); /* Il "24" in rosso */
}

/* --- ADATTAMENTO MOBILE --- */
@media (max-width: 768px) {
    .brand-logo {
        gap: 8px; /* Meno spazio su mobile */
    }
    
    .brand-logo img {
        height: 45px; /* Logo leggermente più piccolo su smartphone */
    }

    .logo-text {
        font-size: 1.2rem; /* Testo un po' più piccolo per non rompere il layout */
    }
}
.nav-menu { display: flex; gap: 25px; align-items: center; }
.nav-link { font-weight: 500; color: var(--secondary-color); }
.nav-link:hover, .nav-link.active { color: var(--primary-color); }
.hamburger { display: none; background: none; border: none; cursor: pointer; }

/* --- HERO SECTION --- */
.hero {
    background: linear-gradient(rgba(26, 60, 94, 0.9), rgba(26, 60, 94, 0.8)), url('hero-bg.webp'); /* Fallback colore se manca img */
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 100px 0;
    text-align: center;
}
.hero h1 { font-size: 2.8rem; margin-bottom: 20px; line-height: 1.2; }
.hero-sub { font-size: 1.2rem; margin-bottom: 30px; opacity: 0.9; max-width: 800px; margin-left: auto; margin-right: auto; }
.trust-badges { margin-top: 30px; display: flex; justify-content: center; gap: 20px; font-size: 0.9rem; flex-wrap: wrap; }

/* --- SERVICES GRID --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.service-card {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s;
    border-top: 4px solid var(--primary-color);
}
.service-card:hover { transform: translateY(-5px); }
.service-card .icon { font-size: 3rem; margin-bottom: 15px; }
.service-card h3 { margin-bottom: 10px; color: var(--secondary-color); }

/* --- CONTENT SPLIT --- */
.content-split { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; align-items: start; }
.check-list li { margin-bottom: 10px; padding-left: 25px; position: relative; }
.check-list li::before { content: '✓'; color: var(--primary-color); position: absolute; left: 0; font-weight: bold; }
.cta-box {
    background: var(--secondary-color);
    color: var(--white);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}
.cta-box h3 { margin-bottom: 10px; color: #ffeb3b; }
.cta-box p { margin-bottom: 20px; }

/* --- FAQ ACCORDION --- */
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item { margin-bottom: 15px; border-bottom: 1px solid #ddd; }
.faq-question {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 15px 0;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--secondary-color);
    display: flex;
    justify-content: space-between;
}
.faq-question::after { content: '+'; font-size: 1.5rem; }
.faq-question.active::after { content: '-'; }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-right: 20px;
}
.faq-answer p { padding-bottom: 15px; color: #555; }

/* --- FOOTER --- */
footer { background-color: var(--secondary-color); color: var(--white); padding: 60px 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col h3 { border-bottom: 2px solid var(--primary-color); display: inline-block; margin-bottom: 20px; padding-bottom: 5px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a:hover { color: #ccc; }
.phone-large { font-size: 1.5rem; font-weight: bold; color: #ffeb3b; }
.copyright { text-align: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; font-size: 0.85rem; opacity: 0.7; }

/* --- MOBILE STICKY BAR --- */
.mobile-sticky-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 999;
    padding: 10px 20px;
    justify-content: space-between;
    align-items: center;
}
.sticky-link { font-weight: bold; color: var(--secondary-color); }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .top-bar { display: none; }
    .desktop-cta { display: none; }
    .hamburger { display: block; }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        height: calc(100vh - var(--header-height));
        padding-top: 40px;
        transition: 0.3s;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
    }
    .nav-menu.active { left: 0; }
    
    .hero h1 { font-size: 2rem; }
    .content-split { grid-template-columns: 1fr; }
    
    .mobile-sticky-bar { display: flex; }
    body { padding-bottom: 70px; } /* Spazio per la sticky bar */
}

/* --- COOKIE BANNER STYLE --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #222; /* Sfondo scuro elegante */
    color: #fff;
    padding: 15px 20px;
    z-index: 9999; /* Deve stare sopra a tutto, anche alla sticky bar mobile */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    border-top: 3px solid var(--primary-color);
    transition: opacity 0.5s ease;
}

.cookie-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.cookie-content p {
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

.cookie-content a {
    color: #fff;
    font-weight: bold;
}

/* Adattamento Mobile per il Cookie Banner */
@media (max-width: 768px) {
    .cookie-banner {
        bottom: 60px; /* Lo alziamo per non coprire la Sticky Bar di chiamata */
    }
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    .cookie-buttons {
        width: 100%;
    }
    .cookie-buttons button {
        width: 100%;
    }
}

/* --- SEO LOCALITY GRID (Al posto della mappa) --- */
.locality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}
.locality-column h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    font-size: 1.1rem;
}
.locality-column ul {
    list-style: none;
}
.locality-column ul li {
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #555;
}
.locality-column ul li:before {
    content: "📍";
    margin-right: 5px;
    font-size: 0.8rem;
}

/* --- RICH SNIPPET HERO BOX --- */
.snippet-box {
    background-color: var(--secondary-color);
    color: white;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 60px; /* Distanza dalla sezione precedente */
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: row; /* Desktop: affiancati */
}

.snippet-image-container {
    flex: 1;
    min-height: 300px;
    position: relative;
}

.snippet-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Riempie il box senza deformarsi */
    display: block;
}

.snippet-text {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.snippet-text h2 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 15px;
    color: #ffeb3b; /* Giallo per contrasto */
}

.snippet-text p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    opacity: 0.9;
}

/* Mobile Responsive per il Box */
@media (max-width: 768px) {
    .snippet-box {
        flex-direction: column; /* Mobile: uno sopra l'altro */
    }
    .snippet-image-container {
        height: 200px; /* Altezza fissa immagine su mobile */
        min-height: auto;
    }
    .snippet-text {
        padding: 30px 20px;
        text-align: center;
        align-items: center;
    }
    .snippet-text h2 {
        font-size: 1.6rem;
    }
}