/* =====================================================
   DIGIUNI — MODERN HEADER
   ВЫРАВНИВАНИЕ ПО ШИРИНЕ ОСНОВНОГО КОНТЕНТА
===================================================== */

.du-header,
.du-header * {
    box-sizing: border-box;
}

.du-header {
    --du-purple: #895be5;
    --du-purple-dark: #5140c4;
    --du-text: #17151f;
    --du-muted: #777386;

    width: 100%;
    max-width: 100%;
    position: relative;
    z-index: 9999;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: transparent;
}


/* =====================================================
   ОСНОВНОЙ КОНТЕЙНЕР HEADER
   ШИРИНА ДО 1350 PX С УЧЁТОМ ОТСТУПОВ
===================================================== */

.du-header-inner {
    width: 100%;
    max-width: 1350px;

    height: 76px;

    margin-left: auto;
    margin-right: auto;

    /* Внутренние отступы для выравнивания контента */
    padding-left: 20px;
    padding-right: 20px;

    display: flex;
    align-items: center;
    gap: 30px;

    background: transparent;

    border: 0;
    box-shadow: none;
}


/* =====================================================
   LOGO
===================================================== */

.du-logo {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    gap: 11px;

    color: var(--du-text) !important;
    text-decoration: none !important;

    transition: transform .25s ease;
}

.du-logo:hover {
    transform: translateY(-1px);
}


/* =====================================================
   ЗНАЧОК ЛОГОТИПА
===================================================== */

.du-logo-mark {
    width: 43px;
    height: 43px;

    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 43px;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            #895be5 0%,
            #7867e8 100%
        );

    box-shadow:
        0 6px 18px rgba(102,84,219,.20);

    overflow: hidden;

    transition:
        transform .3s ease,
        box-shadow .3s ease;
}

.du-logo:hover .du-logo-mark {
    transform:
        translateY(-2px)
        rotate(-2deg);

    box-shadow:
        0 9px 23px rgba(102,84,219,.28);
}


/* =====================================================
   ИКОНКА ШАПОЧКИ
===================================================== */

.du-logo-mark-img {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    object-fit: cover;
    border-radius: inherit;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}


/* =====================================================
   НАЗВАНИЕ
===================================================== */

.du-logo-text {
    display: flex;
    flex-direction: column;

    line-height: 1;
}

.du-logo-title {
    font-size: 20px;
    font-weight: 800;

    letter-spacing: -.7px;

    white-space: nowrap;
}


/* =====================================================
   ПОДЗАГОЛОВОК
===================================================== */

.du-logo-subtitle {
    --du-subtitle-width: 140px;

    margin-top: 5px;

    align-self: flex-start;

    display: inline-block;

    box-sizing: content-box;

    overflow: hidden;
    white-space: nowrap;

    font-size: 9px;
    font-weight: 600;

    letter-spacing: 1.5px;

    text-transform: uppercase;

    color: var(--du-muted);

    border-right:
        1px solid var(--du-muted);

    width: 0;

    animation:
        duTyping 5.5s linear infinite,
        duCursorBlink .8s step-end infinite;
}


@keyframes duTyping {
    0% {
        width: 0;
        animation-timing-function: steps(20, end);
    }

    40%,
    100% {
        width: var(--du-subtitle-width);
    }
}


@keyframes duCursorBlink {
    50% {
        border-right-color: transparent;
    }
}


/* =====================================================
   NAVIGATION
===================================================== */

.du-nav {
    display: flex;
    align-items: center;

    gap: 5px;

    margin-left: 32px;

    flex: 0 0 auto;
}


/* =====================================================
   ОБЫЧНЫЕ ПУНКТЫ
===================================================== */

.du-nav-link {
    height: 42px;

    padding: 0 15px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    color: var(--du-text) !important;

    text-decoration: none !important;

    font-size: 14px;
    font-weight: 650;

    white-space: nowrap;

    transition:
        color .22s ease,
        background .22s ease,
        transform .22s ease;
}

.du-nav-link:hover {
    color: var(--du-purple) !important;

    background: rgba(102,84,219,.07);

    transform: translateY(-1px);
}


/* =====================================================
   КУРСЫ
===================================================== */

.du-courses-link {
    position: relative;

    height: 42px;

    padding: 0 17px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    border-radius: 11px;

    color: var(--du-purple) !important;

    text-decoration: none !important;

    font-size: 14px;
    font-weight: 700;

    white-space: nowrap;

    background: rgba(102,84,219,.08);

    border: 1px solid rgba(102,84,219,.13);

    box-shadow: none;

    transition:
        background .25s ease,
        border-color .25s ease,
        color .25s ease,
        transform .25s ease,
        box-shadow .25s ease;
}


.du-courses-link:hover {
    color: #fff !important;

    background: var(--du-purple);

    border-color: var(--du-purple);

    transform: translateY(-1px);

    box-shadow:
        0 6px 16px rgba(102,84,219,.18);
}


/* =====================================================
   МИГАЮЩАЯ ТОЧКА
===================================================== */

.du-live-dot {
    width: 5px;
    height: 5px;

    flex: 0 0 5px;

    border-radius: 50%;

    background: var(--du-purple);

    animation: duLiveDot 1.8s ease-in-out infinite;

    transition: background .25s ease;
}


.du-courses-link:hover .du-live-dot {
    background: #fff;

    animation: none;

    opacity: 1;

    transform: scale(1.15);

    box-shadow:
        0 0 0 4px rgba(255,255,255,.18);
}


@keyframes duLiveDot {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);

        box-shadow:
            0 0 0 0 rgba(102,84,219,.45);
    }

    50% {
        opacity: .55;
        transform: scale(1.18);

        box-shadow:
            0 0 0 4px rgba(102,84,219,0);
    }
}


/* =====================================================
   ПРАВАЯ ЧАСТЬ HEADER
===================================================== */

.du-header-actions {
    margin-left: auto;

    display: flex;
    align-items: center;

    gap: 8px;

    flex: 0 0 auto;
}


/* =====================================================
   SEARCH
===================================================== */

.du-search {
    position: relative;
}


.du-search-button {
    width: 43px;
    height: 43px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 12px;

    background: transparent;

    color: var(--du-text);

    cursor: pointer;

    transition:
        background .2s ease,
        color .2s ease,
        transform .2s ease;
}


.du-search-button:hover {
    color: var(--du-purple);

    background: rgba(102,84,219,.07);

    transform: translateY(-1px);
}


/* =====================================================
   ИКОНКА ПОИСКА
===================================================== */

.du-search-icon {
    width: 18px;
    height: 18px;

    position: relative;

    border: 1.8px solid currentColor;

    border-radius: 50%;
}


.du-search-icon::after {
    content: "";

    position: absolute;

    width: 7px;
    height: 1.8px;

    right: -5px;
    bottom: -2px;

    background: currentColor;

    border-radius: 3px;

    transform: rotate(45deg);
}


/* =====================================================
   ОКНО ПОИСКА
===================================================== */

.du-search-box {
    position: absolute;

    right: 0;
    top: calc(100% + 12px);

    width: 340px;
    max-width: calc(100vw - 24px);

    padding: 10px;

    background: rgba(255,255,255,.98);

    border: 1px solid #eceaf3;

    border-radius: 15px;

    box-shadow:
        0 18px 50px rgba(38,31,83,.13);

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(7px)
        scale(.98);

    transition: .22s ease;
}


.du-search.active .du-search-box {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(0)
        scale(1);
}


/* =====================================================
   SEARCH FORM
===================================================== */

.du-search-form {
    display: flex;
    gap: 7px;
}


.du-search-input {
    width: 100%;
    min-width: 0;
    height: 42px;

    padding: 0 13px;

    border: 1px solid #eceaf3 !important;
    border-radius: 10px !important;

    outline: none !important;

    background: #faf9fd !important;

    font-size: 14px;
}


.du-search-input:focus {
    border-color: #b8aff0 !important;

    background: #fff !important;
}


.du-search-submit {
    height: 42px;

    padding: 0 15px;

    border: 0;
    border-radius: 10px;

    background: var(--du-purple);

    color: #fff;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition: background .2s ease;
}


.du-search-submit:hover {
    background: var(--du-purple-dark);
}


/* =====================================================
   MOBILE BUTTON
===================================================== */

.du-mobile-toggle {
    display: none;

    width: 43px;
    height: 43px;

    flex: 0 0 43px;

    border: 0;
    border-radius: 12px;

    background: rgba(102,84,219,.07);

    cursor: pointer;

    position: relative;
}


.du-mobile-toggle span,
.du-mobile-toggle span::before,
.du-mobile-toggle span::after {
    position: absolute;

    width: 19px;
    height: 2px;

    left: 50%;
    top: 50%;

    transform: translate(-50%,-50%);

    background: var(--du-text);

    border-radius: 5px;

    transition: .25s ease;
}


.du-mobile-toggle span::before,
.du-mobile-toggle span::after {
    content: "";

    left: 0;
}


.du-mobile-toggle span::before {
    top: -6px;
}


.du-mobile-toggle span::after {
    top: 6px;
}


/* =====================================================
   MOBILE MENU
===================================================== */

.du-mobile-menu {
    display: none;

    width: 100%;
    max-width: 1350px;

    margin: 0 auto;

    padding: 10px;

    background: rgba(255,255,255,.98);

    border: 1px solid #eceaf3;

    border-radius: 16px;

    box-shadow:
        0 18px 50px rgba(38,31,83,.10);
}


.du-mobile-menu.active {
    display: block;

    animation: duMobileOpen .22s ease;
}


@keyframes duMobileOpen {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.du-mobile-menu a {
    min-height: 45px;

    padding: 0 13px;

    display: flex;
    align-items: center;

    border-radius: 10px;

    color: var(--du-text) !important;

    text-decoration: none !important;

    font-size: 14px;
    font-weight: 650;
}


.du-mobile-menu a:hover {
    color: var(--du-purple) !important;

    background: #f6f4fd;
}


/* =====================================================
   КНОПКА КУРСОВ НА МОБИЛЬНОМ
===================================================== */

.du-mobile-courses {
    margin-bottom: 5px;

    justify-content: center;

    color: var(--du-purple) !important;

    background: rgba(102,84,219,.08);

    border: 1px solid rgba(102,84,219,.13);
}


.du-mobile-courses:hover {
    color: #fff !important;

    background: var(--du-purple) !important;
}


/* =====================================================
   АДАПТАЦИЯ — НЕБОЛЬШИЕ ДЕСКТОПЫ
===================================================== */

@media (max-width: 1350px) {
    .du-header-inner {
        width: calc(100% - 32px);
        max-width: 1350px;

        padding-left: 20px;
        padding-right: 20px;
    }

    .du-mobile-menu {
        width: calc(100% - 32px);
        max-width: 1350px;
    }
}


/* =====================================================
   ПЛАНШЕТЫ
===================================================== */

@media (max-width: 900px) {
    .du-header-inner {
        width: 100%;
        max-width: 100%;

        height: 70px;

        padding: 0 16px;

        gap: 16px;
    }

    .du-nav {
        gap: 2px;
        margin-left: 12px;
    }

    .du-nav-link {
        padding: 0 11px;
    }

    .du-search {
        display: none;
    }

    .du-mobile-menu {
        width: calc(100% - 32px);
        max-width: 100%;
    }
}


/* =====================================================
   МОБИЛЬНЫЕ УСТРОЙСТВА
===================================================== */

@media (max-width: 720px) {
    .du-header-inner {
        width: 100%;
        max-width: 100%;

        height: 66px;

        padding: 0 12px;

        gap: 8px;
    }

    .du-nav {
        display: none;
    }

    .du-mobile-toggle {
        display: block;
        margin-left: 4px;
    }

    .du-logo {
        gap: 9px;
        min-width: 0;
    }

    .du-logo-title {
        font-size: 18px;
    }

    .du-logo-subtitle {
        display: none;
    }

    .du-logo-mark {
        width: 39px;
        height: 39px;
        flex-basis: 39px;

        border-radius: 12px;
    }

    .du-header-actions {
        gap: 4px;
    }

    .du-mobile-menu {
        width: calc(100% - 24px);
        max-width: 100%;
    }
}


/* =====================================================
   УЗКИЕ ТЕЛЕФОНЫ
===================================================== */

@media (max-width: 420px) {
    .du-logo-title {
        font-size: 17px;
        letter-spacing: -.5px;
    }

    .du-logo-mark {
        width: 37px;
        height: 37px;
        flex-basis: 37px;
    }

    .du-header-inner {
        gap: 6px;
    }

    .du-mobile-toggle {
        margin-left: 0;
    }
}


/* =====================================================
   УМЕНЬШЕНИЕ АНИМАЦИЙ
===================================================== */

@media (prefers-reduced-motion: reduce) {
    .du-live-dot,
    .du-logo-subtitle {
        animation: none !important;
    }

    .du-logo-subtitle {
        width: var(--du-subtitle-width) !important;
        border-right: 0 !important;
    }

    .du-logo,
    .du-logo-mark,
    .du-nav-link,
    .du-courses-link,
    .du-search-button {
        transition: none !important;
    }
}