
:root {
--primary-color: #d32f2f; /* Rosso Soccorso */
--secondary-color: #1a1a1a; /* Nero/Grigio scuro moderno */
--accent-color: #ff9800; /* Arancione per i dettagli ad alto impatto */
--light-bg: #f8f9fa;
--dark-bg: #121212;
--text-color: #333;
--text-light: #f4f4f4;
}

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

body {
font-family: 'Roboto', sans-serif;
background-color: #fff;
color: var(--text-color);
line-height: 1.8;
}

h1, h2, h3, h4 {
font-family: 'Montserrat', sans-serif;
font-weight: 700;
}

/* CONTAINER PIU' LARGO PER DESKTOP/MAC */
.container {
width: 90%;
max-width: 1450px; 
margin: 0 auto;
}

.section-padding {
padding: 100px 0;
}

/* Header & Nav Transparente/Sticky */
header {
position: fixed;
top: 0;
width: 100%;
z-index: 1000;
padding: 25px 0;
transition: all 0.4s ease;
background-color: transparent;
}

header.scrolled {
background-color: rgba(26, 26, 26, 0.95);
padding: 15px 0;
box-shadow: 0 4px 20px rgba(0,0,0,0.3);
backdrop-filter: blur(10px);
}

.header-container {
display: flex;
justify-content: space-between;
align-items: center;
}

/* NUOVI STILI PER IL LOGO IMMAGINE */
.logo a {
    text-decoration: none;
    display: inline-block;
}

.header-logo {
    height: 65px; /* Altezza ottimale per la leggibilità */
    width: auto;
    transition: all 0.4s ease;
}

header.scrolled .header-logo {
    height: 40px; /* Si rimpicciolisce con lo scroll */
    padding: 5px 10px;
}

nav {
    display: flex;
    align-items: center;
    gap: 40px;
}

.social-icons {
list-style: none;
display: flex;
gap: 20px;
}

.social-icons a {
color: #fff;
font-size: 1.5rem;
transition: all 0.3s ease;
text-decoration: none;
}

.social-icons a:hover {
color: var(--accent-color);
transform: translateY(-3px);
}

/* LANGUAGE SWITCHER */
.lang-switcher {
    display: flex;
    gap: 10px;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #fff;
}

.lang-switcher a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s ease;
}

.lang-switcher a.active {
    color: var(--accent-color);
}

.lang-switcher a:hover {
    color: #fff;
}

/* Hero Section (Immagine a pagina intera) */
#hero {
height: 100vh;
min-height: 600px;
background-image: url('baib_into.jpg');
background-size: cover;
background-position: center;
background-attachment: fixed; /* Effetto Parallasse */
display: flex;
align-items: center;
justify-content: center;
position: relative;
text-align: center;
}

.hero-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 100%);
z-index: 1;
}

.hero-content {
position: relative;
z-index: 2;
color: #fff;
max-width: 900px;
padding: 0 20px;
margin-top: 50px;
}

.hero-content h2 {
font-size: 4.5rem;
font-weight: 900;
margin-bottom: 20px;
line-height: 1.1;
text-transform: uppercase;
text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.hero-content p {
font-size: 1.6rem;
margin-bottom: 40px;
font-weight: 300;
text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.btn {
display: inline-block;
padding: 16px 40px;
text-decoration: none;
font-size: 1.1rem;
border-radius: 50px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 1px;
transition: all 0.3s ease;
}

.btn-primary {
background-color: var(--primary-color);
color: #fff;
box-shadow: 0 10px 20px rgba(211, 47, 47, 0.4);
}

.btn-primary:hover {
background-color: #b71c1c;
transform: translateY(-5px);
box-shadow: 0 15px 25px rgba(211, 47, 47, 0.6);
}


/* --- NUOVE CLASSI PER SEZIONI CON SFONDO GRANDE --- */
.full-bg-section {
    position: relative;
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Effetto parallasse anche sulle sezioni */
    overflow: hidden;
}

/* Assegnazione immagini di sfondo alle sezioni */
.bg-modulare { background-image: url('3e.jpg'); }
.bg-neve { background-image: url('2.jpg'); }
.bg-macerie { background-image: url('1d.jpg'); }
.bg-motorsport { background-image: url('1c.jpg'); }
.bg-clinica { background-image: url('1a.jpg'); }

.bg-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.65); /* Scurisce l'immagine per far leggere il testo */
    z-index: 1;
}

.bg-overlay-darker {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75); /* Più scuro per le sezioni esterne chiare */
    z-index: 1;
}

.relative-content {
    position: relative;
    z-index: 2;
}

.dark-glass-box {
    background: rgba(20, 20, 20, 0.85);
    padding: 45px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
}

.dark-glass-box h3 {
    color: var(--accent-color);
}

.dark-glass-box p {
    color: var(--text-light) !important;
}

/* -------------------------------------------------- */

/* Tipografia e Utilities */
.section-title {
text-align: center;
margin-bottom: 60px;
}

.section-title h2 {
font-size: 3.5rem;
color: var(--secondary-color);
margin-bottom: 15px;
text-transform: uppercase;
}

.section-title p {
font-size: 1.4rem;
color: #777;
font-style: italic;
}

.text-light h2 {
color: #fff;
text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.text-light p {
color: #ddd;
}

.text-center { text-align: center; }
.max-w-800 { max-width: 800px; margin-left: auto; margin-right: auto; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }
.mt-10 { margin-top: 10px; }
.mt-50 { margin-top: 50px; }

/* Griglie e Layout Immagini */
.img-fluid {
width: 100%;
height: auto;
display: block;
object-fit: cover;
}

.rounded {
border-radius: 15px;
}

.shadow {
box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.hover-zoom {
transition: transform 0.4s ease;
border: 3px solid rgba(255,255,255,0.1);
}

.hover-zoom:hover {
transform: scale(1.05);
border-color: var(--accent-color);
z-index: 10;
position: relative;
}

/* FEATURE GRID */
.feature-grid {
display: grid;
grid-template-columns: 1fr 1.7fr; 
gap: 60px;
align-items: center;
}

.feature-grid.reverse {
grid-template-columns: 1.7fr 1fr;
}
.feature-grid.reverse .text-box {
    order: 2; /* Testo a destra */
}
.feature-grid.reverse .feature-images {
    order: 1; /* Immagini a sinistra */
}

.text-box h3 {
font-size: 2.2rem;
color: var(--primary-color);
margin-bottom: 25px;
}

.text-box p {
font-size: 1.15rem;
margin-bottom: 20px;
color: #555;
}

/* VARIANTI GRIGLIE IMMAGINI */
.grid-2-col {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 35px;
align-items: center;
}

.grid-1-col {
display: grid;
grid-template-columns: 1fr;
gap: 35px;
align-items: center;
}

/* Classe per espandere un'immagine su due colonne */
.span-2 {
    grid-column: span 2;
    width: 100%;
}

/* Classe per rimpicciolire l'immagine verticale (1d.jpg) */
.portrait-img {
    width: 60%;
    margin: 0 auto;
}

/* Griglie stile Masonry/Cards */
.masonry-grid-3 {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 30px;
}

.masonry-grid-2 {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 30px;
}

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

/* Logistica Cards */
.logistics-card {
background: #fff;
padding: 20px;
border-radius: 20px;
box-shadow: 0 10px 30px rgba(0,0,0,0.05);
transition: transform 0.3s;
}

.logistics-card:hover {
transform: translateY(-10px);
}

.logistics-card h4 {
color: var(--secondary-color);
font-size: 1.4rem;
margin-bottom: 10px;
}

.logistics-card p {
color: #666;
}

/* Footer */
footer {
background-color: #0a0a0a;
color: #fff;
padding: 80px 0 20px;
}

.footer-content {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #333;
padding-bottom: 50px;
margin-bottom: 30px;
}

.footer-info h3 {
font-size: 2.2rem;
font-weight: 900;
margin-bottom: 10px;
}

.text-accent {
color: var(--accent-color) !important;
text-decoration: none;
}

.footer-social h4 {
font-size: 1.2rem;
color: #888;
}

.footer-bottom {
text-align: center;
color: #666;
font-size: 0.9rem;
}

/* Responsive e Fix per iOS/Mobile */
@media(max-width: 1024px) {
    .feature-grid, .feature-grid.reverse {
        grid-template-columns: 1fr;
    }
    .feature-grid .text-box, .feature-grid.reverse .text-box {
        order: -1; /* Testo sempre sopra su mobile/tablet */
    }
    .feature-grid .feature-images, .feature-grid.reverse .feature-images {
        order: 0; /* Immagini sempre sotto */
    }
    nav {
        gap: 15px;
    }
}

@media(max-width: 768px) {
    /* Fix bug immagini di sfondo sparite o zoomate su cellulari (in particolare iOS) */
    .full-bg-section, #hero {
        background-attachment: scroll !important;
        background-position: center center;
    }

    /* Ingrandire le immagini piccole impilandole una sopra l'altra da mobile */
    .grid-2-col {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Quando si passa a colonna singola su mobile, disattivare lo span su 2 colonne per evitare che l'immagine "esca" dallo schermo */
    .span-2 {
        grid-column: span 1;
    }

    /* L'immagine verticale (1d.jpg) su mobile può essere leggermente più larga */
    .portrait-img {
        width: 85%;
    }

    .hero-content h2 { font-size: 3rem; }
    .masonry-grid-3 { grid-template-columns: 1fr; }
    .footer-content { flex-direction: column; text-align: center; gap: 40px; }
    .section-title h2 { font-size: 2.5rem; }
    .dark-glass-box { padding: 25px; }
    
    nav {
        flex-direction: column;
        align-items: flex-end;
    }
}


/* --- SEZIONE CONTATTI E MAPPA --- */
.bg-light {
    background-color: var(--light-bg);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 40px;
    align-items: stretch;
}

.contact-card {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 25px;
}

.contact-card h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    font-size: 1.1rem;
    color: #444;
}

.contact-item i {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-top: 5px;
    width: 24px;
    text-align: center;
}

.contact-item a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.map-container {
    overflow: hidden;
    border-radius: 20px;
    min-height: 420px;
    background: #e9ecef;
}

@media(max-width: 900px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .contact-card {
        padding: 30px;
    }
    .map-container {
        min-height: 350px;
    }
}
