:root {
/* calculated in dropdown.js*/
    --mobile-header-offset: 90px;
}


header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    background-color: white;
    color: var(--textColorDark);
    position: sticky;
    top: 0;
    z-index: 1000;
    border: none;
    background-image: linear-gradient(to bottom right, var(--clr5) -150%, var(--clr6) 90%);
    transition: transform 0.28s ease;
    will-change: transform;
	max-height:300px;
}

header.header-hidden {
    transform: translateY(-100%);
}

.mobile-menu {
    display: none;
}

.hamburger {
    border: none;
    background: transparent;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger span {
    width: 26px;
    height: 3px;
    background-color: var(--textColorDark);
    border-radius: 3px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.mobile-nav-links {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
}

header nav ul {
    display: flex;
    flex-direction: row;
    list-style-type: none;
    padding: 10px;
    margin: 0;
    gap: 16px;
    min-width: 500px;
    justify-content: center;
    align-items: center;
}

header nav ul li {
    position: relative;
    padding-bottom: 4px;
}

header nav ul li::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--textColorDark);
    transition: width 0.3s ease-in-out;
    z-index: -1;
}

header nav ul li:hover::after,
header nav ul li:focus-within::after {
    width: 100%;
}

nav ul li a {
    text-decoration: none;
    color: var(--textColorDark);
    font-size: 14px;
    font-weight: 500;
}

.dropdown-button {
    border: none;
    cursor: pointer;
    background-color: var(--clr6);
    color: var(--textColorDark);
}

.legacy {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.previous {
    display: none;
    flex-direction: column;
    position: fixed;
    background-image:linear-gradient(to bottom right, var(--clr5) -250%, var(--clr6) 90%); 
    gap: 4px;
    border: 2px solid var(--textColorDark);
}

.previous a {
    color: var(--textColorDark);
    text-decoration: none;
    padding: 8px 12px;
    transition: background-color 0.3s ease;
}

.previous a:hover {
    background-color: var(--textColorDark);
    color: var(--textColorLight);
}

header .logo {
    width: 100px;
    height: auto;
    margin-top: 10px;
}

@media (max-width: 600px) {

    html {
        scroll-padding-top: var(--mobile-header-offset);
    }

    body {
        padding-top: var(--mobile-header-offset);
    }
    nav.menu {
        display: none;
    }

header {
    position: fixed; 
    top: 0;
    width: 100%;
    z-index: 1000;

    transition: transform 0.28s ease, background-color 0.3s ease; 
    box-sizing: border-box; 
    min-height: 60px;
	max-height:100px;
}

.mobile-menu {
    display: flex;
    align-items: center;
}

    .mobile-menu {
        display: flex;
        flex-direction: column;
        align-items: start;
        margin-left: auto;
		position:relative;
    }

.moblie-nav-links{
    position:fixed;
}

    .mobile-menu .mobile-nav-links {
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        width: 40vw;
        min-width: 180px;
        max-width: 320px;
        height: 200vh;
        /*
        height: calc(100vh - 72px);*/
        background: white;
        border: 2px solid var(--textColorDark);
        border-right: none;
        border-radius: 0px;
        padding: 10px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        gap: 6px;
        z-index: 999;
        box-sizing: border-box;
        overflow-y: auto;
        transform: translateX(110%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.2s ease, visibility 0.2s ease;
        padding: var(--mobile-header-offset) 0px 0px 0px;
        overflow-x: hidden;
    }

    .mobile-menu .mobile-nav-links li {
        width: 100%;
        border-bottom: 1px solid var(--textColorDark);
    }

    .mobile-menu .mobile-nav-links a {
        display: block;
        width: 100%;
        text-decoration: none;
        color: var(--textColorDark);
        padding: 10px 12px;
    }

    .mobile-menu .mobile-nav-links a:hover,
    .mobile-menu .mobile-nav-links a:focus-visible {
        background-color: var(--textColorLight);
        color: var(--textColorDark);
    }

    .mobile-menu .legacy-catalog {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-menu .legacy-catalog .previous {
        position: static;
        border: none;
        gap: 0;
        display: none;
    }

    .mobile-menu .legacy-catalog.is-open .previous {
        display: flex;
    }

    .mobile-menu .legacy-catalog .previous a {
        padding-left: 24px;
    }

    .mobile-menu.open .mobile-nav-links {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .hamburger {
        z-index: 1001;
    }

    .mobile-menu.open .hamburger span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .mobile-menu.open .hamburger span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu.open .hamburger span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    header .logo {
        width: 78px;
    	margin-top:5px;
    }

    header {
        padding: 14px 16px;
    }

}