@import url(../variables.css);

/*header section*/
.headerContainer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    max-width: var(--maxw);
    margin: auto;
}

.headerLogo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mobile {
    display: none;
}

.nomagarLogo {
    width: auto;
    height: 40px;
}

.searchBox {
    background-color: var(--box);
    width: 40%;
    min-width: 200px;
    max-width: 250px;
    height: 46px;
    padding: 0 10px;
    margin-left: 40px;
    border-radius: var(--radius);
    overflow: hidden;
    display: none;
    align-items: center;
    justify-content: center;
    margin-inline-start: auto;
}

.searchBtn {
    width: 28px;
    height: 28px;
    background-color: transparent;
    border: 0;
    padding: 0 !important;
}

.searchInput {
    flex: 1;
    background: transparent;
    border: 0;
    height: 38px;
    font-size: 15px;
    color: var(--text);
    padding: 0 8px;
}

.searchInput:focus {
    outline: none;
    box-shadow: none
}

.searchInput::placeholder {
    color: var(--text);
    font-size: 14px;
}

.menuItem {
    margin: 0 8px;
    white-space: nowrap;
}

.menuItem sup {
    background-color: #234bc9;
    border-radius: var(--radius);
    font-size: 12px;
    padding: 0 10px 5px 10px;
    color: var(--text);
}

.menuItem .txt {
    display: inline-block;
    transition: transform .1s
}

.menuItem:hover .txt {
    transform: translateY(-3px)
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

.burger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    cursor: pointer
}

.burger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #eaeaea;
    transition: transform .25s, opacity .2s
}

.burger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0
}

.burger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg)
}

.burger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg)
}

.mainNav {
    position: static;
    transform: none;
    transition: none;
    background: transparent;
    height: auto;
    width: auto;
    padding: 0;
    flex: 0.5 1 auto;
}

.mainNav ul > li:nth-child(4) {
    margin-inline-end: auto;
}

.mainNav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap
}

.mainNav a.menuItem {
    color: var(--text)
}

#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
    z-index: 999
}

#overlay.is-open {
    opacity: 1;
    pointer-events: auto
}

#overlay.anim {
    transition: opacity .25s;
}

.spacer {
    display: none;
}

@media (max-width: 992px) {
    .mainNav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        background: #111111;
        box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 20px 50px rgba(0, 0, 0, .4);
        transform: translateX(100%);
        /* نکته: این خط رو برمی‌داریم تا اولِ لود ترنزیشن نداشته باشه */
        /* transition: transform .3s ease; */
        padding: 20px;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    /* فقط وقتی کلاس anim اضافه شد، ترنزیشن فعال بشه */
    .mainNav.anim {
        transition: transform .3s ease;
    }

    .mainNav.is-open {
        transform: translateX(0)
    }

    .mainNav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 10px
    }

    .mainNav a {
        display: block;
        padding: 12px 10px;
        border-radius: 12px;
        background: transparent
    }

    .mainNav a:hover {
        background: #1b1b1c
    }

    .burger {
        display: flex
    }
}

@media (min-width: 993px) {
    .burger {
        display: none
    }

    .spacer {
        display: block;
    }
}

@media (min-width: 1280px) {
    .searchBox {
        display: flex;
    }
}

/*end of header section*/
