/* =========================================
   1. VARIABILI E RESET
   ========================================= */
:root {
    /* Colori Brand */
    --primary-color: #0056b3;   /* Blu Acceso (H1, CTA Secondarie, Sfondo Contatti) */
    --secondary-color: #32485D; /* Blu Scuro/Grigio (H2, Footer, Testo Header) */
    --accent-color: #e63946;    /* Rosso (CTA Principali, Allarmi) */
    
    /* Colori Neutri */
    --bg-light: #f4f7f9;        /* Sfondo grigio chiarissimo */
    --white: #ffffff;
    --text-color: #333333;      /* Testo standard */
    
    /* Spaziature */
    --padding-std: 20px;
}

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

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);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

ul {
    list-style: none;
}

/* =========================================
   2. LAYOUT E UTILITY
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--padding-std);
}

section {
    padding: 60px 0;
}

.text-center {
    text-align: center;
}

.bg-light {
    background-color: var(--bg-light);
}

/* =========================================
   3. TIPOGRAFIA
   ========================================= */
h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    line-height: 1.2;
    text-transform: uppercase;
    font-weight: 900;
}

h2 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-weight: 700;
}

h3 {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

p {
    margin-bottom: 15px;
}

/* Header di sezione centrati */
.section-header {
    margin-bottom: 50px;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================
   4. HEADER (Testo SX + Logo DX)
   ========================================= */
header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between; /* Spinge testo a sinistra e logo a destra */
    align-items: center;
    height: 90px;
    padding-top: 5px;
    padding-bottom: 5px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--secondary-color);
    text-transform: uppercase;
}

/* Immagine Logo a Destra */
.header-logo-img {
    max-height: 75px; 
    width: auto;
    display: block;
}

/* =========================================
   5. HERO SECTION
   ========================================= */
.hero {
    background: linear-gradient(rgba(255,255,255,0.85), rgba(255,255,255,0.95)), 
                url('tecnico_rileva_perdita_acqua.webp');
    background-size: cover;
    background-position: center;
    padding: 80px 0;
    text-align: center;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.hero-subtitle-text {
    font-size: 1.8rem;
    color: var(--accent-color);
    text-transform: uppercase;
    border-bottom: 3px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.hero-description {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 40px;
    color: #444;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* =========================================
   6. PULSANTI (CTA)
   ========================================= */
.cta-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 5px;
    font-weight: bold;
    display: inline-block;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.primary-btn {
    background-color: var(--accent-color);
    color: var(--white);
}
.primary-btn:hover {
    background-color: #c92a36;
    transform: translateY(-2px);
}

.secondary-btn {
    background-color: var(--primary-color);
    color: var(--white);
}
.secondary-btn:hover {
    background-color: #004494;
    transform: translateY(-2px);
}

.white-btn {
    background-color: var(--white);
    color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.white-btn:hover {
    background-color: #f1f1f1;
    transform: translateY(-2px);
}

/* =========================================
   7. CARDS (Grid System)
   ========================================= */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.card {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    border-top: 5px solid var(--primary-color);
}

.card:hover {
    transform: translateY(-7px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* =========================================
   8. SEZIONI SPLIT (Immagine + Testo SEO)
   ========================================= */
.split-container {
    display: flex;
    align-items: center;
    gap: 50px;
}

.split-image {
    flex: 1;
}

.split-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    object-fit: cover;
}

.split-text {
    flex: 1;
}

.split-text h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.split-text p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 20px;
}

/* =========================================
   9. NAVIGAZIONE CITTÀ
   ========================================= */
.city-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
    margin-bottom: 20px;
}

.city-btn {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: bold;
}

.city-btn:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.small-note {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-top: 10px;
}

/* =========================================
   10. FAQ (Accordion)
   ========================================= */
details {
    background: var(--white);
    margin-bottom: 15px;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e1e1e1;
    cursor: pointer;
    transition: background 0.2s;
}

details:hover {
    background: #fafafa;
}

summary {
    font-weight: bold;
    color: var(--secondary-color);
    font-size: 1.1rem;
    outline: none;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

summary::-webkit-details-marker { display: none; }

summary::after {
    content: '+';
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-left: 10px;
}

details[open] summary::after {
    content: '-';
    color: var(--accent-color);
}

details[open] summary {
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* =========================================
   11. CONTATTACI (Sezione Finale)
   ========================================= */
#contact {
    background-color: var(--primary-color) !important;
    color: var(--white);
    position: relative;
}

.cta-box {
    text-align: center;
    position: relative;
    z-index: 2;
}

#contact h2, #contact p, #contact strong {
    color: var(--white);
}

#contact h2 {
    border-color: var(--white);
}

.contact-links {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-links a {
    color: var(--white) !important;
    text-decoration: underline;
    font-weight: bold;
    font-size: 1.1rem;
}

.contact-links a:hover {
    color: #e0e0e0 !important;
    text-decoration: none;
}

/* =========================================
   12. FOOTER
   ========================================= */
footer {
    background-color: var(--secondary-color);
    color: #cccccc;
    padding: 40px 0;
    text-align: center;
    font-size: 0.9rem;
    border-top: 5px solid rgba(0,0,0,0.1);
}

.footer-links {
    margin: 15px 0;
}

.footer-links a, .social-links a {
    margin: 0 10px;
    color: var(--white);
}

.footer-links a:hover, .social-links a:hover {
    text-decoration: underline;
    color: var(--accent-color);
}

.social-links {
    margin-top: 20px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

/* =========================================
   13. PULSANTI STICKY (Mobile)
   ========================================= */
.sticky-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 2000;
}

.btn-float {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    color: var(--white);
    transition: transform 0.3s;
}

.btn-float:hover { transform: scale(1.1); }
.wa-float { background-color: #25D366; }
.call-float { background-color: var(--primary-color); }

/* =========================================
   14. MEDIA QUERIES (Responsive)
   ========================================= */
@media (max-width: 992px) {
    /* Stack sezioni split su tablet/mobile */
    .split-container {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }
    .reverse-layout {
        flex-direction: column; 
    }
    .split-image {
        order: -1; /* Immagine sempre sopra */
        width: 100%;
        max-width: 600px;
    }
    .split-text p {
        text-align: left;
    }
}

@media (max-width: 768px) {
    /* Typography Mobile */
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.2rem; }
    .hero-subtitle-text { font-size: 1.4rem; }

    /* Header Stack */
    .header-inner {
        flex-direction: row; /* Mantiene affiancati ma adatta */
        justify-content: space-between;
        height: 80px;
        gap: 10px;
    }
    .logo {
        font-size: 1rem;
        line-height: 1.2;
        max-width: 60%;
    }
    .header-logo-img {
        max-height: 50px;
    }

    /* Buttons Stack */
    .city-buttons { flex-direction: column; }
    .city-btn { width: 100%; display: block; }
    
    /* Container */
    .container { padding: 0 15px; }
}

/* =========================================
   BOX "CLICCA & CHIAMA" (Stile Immagine)
   ========================================= */
.click-call-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
    border: 3px solid #003366; /* Blu scuro come nell'immagine */
    border-radius: 10px;
    padding: 15px 30px;
    margin: 40px auto; /* Spazio sopra e sotto */
    max-width: 600px; /* Larghezza massima simile a un banner */
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.click-call-box:hover {
    transform: scale(1.02); /* Leggero ingrandimento al passaggio */
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    background-color: #f9fcff;
}

/* Parte Sinistra (Telefono) */
.cc-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #003366;
}

.cc-phone-icon svg {
    width: 40px;
    height: 40px;
    margin-bottom: 5px;
    transform: rotate(-10deg); /* Inclina la cornetta come nell'img */
}

.cc-number {
    font-size: 1.4rem;
    font-weight: 900;
    white-space: nowrap;
}

/* Parte Centrale (Testo) */
.cc-center {
    text-align: center;
    flex: 1; /* Prende lo spazio disponibile */
    padding: 0 15px;
}

.cc-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #003366;
    text-transform: uppercase;
    line-height: 1.1;
}

.cc-subtitle {
    font-size: 1rem;
    color: #444;
    margin-top: 5px;
    font-weight: 500;
}

/* Parte Destra (Mascotte) */
.cc-right {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mascot-drop {
    width: 100%;
    height: auto;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.2));
}

/* --- RESPONSIVE PER IL BOX --- */
@media (max-width: 600px) {
    .click-call-box {
        flex-direction: column; /* Impila tutto su mobile */
        text-align: center;
        padding: 20px;
        gap: 15px;
    }
    
    .cc-left {
        flex-direction: row; /* Numero e icona vicini su mobile */
        gap: 10px;
    }
    
    .cc-phone-icon svg {
        width: 30px;
        height: 30px;
        margin-bottom: 0;
    }

    .cc-title { font-size: 1.4rem; }
}