:root {
    --primary-color: #1473e6; /* Blu Acceso */
    --secondary-color: #06d987; /* Verde Acceso */
    --light-bg: rgba(255, 255, 255, 0.1); /* Sfondo glassmorphism leggero */
    --dark-text: #1e144a;
    --light-text: #fff;
    --border-radius-lg: 1.5rem; /* Aumentato per maggiore stondatura */
    --border-radius-sm: 0.75rem;
    --font-poppins: "Poppins", sans-serif;
    --font-montserrat: "Montserrat", sans-serif;
}

body {
    font-family: var(--font-montserrat);
    line-height: 1.6;
    color: var(--dark-text);
    overflow-x: hidden;
    background: linear-gradient(-45deg, var(--primary-color), var(--secondary-color), var(--primary-color), var(--secondary-color));
    background-size: 400% 400%;
    /* animation: gradientShift 15s ease infinite;
    -webkit-animation: gradientShift 15s ease infinite;
    background-attachment: fixed; */
}
canvas#c{
    width: 100%;
    height: 100vh;
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    object-fit: cover;
}
/* @keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@-webkit-keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
} */
.ideogramma{
    max-height: 45px;
    margin-right: 6px;
}
h1, h2, h3, h4, h5, h6, .section-title {
    font-family: var(--font-poppins);
    font-weight: 700; /* Impostato a 700, non 800 */
    color: var(--dark-text);
}

.navbar-nav .nav-link {
    font-family: var(--font-poppins);
    font-weight: 600; /* Per i link di navigazione */
}


.section-title {
    font-size: clamp(2.5rem, 8vw, 6rem);
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 0.5rem;
    display: inline-block;
    color: var(--light-text);
}

/* Colori e Bottoni */
.btn-primary {
    background-color: var(--light-bg);
    border-color: var(--light-text);
    border-radius: 50px;
    padding: 0.75rem 2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: none;
    border-width: 2px;
}
.btn-primary:hover {
    background-color: var(--light-text);
    border-color: var(--light-text);
    transform: translateY(-2px);
    color: var(--primary-color);
}

/* .icon-primary { color: var(--primary-color); }
.icon-secondary { color: var(--secondary-color); } */
.icon-primary, .icon-secondary{
    color: white !important;
}

/* Feather Icons */
.feather-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}
.feather-icon-lg {
    width: 48px;
    height: 48px;
}
.feather-icon-md {
    width: 28px;
    height: 28px;
}

/* Glassmorphism General Style (applicato a .glass-box) */
.glass-box {
    background: rgba(255, 255, 255, 0.1); /* Sfondo semi-trasparente */
    backdrop-filter: blur(10px); /* Effetto sfocatura dietro */
    border: 2px solid rgba(255, 255, 255, 0.2); /* Bordo semitrasparente */
    border-radius: var(--border-radius-lg);
    transition: transform 0.3s ease-out, background 0.3s ease;
    position: relative;
    transform-style: preserve-3d; /* Abilita trasformazioni 3D */
    perspective: 1000px; /* Profondità prospettica */
    box-shadow: 
    0 8px 80px rgba(8, 26, 78, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 34px 17px rgba(255, 255, 255, 0.2);

    /* Effetto 3D fluttuante di default */
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-5px);
    animation: float3D 8s ease-in-out infinite alternate; /* Animazione di fluttuazione */
}

/* Animazione di fluttuazione 3D */
@keyframes float3D {
    0% { transform: perspective(1000px) rotateX(1deg) rotateY(-3deg) translateY(0px); }
    50% { transform: perspective(1000px) rotateX(6deg) rotateY(-9deg) translateY(20px); }
    100% { transform: perspective(1000px) rotateX(1deg) rotateY(-3deg) translateY(0px); }
}

/* Header Desktop */
.fixed-top-desktop {
    /*background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255,255,255,0.2);
    box-shadow: none;*/
    z-index: 1030;
}
.logo-link{
    color: var(--light-text);
    font-weight: 800;
    font-size: clamp(1rem, 4vw, 1.8rem);
    text-shadow: 2px 2px 0 #5ca5fe;
    font-family: var(--font-poppins);
}
.fixed-top-desktop .logo {
    height: 50px;
}
.fixed-top-desktop .phone-number {
    font-weight: 600; /* Poppins 600 */
    color: var(--light-text);
}
.fixed-top-desktop .phone-number a {
    color: var(--light-text);
    text-decoration: none;
    margin-left: 0.5rem;
}
.fixed-top-desktop .phone-number a:hover {
    /*color: var(--primary-color);*/
    opacity: .5;
}

section#chi-siamo, 
section#servizi, 
section#gallery,
section#settori,
section#contatti{
    background-color: rgba(255,255,255,0.7);
}
section#chi-siamo h2, 
section#servizi h2, 
section#gallery h2,
section#settori h2,
section#contatti h2{
    color: var(--primary-color);

}
section#chi-siamo h3, 
section#servizi h3, 
section#gallery h3,
section#contatti h3{
    color: var(--secondary-color);
}
section#chi-siamo p, 
section#servizi p, 
section#gallery p,
section#contatti p{
    color: var(--dark-color);
    font-size: 1rem;
}
section#contatti span{
    color: var(--dark-color);
}
/* Navigazione Bottom Desktop */
.bottom-nav {
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    border-radius: var(--border-radius-lg);
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    max-width: fit-content;
    box-shadow: none;
    z-index: 1020;
    padding: 0.5rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#chi-siamo, #servizi, #settori, #gallery, #contatti{
    padding-bottom: 10rem !important;
}

.bottom-nav .navbar-nav .nav-link {
    color: var(--primary-color);
    padding: 0.75rem 1.2rem;
    margin: 0 0.5rem;
    border-radius: var(--border-radius-sm);
    transition: all 0.3s ease;
    font-weight: 600;
    white-space: nowrap;
}

.bottom-nav .navbar-nav .nav-link:hover,
.bottom-nav .navbar-nav .nav-link.active {
    background-color: rgba(var(--primary-color-rgb), 0.7);
    color: var(--light-text);
    transform: translateY(-3px);
    border-color: rgba(var(--primary-color-rgb), 0.8);
}
.bottom-nav .navbar-nav .nav-link:hover, 
.bottom-nav .navbar-nav .nav-link.active, 
#navbarNav .navbar-nav .nav-link.active {
    background-color: var(--primary-color);
    color: white; 
}

/* Navigazione Mobile (Hamburger) */
.mobile-nav {
    
    backdrop-filter: blur(28px);
    box-shadow: none;
    z-index: 1030;
}
.mobile-nav .navbar-brand .logo-mobile {
    height: 40px;
}
.mobile-nav .navbar-toggler {
    border-color: rgba(255,255,255,0.6);
    background-color: rgba(255,255,255,0.5);
}
.mobile-nav .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2820, 115, 230, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.mobile-nav .navbar-nav .nav-link {
    color: var(--light-text);
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    font-size: 8vw;
}
.mobile-nav .navbar-nav .nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(var(--primary-color-rgb), 0.1);
}

/* Hero Section */
#hero {
    height: 100vh;
    background: transparent;
    position: relative;
    overflow: hidden;
}
#hero h1 {
    font-size: clamp(3rem, 14vw, 7rem);
    line-height: 1.1;
    color: var(--light-text);
    font-weight: 800 !important;
}
#hero p.lead {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--light-text);
    text-shadow: 1px 1px 5px rgba(0,0,0,0.3);
    font-weight: 500;
}

#hero-particles-canvas {
    pointer-events: none;
    background: transparent;
}

/* Sezioni */
section {
    padding-top: 8rem;
    padding-bottom: 8rem;
    position: relative;
}

/* Chi Siamo Section - utilizza .glass-box */
#chi-siamo h3 {
    color: var(--light-text);
    font-size: 1.8rem;
    margin-top: 1rem;
}
#chi-siamo p {
    font-size: 1.1rem;
    color: white;
}

/* Servizi Section - utilizza .glass-box */
.service-box {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    animation: none; 
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateY(0px);
}
.service-box h3 {
    font-size: 1.6rem;
    margin-top: 1rem;
    color: var(--light-text);
}
.service-box p {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 0;
}

/* Settori Section - utilizza .glass-box */
.sector-box {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    height: 250px;
    /* Rimuovi l'animazione di default per i box settore quando l'immagine è l'elemento principale */
    animation: none;
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateY(0px);
}
.sector-box .sector-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.sector-box:hover .sector-img {
    transform: scale(1.1);
}
.sector-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(53, 85, 124, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 1;
    transition: opacity 0.6s ease;
    transform: translateZ(10px); /* Per assicurarsi che l'overlay sia sopra e abbia una profondità */
}
.sector-box:hover .sector-overlay {
    opacity: 1;
    background-color: rgba(20, 115, 230, 0.7);
}
.sector-overlay h3 {
    color: var(--light-text);
    font-size: 1.8rem;
    margin-top: 0.5rem;
}
.sector-overlay .feather-icon-lg {
    color: var(--light-text);
}


/* Gallery Section (Masonry) */
#gallery {
    padding-top: 8rem;
    padding-bottom: 8rem;
}
.masonry-grid {
    column-count: 3;
    column-gap: 1rem;
}
.masonry-item {
    margin-bottom: 1rem;
    break-inside: avoid;
    max-width: 32%;
    object-fit: cover;
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--border-radius-sm);
}
.masonry-item img:hover {
    transform: scale(1.02);
}

/* Contatti Section - utilizza .glass-box */
.contact-info {
    height: 100%;
}

.contact-info strong{
    color: var(--primary-color);
}
.contact-info h3 {
    color: var(--light-text);
}
.contact-list a {
    color: var(--dark-text);
    
}
.contact-info .icon-primary,
.contact-info .icon-secondary{
    color: var(--secondary-color) !important;
}
.contact-list a:hover {
    color: var(--primary-color);
}
.map-container {
    height: 400px;
    border: 1px solid rgba(255,255,255,0.2);
}
.map-container iframe {
    height: 100%;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--light-text);
    font-size: 0.9rem;
}
footer .social-icons a {
    font-size: 1.5rem;
    transition: color 0.3s ease;
}
footer .social-icons a:hover {
    color: var(--secondary-color);
}
footer a {
    text-decoration: none;
    transition: color 0.3s ease;
}
footer a:hover {
    color: var(--secondary-color);
}

/* Parallax */
.parallax-element {
    transition: transform 0.1s linear;
}
@media (max-width: 1400px) {
    .masonry-grid {
        column-count: 3;
    }
    .masonry-item {
        max-width: 32%;
    }
}
/* Media Queries per il Responsive */
@media (max-width: 991.98px) {
    .fixed-top-desktop, .bottom-nav {
        display: none !important;
    }
    .mobile-nav {
        display: block !important;
    }
    .mobile-nav .container-fluid .navbar-collapse{
        
    }
    .mobile-nav .container-fluid .navbar-collapse .navbar-nav{
        margin-left: 0 !important;
        margin-top: 15vh;
    }
    .mobile-nav .container-fluid .navbar-collapse.show{
        height: calc(100vh - 100px);
        /*display: flex;*/
    }
    #navbarNav .navbar-nav .nav-link.active{
        border-radius: 1rem;
        border: 4px solid rgba(255, 255, 255, 0.474);
        background: transparent;
        color: var(--primary-color);
        background-color: rgba(255, 255, 255, 0.686);
        
    }
    #navbarNav .navbar-nav .nav-link.active::before{
        content: "💧 ";
    }
    #hero {
        height: 80vh;
    }
    #hero h1 {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }
    .section-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    .masonry-grid {
        column-count: 2;
    }
    #contatti .row {
        flex-direction: column;
    }
    .map-container {
        height: 300px;
    }
    .glass-box {
        /* Disabilita animazione fluttuante su mobile */
        animation: none !important; 
        transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateY(0px) !important;
    }
    .mappa{
        height: 400px !important;
    }
    .masonry-item {
        max-width: 47.5%
    }
    .ideogramma{
        max-height: 35px;
        margin-right: 6px;
    }
}

@media (max-width: 767.98px) {
    /* body{
        background-size: 200% 200%;
        animation: gradientShift 12s ease infinite;
        -webkit-animation: gradientShift 12s ease infinite;
        background-attachment: fixed;
    } */

    #chi-siamo .row,
    #servizi .row,
    #settori .row {
        flex-direction: column;
    }
    .masonry-grid {
        column-count: 2;
    }
    .contact-info, .map-container {
        margin-bottom: 1.5rem;
    }
    .masonry-item {
        width: 100%;
       height: auto;
        object-fit: cover;
    }
}