/* BURGER */
.menu__burger {
    display: none;
}

@media (max-width: 768px) {
    .menu__burger {
        display: block;
        position: relative;
        width: 37px;
        height: 22px;
        z-index: 20;

    }

    .menu__burger span,
    .menu__burger::after,
    .menu__burger::before {
        content: "";
        transition: all 0.3s ease 0s;
        right: 0;
        position: absolute;
        width: 100%;
        height: 2px;
        background-color: #fff;
    }

    .menu__burger::before {
        top: 0;
    }

    .menu__burger::after {
        bottom: 0;
    }

    .menu__burger span {
        top: calc(50% - 1px);
    }
}

.menu-open .menu__burger span {
    width: 0;
}

.menu-open .menu__burger {
    width: 0;
}

/* --------- HEADER ---------- */
.header-white  .menu-item a {
    color: #000;
}

.header-white .menu-item  a {
    color: #000;
}


.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 4;
}

.header-sub {
    max-height: 105px;
}

.header__wrapper {
    padding-top: 50px;
    display: flex;
    justify-content: space-between;
}

.header__wrapper-nav {
    display: flex;
    align-items: baseline;
}

.header__wrapper-nav-list {
    position: relative;
    display: flex;
    gap: 37px;
    margin-right: 56px;
}

.menu-item a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    font-size: 21px;
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.menu-item a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1px;
    background-color: #e17a44;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

/* Активные пункты */
.current-menu-item > a::after,
.current_page_item > a::after,
.current-menu-ancestor > a::after {
    transform: scaleX(1) !important;
    width: 100%;
}

/* Подчеркивание строго под текстом */
.menu-item a {
    position: relative;
    display: inline-block;
}

.menu-item a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e17a44;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.menu-item a:hover::after,
.current-menu-item a::after,
.current_page_item a::after {
    transform: scaleX(1);
}

/* ------ появление выпадающего меню  --------*/
.header-white .menu-item a:hover {
    color: #e17a44;
    text-shadow: none;
}

.header__wrapper-nav-connect-wa {
    width: 40px;
    height: 40px;
}
.header-white .header__wrapper-nav-connect-phone {
    color: #000;
}
.header__wrapper-nav-connect-phone:hover {
    text-shadow: 0 0 1px rgb(255, 255, 255);
}

.header-white .header__wrapper-nav-connect-phone:hover {
    text-shadow: 0 0 1px rgb(0, 0, 0);

}

.menu-item a:hover {
    color: #e17a44;
    text-shadow: none;
}

.menu-item a:hover::after {
    transform: scaleX(1);
}

.menu-item a img {
    transition: 0.3s;
}
.withSub {
    position: relative;
}
.header-white .withSub a{

    color: #e17a44;
    /*padding-bottom: 17px;*/
    margin-right: 25px;
}
.withSub a{

    color: #e17a44;
    padding-bottom: 17px;
    margin-right: 25px;
}

.withSub a::before {
    content: url("/wp-content/themes/traectoriya/components/header/img/arrow.svg");
    position: absolute;
    top: -2px;
    right: -28px;
    transition: 0.3s;
}
.header-white .withSub a:hover {
    color: #e17a44;
    text-shadow: none;
}

.withSub a:hover {
    color: #e17a44;
    text-shadow: none;
    padding-bottom: 17px;
}

.withSub a::after {
    bottom: 14px;
}

.withSub:hover a::before {
    transform: rotate(180deg);
}



.withSub:hover .sub-menu {
    opacity: 1;
    visibility: visible;
}

/* ------------------- */

.header__wrapper-nav-connect-social {
    display: flex;
    align-items: center;
    gap: 48px;
    font-weight: 400;
    font-size: 21px;
    color: #fff;
}

.header__wrapper-nav-connect-wa img {
    transition: 0.3s;
    width: 34px;
    height: 34px;
}

.header__wrapper-nav-connect-wa:hover img {
    width: 40px;
    height: 40px;
}

.sub-menu {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 43px;
    left: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 359px;
    transition: 0.3s;
}

.sub-menu .menu-item a {
    transition: 0.3s;
    display: inline-block;
    background: #fff;
    color: #000;
    padding: 16px 20px;
    width: 100%;
    font-size: 16px;
}
.sub-menu .menu-item a::before {
    content: '';
}

.sub-menu .menu-item a::after {
    display: none;
}

.sub-menu .menu-item a:hover {
    background: #e5e5e5;
    color: #000;
    text-shadow: unset;
    padding: 16px 20px;
}

.header__wrapper-phone-mobile,
.header__wrapper-nav-extra {
    display: none;
}

.header__wrapper-nav-extra {
    list-style: none;
    margin: 0;
    padding: 0;
}

.header__wrapper-nav-img {
    display: none;
}

.header__wrapper-nav-list-item-big {
    display: none;
}

@media (max-width: 1035px) {
    .header__wrapper-nav-list {
        gap: 23px;
        margin-right: 19px;
    }
}

@media (max-width: 991px) {
    .header__wrapper-nav-list {
        margin-right: 0;
    }

    .header__wrapper-nav-connect-social {
        display: none;
    }
}

@media (max-width: 768px) {
   .withSub a {
        padding: 0;
    }
     .withSub a::before {
        display: none;
    }
    .header__wrapper-nav-list {
        flex-direction: column;
    }

    .header__wrapper-nav {
        position: fixed;
        top: 0;
        left: -100%;
        transition: 0.3s;
        background: #000;
        height: 100%;
        width: 100%;
        flex-direction: column;
        padding: 13px 30px;
        z-index: 19;
    }

    .header__wrapper-nav a {
        color: #fff;
    }
  .withSub a:hover {
        color: #e17a44;
        text-shadow: none;
        padding-bottom: 0;
    }

    .withSub a::after {
        bottom: -2px;
    }
    .withSub a {
        color: #fff;
    }

    .burger-open.black-burger span,
    .burger-open.black-burger::after,
    .burger-open.black-burger::before {
        background-color: #fff;
    }

    .black-burger span,
    .black-burger::after,
    .black-burger::before {
        background-color: #000;
    }

    .menu-open {
        left: 0;
    }

    .burger-open.menu__burger::after {
        bottom: calc(50% - 1px);
        transform: rotate(45deg);
    }

    .burger-open.menu__burger::before {
        top: calc(50% - 1px);
        transform: rotate(-45deg);
    }

    .burger-open.menu__burger span {
        width: 0;
    }
    .header__wrapper-nav-list-item-big {
        display: block;

    }
    .header__wrapper-nav-list-item-big a{
        font-weight: 600;
        font-size: 26px;
        line-height: 120%;
        color: #fff;
    }

    .menu-item a{
        font-weight: 500;
    }



    .header__wrapper-nav-img {
        display: block;
        margin-bottom: 40px;
    }

    .sub-menu {
        position: static;
        gap: 12px;
        opacity: 1;
        visibility: visible;
        max-height: 0;
        height: 100%;
        overflow: hidden;
    }

    .sub-menu .menu-item a {
        padding: 0;
        background: unset;
        color: #fff;
        font-size: 21px;
        font-weight: 400;
    }
    .header-white  .menu-item a {
        color: #fff;
    }

    .header__wrapper-phone-mobile {
        display: flex;
        align-items: center;
        margin-left: auto;
        margin-right: 55px;
        color: #fff;
        font-weight: 400;
        font-size: 16px;
        line-height: 1.2;
        text-decoration: none;
        white-space: nowrap;
        z-index: 20;
    }

    .header-white .header__wrapper-phone-mobile {
        color: #fff;
    }

    .header__wrapper-nav-extra {
        display: flex;
        flex-direction: column;
        gap: 23px;
        width: 100%;
        margin-top: 23px;
    }

    .header__wrapper-nav-address span {
        display: block;
        font-weight: 500;
        font-size: 21px;
        line-height: 120%;
        color: #fff;
    }

    .sub-menu .menu-item a::after {
        display: block;
    }

    .sub-menu .menu-item a:hover {
        background: unset;
        padding: 0;
        color: #e17a44;
    }
}

@media (min-width: 769px) {
    .header__wrapper-phone-mobile,
    .header__wrapper-nav-extra {
        display: none !important;
        visibility: hidden;
        pointer-events: none;
    }
}

@media (max-width: 600px) {
    .header__wrapper {
        padding-top: 13px;
    }

    .header__wrapper-nav-img {
        width: 48px;
        height: 38px;
    }

    .header__wrapper-img {
        width: 48px;
        height: 38px;
    }

    .menu__burger {
        position: absolute;
        top: 21px;
        right: 21px;
        width: 40px;
        height: 26px;
    }

    .header__wrapper-nav-list {
        gap: 23px;
    }

    .header__wrapper-nav-list-item-big {
        font-size: 22px;
    }

    .menu-item a {
        font-size: 18px;
    }

    .sub-menu   .menu-item a{
        font-size: 18px;
    }

    .header__wrapper-phone-mobile {
        font-size: 14px;
        margin-right: 65px;
    }

    .header__wrapper-nav-address span {
        font-size: 18px;
    }

    .header__wrapper-nav {
        padding: 13px 15px;
    }

    .header__wrapper-nav-list-item-dropdown {
        gap: 17px;
        line-height: 19px;
    }
}

/* Убираем подчеркивание для пункта меню с логотипом */
.menu-item-colab a::after,
.menu-item-colab a:hover::after,
.menu-item-colab a::before {
    display: none !important;
}

.menu-item-colab a {
    text-decoration: none !important;
}

/* Дополнительная защита для всех состояний */
.menu-item-colab a:hover {
    text-decoration: none !important;
}

.menu-item-colab a:hover::after {
    transform: scaleX(0) !important;
}

