/* ============================================================
   TOPBAR — ФИНАЛЬНАЯ ВЕРСИЯ v2
   ============================================================ */

/* ============ БАЗОВЫЙ TOPBAR ============ */
.avito-topbar {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    font-size: 13px;
    padding: 8px 0;
    position: relative;
    z-index: 1001;
}

.avito-topbar-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

/* ============ КНОПКА "ВОЙТИ" ============ */
.topbar-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: #00AAFF;
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
    line-height: 1;
}

.topbar-login-btn:hover {
    background: #0088cc;
    color: #fff;
    text-decoration: none;
}

.topbar-login-btn i {
    font-size: 16px;
}

/* ============ ИКОНКИ ============ */
.topbar-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    margin: 0;
    color: #666;
    font-size: 20px;
    line-height: 1;
    text-decoration: none;
    transition: color 0.15s;
    flex-shrink: 0;
}

.topbar-icon:hover {
    color: #00AAFF;
    text-decoration: none;
}

.topbar-icon i {
    display: inline-block;
    font-family: "bootstrap-icons";
    font-style: normal;
    font-weight: normal;
    font-size: 20px;
    line-height: 1;
    color: inherit;
}

.topbar-icon i::before {
    display: inline-block;
    font-family: "bootstrap-icons";
    font-size: 20px;
    line-height: 1;
    color: inherit;
}

/* ============ БЕЙДЖИ ============ */
.topbar-badge {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1.4;
    pointer-events: none;
}

.topbar-badge-red { background: #FF4053; }
.topbar-badge-green { background: #04E061; }

/* ============ АВАТАР — КРУЖОК ============ */
.topbar-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    overflow: hidden;
    text-decoration: none;
    background: #FFC107;   /* ← ЖЁЛТЫЙ, если нет фото */
    color: #1a1a1a;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #e0e0e0;
    transition: transform 0.15s, box-shadow 0.15s;
}

.topbar-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px #00AAFF;
    text-decoration: none;
}

.topbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.topbar-avatar-letter {
    line-height: 1;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}

/* ============================================================
   ПЛАНШЕТЫ (max-width: 992px)
   ============================================================ */
@media (max-width: 992px) {
    .avito-topbar-inner {
        padding: 0 16px;
    }

    .topbar-right {
        gap: 10px;
    }

    .topbar-icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        font-size: 18px;
    }

    .topbar-icon i,
    .topbar-icon i::before {
        font-size: 18px;
    }

    .topbar-avatar {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        font-size: 13px;
    }

    .topbar-avatar-letter {
        font-size: 13px;
    }

    .topbar-login-btn {
        padding: 7px 14px;
        font-size: 13px;
    }

    .topbar-badge {
        font-size: 9px;
        padding: 1px 4px;
        min-width: 14px;
    }
}

/* ============================================================
   МОБИЛЬНЫЕ (max-width: 576px)
   ============================================================ */
@media (max-width: 576px) {
    .avito-topbar {
        padding: 6px 0;
    }

    .avito-topbar-inner {
        padding: 0 12px;
    }

    .topbar-right {
        gap: 8px;
    }

    .topbar-icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        font-size: 18px;
    }

    .topbar-icon i,
    .topbar-icon i::before {
        font-size: 18px;
    }

    .topbar-avatar {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
    }

    .topbar-avatar-letter {
        font-size: 12px;
    }

    .topbar-login-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .topbar-login-btn i {
        font-size: 14px;
    }

    .topbar-badge {
        font-size: 8px;
        padding: 1px 3px;
        min-width: 12px;
    }
}

/* ============================================================
   NOTIFICATIONS DROPDOWN
   ============================================================ */
.topbar-notifications-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    max-height: 400px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.notifications-dropdown.open {
    display: flex;
}

.notifications-header {
    padding: 14px 18px;
    border-bottom: 1px solid #eee;
    font-weight: 700;
    font-size: 15px;
    color: #1a1a1a;
}

.notifications-list {
    flex: 1;
    overflow-y: auto;
    max-height: 300px;
}

.notifications-item {
    display: flex;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.notifications-item:hover {
    background: #f8f8f8;
}

.notifications-item.unread {
    background: #f0f8ff;
}

.notifications-item-icon {
    font-size: 20px;
    color: #00AAFF;
    flex-shrink: 0;
}

.notifications-item-content {
    flex: 1;
    min-width: 0;
}

.notifications-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.notifications-item-text {
    font-size: 12px;
    color: #666;
}

.notifications-item-time {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.notifications-empty {
    text-align: center;
    padding: 30px 20px;
    color: #999;
    font-size: 14px;
}

.notifications-all {
    display: block;
    text-align: center;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #00AAFF;
    text-decoration: none;
    border-top: 1px solid #eee;
}

.notifications-all:hover {
    background: #f8f8f8;
}

@media (max-width: 576px) {
    .notifications-dropdown {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: auto;
        width: 300px;
        max-width: calc(100vw - 24px);
        z-index: 9999;
    }
}

/* ============ КНОПКА "ВОЙТИ" ============ */
.topbar-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: #00AAFF;
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
    line-height: 1;
    flex-shrink: 0;
}

.topbar-login-btn:hover {
    background: #0088cc;
    color: #fff;
    text-decoration: none;
}

.topbar-login-btn i {
    font-size: 16px;
}

/* Аватар — кружок (жёлтый если нет фото) */
.topbar-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    overflow: hidden;
    text-decoration: none;
    background: #FFC107;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #e0e0e0;
    transition: transform 0.15s, box-shadow 0.15s;
}

.topbar-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px #00AAFF;
    text-decoration: none;
}

.topbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.topbar-avatar-letter {
    line-height: 1;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Мобильная адаптация */
@media (max-width: 992px) {
    .topbar-login-btn {
        padding: 7px 14px;
        font-size: 13px;
    }
    .topbar-login-btn i {
        font-size: 14px;
    }
    .topbar-avatar {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
    }
    .topbar-avatar-letter {
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .topbar-right {
        gap: 6px;
    }

    .topbar-icon {
        width: 26px;
        height: 26px;
        min-width: 26px;
        min-height: 26px;
        font-size: 17px;
    }

    .topbar-icon i,
    .topbar-icon i::before {
        font-size: 17px;
    }

    .topbar-login-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .topbar-login-btn span {
        display: inline;  /* Оставляем текст "Войти" */
    }

    .topbar-login-btn i {
        font-size: 14px;
    }

    .topbar-avatar {
        width: 26px;
        height: 26px;
        min-width: 26px;
        min-height: 26px;
    }

    .topbar-avatar-letter {
        font-size: 12px;
    }

    .topbar-badge {
        font-size: 8px;
        padding: 1px 3px;
        min-width: 12px;
    }
}