#masthead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-white-container {
    position: relative;
    background-color: var(--color-secondary-1);

    >.container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 30px;
        padding-bottom: 30px;
    }
}

.header-logo {
    width: 202px;
}

.header-icon-group {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-go-search {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-primary-2);
    width: 200px;
    background-color: var(--color-secondary-1);

    >input[type="search"] {
        background-color: transparent;
        flex-grow: 1;
        border: none;
        outline: none;
        padding: 0;
        border-radius: 0;

        &::placeholder {
            color: var(--color-gray-4);
        }
    }

    button[type="submit"] {
        flex-shrink: 0;
    }
}
.header-mobile-open-search{
    display: none;
}
.header-burger{
    display: none;
    .cancel{
        display: none;
    }

    &.active{
        .cancel{
            display: initial;
        }
        .burger{
            display: none;
        }
    }
}
.header-red-container {
    background-color: var(--color-primary-2);

    ul {
        display: flex;
        justify-content: space-between;
    }
}

.header-main-item {
    position: relative;

    >a,
    >button {
        color: white;
        padding: 12px 0;
        position: relative;
        z-index: 1;
        overflow-y: clip;

        display: flex;
        align-items: center;
        justify-content: center;

        &::after {
            content: "";
            position: absolute;
            z-index: -1;
            width: calc(100% + 32px);
            aspect-ratio: 1;
            border-radius: 999px;
            background-color: var(--color-primary-3);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.3s;
        }

        &:hover::after {
            opacity: 1;
        }
    }

    >.dropdown {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        width: max-content;
        padding: 24px;
        background-color: white;
        box-shadow: 0 15px 30px 0 rgba(0, 0, 0, 0.10);
        border-radius: 10px;

        display: none;

        >a {
            display: flex;
            align-items: center;
            justify-content: space-between;
            color: var(--color-gray-1);
            transition: color 0.3s;

            >svg {
                flex-shrink: 0;
            }

            >h4 {
                color: inherit;
            }

            &:hover {
                color: var(--color-primary-2);
            }
        }

        >.line {
            height: 1px;
            background-color: var(--color-gray-5);
            margin: 16px 0;
        }

        >ul {
			display: grid;
			grid-auto-flow: column;
			gap: 8px 24px;

            a {
                min-width: 124px;
                display: flex;
                align-items: center;
                gap: 8px;
                >p {
                    font-weight: 500;
                }

                >svg {
                    flex-shrink: 0;
                    transition: transform 0.2s;
                }

                &:hover>svg {
                    transform: translateX(-3px);
                    animation: left-right-move .4s .2s infinite alternate;
                }
            }
        }

    }

    &.active>.dropdown {
        display: initial;
        animation: fade-in .5s forwards;
    }

    &.unactive>.dropdown {
        display: initial;
        pointer-events: none;
        animation: fade-out .5s forwards;
    }

    &:first-child>.dropdown {
        left: -24px;
        transform: translateX(0%);
    }

    &:last-child>.dropdown {
        left: auto;
        right: -24px;
        transform: translateX(0%);
    }
}

.header-contact {
    position: fixed;
    bottom: 40px;
    right: 24px;

    >div {
        position: relative;
        border-radius: 50%;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.10);
        margin-bottom: 16px;

        picture{
            display: block;
            width: 40px;
        }
        p{
            display: none;
            font-weight: 500;
            width: 28px;
        }
        >div {
            position: absolute;
            top: 50%;
            left: 0;
            transform: translate(calc(-100% - 20px), -50%);
            background-color: white;
            width: max-content;
            border-radius: 10px;
            overflow: hidden;

            >a {
                padding: 12px 24px;
                background-color: white;
                transition: background-color .3s, color .3s;

                &:hover {
                    background-color: color-mix(in srgb, var(--color-primary-2) 10%, white 90%);
                    color: var(--color-primary-2);
                }
            }

            >img{
                width: 25vw;
                max-width: 200px;
            }

            &:has(>img){
                top: auto;
                bottom: 0;
                transform: translate(calc(-100% - 20px), 0);
            }

            &.hidden {
                display: none;
            }
        }
    }

    >div:last-child {
        margin-bottom: 0;
    }
}

.header-mobile-list{
    display: none;
    position: fixed;
    inset: var(--nav-height) 0 0 0;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 24px;
    >div{
        background-color: white;
        width: 100%;
        height: 100%;
        border-radius: 10px;
        padding: 16px;
        overflow: auto;
        overscroll-behavior: contain;
    }
}

.header-mobile-item{
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-gray-5);
    >.trigger{
        display: flex;
        align-items: center;
        justify-content: space-between;
        .minus{
            transform-origin: center;
            transition: transform .5s;
        }
    }
    >.dropdown{
        display: grid;
        grid-template-rows: 0fr;
        transition: grid-template-rows .5s;
        >div{
            overflow: hidden;
            >div{
                padding: 12px 12px 0;
                display: flex;
                flex-direction: column;
                gap: 8px;
                >a{
                    display: flex;
                    align-items: center;
                    gap: 8px;
                }
            }
        }
    }
    &.active{
        >.trigger .minus{
            transform: rotate(90deg);
        }
        > .dropdown{
            grid-template-rows: 1fr;
        }
    }
    &:last-child{
        margin-bottom: 0;
    }
}

@keyframes left-right-move {
    0% {
        transform: translateX(-3px);
    }

    100% {
        transform: translateX(3px);
    }
}

@media screen and (width < 1024px) {
    .header-mobile-open-search{
        display: block;
        &.hidden{
            display: none;
        }
    }
    .header-burger{
        display: block;
    }
    .header-go-search {
        position: absolute;
        right: 68px;
        left: 24px;
        width: auto;
        display: none;
        &.active{
            display: flex;
        }
    }
    .header-red-container {
        display: none;
    }
    .header-mobile-list.active{
        display: initial;
    }
}

@media screen and (width < 576px) {
    .header-logo {
        width: 135px;
    }
    .header-contact {
        bottom: 0;
        left: 0;
        right: 0;
        display: flex;
        gap: 5px;
        background: linear-gradient(135deg, #B99966 0%, #E9D9B3 29.95%, #F8EECB 47.34%, #DBC59C 78.26%, #A8895B 100.48%);
        >div {
            border-radius: initial;
            box-shadow: none;
            margin-bottom: 0;

            width: auto;
            flex: 1;
            padding: 12px;
            picture{
                width: 24px;
                flex-shrink: 0;
            }
            p{
                display: initial;
            }
            >a,>button{
                width: 100%;
                display: flex;
                align-items: center;
                justify-content: center;
                gap: 8px;
            }
            &::after{
                content: "";
                display: block;
                width: 1px;
                height: 24px;
                background-color: white;
                position: absolute;
                right: -3px;
                top: 18px;
            }

            &:last-child::after{
                content: none;
            }

            >div {
                top: 0;
                transform: translateY(calc(-100% - 20px));
                &:has(>img){
                    top: 0;
                    bottom: auto;
					left: auto;
                	right: 0;
                    transform: translateY(calc(-100% - 20px));
                }
            }
        }
    }
}