/* ===== Верхнее меню: компактная правая часть (inc/header-user.php). Шапка тёмная в обеих темах ===== */

.mainNav .logo {
    margin-right: 24px;
    flex-shrink: 0;
}

.mainNav .navList ul {
    gap: 22px;
}

.mainNav .searchBtn {
    margin: 0 4px 0 18px;
    flex-shrink: 0;
}

.mainNav .cabBtnWrapper {
    gap: 8px;
    flex-shrink: 0;
}

/* кнопки одной высоты: 40px */
.mainNav .cabBtnWrapper .btn {
    height: 40px !important;
    padding: 0 16px !important;
    font-size: 15px !important;
    white-space: nowrap;
}

/* «Регистрация» - главная кнопка для гостя */
html :is(.header, .headerPage) .cabBtnWrapper .btn.hmBtnAccent {
    background: #87997E !important;
    border-color: #87997E !important;
    color: #fff !important;
}

html :is(.header, .headerPage) .cabBtnWrapper .btn.hmBtnAccent:hover {
    background: #96A88C !important;
    border-color: #96A88C !important;
}

/* круглые иконки (уведомления, язык, тема): без обводки, подсветка при наведении */
.mainNav .cabBtnWrapper .userNotifications,
.mainNav .cabBtnWrapper .hlSwitchBtn,
.mainNav .cabBtnWrapper .themeToggle {
    width: 38px;
    height: 38px;
    box-shadow: none;
    color: #fff;
    transition: background 0.2s;
}

.mainNav .cabBtnWrapper .userNotifications:hover,
.mainNav .cabBtnWrapper .hlSwitchBtn:hover,
.mainNav .cabBtnWrapper .hlSwitch.is-open .hlSwitchBtn,
.mainNav .cabBtnWrapper .themeToggle:hover {
    background: rgba(255, 255, 255, 0.13);
}

.mainNav .userNotifications svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s ease;
}

.mainNav .userNotifications:hover svg {
    transform: rotate(-12deg) scale(1.1);
}

.mainNav .userNotifications span {
    top: 0;
    right: 0;
    border-radius: 9px;
}

/* ---------- меню пользователя ---------- */

.hmUser {
    position: relative;
    z-index: 6;
}

.hmUserBtn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 10px 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    font: inherit;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    outline: none;
    transition: background 0.2s, border-color 0.2s;
}

.hmUserBtn:hover,
.hmUser.is-open .hmUserBtn {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.25);
}

.hmUserBtn:focus-visible {
    outline: 2px solid #87997E;
    outline-offset: 2px;
}

.hmUser svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hmUserBtn > svg:last-child {
    width: 14px;
    height: 14px;
    opacity: 0.7;
    transition: transform 0.2s;
}

.hmUser.is-open .hmUserBtn > svg:last-child {
    transform: rotate(180deg);
}

.hmUserName {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hmUserList {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 1000;
    min-width: 210px;
    margin: 0;
    padding: 6px;
    list-style: none;
    text-align: left;
    background: rgba(39, 44, 48, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.hmUser.is-open .hmUserList {
    display: block;
    animation: hmUserDrop 0.18s ease;
}

@keyframes hmUserDrop {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

.hmUserList li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hmUserList a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 7px;
    color: #fff;
    font-size: 15px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
}

.hmUserList a:hover {
    background: rgba(255, 255, 255, 0.13);
}

.hmUserList a svg {
    opacity: 0.7;
}

.hmUserList b {
    margin-left: auto;
    min-width: 20px;
    padding: 2px 6px;
    border-radius: 9px;
    background: #87997E;
    font-size: 11px;
    text-align: center;
}

.hmUserList .hmUserOut {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hmUserList .hmUserOut a {
    color: #E8697A;
}

/* ---------- узкие экраны ---------- */

/* адвент - только иконка, подпись во всплывающей подсказке */
@media screen and (max-width: 1280px) {
    .mainNav .cabBtnWrapper .hadvHeadTxt {
        display: none;
    }

    .mainNav .cabBtnWrapper .hadvHeadBtn {
        padding: 0 11px !important;
    }

    .mainNav .navList ul {
        gap: 16px;
    }
}

/* мобильное меню обрезает выпадающие блоки: пункты пользователя показываем списком */
@media screen and (max-width: 980px) {
    .mainNav .logo {
        margin-right: 0;
    }

    .mainNav .searchBtn {
        margin: 0;
    }

    .mainNav .cabBtnWrapper {
        gap: 10px;
    }

    .mainNav .cabBtnWrapper .hadvHeadTxt {
        display: inline;
    }

    .mainNav .cabBtnWrapper .hadvHeadBtn {
        padding: 0 16px !important;
    }

    .hmUser {
        width: 100%;
        order: 10;
    }

    .hmUserBtn {
        display: none;
    }

    .hmUserList {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
        position: static;
        min-width: 0;
        background: rgba(255, 255, 255, 0.06);
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .hmUserList .hmUserOut {
        margin: 0;
        padding: 0;
        border: 0;
    }
}
