/* Hero description visibility logic */
.descrizione-mobile,
.titolo-mobile {
    display: none;
}

.descrizione-desktop,
.titolo-desktop {
    display: block;
}

@media (max-width: 660px) {
    .titolo-mobile {
        display: block !important;
    }

    .titolo-desktop {
        display: none !important;
    }

    .descrizione-mobile {
        display: block !important;
    }

    .descrizione-desktop {
        display: none !important;
    }
}

@media (min-width: 851px) {
    .hero-content-custom .custom900\:justify-start {
        justify-content: flex-start !important;
    }
}

@media (min-width: 851px) {
    .custom900\:inline {
        display: inline !important;
    }
}

@media (max-width: 850px) {
    .custom900\:inline {
        display: none !important;
    }
}

/* Custom breakpoint per 851px (custom900) */
@media (min-width: 851px) {
    .custom900\:flex {
        display: flex !important;
    }

    .custom900\:hidden {
        display: none !important;
    }
}

@media (max-width: 850px) {
    .custom900\:flex {
        display: none !important;
    }

    .custom900\:hidden {
        display: block !important;
    }
}

/* Animazione per la freccia nella hero */
.arrow-animate {
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
}

.arrow-animate.hide {
    opacity: 0;
    pointer-events: none;
}


/* Configurazione Scroll Magnetico */
html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-y: none;
}

body {
    background-color: #000;
    color: #fff;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
}

/* Helper per disabilitare lo snap quando il menu è aperto */
html.menu-open {
    scroll-snap-type: none !important;
}

body.menu-open {
    overflow: hidden !important;
}

section {
    min-height: 100vh;
    /* fallback */
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 5rem;
    padding-bottom: 15px;
}

/* Use stable viewport units to avoid Safari mobile toolbar jank */
@supports (height: 100svh) {
    section {
        min-height: 100svh;
    }
}

@media (max-height: 755px) {
    section {
        padding-top: 5rem;
    }
}

/* Animazioni "Staggered" con Blur (Video 0:09) */


.reveal-item {
    opacity: 0;
    transform: translateY(25px) scale(0.98);
    filter: blur(10px);
    transition: opacity 1.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 1.6s cubic-bezier(0.16, 1, 0.3, 1),
        filter 1.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity, filter;
}

.visible .reveal-item {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.visible .reveal-item:nth-child(1) {
    transition-delay: 0.15s;
}

.visible .reveal-item:nth-child(2) {
    transition-delay: 0.3s;
}

.visible .reveal-item:nth-child(3) {
    transition-delay: 0.5s;
}

.visible .reveal-item:nth-child(4) {
    transition-delay: 0.7s;
}

/* Delays per i loghi dentro il div flex */
#marchi .flex .reveal-item {
    transition-delay: 0.6s !important;
}

.reveal-item.revealed {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* Stile Navbar */
nav {
    background: rgba(0, 0, 0, 0.4);
}

/* Menu Hamburger */
.hamburger {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
    width: 25px;
    height: 18px;
    position: relative;
    z-index: 60;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
    border-radius: 0;
    position: absolute;
    left: 0;
}

.hamburger span:nth-child(1) {
    top: 0;
}

.hamburger span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger span:nth-child(3) {
    bottom: 0;
}

.hamburger.active span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    padding: 40px 20px;
    z-index: 40;
}

.mobile-menu.active {
    display: block;
}

/* Mobile-first: nasconde il menu desktop, mostra l'hamburger */
.desktop-menu {
    display: none !important;
}

@media (min-width: 851px) {
    .hamburger {
        display: none;
    }

    .desktop-menu {
        display: flex !important;
    }
}

/* Carosello Lavori */
.carousel-container {
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.carousel-slides {
    display: flex;
    transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.carousel-slide {
    min-width: 100%;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.carousel-slide img {
    pointer-events: none;
    -webkit-user-drag: none;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 15px 0;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

/* Modal Lightbox */
.modal {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 100vh;
}

.modal.active {
    display: flex;
}

html.modal-open,
body.modal-open {
    overflow: hidden;
    height: 100%;
    touch-action: none;
    overscroll-behavior: contain;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
    box-sizing: border-box;
}

.modal-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 1001;
}

.modal-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 24px;
    user-select: none;
    -webkit-user-select: none;
}

.modal-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-arrow.left {
    left: 20px;
}

.modal-arrow.right {
    right: 20px;
}

@media (max-width: 767px) {
    .modal-arrow {
        display: none;
    }

    .modal-content {
        padding: 0;
    }
}

.brand-hisense {
    color: #00897B;
}

.brand-daikin {
    color: #00A1E4;
}

/* Spacer visibile solo su mobile */
.spacer-mobile {
    display: block;
}

@media (min-width: 768px) {
    .spacer-mobile {
        display: none;
    }
}

/* Footer con scroll-snap e transizione di ingresso */
footer {
    scroll-snap-align: start;
    /* trattato come le altre sezioni */
    scroll-snap-stop: always;
    transition: opacity 2.0s ease;
    opacity: 0;
    will-change: opacity;
    contain: paint;
    scroll-margin-top: 5rem;
    /* ridotto per farlo fermare più in alto */
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
}

footer.footer-visible {
    opacity: 1;
}

/* Footer spacing like sections on small screens */
@media (max-width: 767px) {
    footer {
        padding-top: 5rem;
        padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
        scroll-margin-top: 1rem;
        /* offset ridotto su mobile per fermarsi più in alto */
    }
}

/* Fluid Sizing for Sponsor Logos - Scales constantly from 320px to 1440px */
.logo-fluid {
    height: clamp(112px, calc(80px + 10vw), 192px);
    width: auto;
    max-width: 42vw;
    object-fit: contain;
}

@media (max-width: 850px) {
    .hero-content-custom {
        margin-left: 0;
        text-align: center;
        align-items: center;
        max-width: 100%;
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
}