/* =========================================
   1. IMPOSTAZIONI GENERALI E FONT
   ========================================= */
html {
    /* FONDAMENTALE: Questo assicura che il click sul menu porti 
       al punto giusto, lasciando spazio per la navbar fissa */
    scroll-padding-top: 100px; 
    
    /* Abilita lo scorrimento fluido (smooth scroll) nativo */
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: #333;
    overflow-x: hidden;
    position: relative;
}

h1, h2, h3, h4, h5, .navbar-brand {
    font-family: 'Montserrat', sans-serif;
}

/* Rimosso il vecchio "header, section { scroll-margin-top... }" 
   perché ora usiamo il metodo più robusto su "html" qui sopra */

/* =========================================
   2. NAVBAR
   ========================================= */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    padding-top: 10px;
    padding-bottom: 10px;
    transition: all 0.3s ease;
    background-color: #212529 !important; /* Grigio scuro/Nero */
}

.nav-link {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.7); /* Grigio chiaro per inattivi */
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #fff;
}

/* --- CLASSE ACTIVE (Gestita dallo ScrollSpy) --- */
/* Quando sei nella sezione, il link diventa VERDE */
.navbar-nav .nav-link.active {
    color: #198754 !important; /* Verde Campanale */
    font-weight: 700;
}

/* =========================================
   3. HERO CAROUSEL
   ========================================= */
#heroCarousel .carousel-item {
    height: 100vh;          
    min-height: 600px;      
    background-image: var(--bg-image); 
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Sfocatura e Overlay */
.carousel-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.45); 
    backdrop-filter: blur(3px);          
    -webkit-backdrop-filter: blur(3px);  
    z-index: 1;
}

.carousel-caption {
    z-index: 10; 
    bottom: 0; top: 0; 
}

.text-shadow { text-shadow: 0 4px 8px rgba(0, 0, 0, 0.9); }

.carousel-caption h1 {
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 20px;
}
.carousel-caption p {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 30px;
}
.carousel-caption .btn {
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    text-transform: uppercase;
    font-weight: 700;
    padding: 12px 30px;
    border-radius: 50px;
}

/* =========================================
   4. CAROSELLO: CONTROLLI E INDICATORI
   ========================================= */
.carousel-control-prev, .carousel-control-next {
    z-index: 20; opacity: 0.7; transition: opacity 0.3s;
}
.carousel-control-prev:hover, .carousel-control-next:hover { opacity: 1; }

.carousel-indicators { z-index: 20; margin-bottom: 2rem; }

.carousel-indicators [data-bs-target] {
    height: 5px; width: 40px; background-color: #fff;
    opacity: 0.5; border: none; border-radius: 2px;
    margin: 0 5px; transition: all 0.3s ease;
}
.carousel-indicators .active {
    background-color: #198754; opacity: 1; transform: scale(1.1);
}

/* =========================================
   5. ANIMAZIONI
   ========================================= */
.animate-up { animation: fadeInUp 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) both; }
.delay-1 { animation-delay: 0.3s; }
.delay-2 { animation-delay: 0.6s; }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   6. SEZIONI (NUMERI, PRODOTTI, ECC)
   ========================================= */
#numeri {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    position: relative;
    z-index: 20;
    padding-top: 4rem; 
    padding-bottom: 4rem;
}

/* Cards Prodotti */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none; overflow: hidden; 
}
.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
}
.card-img-top {
    height: 250px; object-fit: cover; transition: transform 0.5s ease;
}
.card:hover .card-img-top { transform: scale(1.05); }

/* Contatti e Footer */
.contact-item {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px; margin-bottom: 15px;
}
.contact-item:last-child { border-bottom: none; }
.text-success { color: #198754 !important; }
footer { border-top: 5px solid #198754; }