header{
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    backdrop-filter: blur(8px);
    z-index: 99;
    
}
.head {
    display: flex;
    text-align: center;
    align-items: center;
    width: 90%;
    margin: auto;
    padding: 10px 0 8px;
    height: 44px;
}
.logo {
    margin: 0 25px 0 0;
}
.logo{
    height: 36px;
    object-fit: cover;
    filter: drop-shadow (0 8px 25px rgba(0,0,0,0.18));
    object-fit: cover;
    object-position: center center;
    display: block;
    
}



.categor a {
    font-size: 20px;
}
.categor {
    display: flex;
    align-items: center;
    gap: 20px;
}
.user-menu {
    position: relative;           /* ← важно */
    margin-left: auto;
}

.user {
    /* это кнопка / аватар, который всегда виден */
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    transform: translate(0, 0);
    position: relative;
    border-color: none;

}
.user-menu.open .user{
    background: rgb(44, 44, 44);
    transform: translate(-50px, 10px);
    opacity: 0;
}

.profile-modal {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    width: 220px;
    background: rgb(44, 44, 44);

    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.18s ease;
    pointer-events: none;
    overflow: hidden;
}
.user-links{
    border-top: 2px solid rgb(104, 104, 104);
    border-bottom: 2px solid rgb(104, 104, 104);
    display: flex;
    flex-direction: column;
    text-align: left;
}
.user-links a{
    padding: 5px;
}
.user-links a:hover{
    background: rgb(70, 70, 70);
}
.out-btn{padding: 5px;}
.out-btn:hover{background: rgb(99, 70, 70);color: #d45e5e;}


.user-menu.open .profile-modal {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* опционально — маленький треугольник сверху */

.search {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.search button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.search button{
    object-fit: cover;
    transition: transform 0.3s ease;
}

.search input {
    position: absolute;
    left: 0;
    width: 0;
    padding: 5px 0;
    border: none;
    border-bottom: 1px solid bisque;
    background: transparent;
    color: bisque;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    opacity: 0;
}

/* При наведении */
.search:hover button,
.search input:focus + button,
.search input:not(:placeholder-shown) + button {
    transform: translateX(400px);
}

.search:hover input,
.search input:focus,
.search input:not(:placeholder-shown) {
    width: 400px;
    padding: 5px 10px;
    opacity: 1;
}

/* Плавное появление текста при фокусе/наведении */
.search input::placeholder {
    color: rgba(244, 245, 220, 0.5);
}


.header-avatar-wrap {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.header-avatar-skeleton {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(90deg,
        rgba(60, 60, 60, 0.6) 25%,
        rgba(90, 90, 90, 0.7) 50%,
        rgba(60, 60, 60, 0.6) 75%
    );
    background-size: 800px 100%;
    animation: shimmer 1.6s infinite linear;
    border: 2px solid #b39b7e;
    box-sizing: border-box;
}

    @media (max-width: 768px) {
    /* ── Хедер ── */
    .head {
        width: 95%;
        padding: 8px 0;
        height: auto;
        gap: 8px;
    }

    /* ── Лого ── */
    .logo { margin: 0 10px 0 0; }
    .logo img { height: 28px; }

    /* ── Навигация ── */
    .categor {
        gap: 10px;
        flex: 1;
        min-width: 0;
    }
    .categor > a { display: none; } /* прячем «Главная» — есть лого */

    /* ── Поиск: на мобиле раскрывается влево, не вылезает за экран ── */
    .search:hover input,
    .search input:focus,
    .search input:not(:placeholder-shown) {
        width: calc(100vw - 140px); /* не шире экрана за вычетом лого+кнопки */
        max-width: 260px;
    }
    .search:hover button,
    .search input:focus + button,
    .search input:not(:placeholder-shown) + button {
        transform: translateX(200px); /* убираем кнопку в сторону */
    }
    .search input { font-size: 14px; }

    /* ── Профиль/логин ── */
    .user-menu { flex-shrink: 0; }
    .user a { font-size: 14px; }

    /* Дропдаун: открывается вправо от правого края, не уходит за экран */
    .profile-modal {
        right: 0;
        left: auto;
        width: 190px;
        top: 44px;  /* ниже хедера */
        border-radius: 12px;
    }

    /* ── Модалка авторизации ── */
    #authModal .modal-content {
        width: 92vw;
        max-width: 360px;
        padding: 20px 18px 24px;
        border-radius: 28px;
    }
    .auth-tab { font-size: 12px; padding: 8px 0; }
    .auth-panel input { font-size: 13px; padding: 10px 12px; }
    .auth-btn { font-size: 13px; padding: 11px; }
    .user-menu.open .user{
    transform: translate(-50px, 50px);
}
}
    
  
    

