/* ==========================================
   BASI GENERALI E TIPOGRAFIA
   ========================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: #f9f9f9;
    color: #333;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================
   NAVIGAZIONE (MENU)
   ========================================== */
nav {
    background-color: #003566;
    padding: 10px 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav a {
    color: white;
    text-decoration: none;
    padding: 12px 18px;
    display: inline-block;
    font-weight: bold;
    transition: 0.3s;
    font-size: 1rem;
}

nav a:hover, nav a.active {
    color: #ffc300;
}

/* ==========================================
   COMPONENTI COMUNI (CARDS & FOOTER)
   ========================================== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-item {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-bottom: 4px solid #ffc300;
}

footer {
    background-color: #001d3d;
    color: white;
    text-align: center;
    padding: 50px 20px;
    margin-top: 50px;
}

footer p {
    margin: 5px 0;
}

/* ============================================================
   CORREZIONI PER DISPOSITIVI MOBILI (Smartphone e piccoli Tablet)
   ============================================================ */
@media (max-width: 768px) {
    
    /* 1. Sistemazione Header e Logo */
    .header-content {
        flex-direction: column !important; /* Stack verticale: logo sopra, testo sotto */
        padding: 15px !important;
        gap: 10px !important;
    }

    .header-content img {
        height: 110px !important; /* Logo ridotto per dare spazio ai testi */
        width: auto !important;
    }

    .header-content h1 {
        font-size: 1.7rem !important; /* Titolo più compatto */
    }

    .header-content p {
        font-size: 1rem !important;
    }

    /* 2. Bandiera Lingua (Lang Switcher) */
    .lang-switcher {
        position: absolute !important;
        top: 15px !important;
        right: 15px !important;
        transform: none !important;
    }

    /* FIX BANDIERINE: Impedisce di ereditare i 110px del logo */
    .lang-switcher img {
        height: 25px !important; 
        width: auto !important;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
    }

    /* 3. Menu di Navigazione: evita sovrapposizioni e diventa fluido */
    nav {
        display: flex !important;
        flex-wrap: wrap !important; /* Manda i link a capo se non ci stanno */
        justify-content: center !important;
        padding: 5px !important;
        position: relative !important;
    }

    nav a {
        font-size: 0.85rem !important;
        padding: 8px 12px !important;
        margin: 2px !important;
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 4px;
    }

    /* 4. Foto Hero (Immagini grandi in alto): evita deformazioni */
    .hero {
        height: 280px !important; /* Altezza fissa ideale per smartphone */
        background-attachment: scroll !important; /* Risolve bug di scorrimento su iPhone */
    }

    .hero-content h2 {
        font-size: 1.5rem !important; /* Testo sopra la foto più piccolo */
        padding: 0 15px !important;
    }

    /* 5. Tabelle (Prezzi): abilita lo scorrimento laterale */
    .prezzi-container {
        padding: 15px !important;
        overflow-x: auto !important; /* Permette di scorrere la tabella col dito */
        -webkit-overflow-scrolling: touch;
    }

    .tabella-prezzi {
        font-size: 0.8rem !important;
        min-width: 550px !important; /* Mantiene la tabella leggibile */
    }

    /* 6. Contatti e Email: evita che il testo esca dai bordi */
    .dettagli-contatto p {
        font-size: 1rem !important;
        word-wrap: break-word !important; /* Spezza l'email se troppo lunga */
        overflow-wrap: break-word !important;
        text-align: left !important;
    }
    
    .blocco-contatto {
        flex-direction: row !important;
        align-items: flex-start !important;
    }

    .blocco-contatto i {
        margin-right: 15px !important;
        font-size: 1.6rem !important;
    }

    /* 7. Griglie generiche e Margini */
    .container {
        padding: 10px 15px !important;
    }
    
    .owner-section {
        flex-direction: column !important;
        text-align: center !important;
    }

    .owner-image {
        max-width: 100% !important;
    }
}