.header {
    position: fixed;
    z-index: 1000;
    top: 14px;
    left: 0;
    right: 0;
    width: 100%;
}

.header__container {
    height: auto;
}

.header__inner {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2.5vw, 40px);
    box-sizing: border-box;
    width: 100%;
    padding: 14px 14px 14px clamp(24px, 4vw, 64px);
    border-radius: 123px;
    background: #ffffffa6;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #101114;
}

.header .logo {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
}

.header .logo img {
    display: block;
    width: auto;
    height: 26px;
    max-width: 180px;
}

.header__menu {
    display: flex;
    flex: 1;
    align-items: center;
    min-width: 0;
}

.header .nav {
    min-width: 0;
    margin: 0 auto;
}

.header .nav__list {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2.2vw, 32px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.header .nav__list > li {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.header .nav__list > li > a {
    position: relative;
    display: flex;
    align-items: center;
    color: rgba(16, 17, 20, 0.62);
    font-size: 16px;
    line-height: 1.35;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.header .nav__list > .current-menu-item > a,
.header .nav__list > .current_page_item > a,
.header .nav__list > .current-menu-ancestor > a {
    color: #101114;
}

.header .nav__list > li > a:hover,
.header .nav__list > li > a:focus-visible {
    color: #101114;
}

/* =========================================================
   ACTIONS
   ========================================================= */

.header__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: clamp(16px, 1.6vw, 24px);
}

.header__phone {
    flex: 0 0 auto;
    color: #101114;
    font-family: "JetBrains Mono", monospace;
    font-size: 16px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-decoration: none;
    white-space: nowrap;
}

.header__phone:hover,
.header__phone:focus-visible {
    color: #1d7ef2;
}

.header__cta {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    height: 48px;
    padding: 0 8px 0 24px;
    border-radius: 999px;
    background: #1d7ef2;
    color: #ffffff;
    font-size: 16px;
    line-height: 1;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.header__cta:hover,
.header__cta:focus-visible {
    background: #328cf5;
}

.header__cta:active {
    transform: translateY(1px);
}

.header__cta-arrow {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #ffffff;
    color: #1d7ef2;
    font-size: 16px;
    line-height: 1;
}

/* =========================================================
   DROPDOWN
   ========================================================= */

.header .nav__list .sub-menu {
    position: absolute;
    top: calc(100% + 18px);
    left: -20px;
    display: block;
    min-width: 240px;
    margin: 0;
    padding: 12px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: 0.2s ease;
}

.header .nav__list li:hover > .sub-menu,
.header .nav__list li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header .nav__list .sub-menu li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.header .nav__list .sub-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: rgba(16, 17, 20, 0.62);
    font-size: 14px;
    line-height: 1.35;
    text-decoration: none;
    white-space: nowrap;
}

.header .nav__list .sub-menu a:hover,
.header .nav__list .sub-menu a:focus-visible {
    background: #f2f3f5;
    color: #101114;
}

.header .menu-item-has-children > a {
    gap: 6px;
}

.header .menu-item-has-children > a::after {
    content: "▾";
    font-size: 10px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.header .menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

.header--main {
    position: fixed;
    z-index: 1000;
    top: 0;
    right: 0;
    left: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-100%);
    transition:
            opacity .3s ease,
            visibility .3s ease,
            transform .3s ease;
}

.header--main.header--main-visible {
    top: 14px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* =========================================================
   MOBILE BUTTON
   ========================================================= */

.header .mobile-menu {
    display: none;
    padding: 0;
    border: 0;
    background: none;
    color: #101114;
    cursor: pointer;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1270px) {
    .header__inner {
        gap: 20px;
        padding-left: 28px;
    }

    .header .nav__list {
        gap: 18px;
    }

    .header .nav__list > li > a {
        font-size: 14px;
    }

    .header__phone {
        display: none;
    }

    .header__cta {
        padding-left: 18px;
        font-size: 14px;
    }
}

/* =========================================================
   MOBILE / TABLET PORTRAIT
   ========================================================= */

@media (max-width: 855px) {
    .header {
        top: 0;
    }

    .header__container {
        width: 100%;
        max-width: 100% !important;
        padding: 0;
    }

    .header__inner {
        gap: 16px;
        min-height: 64px;
        padding: 10px 20px;
        border-radius: 0;
    }

    .header .logo img {
        height: 22px;
        max-width: 150px;
    }

    .header__menu {
        flex: initial;
        margin-left: auto;
    }

    .header .nav {
        position: fixed;
        z-index: -1;
        top: 64px;
        left: 0;
        display: block;
        width: 100%;
        height: calc(100dvh - 64px);
        margin: 0;
        padding: 0;
        border-radius: 0;
        background: #ffffff;
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition:
                opacity 0.25s ease,
                visibility 0.25s ease,
                transform 0.25s ease;
    }

    .header .nav--active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .header .nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        margin: 0;
        padding: 16px 20px 32px;
    }

    .header .nav__list > li {
        width: 100%;
        border-bottom: 1px solid rgba(16, 17, 20, 0.08);
    }

    .header .nav__list > li > a {
        width: 100%;
        box-sizing: border-box;
        padding: 18px 0;
        color: rgba(16, 17, 20, 0.62);
        font-size: 22px;
        line-height: 1.2;
        font-weight: 600;
        white-space: normal;
    }

    .header .nav__list > .current-menu-item > a,
    .header .nav__list > .current_page_item > a,
    .header .nav__list > .current-menu-ancestor > a {
        color: #101114;
    }

    .header .nav__list .sub-menu {
        position: static;
        display: block;
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 0 0 12px 16px;
        border-radius: 0;
        background: none;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .header .nav__list .sub-menu li {
        margin: 0;
        padding: 0;
    }

    .header .nav__list .sub-menu a {
        display: block;
        width: 100%;
        box-sizing: border-box;
        padding: 8px 0;
        border-radius: 0;
        color: rgba(16, 17, 20, 0.62);
        font-size: 14px;
        line-height: 1.4;
        white-space: normal;
    }

    .header .menu-item-has-children > a::after {
        display: none;
        content: "";
    }

    .header__actions {
        margin-left: auto;
    }

    .header__phone {
        display: block;
        font-size: 13px;
    }

    .header__cta {
        display: none;
    }

    .header .mobile-menu {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        flex: 0 0 auto;
    }

    .header .mobile-menu svg {
        display: block;
        width: 24px;
        height: auto;
    }

    .header .mobile-menu svg:last-child {
        display: none;
    }

    .header .mobile-menu.menu--active svg:first-child {
        display: none;
    }

    .header .mobile-menu.menu--active svg:last-child {
        display: block;
    }
}

/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 479px) {
    .header__inner {
        min-height: 60px;
        padding: 10px 15px;
    }

    .header .logo img {
        height: 20px;
        max-width: 120px;
    }

    .header__phone {
        display: none;
    }

    .header .nav {
        top: 60px;
        height: calc(100dvh - 60px);
    }

    .header .nav__list {
        padding: 12px 15px 28px;
    }

    .header .nav__list > li > a {
        padding: 16px 0;
        font-size: 20px;
    }
}