/*
 * Sticky Header Effect CSS
 * Custom styles for Elementor header with scroll effects
 */

/* Sticky Header Transitions */
.elementor-element-25a5fd8 {
    transition: all 0.3s ease !important;
}

/* Stato normale (top della pagina) */
.elementor-element-25a5fd8 {
    background-color: transparent !important;
    padding: 20px 0 !important;
    min-height: auto !important;
}

/* Stato scrolled - Header ridotto */
.elementor-element-25a5fd8.header-scrolled {
    background-color: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    padding: 10px 0 !important;
    min-height: 60px !important;
}

/* Container interno - riduzione padding */
.elementor-element-25a5fd8 .e-con-inner {
    transition: all 0.3s ease !important;
    padding: 20px 0 !important;
}

.elementor-element-25a5fd8.header-scrolled .e-con-inner {
    padding: 10px 0 !important;
}

/* Logo Container - elemento specifico */
.elementor-element-441253b {
    transition: all 0.3s ease !important;
    max-width: 100% !important;
    overflow: visible !important;
    display: flex !important;
    align-items: center !important;
}

/* Logo Container ridotto quando scrolled - SOLO max-width, NO transform */
.elementor-element-25a5fd8.header-scrolled .elementor-element-441253b {
    max-width: 65% !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Logo stesso - SOLO se necessario */
.elementor-element-441253b img {
    transition: all 0.3s ease !important;
    max-width: 100% !important;
    height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Assicurati che il logo rimanga visibile */
.elementor-element-25a5fd8.header-scrolled .elementor-element-441253b img {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
}

/* Rimuovo i transform scale che potrebbero causare problemi */
.elementor-element-25a5fd8 img,
.elementor-element-25a5fd8 .elementor-image img,
.elementor-element-25a5fd8 .elementor-widget-image img {
    transition: all 0.3s ease !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Widget container fix */
.elementor-element-441253b .elementor-widget-container {
    transition: all 0.3s ease !important;
    overflow: visible !important;
}

/* Responsive */
@media (max-width: 768px) {
    .elementor-element-25a5fd8.header-scrolled .elementor-element-441253b {
        max-width: 70% !important;
    }
    
    .elementor-element-25a5fd8.header-scrolled {
        padding: 8px 0 !important;
        min-height: 50px !important;
    }
    
    .elementor-element-25a5fd8.header-scrolled .e-con-inner {
        padding: 8px 0 !important;
    }
}

@media (max-width: 480px) {
    .elementor-element-25a5fd8.header-scrolled .elementor-element-441253b {
        max-width: 75% !important;
    }
    
    .elementor-element-25a5fd8.header-scrolled {
        padding: 5px 0 !important;
        min-height: 45px !important;
    }
    
    .elementor-element-25a5fd8.header-scrolled .e-con-inner {
        padding: 5px 0 !important;
    }
}

/* Debug - forza visibilità */
.elementor-element-25a5fd8.header-scrolled * {
    visibility: visible !important;
}

.elementor-element-25a5fd8.header-scrolled .elementor-element-441253b * {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Fix generale per tutti gli elementi logo */
.elementor-element-25a5fd8 [class*="elementor-element-441253b"] {
    overflow: visible !important;
}

/* Supporto per eventuali elementi di navigazione */
.elementor-element-25a5fd8.header-scrolled .elementor-nav-menu a {
    transition: color 0.3s ease;
}

/* Fix per doppio logo - nasconde spacer Elementor */
.elementor-element-25a5fd8.elementor-sticky__spacer {
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.elementor-element-25a5fd8.elementor-sticky__spacer * {
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Assicura che solo l'header attivo sia visibile */
.elementor-element-25a5fd8.elementor-sticky--active {
    z-index: 999 !important;
}

/* Durante la transizione, nasconde elementi duplicati */
.elementor-element-25a5fd8:not(.elementor-sticky--active) .elementor-element-441253b {
    transition-delay: 0.1s !important;
}

/* Fix per evitare flickering durante scroll */
.elementor-element-25a5fd8.elementor-sticky--effects .elementor-element-441253b {
    transform: none !important;
}

/* Transizione più fluida per il logo container */
.elementor-element-441253b {
    transition: max-width 0.3s ease-in-out !important;
}

.elementor-element-25a5fd8.header-scrolled .elementor-element-441253b {
    transition: max-width 0.3s ease-in-out !important;
}
