/* 
 * Anselmo Group - Styles
 * Ultimo aggiornamento: 2025-01-28 18:00:00
 * Cache busting: v1.0.12
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
}

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

@media (max-width: 768px) {
    .container {
        padding: 0 20px !important;
        margin: 0 auto !important;
        max-width: calc(100% - 40px) !important;
        width: calc(100% - 40px) !important;
        box-sizing: border-box !important;
    }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 73, 132, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    padding-top: 3px;
}

.navbar.navbar-scrolled {
    background: rgba(15, 73, 132, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo img {
    height: 40px;
    transition: transform 0.3s ease;
    filter: brightness(0) invert(1); /* Rende il logo bianco su sfondo scuro */
}

.nav-logo img:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-link .nav-link-icon {
    width: 13px !important;
    height: 13px !important;
    min-width: 13px !important;
    min-height: 13px !important;
    flex-shrink: 0;
}

.nav-link:hover .nav-link-icon {
    --lord-icon-primary: #F4C86D;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #F4C86D;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-flags {
    display: flex;
    gap: 0.5rem;
}

.nav-flags a {
    text-decoration: none;
    display: block;
}

.flag {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.flag:hover {
    transform: scale(1.2);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.hero-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    background: linear-gradient(135deg, #0F4984 0%, #1e3a8a 100%);
    will-change: transform;
    transform: translateZ(0);
}

.hero-fallback-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0F4984 0%, #1e3a8a 100%);
    z-index: -1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 73, 132, 0.6) 0%, rgba(15, 73, 132, 0.5) 100%); /* Ridotta drasticamente trasparenza per massima visibilità video */
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 8rem; /* Aumentato per dare più spazio sopra rispetto all'header */
    transform: translateZ(0);
    will-change: transform;
}



.hero-content {
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 0;
    margin-top: 0; /* Rimosso completamente per spostare tutto più in alto */
}

    .hero-logo {
        margin-bottom: 0.5rem; /* Ridotto drasticamente */
        margin-top: 0.5rem; /* Ridotto drasticamente */
        animation: fadeInUp 1s ease-out;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        text-align: center !important;
        width: 100% !important;
    }

.hero-logo-img {
    height: 80px; /* Aumentato da 65px per logo più grande */
    width: auto;
    filter: brightness(0) invert(1); /* Rende il logo bianco su sfondo scuro */
    animation: fadeInUp 1s ease-out;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 auto !important; /* Centra il logo */
    text-align: center !important;
}

/* Hero Brands Section */
.hero-brands {
    margin-top: 0.5rem; /* Leggero gap aggiuntivo da hero-description */
    text-align: center;
    animation: fadeInUp 1s ease-out 0.9s both;
}

.hero-brands-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1.5rem; /* Ridotto da 2rem per meno spazio tra le card */
    max-width: 900px;
    margin: 0 auto !important; /* Forza il centraggio */
    margin-bottom: 1rem; /* Ridotto spazio sotto */
    justify-content: center !important; /* Forza il centraggio della griglia */
    align-items: center !important; /* Forza l'allineamento verticale */
}

.hero-brand-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem; /* Ridotto padding per card più compatte */
    background: rgba(255, 255, 255, 0.6); /* Aumentato da 0.3 a 0.6 per sfondo più bianco e meno trasparente */
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.5); /* Aumentato da 0.4 a 0.5 per maggiore visibilità */
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 40px; /* Ridotto di metà da 80px a 40px */
    overflow: visible; /* Cambiato da hidden a visible per permettere ai loghi di essere visibili */
    position: relative; /* Per gestire meglio il contenuto */
    width: 100%; /* Assicura che le card occupino tutto lo spazio disponibile */
    box-sizing: border-box; /* Include padding nel calcolo della larghezza */
}

.hero-brand-item:hover {
    background: rgba(255, 255, 255, 0.75); /* Aumentato da 0.45 a 0.75 per hover più bianco e visibile */
    transform: translateY(-5px);
    border-color: #F4C86D;
    box-shadow: 0 10px 25px rgba(244, 200, 109, 0.3); /* Aumentato da 0.2 a 0.3 */
}

.hero-brand-logo {
    width: 140px;
    height: 50px;
    object-fit: contain;
    filter: none;
    display: block;
    visibility: visible;
    opacity: 1;
    flex-shrink: 0;
    margin: 0 auto;
    max-width: 100%;
}

h1.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 0.5rem; /* Ridotto ulteriormente per spostare tutto più in alto */
    margin-top: 0; /* Rimosso spazio sopra il titolo */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease-out;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: white !important;
}

.group-circle {
    background: white;
    color: #0F4984;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    margin-left: 1rem;
    font-size: 0.8em;
    display: inline-block;
    animation: pulse 2s infinite;
}

    .hero-subtitle {
        font-size: 1.3rem;
        font-weight: 600; /* Aumentato da 300 a 600 per renderlo più bold */
        margin-bottom: 2.5rem; /* Gap aumentato tra subtitle e hero-text-box */
        opacity: 1; /* Aumentato da 0.9 a 1 per maggiore visibilità */
        animation: fadeInUp 1s ease-out 0.3s both;
        display: block !important;
        visibility: visible !important;
        color: #F4C86D !important; /* Colore giallo per renderlo più prominente */
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); /* Ombra per maggiore leggibilità */
    }

.hero-description {
    max-width: 900px;
    margin: 0 auto 3.5rem auto; /* Gap aumentato tra hero-text-box e card brand */
    animation: fadeInUp 1s ease-out 0.6s both;
    width: 100%;
}

/* Nuovo design moderno per il testo hero */
.hero-text-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
    width: 100%;
}

.hero-text-box {
    background: rgba(15, 73, 132, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(244, 200, 109, 0.3);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(244, 200, 109, 0.2);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.hero-text-box.animate-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Fallback: mostra hero se JS lento/assente (dopo 3s) */
.hero-text-box:not(.animate-in) {
    animation: heroFallback 0.6s ease 3s forwards;
}
.hero-text-box:not(.animate-in) .hero-text-line {
    animation: heroLineFallback 0.3s ease 3.2s forwards;
}
@keyframes heroFallback {
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes heroLineFallback {
    to { opacity: 1; transform: translateY(0); }
}

.hero-text-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.hero-text-box:hover::before {
    left: 100%;
}

.hero-text-box:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

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

.hero-text-line {
    font-size: 1.1rem;
    line-height: 1.2;
    margin-bottom: 0.2rem;
    opacity: 0;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 300;
    text-align: center;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animazioni gestite via JavaScript per maggiore controllo */

.hero-text-highlight {
    color: #F4C86D !important;
    font-weight: 600 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
}

.hero-text-highlight strong {
    color: #F4C86D !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
}

/* Stile distintivo per il nome del gruppo aziendale */
.hero-text-company {
    color: #FFFFFF !important;
    font-weight: 700 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9) !important;
    position: relative;
}

.hero-text-company strong {
    color: #FFFFFF !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9) !important;
    letter-spacing: 0.5px !important;
}



.hero-text-emphasis {
    color: #F4C86D !important;
    font-weight: 700 !important;
    font-size: 1.2rem !important;
    letter-spacing: 1px !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
    position: relative;
}



.hero-text-decoration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0.3;
    z-index: 1;
}

.decoration-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #F4C86D, transparent);
    animation: pulse 3s ease-in-out infinite;
}

.decoration-dot {
    width: 6px;
    height: 6px;
    background: #F4C86D;
    border-radius: 50%;
    animation: pulse 3s ease-in-out infinite 1.5s;
}

/* Particelle fluttuanti per effetto moderno */
.hero-text-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(244, 200, 109, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(244, 200, 109, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(244, 200, 109, 0.1) 1px, transparent 1px);
    background-size: 100px 100px, 150px 150px, 80px 80px;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-10px) rotate(1deg);
    }
    66% {
        transform: translateY(5px) rotate(-1deg);
    }
}

/* Animazioni moderne gestite via JavaScript */

@keyframes shimmer {
    0%, 100% {
        opacity: 0.5;
        transform: scaleX(0.8);
    }
    50% {
        opacity: 1;
        transform: scaleX(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.scroll-arrow {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 2s infinite;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 18px;
}

.scroll-arrow:hover {
    color: #F4C86D;
    transform: scale(1.1);
}

/* Brands Section */
.brands-section {
    padding: 8rem 0 5rem 0;
    background: white;
    position: relative;
    overflow: hidden;
    background: url('Materiale/pasta.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    animation: imageZoom 60s ease-in-out infinite;
}



.brands-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.7) 0%, 
        rgba(255, 237, 78, 0.02) 25%, 
        rgba(255, 255, 255, 0.7) 50%, 
        rgba(255, 237, 78, 0.03) 75%, 
        rgba(255, 255, 255, 0.7) 100%);
    background-size: 200% 200%;
    background-position: 0% 0%;
    z-index: 0;
    pointer-events: none;
    animation: glassReflection 12s ease-in-out infinite;
}

.brands-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 15%;
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(255, 255, 255, 0.5) 50%, 
        transparent 100%);
    z-index: 1;
    pointer-events: none;
}

.brands-section .section-title {
    color: #0F4984;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
    margin-bottom: 4rem;
    position: relative;
    z-index: 3;
}

@media (max-width: 768px) {
    .brands-section {
        background-size: cover;
        background-position: center;
        background-attachment: scroll;
    }
    
    .brands-section::after {
        display: none; /* Remove overlay on mobile */
    }
    
    .brands-section .section-title {
        margin-bottom: 3rem;
        font-size: 2rem;
    }
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

.brand-card {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    z-index: 2;
}

.brand-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: #0F4984;
}

.brand-url {
    color: #0F4984;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.brand-logo {
    max-width: 200px;
    height: auto;
    transition: transform 0.3s ease;
}

/* Logo per sfondi chiari (usa il blu) */
.brand-logo {
    filter: none;
}

/* Logo per sfondi scuri (usa il bianco) */
.dark-bg .brand-logo {
    filter: brightness(0) invert(1);
}

.brand-card:hover .brand-logo {
    transform: scale(1.05);
}

/* Removed special margin for first card to ensure uniform sizing */

/* Sezione Eventi e Fiere 2026 - Marquee */
.events-2026-section {
    padding: 5rem 0;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #e8eef5 100%);
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(15, 73, 132, 0.1);
    border-bottom: 1px solid rgba(15, 73, 132, 0.1);
}
.events-2026-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(15, 73, 132, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(244, 200, 109, 0.06) 0%, transparent 50%);
    z-index: 1;
    pointer-events: none;
}
.events-2026-section .container {
    position: relative;
    z-index: 2;
}
.events-2026-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 1rem;
    margin: -2rem auto 2.5rem;
    max-width: 600px;
    line-height: 1.5;
}
.events-marquee-wrap {
    overflow: hidden;
    margin: 0 -20px;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    mask-size: 100% 100%;
    -webkit-mask-size: 100% 100%;
}
.events-marquee {
    overflow: hidden;
    user-select: none;
}
.events-marquee-wrap:hover .events-marquee-track {
    animation-play-state: paused;
}
.events-marquee-track {
    display: flex;
    gap: 2rem;
    padding: 1.5rem 0;
    width: max-content;
    animation: eventsMarquee 40s linear infinite;
    will-change: transform;
}
.events-marquee-track img {
    height: 115px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    filter: grayscale(0.15);
    opacity: 0.9;
    transition: filter 0.3s ease, opacity 0.3s ease;
    flex-shrink: 0;
    cursor: pointer;
}
.events-marquee-track img:hover {
    filter: grayscale(0);
    opacity: 1;
}
@keyframes eventsMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@media (max-width: 768px) {
    .events-2026-section { padding: 3rem 0; }
    .events-2026-subtitle { font-size: 0.9rem; margin: -1.5rem auto 1.5rem; }
    .events-marquee-track { gap: 1.5rem; animation-duration: 35s; }
    .events-marquee-track img { height: 80px; max-width: 180px; }
}

/* Lightbox Eventi/Fiere 2026 */
.events-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.events-lightbox.open {
    display: flex;
    opacity: 1;
}
.events-lightbox-img {
    max-width: 55vw;
    max-height: 65vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}
.events-lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.5rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: opacity 0.2s, color 0.2s;
}
.events-lightbox-close:hover {
    opacity: 1;
    color: #fff;
}
.events-lightbox-prev,
.events-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.15rem;
    width: 44px;
    height: 44px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.events-lightbox-prev:hover,
.events-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
}
.events-lightbox-prev {
    left: 1.5rem;
}
.events-lightbox-next {
    right: 1.5rem;
}
@media (max-width: 768px) {
    .events-lightbox-img {
        max-width: 75vw;
        max-height: 55vh;
    }
    .events-lightbox-prev,
    .events-lightbox-next {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }
    .events-lightbox-prev { left: 0.75rem; }
    .events-lightbox-next { right: 0.75rem; }
    .events-lightbox-close { top: 1rem; right: 1rem; font-size: 1.5rem; }
}

/* Gallery Section */
.gallery-section {
    padding: 8rem 0 5rem 0;
    background: white;
    position: relative;
    overflow: hidden;
    background: url('Materiale/pasta-bg.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    /* Effetto zoom continuo funzionante - l'immagine si ingrandisce gradualmente da 120% a 140% */
    animation: imageZoom 30s ease-in-out infinite;
}

.gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(255, 237, 78, 0.01) 25%, 
        rgba(255, 255, 255, 0.95) 50%, 
        rgba(255, 237, 78, 0.01) 75%, 
        rgba(255, 255, 255, 0.95) 100%);
    background-size: 200% 200%;
    background-position: 0% 0%;
    z-index: 0;
    pointer-events: none;
    animation: glassReflection 12s ease-in-out infinite;
}

.gallery-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.7) 0%, 
        rgba(255, 255, 255, 0.65) 50%, 
        rgba(255, 255, 255, 0.7) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Regole specifiche per mobile per l'area gallery */
@media (max-width: 768px) {
    .gallery-section {
        background-size: cover !important;
        background-position: center !important;
        background-attachment: scroll !important;
        background-repeat: no-repeat !important;
        animation: none !important;
    }
    
    .gallery-section::before {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.995) 0%, 
            rgba(255, 255, 255, 0.99) 50%, 
            rgba(255, 255, 255, 0.995) 100%) !important;
        animation: none;
    }
    
    .gallery-section::after {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.98) 0%, 
            rgba(255, 255, 255, 0.95) 50%, 
            rgba(255, 255, 255, 0.98) 100%) !important;
        animation: none;
        display: block !important; /* Riattivo l'overlay per maggiore opacità */
    }
}

/* Titoli sezioni unificati: Gallery "Il Nostro Gruppo" e FAQ */
.section-title,
.faq-section-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 3rem;
    color: #0F4984;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding-bottom: 1rem;
    display: inline-block;
    width: 100%;
}
/* Linea decorativa oro: precisione industriale, richiama logo e brand */
.section-title::after,
.faq-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #F4C86D, #fff, #F4C86D);
    border-radius: 2px;
    animation: sectionTitleLineIn 0.8s ease-out 0.4s forwards;
    box-shadow: 0 0 10px rgba(244, 200, 109, 0.35);
}
@keyframes sectionTitleLineIn {
    to { width: 100px; }
}
.section-title:hover::after,
.faq-section-title:hover::after {
    width: 160px;
    transition: width 0.35s ease;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

.gallery-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.gallery-image {
    position: relative;
    height: 300px; /* Ripristinato alla dimensione originale */
    overflow: hidden;
    border-radius: 15px;
}

.gallery-image img,
.gallery-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    /* Previene il movimento del video durante lo scroll su mobile */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.gallery-item:hover .gallery-image img,
.gallery-item:hover .gallery-image video {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(15, 73, 132, 0.6)); /* Ridotta ulteriormente trasparenza per immagine di sfondo più visibile */
    color: white;
    padding: 2rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #F4C86D;
}

.gallery-overlay p {
    opacity: 0.9;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Stili per le icone animate delle statistiche */
.stat-icon, .value-icon {
    width: 3rem;
    height: 3rem;
    transition: all 0.3s ease;
}

.stat-icon:hover, .value-icon:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px rgba(244, 200, 109, 0.8));
}

/* Stili per le icone Flaticon */
.flaticon-icon {
    width: 100%;
    height: 100%;
    filter: brightness(0) saturate(100%) invert(81%) sepia(16%) saturate(1078%) hue-rotate(8deg) brightness(98%) contrast(92%);
    animation: iconFloat 3s ease-in-out infinite;
}

.flaticon-icon:hover {
    transform: scale(1.1);
    filter: brightness(0) saturate(100%) invert(81%) sepia(16%) saturate(1078%) hue-rotate(8deg) brightness(110%) contrast(102%);
}

/* Animazione per le icone */
@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* Responsive design per le card della galleria */
/* Desktop - Card più grandi per Hero Section */
@media (min-width: 1201px) {
    .hero-brands-grid {
        gap: 1.8rem; /* Ridotto da 2.5rem per meno spazio tra le card */
        max-width: 1200px; /* Aumentato per sfruttare meglio lo spazio */
    }
    
    .hero-brand-item {
        padding: 1.5rem 4rem; /* Ridotto padding orizzontale per card più proporzionate */
        min-height: 100px; /* Altezza adeguata per loghi visibili ma ancora rettangolari */
        background: rgba(255, 255, 255, 0.6); /* Mantiene sfondo più bianco */
        width: 100%; /* Assicura che le card occupino tutto lo spazio disponibile */
        box-sizing: border-box; /* Include padding nel calcolo della larghezza */
    }
    

    
    .hero-brand-item:hover {
        transform: translateY(-8px); /* Aumentato da -5px */
        background: rgba(255, 255, 255, 0.75); /* Mantiene hover più bianco */
    }
}

/* Schermi molto grandi - Card ancora più grandi per Hero */
@media (min-width: 1600px) {
    .hero-brands-grid {
        gap: 2rem; /* Ridotto da 3rem per meno spazio tra le card */
        max-width: 1400px; /* Aumentato per sfruttare meglio lo spazio */
    }
    
    .hero-brand-item {
        padding: 1.8rem 5rem; /* Ridotto padding orizzontale per card più proporzionate */
        min-height: 120px; /* Altezza adeguata per loghi visibili ma ancora rettangolari */
        background: rgba(255, 255, 255, 0.6); /* Mantiene sfondo più bianco */
        width: 100%; /* Assicura che le card occupino tutto lo spazio disponibile */
        box-sizing: border-box; /* Include padding nel calcolo della larghezza */
    }
    

    
    .hero-brand-item:hover {
        transform: translateY(-10px); /* Aumentato per schermi molto grandi */
        background: rgba(255, 255, 255, 0.75); /* Mantiene hover più bianco */
    }
}

@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .gallery-image {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gallery-image {
        height: 200px;
    }
}

/* Statistics Section */
.stats-section {
    padding: 5rem 0;
    background: #0F4984; /* Sfondo blu solido corretto ANSELMO */
    color: white;
    position: relative;
    overflow: hidden;
    scroll-margin-top: 100px; /* Offset per il menu fisso - posiziona la sezione più in alto */
}

.stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(244, 200, 109, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(244, 200, 109, 0.12) 0%, transparent 60%),
        radial-gradient(circle at 50% 50%, rgba(244, 200, 109, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 10% 30%, rgba(244, 200, 109, 0.10) 0%, transparent 55%),
        radial-gradient(circle at 90% 70%, rgba(244, 200, 109, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 30% 10%, rgba(244, 200, 109, 0.09) 0%, transparent 50%);
    z-index: 1;
    animation: goldenGlow 15s ease-in-out infinite;
}

.stats-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, 
            rgba(15, 73, 132, 0.15) 0%, 
            rgba(15, 73, 132, 0.08) 25%,
            rgba(244, 200, 109, 0.05) 50%, 
            rgba(15, 73, 132, 0.08) 75%,
            rgba(15, 73, 132, 0.15) 100%),
        linear-gradient(45deg,
            rgba(244, 200, 109, 0.03) 0%,
            rgba(15, 73, 132, 0.05) 50%,
            rgba(244, 200, 109, 0.03) 100%);
    background-size: 400% 400%, 200% 200%;
    background-position: 0% 0%, 0% 0%;
    z-index: 1;
    pointer-events: none;
    animation: liquidGlass 25s ease-in-out infinite, liquidGlass2 18s ease-in-out infinite reverse;
    backdrop-filter: blur(2px);
    filter: contrast(1.1) brightness(1.05);
}







.stats-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.stats-left {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem; /* Ridotto da 1.5rem per avvicinare il logo al testo */
    padding: 1rem 1.5rem; /* Ridotto padding verticale per blocchi più bassi */
    background: 
        rgba(255, 255, 255, 0.08),
        linear-gradient(135deg, 
            rgba(244, 200, 109, 0.05) 0%,
            rgba(255, 255, 255, 0.03) 50%,
            rgba(244, 200, 109, 0.05) 100%);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(244, 200, 109, 0.2);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 0 20px rgba(244, 200, 109, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(244, 200, 109, 0.1), 
        transparent);
    transition: left 0.6s ease;
}

.stat-item:hover::before {
    left: 100%;
}

/* Stili per le icone animate */
.stat-icon, .value-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

/* Stili per le icone Lottie */
.stat-icon lottie-player, .value-icon lottie-player {
    width: 100%;
    height: 100%;
    display: block;
}

/* Stili specifici per le icone Lottie nelle statistiche */
.stat-icon lottie-player {
    width: 60px !important;
    height: 60px !important;
}

/* Stili specifici per le icone Lottie nei valori */
.value-icon lottie-player {
    width: 40px !important;
    height: 40px !important;
}

.stat-item:hover .stat-icon,
.value-item:hover .value-icon {
    transform: scale(1.1);
}

/* Animazione personalizzata per le icone */
@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.stat-icon:hover,
.value-icon:hover {
    animation: iconPulse 0.6s ease-in-out;
}

/* Mobile liquid glass effect - automatic without events */
@media (max-width: 768px) {
    .stat-item::before {
        animation: mobileLiquidGlass 4s ease-in-out infinite;
        transition: none;
    }
    
    .stat-item {
        animation: mobileGlow 6s ease-in-out infinite;
    }
    
    .stat-item:nth-child(2) {
        animation-delay: 1s;
    }
    
    .stat-item:nth-child(3) {
        animation-delay: 2s;
    }
    
    .stat-item:nth-child(4) {
        animation-delay: 3s;
    }
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(10px) scale(1.02);
    border-color: rgba(244, 200, 109, 0.3);
    box-shadow: 0 12px 40px rgba(244, 200, 109, 0.1);
}

/* Stili per le icone Lottie nelle statistiche */
.stat-item lottie-player {
    width: 60px;
    height: 60px;
}

.stat-logo {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1); /* Rende il logo bianco su sfondo scuro */
}



.stat-text h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.stat-text p {
    font-size: 1.5rem;
    font-weight: 700;
    color: #F4C86D;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Custom styling for supply chain title to match SITI PRODUTTIVI size */
.supply-chain-title {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
}

/* Stile specifico per avvicinare il logo al testo nel primo item */
.stat-item:first-child {
    gap: 0.5rem; /* Gap ridotto solo per il primo item per avvicinare logo e testo */
}

/* Posizionamento logo ISAF per lingua italiana (testo lungo) */
.stat-item:first-child .stat-logo {
    margin-left: 0.5rem; /* Spazio generoso per testo italiano lungo */
}

/* Posizionamento logo ISAF per lingua spagnola (testo medio) */
html[lang="es"] .stat-item:first-child .stat-logo,
html[lang="es-ES"] .stat-item:first-child .stat-logo {
    margin-left: 0.8rem; /* Spazio ampio per testo spagnolo medio */
}

/* Posizionamento logo ISAF per lingua inglese (testo corto) */
html[lang="en"] .stat-item:first-child .stat-logo,
html[lang="en-US"] .stat-item:first-child .stat-logo {
    margin-left: 1.2rem; /* Spazio molto generoso per testo inglese corto */
}

.stats-right {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.value-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.value-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-10px) scale(1.02);
    border-color: rgba(244, 200, 109, 0.3);
    box-shadow: 0 12px 40px rgba(244, 200, 109, 0.1);
}

.value-item i {
    font-size: 2rem;
    color: #F4C86D;
    min-width: 40px;
    transition: all 0.3s ease;
}

.value-item:hover i {
    transform: scale(1.1);
    color: #F4C86D;
}

/* Stili per le icone Lottie nei value-item */
.value-item lottie-player {
    width: 40px;
    height: 40px;
    min-width: 40px;
}

.value-content {
    flex: 1;
}

.value-item h3 {
    font-size: 1.1rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    margin-bottom: 0.5rem;
}

.value-item p {
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.9;
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

/* Contact Section */
.contact-section {
    padding: 5rem 0;
    background: white;
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.contact-item i {
    font-size: 2rem;
    color: #0F4984;
    margin-top: 0.5rem;
}

.contact-item h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #0F4984;
}

.contact-item p {
    color: #666;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: linear-gradient(to bottom, rgba(255,255,255,1) 0%, rgba(248,250,252,1) 100%);
    color: #0F4984;
    padding: 3rem 0 1rem;
    border-top: 3px solid #0F4984;
    border-left: 1px solid rgba(15, 73, 132, 0.2);
    border-right: 1px solid rgba(15, 73, 132, 0.2);
    border-bottom: 1px solid rgba(15, 73, 132, 0.2);
    position: relative;
    overflow: hidden;
    box-shadow: 0 -8px 30px rgba(15, 73, 132, 0.18);
}

/* Effetto Liquid Glass per il footer - blu più marcato */
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(15, 73, 132, 0.22) 0%, transparent 55%),
        radial-gradient(circle at 80% 20%, rgba(15, 73, 132, 0.18) 0%, transparent 55%),
        radial-gradient(circle at 50% 50%, rgba(15, 73, 132, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 10% 30%, rgba(15, 73, 132, 0.20) 0%, transparent 50%);
    z-index: 1;
    pointer-events: none;
}

.footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(15, 73, 132, 0.14) 0%, 
        rgba(15, 73, 132, 0.10) 25%, 
        rgba(15, 73, 132, 0.22) 50%, 
        rgba(15, 73, 132, 0.10) 75%, 
        rgba(15, 73, 132, 0.14) 100%);
    background-size: 300% 300%;
    background-position: 0% 0%;
    z-index: 1;
    pointer-events: none;
    animation: footerLiquidGlass 15s ease-in-out infinite;
    backdrop-filter: blur(1px);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.footer-logo-wrap {
    position: relative;
    display: inline-block;
    overflow: hidden;
    isolation: isolate;
}

.footer-logo img {
    height: 40px;
    filter: none;
    position: relative;
    z-index: 1;
}

.footer-links {
    display: flex;
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.footer-links a {
    color: #0F4984; /* Cambiato da bianco a blu */
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500; /* Aggiunto peso al font per migliore leggibilità */
}

.footer-links a:hover {
    color: #F4C86D; /* Hover in giallo per coerenza con il tema */
}

.footer-social {
    display: flex;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.footer-social a {
    color: #0F4984; /* Cambiato da bianco a blu */
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.footer-social a:hover {
    color: #F4C86D; /* Hover in giallo per coerenza con il tema */
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    padding-bottom: 1.5rem; /* Aggiunto padding sotto il copyright */
    border-top: 1px solid rgba(15, 73, 132, 0.2); /* Bordo blu più sottile */
    opacity: 0.8;
    color: #0F4984; /* Cambiato da bianco a blu */
    position: relative;
    z-index: 2;
}

.footer-bottom p {
    margin: 0.2rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Footer responsive display */
.footer-mobile {
    display: none;
}

.footer-desktop {
    display: block;
}

/* P.IVA: non link, non blu sottolineato (iOS auto-detect telefono) */
.footer-piva,
.footer-piva span {
    color: inherit !important;
    text-decoration: none !important;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

@keyframes mobileLiquidGlass {
    0%, 100% {
        left: -100%;
        opacity: 0.8;
    }
    25% {
        left: -50%;
        opacity: 1;
    }
    50% {
        left: 0%;
        opacity: 0.9;
    }
    75% {
        left: 50%;
        opacity: 1;
    }
}

@keyframes mobileGlow {
    0%, 100% {
        background: 
            rgba(255, 255, 255, 0.08),
            linear-gradient(135deg, 
                rgba(244, 200, 109, 0.05) 0%,
                rgba(255, 255, 255, 0.03) 50%,
                rgba(244, 200, 109, 0.05) 100%);
        border-color: rgba(244, 200, 109, 0.2);
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.15),
            0 0 20px rgba(244, 200, 109, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% {
        background: 
            rgba(255, 255, 255, 0.12),
            linear-gradient(135deg, 
                rgba(244, 200, 109, 0.08) 0%,
                rgba(255, 255, 255, 0.05) 50%,
                rgba(244, 200, 109, 0.08) 100%);
        border-color: rgba(244, 200, 109, 0.4);
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.2),
            0 0 30px rgba(244, 200, 109, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
}

@keyframes glassReflection {
    0%, 100% {
        background-position: 0% 0%;
    }
    25% {
        background-position: 100% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    75% {
        background-position: 0% 100%;
    }
}

@keyframes imageZoom {
    0%, 100% {
        background-size: 120% 120%;
        transform: scale(1);
    }
    50% {
        background-size: 140% 140%;
        transform: scale(1.05);
    }
}

@keyframes liquidGlass {
    0%, 100% {
        background-position: 0% 0%;
        opacity: 0.8;
    }
    25% {
        background-position: 100% 0%;
        opacity: 1;
    }
    50% {
        background-position: 100% 100%;
        opacity: 0.9;
    }
    75% {
        background-position: 0% 100%;
        opacity: 1;
    }
}

@keyframes liquidGlass2 {
    0%, 100% {
        background-position: 0% 0%;
        opacity: 0.7;
    }
    33% {
        background-position: 100% 0%;
        opacity: 0.9;
    }
    66% {
        background-position: 100% 100%;
        opacity: 0.8;
    }
}

@keyframes goldenGlow {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

@keyframes footerLiquidGlass {
    0%, 100% {
        background-position: 0% 0%;
    }
    25% {
        background-position: 100% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    75% {
        background-position: 0% 100%;
    }
}





/* Responsive Design */
@media (max-width: 768px) {
    /* MOBILE OVERRIDE - FORZA TUTTE LE REGOLE */
    body .hero-content {
        padding: 0 2rem !important; /* Aumentato padding laterale per margini */
        margin: 0 !important;
        position: relative !important;
        z-index: 2 !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        padding-top: 8rem !important; /* Aumentato per evitare taglio del titolo */
        padding-bottom: 2rem !important;
    }
    
    body .hero-brands-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: repeat(3, 1fr) !important;
        gap: 1.5rem !important;
        max-width: 100% !important;
        padding: 0 2rem !important; /* Aumentato padding laterale per margini */
        margin: 0 auto 0 auto !important;
        justify-content: center !important;
        align-items: center !important;
    }
    

    

    

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(15, 73, 132, 0.98);
        backdrop-filter: blur(10px);
        padding: 1rem 0;
        flex-direction: column;
        gap: 1rem;
        z-index: 1000;
    }
    
    .nav-menu .nav-flags {
        display: none; /* Hide flags in main nav on mobile */
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu .nav-flags {
        display: flex;
        justify-content: center;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav-container {
        padding: 0.5rem 1rem;
    }
    
    .nav-logo img {
        height: 30px;
    }
    
    .nav-flags .flag {
        width: 20px;
        height: 14px;
    }
    
    .hero {
        height: auto;
        min-height: auto;
        padding: 0;
        overflow: visible; /* Cambiato da hidden a visible per permettere scroll naturale */
        position: relative;
        margin-top: 0; /* Assicura che non ci sia scroll iniziale */
    }
    
    .hero-overlay {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        background: linear-gradient(135deg, rgba(15, 73, 132, 0.9) 0%, rgba(15, 73, 132, 0.8) 100%);
        padding: 0.5rem 0;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        z-index: 1;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .hero-content {
        padding: 0 1rem;
        margin: 0; /* Rimosso margin che causava spostamenti */
        position: relative;
        z-index: 2;
        max-width: 100%;
        min-height: 100vh; /* Cambiato da height a min-height per evitare scroll */
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* Sposta tutto in alto */
        align-items: center;
        padding-top: 6rem; /* Aumentato spazio per la navbar */
        padding-bottom: 2rem; /* Spazio in basso */
    }
    
    /* CORREZIONE PER LOGO E TITOLO SU MOBILE */
    .hero-logo {
        margin-bottom: 1.5rem;
        display: none !important; /* Nascondo il logo su mobile - già presente nel menu */
        visibility: hidden !important;
        opacity: 0 !important;
        position: relative !important;
        z-index: 10 !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .hero-logo-img {
        height: 40px !important;
        width: auto !important;
        display: none !important; /* Nascondo il logo su mobile */
        visibility: hidden !important;
        opacity: 0 !important;
        filter: brightness(0) invert(1) !important;
        position: relative !important;
        z-index: 10 !important;
        margin: 0 auto !important;
        text-align: center !important;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
        margin-bottom: 1.5rem; /* Gap tra subtitle e hero-text-box */
        margin-top: 0; /* Rimosso margine superiore */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #F4C86D !important; /* Colore giallo per coerenza con desktop */
        text-align: center !important;
        position: relative !important;
        z-index: 10 !important;
        font-weight: 600 !important; /* Font weight bold per coerenza */
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important; /* Ombra per leggibilità */
    }
    
    h1.hero-title {
        font-size: 2.5rem;
        margin-bottom: 1rem; /* Ridotto per migliore distribuzione */
        margin-top: 0; /* Rimosso margine superiore */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: white !important;
        text-align: center !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    .hero-description {
        margin-bottom: 2rem; /* Gap tra hero-text-box e card brand */
        margin-top: 0; /* Rimosso margine superiore */
    }
    
    .hero-description p {
        font-size: 1rem;
        line-height: 1.6;
        padding: 0 1rem;
    }
    

    
    .scroll-indicator {
        position: relative;
        bottom: auto;
        margin-top: 2rem;
    }
    

    
    .hero-video {
        display: block; /* Show video on mobile */
        position: absolute; /* Keep absolute positioning */
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        z-index: -1;
    }
    
    .hero-products {
        flex-direction: column;
        gap: 2rem;
    }
    
    .product-image {
        max-width: 150px;
    }
    
    .stats-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    /* Footer responsive - mantiene il design bianco/blu su mobile */
    .footer {
        background: white !important;
        color: #0F4984 !important;
        border-top: 2px solid #0F4984 !important;
        position: relative !important;
        overflow: hidden !important;
    }
    
    /* Effetto liquid glass su mobile - blu marcato */
    .footer::before {
        background: 
            radial-gradient(circle at 20% 80%, rgba(15, 73, 132, 0.22) 0%, transparent 55%),
            radial-gradient(circle at 80% 20%, rgba(15, 73, 132, 0.18) 0%, transparent 55%),
            radial-gradient(circle at 50% 50%, rgba(15, 73, 132, 0.12) 0%, transparent 45%),
            radial-gradient(circle at 10% 30%, rgba(15, 73, 132, 0.20) 0%, transparent 50%) !important;
        z-index: 1 !important;
        pointer-events: none !important;
    }
    
    .footer::after {
        background: linear-gradient(135deg, 
            rgba(15, 73, 132, 0.14) 0%, 
            rgba(15, 73, 132, 0.10) 25%, 
            rgba(15, 73, 132, 0.22) 50%, 
            rgba(15, 73, 132, 0.10) 75%, 
            rgba(15, 73, 132, 0.14) 100%) !important;
        background-size: 300% 300% !important;
        background-position: 0% 0% !important;
        z-index: 1 !important;
        pointer-events: none !important;
        animation: footerLiquidGlass 15s ease-in-out infinite !important;
        backdrop-filter: blur(1px) !important;
    }
    
    .footer-logo img {
        filter: none !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    .footer-links a {
        color: #0F4984 !important; /* Link sempre blu su mobile */
        position: relative !important;
        z-index: 2 !important;
    }
    
    .footer-social a {
        color: #0F4984 !important; /* Icone social sempre blu su mobile */
        position: relative !important;
        z-index: 2 !important;
    }
    
    .footer-bottom {
        color: #0F4984 !important;
        border-top: 1px solid rgba(15, 73, 132, 0.35) !important;
        padding-bottom: 1.5rem !important; /* Mantiene padding sotto il copyright su mobile */
        position: relative !important;
        z-index: 2 !important;
    }
    
    .footer-bottom p {
        margin: 0.3rem 0 !important;
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
    }
    
    /* Footer responsive display for mobile */
    .footer-desktop {
        display: none !important;
    }
    
    .footer-mobile {
        display: block !important;
    }
    
    .footer-mobile p {
        margin: 0.3rem 0 !important;
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
        pointer-events: none !important;
        user-select: none !important;
    }
    
    /* CORREZIONE PER L'AREA "IL NOSTRO GRUPPO" - IMMAGINE DI SFONDO */
    .gallery-section {
        padding: 5rem 0 5rem 0; /* Aumentato padding top per creare spazio dalle card */
        margin-top: 0;
    }
    
    .brands-section {
        padding: 3rem 0 5rem 0;
        animation: none; /* Disable animation on mobile */
        margin-top: 0;
        background-size: cover !important;
        background-position: center !important;
        background-attachment: scroll !important;
    }
    
    .brands-grid {
        grid-template-columns: 1fr;
    }
    
    /* Removed special margin for first card to ensure uniform sizing */
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    /* Fix mobile scroll issues */
    html, body {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: auto;
        overflow-x: hidden;
    }
    
    .hero {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: auto;
    }
    
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }
    
    /* Enable key animations and effects on mobile */
    .hero-logo, .hero-brands, .hero-brand-item, .gallery-overlay {
        animation: initial !important;
        transition: initial !important;
    }
    
    /* Keep video and liquid glass effects active */
    .hero-video {
        display: block !important;
    }
    
    .stats-section::before, .stats-section::after, 
    .gallery-section::before, .gallery-section::after {
        animation: initial !important;
    }
    
    /* Liquid glass effect now active on mobile */
    
    .contact-info {
        grid-template-columns: 1fr;
    }
    
    /* CORREZIONE FINALE PER NAVBAR E HERO */
    .navbar {
        z-index: 1000 !important;
        position: fixed !important;
    }
    
    .hero {
        margin-top: 0 !important;
        padding-top: 0 !important;
        top: 0 !important;
        margin-bottom: 2rem !important; /* Aggiunto margine sotto la sezione hero */
    }
    
    .hero-overlay {
        top: 0 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    .hero-content {
        margin-top: 0 !important;
        padding-top: 0 !important;
        top: 0 !important;
    }
}

/* Media Query per MacBook da 12 pollici (1280x800) */
@media (min-width: 1280px) and (max-width: 1440px) and (min-height: 800px) and (max-height: 900px) {
    .hero-content {
        max-width: 900px; /* Aumentato per schermi più larghi */
        padding: 0 3rem; /* Più padding laterale */
    }
    
    h1.hero-title {
        font-size: 3.5rem; /* Titolo leggermente più piccolo per MacBook 12" */
        margin-bottom: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.4rem; /* Sottotitolo proporzionato */
        margin-bottom: 2.5rem; /* Gap tra subtitle e hero-text-box */
    }
    
    .hero-description p {
        font-size: 1.2rem; /* Testo leggermente più grande */
        line-height: 1.8;
    }
    
    .hero-brands-grid {
        max-width: 1000px; /* Griglia più larga per MacBook 12" */
        gap: 2.5rem; /* Più spazio tra i loghi */
    }
    
    .hero-brand-item {
        min-height: 70px; /* Ridotto drasticamente per card molto basse e rettangolari */
        padding: 0.8rem 3rem; /* Molto più larghe (3rem orizzontale) e molto meno alte (0.8rem verticale) */
        background: rgba(255, 255, 255, 0.6) !important; /* Sfondo più bianco e meno trasparente */
        border: 1px solid rgba(255, 255, 255, 0.5) !important; /* Bordo più visibile */
    }
    
    .hero-brand-logo {
        width: 120px !important; /* Dimensione fissa */
        height: 65px !important; /* Dimensione fissa */
        filter: none; /* Mantiene i colori naturali dei loghi */
        display: block !important; /* Forza la visualizzazione */
        visibility: visible !important; /* Forza la visibilità */
        opacity: 1 !important; /* Forza l'opacità */
        flex-shrink: 0; /* Previene il collasso delle dimensioni */
    }
    
    .section-title {
        font-size: 1.8rem; /* Titolo sezioni proporzionato */
        margin-bottom: 3.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Card più larghe */
        gap: 2.5rem;
    }
    
    .stats-content {
        gap: 3rem; /* Più spazio tra le statistiche */
    }
    
    .container {
        max-width: 1100px; /* Container più largo */
        padding: 0 2rem;
    }
}

/* Media Query per MacBook da 14 pollici (1440x900 e 1512x982) */
@media (min-width: 1440px) and (max-width: 1600px) and (min-height: 900px) and (max-height: 1000px) {
    .hero-content {
        max-width: 1000px; /* Ancora più largo per MacBook 14" */
        padding: 0 4rem; /* Più padding laterale */
    }
    
    h1.hero-title {
        font-size: 4rem; /* Titolo proporzionato per MacBook 14" */
        margin-bottom: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem; /* Sottotitolo proporzionato */
        margin-bottom: 3rem; /* Gap tra subtitle e hero-text-box */
    }
    
    .hero-description p {
        font-size: 1.3rem; /* Testo proporzionato */
        line-height: 1.9;
    }
    
    .hero-brands-grid {
        max-width: 1100px; /* Griglia ottimizzata per MacBook 14" */
        gap: 3rem; /* Spazio ottimale tra i loghi */
    }
    
    .hero-brand-item {
        min-height: 80px; /* Ridotto drasticamente per card molto basse e rettangolari */
        padding: 1rem 4rem; /* Molto più larghe (4rem orizzontale) e molto meno alte (1rem verticale) */
        background: rgba(255, 255, 255, 0.6) !important; /* Sfondo più bianco e meno trasparente */
        border: 1px solid rgba(255, 255, 255, 0.5) !important; /* Bordo più visibile */
    }
    
    .hero-brand-logo {
        width: 140px !important; /* Dimensione fissa */
        height: 75px !important; /* Dimensione fissa */
        filter: none; /* Mantiene i colori naturali dei loghi */
        display: block !important; /* Forza la visualizzazione */
        visibility: visible !important; /* Forza la visibilità */
        opacity: 1 !important; /* Forza l'opacità */
        flex-shrink: 0; /* Previene il collasso delle dimensioni */
    }
    
    .section-title {
        font-size: 2rem; /* Titolo sezioni ottimizzato */
        margin-bottom: 4rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Card ottimizzate */
        gap: 3rem;
    }
    
    .stats-content {
        gap: 4rem; /* Spazio ottimale tra le statistiche */
    }
    
    /* Ottimizzazione icone animate su tablet */
    .stat-icon, .value-icon {
        font-size: 2.2rem;
        width: 55px;
        height: 55px;
    }
    
    .container {
        max-width: 1200px; /* Container ottimizzato */
        padding: 0 2.5rem;
    }
    
    .gallery-section, .brands-section {
        padding: 10rem 0 6rem 0; /* Più spazio verticale */
    }
    
    .stats-section {
        padding: 6rem 0; /* Sezione statistiche ottimizzata */
    }
}

@media (max-width: 480px) {
    .brands-section {
        background-size: cover;
        background-position: center;
        background-attachment: scroll;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    .hero-logo-img {
        height: 25px;
    }
    
    /* MacBook 14" specific fixes */
    @media (min-width: 1440px) and (max-width: 1512px) {
        .hero-logo {
            margin-top: 0.5rem;
            margin-bottom: 0.5rem;
        }
        
        .hero-logo-img {
            height: 55px;
            width: auto;
        }
        
        .hero-content {
            padding-top: 2rem;
        }
    }
    
    /* General medium screen fixes */
    @media (min-width: 1200px) and (max-width: 1600px) {
        .hero-logo {
            margin-top: 0.75rem;
            margin-bottom: 0.75rem;
        }
        
        .hero-logo-img {
            height: 60px;
            width: auto;
        }
        
        .hero-content {
            padding-top: 1.5rem;
        }
    }
    

    
    /* Ottimizzazione icone animate su mobile */
    .stat-icon, .value-icon {
        width: 50px;
        height: 50px;
    }
    
    .stat-icon lottie-player, .value-icon lottie-player {
        width: 50px;
        height: 50px;
    }
    
    .stat-item, .value-item {
        padding: 1.2rem;
        gap: 1rem;
    }
    
    /* Hero brands mobile optimization - removed duplicate */
    
    /* Gallery section mobile */
    .gallery-section::after {
        display: none; /* Remove overlay on mobile */
    }
    
    /* Ottimizzazione per smartphone molto piccoli */
    @media (max-width: 480px) {
        h1.hero-title {
            font-size: 1.6rem;
            margin-bottom: 0.6rem;
        }
        
        .hero-subtitle {
            font-size: 0.8rem;
            margin-bottom: 1rem; /* Gap tra subtitle e hero-text-box */
        }
        
        .hero-description p {
            font-size: 0.8rem;
            line-height: 1.4;
        }
        
        .hero-brand-logo {
            max-width: 70px; /* Ancora più grande su smartphone */
            max-height: 85px;
        }
        
        .hero-brands-grid {
            gap: 1rem; /* Più spazio tra i loghi */
        }
    }
    
    /* CORREZIONE OPACITÀ IMMAGINE DI SFONDO SU MOBILE */
    .gallery-section {
        background-opacity: 0.8 !important; /* Ripristino visibilità dell'immagine di sfondo */
    }
    
    .gallery-section::before {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.7) 0%, 
            rgba(255, 255, 255, 0.6) 50%, 
            rgba(255, 255, 255, 0.7) 100%) !important;
        animation: none;
    }
    
    .gallery-section::after {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.6) 0%, 
            rgba(255, 255, 255, 0.5) 50%, 
            rgba(255, 255, 255, 0.6) 100%) !important;
        animation: none;
        display: block !important; /* Riattivo l'overlay per maggiore opacità */
    }
    
    h1.hero-title {
        font-size: 1.8rem;
    }
    
    .group-circle {
        display: block;
        margin: 1rem auto 0;
        width: fit-content;
    }
    
    /* Titolo "Il Nostro Gruppo" più piccolo su mobile */
    .section-title {
        font-size: 1.2rem; /* Proporzionale alla dimensione base 1.5rem */
        margin-bottom: 1.5rem;
        font-weight: 600 !important; /* Stesso font-weight per coerenza */
        text-transform: uppercase !important; /* Tutto maiuscolo per uniformità */
        letter-spacing: 1px !important; /* Spaziatura lettere per coerenza */
        color: #0F4984 !important; /* Colore blu per uniformità */
    }
    
    /* CORREZIONE LOGO E TITOLO SU SCREEN PICCOLI */
    .hero-logo {
        margin-bottom: 1rem;
        display: none !important; /* Nascondo il logo su mobile - già presente nel menu */
        visibility: hidden !important;
        opacity: 0 !important;
        position: relative !important;
        z-index: 10 !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .hero-logo-img {
        height: 35px !important;
        width: auto !important;
        display: none !important; /* Nascondo il logo su mobile */
        visibility: hidden !important;
        opacity: 0 !important;
        filter: brightness(0) invert(1) !important;
        position: relative !important;
        z-index: 10 !important;
        margin: 0 auto !important; /* Centra il logo */
        text-align: center !important;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.2rem; /* Gap tra subtitle e hero-text-box */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: white !important;
        text-align: center !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    h1.hero-title {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
        margin-top: 0; /* Rimosso margin-top problematico */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: white !important;
        text-align: center !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    .stat-item, .value-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .stat-logo {
        margin-left: 0;
        margin: 0 auto;
    }
    
    .value-item p {
        font-size: 0.85rem;
    }
    
    /* Ridotta opacità overlay "Il nostro gruppo" su mobile per vedere meglio l'immagine di sfondo */
    .group-section::before {
        background: linear-gradient(transparent, rgba(15, 73, 132, 0.4)) !important; /* Ridotta ulteriormente trasparenza per mobile */
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    z-index: 10001;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: #0F4984;
    text-decoration: none;
}

.modal-header {
    background: linear-gradient(135deg, #0F4984 0%, #1e3a8a 100%);
    color: white;
    padding: 2rem;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-header i {
    font-size: 2rem;
    color: #F4C86D;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.modal-body {
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.modal-image {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.modal-image img,
.modal-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.modal-image {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: 400px;
}

.modal-image:hover img,
.modal-image:hover video {
    transform: scale(1.05);
}

.modal-text h3 {
    color: #0F4984;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.modal-text p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.modal-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.feature:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.feature i {
    color: #0F4984;
    font-size: 1.2rem;
    min-width: 20px;
}

.feature span {
    color: #333;
    font-weight: 500;
}

/* Gallery item cursor */
.gallery-item {
    cursor: pointer;
}

/* Modal animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .modal-header {
        padding: 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-image {
        height: 250px;
    }
}

/* Fix for pasta background image on mobile */
@media (max-width: 768px) {
    .brands-section {
        background-size: cover;
        background-position: center;
        background-attachment: scroll;
    }
    
    /* Fix overlapping areas */
    .hero-description {
        margin-top: 0; /* Rimosso margin problematico */
        margin-bottom: 2.5rem; /* Gap tra hero-text-box e card brand */
        padding: 0 1rem;
    }
    
    .hero-description p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .scroll-indicator {
        bottom: 2rem; /* RIDOTTO SPAZIO DAL BASSO PER AVVICINARE ALLA SEZIONE SUCCESSIVA */
        position: absolute !important;
        margin-top: 2rem !important; /* RIDOTTO SPAZIO SOPRA */
    }
    
    .scroll-arrow {
        width: 20px;
        height: 20px;
    }
    
    /* Gallery cards mobile - show overlay by default */
    .gallery-overlay {
        transform: translateY(0);
        background: linear-gradient(transparent, rgba(15, 73, 132, 0.95));
    }
    
    .gallery-item:hover .gallery-overlay {
        transform: translateY(0);
    }
    
    /* CORREZIONE GLOBALE PER SCROLL E POSIZIONAMENTO */
    .hero {
        overflow: visible !important;
        position: relative !important;
    }
    
    .hero-overlay {
        overflow: visible !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    .hero-content {
        position: relative !important;
        z-index: 10 !important;
        overflow: visible !important;
    }
    
    /* Rimuove eventuali blocchi di scroll */
    html, body {
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .hero-video {
        z-index: -1 !important;
    }
}

/* Preloader: stili critici in head, qui solo eventuali override */
    
    /* Fix video parallax on mobile */
    .hero-video {
        position: fixed !important;
        z-index: -1 !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    /* Ensure overlay moves with content on mobile */
    .hero-overlay {
        position: relative !important;
        z-index: 1 !important;
    }
}

/* Extra small mobile devices */
@media (max-width: 360px) {
    /* Fix video parallax on very small screens */
    .hero-video {
        position: fixed !important;
        z-index: -1 !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    .hero-overlay {
        position: relative !important;
        z-index: 1 !important;
    }
    
    .hero-brands-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0 0.2rem;
        margin-bottom: 2rem; /* Spazio sotto per evitare tagli */
    }
    
    .hero-brand-item {
        padding: 0.4rem 1rem; /* Più larghe (1rem orizzontale) e altezza adeguata (0.4rem verticale) per loghi visibili */
        min-height: 45px; /* Altezza adeguata per loghi visibili ma ancora rettangolari */
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        background: rgba(255, 255, 255, 0.6) !important; /* Sfondo più bianco e meno trasparente */
        border: 1px solid rgba(255, 255, 255, 0.5) !important; /* Bordo più visibile */
    }
    
    .hero-brand-logo {
        width: 60px !important; /* Ridimensionato per mobile molto piccolo */
        height: 35px !important; /* Ridimensionato per mobile molto piccolo */
        object-fit: contain;
        filter: none; /* Mantiene i colori naturali dei loghi */
        display: block !important; /* Forza la visualizzazione */
        visibility: visible !important; /* Forza la visibilità */
        opacity: 1 !important; /* Forza l'opacità */
        flex-shrink: 0; /* Previene il collasso delle dimensioni */
        margin: 0 auto; /* Centra i loghi */
    }
    
    /* Titolo "Il Nostro Gruppo" ancora più piccolo su schermi molto piccoli */
    .section-title {
        font-size: 1rem; /* Proporzionale alla dimensione base 1.5rem */
        margin-bottom: 1.5rem;
        font-weight: 600 !important; /* Stesso font-weight per coerenza */
        text-transform: uppercase !important; /* Tutto maiuscolo per uniformità */
        letter-spacing: 1px !important; /* Spaziatura lettere per coerenza */
        color: #0F4984 !important; /* Colore blu per uniformità */
    }
    
    /* CORREZIONE LOGO E TITOLO SU SCREEN MOLTO PICCOLI */
    .hero-logo {
        margin-bottom: 0.8rem;
        display: none !important; /* Nascondo il logo su mobile - già presente nel menu */
        visibility: hidden !important;
        opacity: 0 !important;
        position: relative !important;
        z-index: 10 !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .hero-logo-img {
        height: 30px !important;
        width: auto !important;
        display: none !important; /* Nascondo il logo su mobile */
        visibility: hidden !important;
        opacity: 0 !important;
        filter: brightness(0) invert(1) !important;
        position: relative !important;
        z-index: 10 !important;
        margin: 0 auto !important; /* Centra il logo */
        text-align: center !important;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem; /* Gap tra subtitle e hero-text-box */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: white !important;
        text-align: center !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    h1.hero-title {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
        margin-top: 0; /* Rimosso margin-top problematico */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: white !important;
        text-align: center !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    /* CORREZIONE PER L'AREA "IL NOSTRO GRUPPO" SU SCREEN MOLTO PICCOLI */
    .gallery-section {
        padding: 4rem 0 3rem 0; /* AUMENTATO PADDING TOP PER SPAZIO DALLA SEZIONE HERO */
        background-opacity: 0.7 !important; /* Ripristino visibilità dell'immagine di sfondo */
    }
    
    .gallery-section::before {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.6) 0%, 
            rgba(255, 255, 255, 0.5) 50%, 
            rgba(255, 255, 255, 0.6) 100%) !important;
        animation: none;
    }
    
    .gallery-section::after {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.5) 0%, 
            rgba(255, 255, 255, 0.4) 50%, 
            rgba(255, 255, 255, 0.5) 100%) !important;
        animation: none;
        display: block !important;
    }
}

/* Smooth Scrolling e ottimizzazioni */
html {
    scroll-behavior: smooth;
    overflow-anchor: auto;
}

/* Loading Animation */
.loading {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.loading.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Gestione a capo del titolo su mobile */
.mobile-break {
    display: none; /* Nascosto su desktop */
}

@media (max-width: 768px) {
    /* HERO SECTION MOBILE - COMPLETAMENTE RIFATTA */
    
    /* Nascondo elementi non necessari */
    .brands-title {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Hero section compatta */
    .hero {
        height: auto !important; /* Altezza automatica per contenere tutto il contenuto */
        min-height: 100vh !important;
        padding: 0 !important;
        overflow: visible !important; /* Cambiato da hidden a visible per permettere scroll */
        position: relative !important;
        margin-top: 0 !important;
    }
    
    /* Video contenuto su mobile */
    .hero-video {
        position: absolute !important; /* Cambiato da fixed a absolute */
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        z-index: -1 !important;
        background: linear-gradient(135deg, #0F4984 0%, #1e3a8a 100%) !important;
    }
    
    /* Hero overlay compatto */
    .hero-overlay {
        position: relative !important;
        top: 0 !important; /* Rimosso offset negativo */
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: linear-gradient(135deg, rgba(15, 73, 132, 0.75) 0%, rgba(15, 73, 132, 0.65) 100%) !important; /* Ridotta opacità per vedere meglio il video su mobile */
        padding: 1rem 0 !important;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
        z-index: 1 !important;
        overflow: visible !important; /* Cambiato da hidden a visible */
        box-sizing: border-box !important;
        min-height: auto !important; /* Cambiato da 100vh a auto per altezza naturale */
    }
    
    /* Container con margini corretti */
    .hero .container {
        padding: 0 10px !important;
        margin: 0 auto !important;
        max-width: calc(100% - 20px) !important;
        width: calc(100% - 20px) !important;
    }
    
    /* Stili responsive per il nuovo design del testo hero */
    .hero-text-box {
        padding: 0.8rem 1.2rem !important;
        border-radius: 15px !important;
        margin: 0.3rem 0 !important;
        background: rgba(15, 73, 132, 0.9) !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        border: 1px solid rgba(244, 200, 109, 0.3) !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .hero-text-line {
        font-size: 0.85rem !important;
        line-height: 1.35 !important;
        margin-bottom: 0.4rem !important;
        text-align: center !important;
        hyphens: none !important;
        text-transform: none !important;
        display: block !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
    }
    
    /* Evita spezzature brutte in parole composte (es. semi-automatici, ripiena e laminata) */
    .hero-nobreak {
        white-space: nowrap;
    }
    
    .hero-text-emphasis {
        font-size: 0.9rem !important;
        letter-spacing: 0.1px !important;
        font-weight: 600 !important;
        text-transform: uppercase !important; /* Tutto maiuscolo per enfasi */
    }
    
    /* Stile mobile per il nome del gruppo aziendale */
    .hero-text-company strong {
        font-size: 0.95rem !important;
        letter-spacing: 0.3px !important;
        text-transform: uppercase !important; /* Nome azienda tutto maiuscolo */
    }
    
    .hero-text-decoration {
        display: none !important; /* Nascondo le decorazioni su mobile per spazio */
    }
    
    /* Regole specifiche per maiuscole in italiano su mobile */
    .hero-text-line:first-letter {
        text-transform: uppercase !important; /* Prima lettera della riga maiuscola */
    }
    
    /* Parole che devono essere maiuscole in italiano */
    .hero-text-line:contains("pasta") {
        text-transform: none !important; /* Mantiene minuscolo per "pasta" */
    }
    
    .hero-text-line:contains("cous") {
        text-transform: none !important; /* Mantiene minuscolo per "cous cous" */
    }
    
    .hero-text-line:contains("pellets") {
        text-transform: none !important; /* Mantiene minuscolo per "pellets" */
    }
    
    .hero-text-line:contains("fritti") {
        text-transform: none !important; /* Mantiene minuscolo per "fritti" */
    }
    
    .hero-text-line:contains("cereali") {
        text-transform: none !important; /* Mantiene minuscolo per "cereali" */
    }
    
    .hero-text-line:contains("farine") {
        text-transform: none !important; /* Mantiene minuscolo per "farine" */
    }
    
    .hero-text-line:contains("prodotti") {
        text-transform: none !important; /* Mantiene minuscolo per "prodotti" */
    }
    
    .hero-text-container {
        margin: 0.5rem 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Regole specifiche per inglese e spagnolo - mantengono capitalize */
    html[lang="en"] .hero-text-line,
    html[lang="es"] .hero-text-line {
        text-transform: capitalize !important; /* Prima lettera maiuscola per inglese e spagnolo */
    }
    
    /* Regole specifiche per italiano - solo prima lettera della riga */
    html[lang="it"] .hero-text-line {
        text-transform: none !important; /* Nessuna trasformazione per italiano */
    }
    
    html[lang="it"] .hero-text-line:first-letter {
        text-transform: uppercase !important; /* Solo prima lettera della riga maiuscola */
    }
}

@media (min-width: 769px) {
    /* Nascondi a capo mobile su desktop */
    .hero-br-mobile {
        display: none;
    }
    
    .hero .container {
        box-sizing: border-box !important;
    }
    
    /* Hero content centrato */
    .hero-content {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding-bottom: 2rem !important; /* Ridotto spazio sotto per non forzare altezza */
    }
    
    /* Logo più piccolo */
    .hero-logo {
        margin-bottom: 0.5rem !important;
        margin-top: 0.5rem !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .hero-logo-img {
        height: 55px !important; /* Ridotto da 60px */
        width: auto !important;
        filter: brightness(0) invert(1) !important;
        margin: 0 auto !important;
    }
    
    /* Titolo compatto */
    .hero-subtitle {
        font-size: 1rem !important; /* Ridotto da 1.1rem */
        font-weight: 600 !important;
        margin-bottom: 1.2rem !important; /* Gap tra subtitle e hero-text-box */
        color: #F4C86D !important;
        text-align: center !important;
        line-height: 1.2 !important;
    }
    
    /* Descrizione compatta */
    .hero-description {
        margin: 0.5rem 0 2rem 0 !important; /* Gap tra hero-text-box e card brand */
        padding: 0 !important;
        max-width: 110% !important;
        width: 110% !important;
        margin-left: -5% !important;
        margin-right: -5% !important;
    }
    
}

/* Media query specifiche per iPhone - MARGINI NORMALI */
@media only screen and (max-width: 428px) {
    /* iPhone 12 Pro Max, 13 Pro Max, 14 Plus, 15 Plus */
    .hero-brands {
        margin-bottom: 3rem !important; /* Margine normale */
    }
}

@media only screen and (max-width: 414px) {
    /* iPhone 12, 12 Pro, 13, 13 Pro, 14, 15 */
    .hero-brands {
        margin-bottom: 3rem !important; /* Margine normale */
    }
}

@media only screen and (max-width: 390px) {
    /* iPhone 12 mini, 13 mini, 14 Pro, 15 Pro */
    .hero-brands {
        margin-bottom: 3rem !important; /* Margine normale */
    }
}

@media only screen and (max-width: 375px) {
    /* iPhone SE, iPhone 6/7/8 */
    .hero-brands {
        margin-bottom: 3rem !important; /* Margine normale */
    }
}

@media only screen and (max-width: 360px) {
    /* iPhone SE (1st gen), dispositivi molto piccoli */
    .hero-brands {
        margin-bottom: 3rem !important; /* Margine normale */
    }
}

/* Skip link - accessibilità e SEO */
.skip-link {
    position: absolute;
    top: -100px;
    left: 20px;
    background: #F4C86D;
    color: #0F4984;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10001;
    transition: top 0.3s ease;
}
.skip-link:focus {
    top: 20px;
}

/* Sezione FAQ - Sfondo chiaro per contrasto con sezione blu */
.faq-section {
    padding: 5rem 0;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #e8eef5 100%);
    color: #1e293b;
    position: relative;
    overflow: hidden;
    scroll-margin-top: 100px;
}
.faq-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(15, 73, 132, 0.06) 0%, transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(244, 200, 109, 0.12) 0%, transparent 60%),
        radial-gradient(circle at 50% 50%, rgba(15, 73, 132, 0.04) 0%, transparent 50%);
    z-index: 1;
}
.faq-section .container {
    position: relative;
    z-index: 2;
}
/* faq-section-title eredita da .section-title sopra; margin-bottom ridotto per il sottotitolo */
.faq-section-title {
    margin-bottom: 0.5rem;
}
.faq-section-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 3rem;
}
.faq-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}
.faq-card {
    background: white;
    padding: 1.75rem;
    border-radius: 20px;
    border: 1px solid rgba(15, 73, 132, 0.12);
    box-shadow: 
        0 4px 20px rgba(15, 73, 132, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.faq-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(244, 200, 109, 0.2), transparent);
    transition: left 0.6s ease;
}
.faq-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(15, 73, 132, 0.25);
    box-shadow: 
        0 20px 50px rgba(15, 73, 132, 0.12),
        0 0 0 1px rgba(244, 200, 109, 0.2);
}
.faq-card:hover::before {
    left: 100%;
}
.faq-card-icon {
    margin-bottom: 1rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0F4984 0%, #1a5a9e 100%);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(15, 73, 132, 0.25);
}
.faq-card h3 {
    color: #0F4984;
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
}
.faq-card p {
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}
@media (max-width: 992px) {
    .faq-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 576px) {
    .faq-section {
        padding: 3rem 0;
    }
    .faq-section-title {
        font-size: 1.6rem;
    }
    .faq-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .faq-card {
        padding: 1.5rem;
    }
}


