:root {
    --primary: #7b49ff;
    --accent: #ffd66f;
    --dark: #111111;
    --ink: #151515;
    --muted: #6f6f76;
    --line: #d8d8d8;
    --white: #ffffff;
}

.main-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    padding: 36px 0 0;
}

.nav-container {
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 80px 1fr 80px;
    align-items: start;
    gap: 30px;
}

.logo-block a {
    display: inline-flex;
}

.logo-img {
    width: 112px;
    height: auto;
    display: block;
}

.nav-toggle {
    display: none;
}

.nav-menu {
    min-height: 45px;
    margin-top: 34px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(22px, 3.1vw, 48px);
    list-style: none;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 999px;
    box-shadow: 0 14px 36px rgba(0, 27, 80, 0.12);
}

.nav-menu a {
    color: #090909;
    text-decoration: none;
    font-family: "Montserrat", sans-serif;
    font-size: 0.94rem;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
}

.nav-actions {
    margin-top: 39px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 17px;
}

.nav-icon-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.nav-icon-link img {
    max-width: 31px;
    max-height: 31px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.nav-icon-link .ti {
    color: var(--white);
    font-size: 31px;
    line-height: 1;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: var(--dark);
    font-size: 0.63rem;
    font-weight: 800;
}

@media (max-width: 980px) {
    .main-header {
        padding-top: 20px;
    }

    .nav-container {
        width: min(100% - 28px, 720px);
        grid-template-columns: 68px 1fr auto;
        gap: 14px;
        align-items: center;
    }

    .logo-img {
        width: 92px;
    }

    .nav-menu {
        margin-top: 0;
        padding: 0 16px;
        gap: 18px;
        overflow-x: auto;
        justify-content: flex-start;
        scrollbar-width: none;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-menu a {
        font-size: 0.82rem;
    }

    .nav-actions {
        margin-top: 0;
        gap: 8px;
    }
}

@media (max-width: 680px) {
    .main-header {
        padding-top: 14px;
    }

    .nav-container {
        position: relative;
        width: min(100% - 20px, 520px);
        grid-template-columns: 50px 1fr 50px;
        gap: 10px;
        align-items: center;
    }

    .logo-img {
        width: 70px;
    }

    .nav-toggle {
        grid-column: 3;
        justify-self: end;
        width: 44px;
        height: 44px;
        padding: 0;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        border: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 14px 36px rgba(0, 27, 80, 0.14);
        cursor: pointer;
    }

    .nav-toggle span {
        width: 18px;
        height: 2px;
        display: block;
        border-radius: 999px;
        background: var(--dark);
        transition: transform 180ms ease, opacity 180ms ease;
    }

    .nav-container.is-open .nav-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-container.is-open .nav-toggle span:nth-child(2) {
        opacity: 0;
    }

    .nav-container.is-open .nav-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-actions {
        display: none;
    }

    .nav-menu {
        position: absolute;
        top: calc(100% + 12px);
        left: 0;
        right: 0;
        width: 100%;
        min-height: 0;
        max-height: 0;
        margin-top: 0;
        padding: 0 18px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        border-radius: 20px;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-6px);
        transition: max-height 220ms ease, opacity 180ms ease, padding 220ms ease, transform 180ms ease;
    }

    .nav-container.is-open .nav-menu {
        max-height: 320px;
        padding-top: 10px;
        padding-bottom: 10px;
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 13px 4px;
        font-size: 0.92rem;
        line-height: 1.2;
    }

    .nav-menu li + li a {
        border-top: 1px solid rgba(17, 17, 17, 0.08);
    }
}

@media (max-width: 460px) {
    .nav-container {
        grid-template-columns: 46px 1fr 46px;
    }

    .logo-img {
        width: 64px;
    }

    .nav-menu a {
        font-size: 0.88rem;
    }
}
