/* ==========================================
   📌 ОСНОВНЫЕ СТИЛИ ШАПКИ (HEADER)
   ========================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px; /* Фиксированная высота для предсказуемости */
    background: rgba(44, 24, 16, 0.98);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(44, 24, 16, 0.4);
}

.site-logo {
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.site-logo a {
    color: white;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    z-index: 10002; /* Выше, чем у открытого меню! */
    padding: 5px;
    flex-shrink: 0;
}

.nav-main {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: nowrap;
}

.nav-link {
    color: #E8CFA8;
    text-decoration: none;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    transition: 0.2s;
    font-size: 14px;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.nav-link-admin { color: #fbbf24; font-weight: 700; }
.nav-link-logout { color: #FCA5A5; font-weight: 600; }
.nav-link-register { background: #8b5cf6; color: white; font-weight: 600; padding: 6px 14px; }

.user-profile-block {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 15px;
    padding-left: 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.user-info { text-align: right; line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 600; color: #E8CFA8; white-space: nowrap; }
.user-zeffyrs { font-size: 12px; color: #fbbf24; font-weight: 600; white-space: nowrap; }

.avatar-link { text-decoration: none; display: block; position: relative; }

.nav-notification-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
    color: #cbd5e1 !important;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
}

.nav-status {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1;
}
.status-has { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.status-none { background: rgba(34, 197, 94, 0.2); color: #22c55e; }

/* Стили аватара */
.header-avatar {
    width: 42px !important; height: 42px !important; flex-shrink: 0;
    overflow: visible !important; margin: 0 !important;
    border: 2px solid rgba(255,255,255,0.2) !important;
}
.header-avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.header-avatar .avatar-badge-icon {
    width: 20px !important; height: 20px !important; font-size: 12px !important;
    bottom: -2px !important; right: -2px !important; border-width: 1px !important;
}
.header-avatar.effect-steam-spice::after { font-size: 16px !important; top: -4px !important; right: -4px !important; }
.header-avatar.frame-ognennaya, .header-avatar.frame-brilliant { padding: 2px !important; border: none !important; }

/* ==========================================
   📱 МОБИЛЬНОЕ МЕНЮ (НАДЕЖНАЯ ВЕРСИЯ)
   ========================================== */
@media (max-width: 960px) {
    .nav-toggle { display: block !important; }
    
    .nav-main {
        display: none;
        position: fixed; /* ИСПРАВЛЕНО: fixed вместо absolute */
        top: 70px; /* Ровно под высотой шапки */
        left: 0;
        right: 0;
        bottom: 0; /* Растягиваем до низа экрана */
        background: rgba(30, 30, 46, 0.98); /* Плотный фон */
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        gap: 15px;
        z-index: 10001; /* Ниже кнопки, но выше всего остального сайта */
        border-top: 2px solid #8b5cf6;
        overflow-y: auto; /* Прокрутка, если меню длинное */
    }
    
    .nav-main.mobile-open { 
        display: flex !important; 
        animation: slideDown 0.3s ease-out;
    }
    
    .nav-main .nav-link, 
    .nav-main .nav-link-admin, 
    .nav-main .nav-link-logout,
    .nav-main .nav-link-register { 
        width: 100%; 
        padding: 15px !important; /* Увеличенная зона для пальца */
        font-size: 16px !important; 
        border-bottom: 1px solid rgba(255,255,255,0.1);
        text-align: left;
    }
    
    .user-profile-block {
        margin-left: 0; padding-left: 0; border-left: none;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-top: 15px; margin-top: 10px; width: 100%;
        justify-content: space-between;
    }
    
    /* Скрываем аватар в мобильном выпадающем списке для экономии места */
    .nav-main .avatar-link { display: none; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .site-header { padding: 0 15px; }
    .site-logo { font-size: 18px; }
}