/* ============================================= */
/*                   OVERLAY                     */
/* ============================================= */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

[data-theme="dark"] .mobile-overlay {
    background: rgba(0,0,0,0.6);
}

/* ============================================= */
/*               ОСНОВНАЯ ШАПКА                  */
/* ============================================= */
.mobile-header {
  display: none;
}

.site-header {
    display: flex;
    width: 100%;
    height: 70px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--medium-gray);
    top: 0;
    z-index: 1000;
    position: fixed;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === Логотип === */
.logo-container {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo-container .logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo-container .logo img {
    height: 32px;
    object-fit: contain;
    transition: filter 0.3s ease;
}

[data-theme="dark"] .logo-container .logo img,
[data-theme="dark"] .mobile-header__logo img,
[data-theme="dark"] .mobile-menu__header .mobile-header__logo img,
[data-theme="dark"] .mobile-header .mobile-header__logo img
{
    filter:
        brightness(0)
        invert(0.7)
        sepia(0.3)
        hue-rotate(200deg)
        saturate(1.8)
        brightness(0.85);
}

.nav-list {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* === Основное меню === */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.8rem 1.2rem;
    margin: 0 0.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: var(--light-gray);
    color: var(--primary);
}

[data-theme="dark"] .nav-link:hover {
    background-color: var(--medium-gray);
}

.site-header .nav-link .svg-icon,
.site-header .dropdown-content a .svg-icon,
.site-header .dropdown-content .btn-logout .svg-icon,
.site-header .user-profile .svg-icon {
    width: 1.15rem;
    height: 1.15rem;
}
/* === Для неавторизованных === */
.login-btn {
    font-size: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    margin-left: 12px;
    transition: color 0.3s ease;
}

.login-btn:hover {
    color: var(--primary);
}

/* === Блок пользователя с dropdown === */
.user-dropdown {
    position: relative;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-profile:hover {
    opacity: 0.8;
}

.avatar-header {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray);
    color: var(--bg-secondary);
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.avatar-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.username {
    color: var(--primary);
    margin: 0 0.5rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

/* === Dropdown === */
.dropdown-content {
    display: none;
    right: 0;
    top: 100%;
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    min-width: 160px;
    z-index: 1001;
    position: absolute;
    border: 1px solid var(--medium-gray);
    transition: all 0.3s ease;
}

.user-settings-menu {
    min-width: 260px;
}

.mobile-header__dropdown.is-open,
.user-dropdown.is-open {
    display: block;
}

.user-dropdown:hover .dropdown-content,
.user-dropdown:focus-within .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--medium-gray);
}

.dropdown-content form {
    margin: 0;
}

.user-settings-menu form {
    width: 100%;
}

.dropdown-content .btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    cursor: pointer;
    text-align: left;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: var(--light-gray);
    color: var(--primary);
}

[data-theme="dark"] .dropdown-content a:hover {
    background-color: var(--medium-gray);
}

/* === Разделитель === */
.divider {
    height: 1px;
    background-color: var(--medium-gray);
    margin: 0.5rem 0;
    transition: background-color 0.3s ease;
}

/* === Log out === */
.dropdown-content .btn-logout:hover {
    background-color: rgba(230, 57, 70, 0.1) !important;
    color: #e63946 !important;
}

[data-theme="dark"] .dropdown-content .btn-logout:hover {
    background-color: rgba(230, 57, 70, 0.2) !important;
}

.header-select {
    height: 34px;
    min-height: 34px;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    padding-right: 34px !important;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5 6 7.5l3-3' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.header-select::-ms-expand {
    display: none;
}

.header-select:hover {
    background-color: var(--bg-secondary) !important;
    border-color: var(--medium-gray) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .header-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5 6 7.5l3-3' stroke='%23cbd5e1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ============================================= */
/*     УНИФИЦИРОВАННЫЕ СТИЛИ ДЛЯ НЕАВТОРИЗОВАННЫХ ДЕСКТОП    */
/* ============================================= */

/* Стили для секции неавторизованных пользователей */
.header-unauth-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Переопределяем стили для десктопных переключателей неавторизованных */
.header-unauth-section .desktop-theme,
.header-unauth-section .desktop-language {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 6px 8px !important;
    transition: background-color 0.3s ease;
    border-radius: 6px;
    margin: 0 2px;
    background: none !important;
}

.header-unauth-section .desktop-theme:hover,
.header-unauth-section .desktop-language:hover {
    background-color: transparent !important;
}

[data-theme="dark"] .header-unauth-section .desktop-theme:hover,
[data-theme="dark"] .header-unauth-section .desktop-language:hover {
    background-color: transparent !important;
}

/* Иконки для неавторизованных */
.header-unauth-section .desktop-theme .theme-icon,
.header-unauth-section .desktop-language .translate-icon {
    width: 16px !important;
    height: 16px !important;
    filter: brightness(0.3);
    transition: filter 0.3s ease;
    flex-shrink: 0;
}

[data-theme="dark"] .header-unauth-section .desktop-theme .theme-icon,
[data-theme="dark"] .header-unauth-section .desktop-language .translate-icon {
    filter: brightness(0.8);
}

/* Формы для неавторизованных */
.header-unauth-section .desktop-theme form,
.header-unauth-section .desktop-language form {
    margin: 0 !important;
    flex: 1;
    min-width: 136px;
}

/* УНИФИЦИРОВАННЫЕ СТИЛИ ДЛЯ SELECT'ОВ НЕАВТОРИЗОВАННЫХ */
.header-unauth-section .desktop-theme .theme-select,
.header-unauth-section .desktop-language .language-select {
    width: 100% !important;
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--medium-gray) !important;
    border-radius: 6px !important;
    padding: 8px 36px 8px 10px !important;
    color: var(--text-primary) !important;
    cursor: pointer;
    font-size: 13px !important;
    font-weight: 500;
    transition: all 0.3s ease;
    box-sizing: border-box;
    height: 34px !important;
    min-width: 136px;
}

@media (min-width: 1025px) and (max-width: 1440px) {
    .header-unauth-section {
        gap: 6px;
    }

    .header-unauth-section .desktop-theme,
    .header-unauth-section .desktop-language {
        gap: 6px;
        margin: 0;
        padding: 6px !important;
    }

    .header-unauth-section .desktop-theme form,
    .header-unauth-section .desktop-language form {
        min-width: 132px;
    }

    .header-unauth-section .desktop-theme .theme-select,
    .header-unauth-section .desktop-language .language-select {
        min-width: 132px;
        padding: 7px 34px 7px 9px !important;
        background-position: right 11px center;
    }
}

.header-unauth-section .desktop-theme .theme-select:hover,
.header-unauth-section .desktop-language .language-select:hover {
    border-color: var(--medium-gray) !important;
    box-shadow: none !important;
}

.header-unauth-section .desktop-theme .theme-select:focus,
.header-unauth-section .desktop-language .language-select:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 4px rgba(52, 152, 219, 0.3) !important;
}

[data-theme="dark"] .header-unauth-section .desktop-theme .theme-select:focus,
[data-theme="dark"] .header-unauth-section .desktop-language .language-select:focus {
    box-shadow: 0 0 4px rgba(74, 168, 255, 0.3) !important;
}

/* Стили для кнопок авторизации в десктопе */
.header-unauth-section .mobile-header__auth {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 4px;
}

.header-unauth-section .mobile-header__login-btn {
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.header-unauth-section .mobile-header__login-btn:hover {
    color: var(--primary);
    background-color: var(--light-gray);
}

[data-theme="dark"] .header-unauth-section .mobile-header__login-btn:hover {
    background-color: var(--medium-gray);
}

/* Убираем разделитель между переключателями и кнопками */
.header-unauth-section > .mobile-header__auth::before {
    display: none !important;
}

/* ============================================= */
/*              ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ               */
/* ============================================= */

/* === Desktop версия (для авторизованных) === */
.desktop-theme {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.8rem 1.5rem;
    transition: background-color 0.3s ease;
}

.desktop-theme:hover {
    background-color: transparent;
}

[data-theme="dark"] .desktop-theme:hover {
    background-color: transparent;
}

.desktop-theme .theme-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0.3);
    transition: filter 0.3s ease;
}

[data-theme="dark"] .desktop-theme .theme-icon {
    filter: brightness(0.8);
}

.desktop-theme form {
    margin: 0;
    flex: 1;
}

.desktop-theme .theme-select {
    width: 100%;
    border: 1px solid var(--medium-gray);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 14px;
    background-color: var(--bg-secondary);
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.desktop-theme .theme-select:hover {
    border-color: var(--medium-gray);
    box-shadow: none;
}

.desktop-theme .theme-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 4px rgba(52, 152, 219, 0.3);
}

[data-theme="dark"] .desktop-theme .theme-select:focus {
    box-shadow: 0 0 4px rgba(74, 168, 255, 0.3);
}

/* === Переключатель языка (для авторизованных) === */
.desktop-language {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.8rem 1.5rem;
    transition: background-color 0.3s ease;
}

.desktop-language:hover {
    background-color: transparent;
}

[data-theme="dark"] .desktop-language:hover {
    background-color: transparent;
}

.desktop-language .translate-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0.3);
    transition: filter 0.3s ease;
}

[data-theme="dark"] .desktop-language .translate-icon {
    filter: brightness(0.8);
}

.desktop-language form {
    margin: 0;
    flex: 1;
}

.desktop-language .language-select {
    width: 100%;
    border: 1px solid var(--medium-gray);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 14px;
    background-color: var(--bg-secondary);
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.user-settings-menu .dropdown-content,
.user-settings-menu {
    min-width: 260px;
}

.user-menu-preference {
    gap: 12px;
    padding: 0.95rem 1.5rem;
}

.user-menu-preference form {
    min-width: 0;
}

.user-menu-preference .theme-select,
.user-menu-preference .language-select {
    min-width: 0;
    width: 100%;
    height: 34px;
    min-height: 34px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.desktop-language .language-select:hover {
    border-color: var(--medium-gray);
    box-shadow: none;
}

.desktop-language .language-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 4px rgba(52, 152, 219, 0.3);
}

[data-theme="dark"] .desktop-language .language-select:focus {
    box-shadow: 0 0 4px rgba(74, 168, 255, 0.3);
}

/* === Mobile версия === */
.user-dropdown .mobile-theme {
    justify-content: space-between;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--medium-gray);
    transition: all 0.3s ease;
}

.user-dropdown .mobile-theme .theme-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0.2);
    transition: filter 0.3s ease;
}

[data-theme="dark"] .user-dropdown .mobile-theme .theme-icon {
    filter: brightness(0.8);
}

.user-dropdown .theme-select {
    flex: 1;
    border: 1px solid var(--medium-gray);
    border-radius: 6px;
    padding: 4px 6px;
    background-color: var(--bg-secondary);
    font-size: 14px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.user-dropdown .theme-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* === Общие стили для выпадающих списков === */
.menu-theme, .menu-language {
    transition: background-color 0.3s ease;
}

/* Стили для option элементов */
.theme-select option,
.language-select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 1024px) {
    .user-dropdown .mobile-theme {
        padding: 12px 14px;
    }

    .user-dropdown .theme-select {
        padding: 6px 8px;
        font-size: 14px;
    }
}

/* ============================================= */
/*               МОБИЛЬНАЯ ВЕРСИЯ                */
/* ============================================= */
@media (max-width: 1024px) {
    /*Скрываем десктоп-шапку*/
    .site-header {
        display: none;
    }

    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.6rem 1rem;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--medium-gray);
        position: sticky;
        top: 0;
        left: 0;
        width: 100vw;
        z-index: 1000;
        transition: background-color 0.3s ease, border-color 0.3s ease;
    }

    /* === Бургер === */
    .mobile-header__burger {
        background: none;
        border: none;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        padding: 6px;
    }

    .burger-line {
        width: 22px;
        height: 2px;
        background-color: var(--text-primary);
        border-radius: 1px;
        transition: 0.3s;
    }

    /* === Логотип === */
    .mobile-header__logo img {
        height: 28px;
        object-fit: contain;
        transition: filter 0.3s ease;
    }

    [data-theme="dark"] .mobile-header__logo img {
        filter: brightness(0.9);
    }

    /* === Для неавторизованных === */
    .mobile-header__auth {
        display: flex;
        gap: 12px;
        align-items: center;
    }

    /* === Пользователь === */
    .mobile-header__user {
        position: relative;
    }

    .user-avatar-btn {
        border: none;
        background: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        overflow: hidden;
        transition: all 0.3s ease;
    }

    #header-avatar-placeholder {
        width: 34px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 16px;
        color: var(--bg-secondary);
        background: var(--gray);
        border-radius: 50%;
        transition: background-color 0.3s ease;
    }

    #header-avatar-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* === Dropdown пользователя === */
    .user-dropdown {
        position: absolute;
        right: 0;
        top: 42px;
        background: var(--bg-secondary);
        border-radius: 8px;
        box-shadow: var(--shadow-md);
        display: none;
        min-width: 220px;
        overflow: hidden;
        border: 1px solid var(--medium-gray);
        transition: all 0.3s ease;
    }

    .user-dropdown ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .user-dropdown li {
        border-bottom: 1px solid var(--medium-gray);
        transition: border-color 0.3s ease;
    }

    .user-dropdown ul li {
        padding: 10px 14px;
        display: flex;
        align-items: center;
        gap: 10px;
        border-bottom: 1px solid var(--medium-gray);
    }

    .user-dropdown li:last-child {
        border-bottom: none;
    }

    .user-dropdown a {
        display: block;
        padding: 10px 12px;
        color: var(--text-primary);
        text-decoration: none;
        font-size: 14px;
        transition: all 0.3s ease;
    }

    .user-dropdown form {
        width: 100%;
        margin: 0;
    }

    .user-dropdown .btn-logout {
        width: 100%;
        border: none;
        background: transparent;
        color: var(--text-primary);
        font: inherit;
        text-align: left;
        cursor: pointer;
        padding: 10px 12px;
    }

    .user-dropdown a:hover {
        background: var(--light-gray);
        color: var(--primary);
    }

    .user-dropdown .btn-logout:hover {
        background: var(--light-gray);
        color: var(--primary);
    }

    [data-theme="dark"] .user-dropdown a:hover {
        background: var(--medium-gray);
    }

    .translate-icon {
        filter: brightness(0.2);
        transition: filter 0.3s ease;
    }

    [data-theme="dark"] .translate-icon {
        filter: brightness(0.8);
    }

    .user-dropdown .mobile-language {
        justify-content: space-between;
    }

    .user-dropdown .mobile-language .translate-icon {
        width: 18px;
        height: 18px;
    }

    .user-dropdown .language-select {
        flex: 1;
        border: 1px solid var(--medium-gray);
        border-radius: 6px;
        height: 34px;
        min-height: 34px;
        padding: 4px 6px;
        background-color: var(--bg-secondary);
        font-size: 14px;
        cursor: pointer;
        color: var(--text-primary);
        transition: all 0.3s ease;
    }

    /* === Offcanvas меню === */
    .mobile-menu {
        position: fixed;
        top: 0;
        height: 100%;
        width: 75vw;
        left: -75vw;
        background: var(--bg-secondary);
        transition: left 0.3s ease;
        z-index: 1001;
        border-right: 1px solid var(--medium-gray);
    }

    .mobile-menu.open {
        left: 0;
    }

    .mobile-menu__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.8rem 1rem;
        border-bottom: 1px solid var(--medium-gray);
        transition: border-color 0.3s ease;
    }

    .mobile-menu__header .mobile-header__logo img {
        height: 26px;
        object-fit: contain;
    }

    .mobile-menu .nav-list {
        display: block;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-menu .nav-list li {
        border-bottom: 1px solid var(--medium-gray);
        transition: border-color 0.3s ease;
    }

    .mobile-menu .nav-list li:last-child {
        border-bottom: none;
    }

    .mobile-menu .nav-link {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 1rem 1.5rem;
        text-decoration: none;
        color: var(--text-primary);
        font-weight: 500;
        transition: all 0.3s ease;
    }

    .mobile-menu .nav-link:hover {
        background: var(--light-gray);
        color: var(--primary);
    }

    [data-theme="dark"] .mobile-menu .nav-link:hover {
        background: var(--medium-gray);
    }

    .mobile-menu .nav-link .svg-icon {
        width: 1.25rem;
        height: 1.25rem;
    }

    /* === Кнопки для неавторизованных === */
    .mobile-header__login-btn {
        font-size: 0.9rem;
        color: var(--text-primary);
        text-decoration: none;
        transition: color 0.3s ease;
    }

    .mobile-header__login-btn:hover {
        color: var(--primary);
    }

    /* Горизонтальная линия над кнопками */
    .mobile-header__right {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .mobile-header__auth {
        display: flex;
        align-items: center;
        gap: 24px;
    }

    .mobile-header__auth::before {
        content: "";
        display: block;
        width: 1px;
        height: 28px;
        background-color: var(--medium-gray);
        margin-right: 10px;
        transition: background-color 0.3s ease;
    }
}

/* ============================================= */
/*          DROPDOWN ДЛЯ НЕАВТОРИЗОВАННЫХ        */
/* ============================================= */

.mobile-header__dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.mobile-header__dropdown-toggle:hover {
    background-color: var(--light-gray);
    color: var(--primary);
}

[data-theme="dark"] .mobile-header__dropdown-toggle:hover {
    background-color: var(--medium-gray);
}

.mobile-header__dropdown {
    position: absolute;
    right: 0;
    top: 42px;
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    display: none;
    min-width: 200px;
    width: calc(100vw - 32px);
    max-width: 280px;
    overflow: hidden;
    border: 1px solid var(--medium-gray);
    z-index: 1001;
    transition: all 0.3s ease;
}

.mobile-header__dropdown-item {
    padding: 16px;
    border-bottom: 1px solid var(--medium-gray);
    transition: border-color 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.mobile-header__dropdown-item:last-child {
    border-bottom: none;
}

/* Стили для theme switcher в dropdown */
.mobile-header__dropdown .mobile-theme-unauth {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.mobile-header__dropdown .mobile-theme-unauth .theme-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0.3);
    flex-shrink: 0;
}

[data-theme="dark"] .mobile-header__dropdown .mobile-theme-unauth .theme-icon {
    filter: brightness(0.8);
}

.mobile-header__dropdown .mobile-theme-unauth form {
    flex: 1;
    width: 100%;
}

.mobile-header__dropdown .mobile-theme-select {
    width: 100% !important;
    background-color: var(--bg-secondary);
    border: 1px solid var(--medium-gray);
    border-radius: 6px;
    padding: 12px 14px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-sizing: border-box;
    display: block;
    margin: 0;
}

/* Стили для языкового переключателя в dropdown */
.mobile-header__dropdown .mobile-language-unauth {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.mobile-header__dropdown .mobile-language-unauth .translate-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0.3);
    flex-shrink: 0;
}

[data-theme="dark"] .mobile-header__dropdown .mobile-language-unauth .translate-icon {
    filter: brightness(0.8);
}

.mobile-header__dropdown .mobile-language-unauth form {
    flex: 1;
    width: 100%;
}

.mobile-header__dropdown .mobile-language-select {
    width: 100% !important;
    background-color: var(--bg-secondary);
    border: 1px solid var(--medium-gray);
    border-radius: 6px;
    padding: 12px 14px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-sizing: border-box;
    display: block;
    margin: 0;
}

.mobile-header__dropdown .mobile-language-select:hover,
.mobile-header__dropdown .mobile-theme-select:hover {
    border-color: var(--medium-gray);
    box-shadow: none;
}

.mobile-header__dropdown .mobile-language-select:focus,
.mobile-header__dropdown .mobile-theme-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 4px rgba(52, 152, 219, 0.3);
}

/* Стили для кнопок авторизации в dropdown */
.mobile-header__auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.mobile-header__auth-buttons .mobile-header__login-btn,
.mobile-header__auth-buttons .mobile-header__signup-btn {
    text-align: center;
    padding: 12px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: block;
    width: 100% !important;
    box-sizing: border-box;
    margin: 0;
}

.mobile-header__auth-buttons .mobile-header__login-btn {
    background: transparent;
    border: 1px solid var(--medium-gray);
    color: var(--text-primary);
}

.mobile-header__auth-buttons .mobile-header__login-btn:hover {
    background: var(--light-gray);
    border-color: var(--gray);
}

.mobile-header__auth-buttons .mobile-header__signup-btn {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: white;
}

.mobile-header__auth-buttons .mobile-header__signup-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

/* Адаптивность для очень маленьких экранов */
@media (max-width: 360px) {
    .mobile-header__dropdown {
        min-width: 180px;
        width: calc(100vw - 24px);
    }

    .mobile-header__dropdown-item {
        padding: 14px 12px;
    }

    .mobile-header__auth-buttons .mobile-header__login-btn,
    .mobile-header__auth-buttons .mobile-header__signup-btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .mobile-header__dropdown .mobile-language-select,
    .mobile-header__dropdown .mobile-theme-select {
        padding: 10px 12px;
    }
}

/* Для средних экранов */
@media (min-width: 361px) and (max-width: 480px) {
    .mobile-header__dropdown {
        width: calc(100vw - 40px);
        max-width: 300px;
    }
}

/* Адаптивность для десктопных переключателей неавторизованных */
@media (max-width: 1200px) {
    .header-unauth-section .desktop-theme form,
    .header-unauth-section .desktop-language form {
        min-width: 128px;
    }

    .header-unauth-section .desktop-theme .theme-select,
    .header-unauth-section .desktop-language .language-select {
        font-size: 12px !important;
        padding: 7px 34px 7px 9px !important;
        min-width: 128px;
        background-position: right 11px center;
    }

    .header-unauth-section {
        gap: 6px;
    }
}

/* Для очень узких экранов */
@media (max-width: 1100px) {
    .header-unauth-section .desktop-theme .theme-select,
    .header-unauth-section .desktop-language .language-select {
        min-width: 122px;
        font-size: 11px !important;
        padding: 6px 32px 6px 8px !important;
        background-position: right 10px center;
    }

    .header-unauth-section .desktop-theme,
    .header-unauth-section .desktop-language {
        padding: 4px 6px !important;
    }
}

/* Убираем старые стили для неавторизованных */
.mobile-header__right .mobile-language-unauth:not(.mobile-header__dropdown .mobile-language-unauth),
.mobile-header__right .mobile-header__auth:not(.mobile-header__dropdown .mobile-header__auth) {
    display: none;
}

/* Стили для контейнера неавторизованных пользователей */
.mobile-header__right {
    position: relative;
    display: flex;
    align-items: center;
}

/* Убедимся, что dropdown виден поверх других элементов */
.mobile-header__dropdown {
    z-index: 1002;
}

/* Дополнительные стили для лучшего отображения select */
.mobile-language-select option,
.mobile-theme-select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
}

/* Стили для иконки в кнопке dropdown */
.mobile-header__dropdown-toggle .svg-icon {
    width: 1.3rem;
    height: 1.3rem;
}

/* Улучшаем отступы для лучшего визуального восприятия */
.mobile-header__dropdown-item:first-child {
    padding-top: 20px;
}

.mobile-header__dropdown-item:last-child {
    padding-bottom: 20px;
}

/* Переопределяем возможные конфликтующие стили */
.mobile-header__dropdown .mobile-language-unauth .mobile-language-select {
    max-width: none !important;
    width: 100% !important;
}

.mobile-header__dropdown .login-btn {
    margin-left: 0 !important;
    width: 100% !important;
}

/* Улучшенные transition для плавности */
.site-header *,
.mobile-header * {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
