/* Header Ledicola */

.bc-header--ledicola{
    .bc-header__top{
        font-weight: light;
        font-size: 14px;
        text-transform: capitalize;
        color: var(--wp--preset--color--text-on-primary);
        a{
            color: var(--wp--preset--color--text-on-primary);
        }
        svg{
            fill: var(--wp--preset--color--text-on-primary) !important;
        }
    }
    .bc-header__middle{
        height: 130px !important;
        font-size: 14px;
        & > div{
            gap: 5px !important;
        }
    }
    .bc-header__bottom{
        height: 40px !important;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        display: flex;
        justify-content: center;
        & > div{
            width: unset !important;
            overflow: auto;
            white-space: nowrap;
        }
        #bc-slideover-nav__btn{
            fill:  var(--wp--preset--color--primary);
            path{
                fill:  var(--wp--preset--color--primary);      
            }
        }
        ul{
            list-style: none;
            display: flex;
            gap: 20px;
            padding: 0;
        }
        li{
            height: 40px !important;
            a{
                height: 40px !important;
                display: flex;
                align-items: center;
                font-family: var(--wp--preset--font-family--body);
                font-weight: bold;
                font-size: 16px !important;
                text-transform: capitalize;
                color: #000;
            }
        }
        .bc-svg:has(#bc-slideover-nav__btn){
            display: flex;
            align-items: center;
            font-weight: bold;
            a{
                height: 40px;
                width: 40px;
                display: flex;
                justify-content: center;
                align-items: center;
                background-color: var(--wp--preset--color--primary); 
                svg path{
                    fill: var(--wp--preset--color--text-on-primary) ;
                }
            }
        }
    }
    .wp-block-site-logo.is-default-size img{
        width: 300px !important;
    }
    .bc-date-ledicola{
        margin-top: 10px;
    }
    .bc-header__bottom a{
        font-family: var(--wp--preset--font-family--heading);
    }
}

@media (max-width: 768px){
    .bc-header--ledicola{
        .bc-header__middle > .is-content-justification-center{
            justify-content: space-between !important;
        }
        .bc-header__middle{
            height: 50px !important;
            .wp-block-social-links {
                display: none !important;
            }
            .bc-svg:has(#bc-slideover-nav-mobile__btn){
                display: flex;
                align-items: center;
                font-weight: bold;
                a{
                    height: 24px;
                }
            }
            .bc-date-ledicola{
                display: none;
            }
        }
        .bc-header__top{
            justify-content: center;
            .wp-block-social-links{
                display: none;
            }
        }
        .wp-block-site-logo.is-default-size img{
            width: 150px !important;
        }
    }
}

/* Slideover Nav */

.bc-slideover-nav{
    width: 100%;
    height: 100%;
    position: fixed;
    inset: 0;
    z-index: 9999999;
    overflow: auto;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
    &.bc-slideover-nav--active{
        visibility: visible;
        opacity: 1;
    }
    .bc-slideover-nav__head{
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 99999;
        height: 60px;
        .wp-block-site-logo.is-default-size img {
            width: 75px;
        }
    }
    form.wp-block-search__button-outside{
        margin: 20px !important;
        input{
            border: none;
            background-color: #F7F7F7;
            border-radius: 4px;
        }
        button{
            border-radius: 4px;
        }
    }
    nav.wp-block-navigation{
        padding: 20px;
        margin-top: 0;
        ul.wp-block-navigation__container{
            align-items: flex-start;
            display: grid;
            grid-template-columns: 1fr;
            gap: 40px;
            li.wp-block-navigation-item{
                position: static;
                display: block;
                & > a{
                    font-family: var(--wp--preset--font-family--heading);
                    font-size: var(--wp--preset--font-size--x-large);
                    color: var(--wp--preset--color--primary);
                    text-transform: uppercase;
                    font-weight: 400;
                    white-space: nowrap;
                }
                .wp-block-navigation__submenu-icon{
                    display: none;
                    & + .wp-block-navigation-submenu{
                        margin-top: 20px;
                        a{
                            font-size: var(--wp--preset--font-size--large);
                            color: var(--wp--preset--color--primary);
                            text-transform: capitalize;
                            padding-left: 0;
                            font-weight: 300;
                        }
                    }
                }
                .wp-block-navigation-submenu{
                    height: auto;
                    min-width: auto;
                    opacity: 1;
                    /* overflow: visible; */
                    visibility: visible;
                    width: auto;
                    position: static;
                    background-color: #fff;
                    border: none;
                }
            }
        }
    }
    .wp-block-social-links{
        padding: 20px;
        a{
            border-radius: 50%;
            width: 20px !important;
            height: 20px  !important;
            display: flex;
            align-items: center;
            justify-content: center;
            svg{
                width: 16px !important;
                height: 16px  !important;
                fill: var(--wp--preset--color--primary) !important;
            }
        }
    }
    .wp-block-blockcraft-child-weather-widget {
        padding: 0 20px;
        padding-top: 0;
        & > div {
            & > span:nth-child(3) {
                margin-left: 0;
            }
        }
    }
    .bc-slideover-nav__content{
        position: absolute;
        z-index: 999999;
        width: 390px;
        height: 100%;
        background-color: #fff;
        overflow-y: auto;
        transform: translateX(0); /* Nasconde il menu */
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .bc-slideover-nav__bg{
        position: absolute;
        inset: 0;
        z-index: 99999;
        background-color: rgba(0, 0, 0, 0.2);
        opacity: 0;
        transition: opacity 0.4s ease;
        cursor: pointer;
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }
    .bc-banner-slideover-nav {
        border-radius: 0px;
    }
    .bc-slideover-nav-cat{
        margin: 20px !important;
        ul{
            padding: 0;
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 15px;
            a{
                font-size: 20px;
                font-weight: bold;
                color: #000 !important;
            }
        }
    }
    .wp-block-separator{
        margin: 20px !important;
    }
    .bc-slideover-nav-prov{
        margin: 20px !important;
        ul{
            padding: 0;
            list-style: none;
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
            a{
                font-size: 16px;
                font-weight: normal;
                color: #000;
            }
        }
    }
}

.bc-slideover-nav:not(.bc-slideover-nav--active) .bc-slideover-nav__content {
    transform: translateX(-100%);
}

.bc-slideover-nav.bc-slideover-nav--active .bc-slideover-nav__bg {
    opacity: 1; /* Mostra lo sfondo */
}

@media (max-width: 448px){
    .bc-slideover-nav{
        .bc-slideover-nav__content{
            width: 90%;
        }
    }
}

@media (min-width: 768px){
    .bc-svg:has(#bc-slideover-nav-mobile__btn){
        display: none;
    }
}

.wp-block-social-links{
    a{
        border-radius: 50%;
        width: 20px !important;
        height: 20px  !important;
        display: flex;
        align-items: center;
        justify-content: center;
        svg{
            width: 16px !important;
            height: 16px  !important;
        }
    }
}

.bc-banner-slideover-nav{
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 6px 20px;
    margin: 20px !important;
    background-color: var(--wp--preset--color--primary);
    border-radius: 10px;
    .bc-svg svg{
        width: 48px;
        height: 48px;
    }
    p{
        color: var(--wp--preset--color--text-on-primary);
        font-family: var(--wp--preset--font-family--body) !important;
        font-size: 18px;
        font-weight: normal;
        line-height: 150%;
    }
    .bc-banner-button-slideover-nav{
        border: 1px solid var(--wp--preset--color--hover-secondary);
        display: flex;
        justify-content: center;
        align-items: center;
        height: 36px;
        width: 36px !important;
        border-radius: 0px;
        margin-left: auto;
        svg{
            fill: var(--wp--preset--color--text-on-secondary) !important;
        }
    }
}

.is-layout-constrained .bc-banner-slideover-nav{
    margin: 20px !important;
}

/* Scrolled class */

@media (min-width: 768px){
    header.wp-block-template-part{
        position: static !important;
    }
}

.bc-header__bottom {
  position: relative; /* o static, a seconda del layout */
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 99998;
  background-color: #fff;
}

/* Solo quando scrolled: la barra diventa fixed e animata */
body.scrolled .bc-header__bottom {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

body.scrolled:has(> #wpadminbar) .bc-header__bottom{
    top: 30px;
}

/* Effetto entrata: parte da sopra */
body.scrolled .bc-header__bottom {
  animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 768px){
    body.scrolled .bc-header__bottom{
        position: static !important;
        animation: none !important;
    }
}