:root {
    --ts-red: #ed1c2b;
    --ts-text: #3f4652;
    --ts-dark: #202633;
    --ts-muted: #717887;
    --ts-line: #e8ebef;
    --ts-blue: #2578f6;
    --ts-bg: #ffffff;
    --ts-header-h: 76px;
}

.tausoft-header {
    position: relative;
    z-index: 9999;
    width: 100%;
    background: rgba(255,255,255,.98);
    border-bottom: 1px solid var(--ts-line);
    box-shadow: 0 2px 12px rgba(16, 24, 40, .035);
}

.tausoft-header-inner {
    width: min(1240px, calc(100% - 40px));
    min-height: var(--ts-header-h);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 30px;
}

.tausoft-brand {
    min-width: 0;
}

.tausoft-brand a {
    display: inline-flex;
    align-items: center;
}

.tausoft-logo-img,
.custom-logo.tausoft-logo-img {
    display: block;
    width: auto;
    height: 62px;
    max-width: 300px;
    object-fit: contain;
}

.tausoft-navigation {
    min-width: 0;
}

.tausoft-navigation ul {
    margin: 0;
    padding: 0;
    list-style: none;
}


.tausoft-navigation ul,
.tausoft-navigation li,
.tausoft-navigation li::before,
.tausoft-navigation li::after,
.tausoft-navigation li::marker,
.tausoft-menu li::before,
.tausoft-menu li::after,
.tausoft-menu li::marker {
    list-style: none !important;
    content: none !important;
}

.tausoft-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.tausoft-menu > li {
    position: relative;
    margin: 0;
}

.tausoft-menu > li > a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
    padding: 14px 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--ts-text);
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .02em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.tausoft-menu > li > a::after {
    display: none !important;
}

.tausoft-menu > li:hover > a,
.tausoft-menu > li.current-menu-item > a,
.tausoft-menu > li.current-menu-ancestor > a {
    color: var(--ts-red);
    background: #f7f8fb;
    border-color: #e7ebf2;
    box-shadow: 0 2px 10px rgba(16, 24, 40, .04);
}

.tausoft-menu .menu-item-has-children > a {
    padding-right: 28px;
}

.tausoft-menu .menu-item-has-children > a::before {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
}

.tausoft-menu .sub-menu {
    position: absolute;
    top: calc(100% - 6px);
    left: -18px;
    z-index: 50;
    min-width: 220px;
    padding: 9px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(9px);
    border: 1px solid var(--ts-line);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(17, 24, 39, .12);
    transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
}

.tausoft-menu li:hover > .sub-menu,
.tausoft-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tausoft-menu .sub-menu li {
    position: relative;
    margin: 0;
}

.tausoft-menu .sub-menu a {
    display: block;
    padding: 11px 12px;
    border-radius: 8px;
    color: var(--ts-text);
    font-size: 13px;
    font-weight: 550;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
}

.tausoft-menu .sub-menu a:hover {
    color: var(--ts-red);
    background: #fafafa;
}


/* Вкладені підменю відкриваються вправо */
.tausoft-menu .sub-menu .menu-item-has-children > a {
    padding-right: 30px;
}

.tausoft-menu .sub-menu .menu-item-has-children > a::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: translateY(-50%) rotate(45deg);
}

.tausoft-menu .sub-menu .sub-menu {
    top: -9px;
    left: calc(100% + 8px);
    right: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
}

.tausoft-menu .sub-menu li:hover > .sub-menu,
.tausoft-menu .sub-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.tausoft-header-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
}



.tausoft-search-toggle,
.tausoft-mobile-toggle,
.tausoft-search-close {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    cursor: pointer;
}

.tausoft-search-toggle {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 9px;
    color: var(--ts-text);
    background: transparent;
}

.tausoft-search-toggle:hover {
    color: var(--ts-red);
    background: #f7f8fa;
}

.tausoft-search-panel {
    border-top: 1px solid var(--ts-line);
    background: #fff;
}

.tausoft-search-panel[hidden] {
    display: none !important;
}

.tausoft-search-inner {
    width: min(900px, calc(100% - 40px));
    min-height: 86px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tausoft-search-inner .search-form {
    flex: 1;
    display: flex;
    margin: 0;
}

.tausoft-search-inner .search-field {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 15px;
    border: 1px solid #dfe3e8;
    border-radius: 10px 0 0 10px;
    outline: none;
    background: #fff;
}

.tausoft-search-inner .search-field:focus {
    border-color: #a8b7cb;
    box-shadow: 0 0 0 3px rgba(37,120,246,.07);
}

.tausoft-search-inner .search-submit {
    height: 46px;
    padding: 0 19px;
    border: 0;
    border-radius: 0 10px 10px 0;
    color: #fff;
    background: var(--ts-red);
    cursor: pointer;
}

.tausoft-search-close {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 9px;
    color: var(--ts-muted);
    background: #f4f5f7;
    font-size: 28px;
    line-height: 1;
}

.tausoft-mobile-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    border-radius: 9px;
    background: transparent;
}

.tausoft-mobile-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    border-radius: 2px;
    background: var(--ts-dark);
}

@media (max-width: 1050px) {
    .tausoft-header-inner {
        grid-template-columns: 270px minmax(0, 1fr) 48px;
        gap: 18px;
    }

    .tausoft-logo-img,
    .custom-logo.tausoft-logo-img {
        height: 54px;
        max-width: 250px;
    }

    .tausoft-menu {
        gap: 20px;
    }

    .tausoft-menu > li > a {
        font-size: 11px;
    }
}

@media (max-width: 840px) {
    :root {
        --ts-header-h: 66px;
    }

    .tausoft-header-inner {
        width: min(100% - 24px, 840px);
        grid-template-columns: minmax(0,1fr) auto auto;
        gap: 8px;
    }

    .tausoft-mobile-toggle {
        display: block;
        order: 2;
    }

    .tausoft-header-tools {
        order: 3;
        gap: 4px;
    }

    .tausoft-language {
        display: none;
    }

    .tausoft-navigation {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        display: none;
        padding: 10px 12px 17px;
        border-top: 1px solid var(--ts-line);
        border-bottom: 1px solid var(--ts-line);
        background: #fff;
        box-shadow: 0 18px 35px rgba(17,24,39,.09);
    }

    .tausoft-navigation.is-open {
        display: block;
    }

    .tausoft-menu {
        display: block;
    }

    .tausoft-menu > li {
        border-bottom: 1px solid #f0f1f3;
    }

    .tausoft-menu > li:last-child {
        border-bottom: 0;
    }

    .tausoft-menu > li > a {
        min-height: auto;
        padding: 14px 12px;
        font-size: 13px;
        justify-content: flex-start;
        border-radius: 10px;
    }

    .tausoft-menu > li > a::after {
        display: none;
    }

    .tausoft-menu .sub-menu {
        position: static;
        min-width: 0;
        padding: 0 0 8px 12px;
        opacity: 1;
        visibility: visible;
        transform: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        display: none;
    }

    .tausoft-menu .menu-item-has-children.is-submenu-open > .sub-menu {
        display: block;
    }

    .tausoft-menu .sub-menu a {
        white-space: normal;
    }

    .tausoft-menu .sub-menu .sub-menu {
        position: static;
        left: auto;
        top: auto;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        padding-left: 16px;
    }

    .tausoft-menu .sub-menu .menu-item-has-children.is-submenu-open > .sub-menu {
        display: block;
    }

}

@media (max-width: 480px) {
    .tausoft-logo-img,
    .custom-logo.tausoft-logo-img {
        height: 44px;
        max-width: 200px;
    }

    .tausoft-search-toggle {
        width: 38px;
        height: 38px;
    }
}
