/* Stili per il menu principale, il search overlay e il cambio di lingua */


/* ------------------------------- */
/* ---------- MAIN MENU ---------- */

.main-menu {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    z-index: 2;
    color: var(--bianco);
    padding: 0.8rem 0;
}

.main-menu__core {
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 1.8rem;
    background-color: transparent;
    transition: background-color 0.3s ease;
    width: fit-content;
}

.main-menu__core--scrolled {
    background-color: var(--nero-35);
    backdrop-filter: blur(15px);
}

.main-menu__core.submenu-is-open {
    background-color: transparent !important;
}

.main-menu__core-button {
    cursor: pointer;
    white-space: nowrap;
}

.main-menu__core-button:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.main-menu__core-logo {
    width: 50px;
    display: block;
    align-self: center;
    margin-right: var(--spacing-xxs);
    cursor: pointer;
}

.submenu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    background-color: var(--nero-35);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    flex-direction: column;
    justify-content: start;
    padding: 32vh 0 0 0;
    opacity: 0;
    pointer-events: none;
}

.submenu-overlay__bg-click {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100%;
    z-index: 1;
}

.submenu-overlay__container {
    position: relative;
    z-index: 2;
    width: 100vw;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 80px;
}

.submenu-panel {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 40px;
    align-items: start;
}

.submenu-column {
    display: flex;
    flex-direction: column;
    flex-grow: 2;
    max-width: 250px;
}

.submenu-panel__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.submenu-card {
    position: relative;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: flex-end;
    padding: 20px;
    overflow: hidden;
    background-position: center;
}

.submenu-card__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.7;
    transition: transform 0.5s ease;
}

.submenu-card__link {
    position: relative;
    z-index: 2;
    text-decoration: none;
}

.submenu-overlay__close-btn {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 3;
    transition: transform 0.2s ease;
}

.submenu-overlay__close-btn img {
    width: 20px;
    height: 20px;
}

.submenu-overlay__close-btn:hover {
    transform: translateX(-50%) scale(1.1);
}

.submenu__link a {
    color: var(--bianco);
    font-size: 1.1rem;
    font-family: fabbrica-light;
    font-style: normal;
    text-decoration: none;
    text-transform: none;
}

.submenu__link a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.submenu__link--bold a {
    font-family: fabbrica-bold;
}

.main-menu__search-btn {
    background-color: transparent;
    outline: 0;
    border: 0;
    width: 13px;
    height: 13px;
    padding: 3px 0 0 0;
    cursor: pointer;
}








/* ------------------------------------ */
/* ---------- SEARCH OVERLAY ---------- */

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 5;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
}

.search-overlay__bg-click {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100%;
    background-color: var(--nero-35);
    z-index: 4;
}

.search-overlay__panel {
    position: relative;
    z-index: 5;
    width: 45vw;
    max-width: 750px;
    height: 100%;
    background-color: var(--bianco);
    padding: 4rem 8rem 4rem 4rem;
    display: flex;
    gap: 5rem;
    flex-direction: column;
    box-sizing: border-box;
    transform: translateX(45vw);
}

.search-overlay__description {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-overlay__content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.search-overlay__suggestions-list {
    list-style: none;
    padding: 0;
}





/* ------------------------------------- */
/* ---------- LANGUAGE SELECT ---------- */


.main-menu__language-select {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.language-select__icon {
    display: block;
    width: 10px;
    height: auto;
    transform-origin: center center;
}

.language-select__overlay {
    position: absolute;
    top: calc(100% + 15px);
    right: -150%;
    background-color: var(--nero-35);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: var(--spacing-xs);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 120px;
    gap: var(--spacing-xs);
    z-index: 4;
    transition: opacity 0.3s;
}

.language-select__button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.25s ease;
    color: var(--grigio-1);
}

.language-select__button:hover,
.language-select__button--active {
    color: var(--bianco);
}





/* -------------------------------------- */
/* ---------- MAIN MENU MOBILE ---------- */



.menu-mobile {
    display: none;
}

.menu-mobile__header {
    position: fixed;
    z-index: 2;
    padding: var(--padding-laterale);
    width: 100vw;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    transition: background-color 0.3s ease;
}

.menu-mobile__header--scrolled {
    background-color: var(--nero-35);
    backdrop-filter: blur(15px);
}

.menu-mobile__header__logo {
    height: 20px;
    display: block;
    align-self: center;
}

.menu-mobile__header__logo > img {
    height: 100%;
    width: auto;
}


.menu-mobile__header__button {
    height: 20px;
}

.menu-mobile__header__button > img {
    height: 100%;
}


.menu-mobile__panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bianco);
    z-index: 3;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
}

.menu-mobile__panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--padding-laterale);
    background-color: var(--bianco);
}

.menu-mobile__panel-logo {
    height: 20px;
}

.menu-mobile__close-btn {
    background: none;
    border: none;
    cursor: pointer;
    height: 20px;
    width: 20px;
}

.menu-mobile__close-btn > img {
    height: 100%;
    width: 100vw;
}

/* Area a scorrimento verticale interno */
.menu-mobile__content {
    flex-grow: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Spinge il footer in fondo se c'è spazio */
}

/* --- ACCORDION SYSTEM (SOTTOMENU) --- */

.menu-mobile__nav {
    padding: var(--padding-laterale);
}

.menu-mobile__nav-item {
    border-bottom: 1px solid var(--grigio-1);
}

.menu-mobile__nav-item:last-of-type {
    border-bottom: none;
}

.menu-mobile__nav-trigger {
    width: 100vw;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    color: var(--grigio-1);
    text-align: left;
    cursor: pointer;
}

.menu-mobile__nav-trigger::after {
    content: '';
    width: 14px;
    height: 14px;
    background-image: url("../img/system/Accordion-open-grey.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.menu-mobile__nav-trigger--active::after  {
    background-image: url("../img/system/Accordion-close-grey.png");
}

.menu-mobile__sub-nav {
    height: 0;
    overflow: hidden;
}

.menu-mobile__sub-nav-inner {
    padding: 10px 0 20px 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xxs);
    color: var(--nero);
}

.menu-mobile__sub-nav-inner a {
    color: var(--nero);
    text-decoration: none;
}

.menu-mobile__footer {
    padding: 30px var(--padding-laterale) 80px  var(--padding-laterale);
    background-color: var(--grigio-5);
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.menu-mobile__search {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-mobile__language {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-mobile__language-switch {
    display: flex;
    gap: 10px;
}

.menu-mobile__language-switch > a {
    color: var(--grigio-3);
}

.menu-mobile__language-switch > a.is-active {
    color: var(--nero);
}



@media screen and (max-width: 700px) {
    .main-menu {
        display: none;
    }
    .menu-mobile {
        display: block;
    }
}