/* ============================================================
 * Breedbase — шапка сайта (унифицированная под эталон).
 * Namespace .bb-* — изоляция от legacy-стилей в style.css.
 *
 * АРХИТЕКТУРА (3 уровня):
 *   1. .bb-topbar  — синяя полоса: хлебная крошка (Breedbase / Порода) слева,
 *                    юзер-блок (👤 Имя, ⏻ Выйти) справа.
 *   2. .bb-mainbar — белая полоса: 🐾 логотип, главная навигация,
 *                    зелёная CTA-кнопка [+ Добавить] справа.
 *   3. .bb-subnav  — светло-серая полоса: подразделы текущей секции,
 *                    прижаты вправо. CTA здесь больше нет — она в main-bar.
 *
 * ПРИНЦИПЫ:
 *   - SOLID/SRP: каждый уровень отвечает за одну смысловую группу.
 *   - KISS: только то, что реально используется в текущем UI.
 *   - DRY: цвета/радиусы/тени — через CSS-переменные.
 * ============================================================ */

:root {
    --bb-color-brand:        #1e5a8e;
    --bb-color-brand-dark:   #134467;
    --bb-color-brand-light:  #cfe2f1;
    --bb-color-text:         #1f2937;
    --bb-color-text-muted:   #64748b;
    --bb-color-border:       #e5e7eb;
    --bb-color-bg-soft:      #f8fafc;
    --bb-color-accent:       #fbbf24;
    --bb-color-danger:       #dc2626;
    --bb-color-success:      #16a34a;
    --bb-color-success-dark: #15803d;
    --bb-radius:             8px;
    --bb-radius-pill:        999px;
    --bb-shadow-sm:          0 1px 2px rgba(0,0,0,0.04);
}

.bb-header { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.bb-container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* ============================================================
 * TOP BAR (уровень 1) — контекст породы + аккаунт
 * ============================================================ */
.bb-topbar {
    background: var(--bb-color-brand);
    color: #fff;
    font-size: 0.875rem;
}
.bb-topbar__inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 38px;
}

/* ─── Хлебная крошка слева: Breedbase / Сибирский хаски ─── */
/* НОВОЕ: заменили старый блок brand-link + breed на семантичную крошку. */
.bb-breadcrumb {
    display: inline-flex; align-items: center; gap: 0.5rem;
    color: rgba(255,255,255,0.9);
}
.bb-breadcrumb__home {
    color: #fff; font-weight: 600; text-decoration: none;
    transition: opacity 0.15s;
}
.bb-breadcrumb__home:hover { opacity: 0.85; }
.bb-breadcrumb__sep {
    color: rgba(255,255,255,0.5);
    user-select: none;
}
.bb-breadcrumb__current {
    color: rgba(255,255,255,0.95);
    text-decoration: none;
}
a.bb-breadcrumb__current:hover { color: #fff; text-decoration: underline; }

/* ─── Юзер-блок справа: 👤 Tester  ⏻ Выйти ─── */
/* ИЗМЕНЕНО: вместо ссылок «О проекте/Контакты» теперь личный кабинет и выход. */
.bb-topbar__user {
    display: flex; align-items: center; gap: 1.25rem;
}
.bb-topbar__user-link,
.bb-topbar__logout {
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 0.4rem;
    transition: color 0.15s;
    font-size: 0.875rem;
}
.bb-topbar__user-link:hover,
.bb-topbar__logout:hover { color: #fff; }
.bb-topbar__user-link i { font-size: 1.05rem; }
.bb-topbar__logout i { font-size: 0.95rem; }
.bb-topbar__avatar {
    width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
    border: 1.5px solid rgba(255,255,255,0.4);
}

/* ─── Переключатель языка (опционально) ─── */
.bb-lang-switcher__btn {
    background: transparent; border: none;
    color: rgba(255,255,255,0.85);
    cursor: pointer; font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--bb-radius);
    transition: background 0.15s, color 0.15s;
}
.bb-lang-switcher__btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ============================================================
 * MAIN BAR (уровень 2) — бренд + навигация + CTA
 * ============================================================ */
.bb-mainbar {
    background: #fff;
    border-bottom: 1px solid var(--bb-color-border);
    box-shadow: var(--bb-shadow-sm);
}
.bb-mainbar__inner {
    display: flex; align-items: center; gap: 2rem; height: 72px;
}

/* ─── Логотип: 🐾 Breedbase ─── */
.bb-logo {
    display: flex; align-items: center; gap: 0.625rem;
    text-decoration: none; color: var(--bb-color-brand);
}
.bb-logo__icon {
    font-size: 1.75rem; color: var(--bb-color-brand);
    line-height: 1;
}
.bb-logo__text {
    font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
}

/* ─── Главная навигация ─── */
.bb-nav {
    display: flex; gap: 0.5rem; margin-left: auto; align-items: center;
}
.bb-nav__link {
    position: relative;
    display: inline-flex; align-items: center; gap: 0.5rem;
    color: var(--bb-color-text-muted);
    font-weight: 500; text-transform: uppercase;
    font-size: 0.85rem; letter-spacing: 0.04em;
    text-decoration: none;
    padding: 0.625rem 0.875rem;
    border-radius: var(--bb-radius);
    transition: color 0.15s, background 0.15s;
}
.bb-nav__link:hover {
    color: var(--bb-color-brand);
    background: var(--bb-color-bg-soft);
}
.bb-nav__link.is-active { color: var(--bb-color-brand); }
.bb-nav__link.is-active::after {
    content: ''; position: absolute;
    left: 0.875rem; right: 0.875rem; bottom: -25px;
    height: 3px; background: var(--bb-color-brand);
    border-radius: 2px 2px 0 0;
}
.bb-nav__link i { font-size: 0.95rem; }

/* ─── CTA-кнопка справа: [+ Добавить] ─── */
/* НОВОЕ: зелёная кнопка переехала из sub-nav сюда (как на эталоне). */
.bb-mainbar__cta { margin-left: 0.5rem; }

/* ============================================================
 * BUTTONS
 * ============================================================ */
.bb-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.625rem 1.125rem; border-radius: var(--bb-radius);
    font-weight: 600; font-size: 0.9rem;
    text-decoration: none; border: none; cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.bb-btn:active { transform: translateY(1px); }
.bb-btn--primary {
    background: var(--bb-color-success);
    color: #fff;
}
.bb-btn--primary:hover { background: var(--bb-color-success-dark); color: #fff; }

/* ============================================================
 * SUB NAV (уровень 3) — подразделы секции, прижаты вправо
 * ============================================================ */
.bb-subnav {
    background: var(--bb-color-bg-soft);
    border-bottom: 1px solid var(--bb-color-border);
}
.bb-subnav__inner {
    display: flex; justify-content: flex-end; gap: 1.75rem;
    height: 44px; align-items: center;
}
.bb-subnav__link {
    color: var(--bb-color-text-muted);
    font-size: 0.9rem; text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.bb-subnav__link:hover { color: var(--bb-color-brand); }
.bb-subnav__link.is-active {
    color: var(--bb-color-brand);
    border-bottom-color: var(--bb-color-brand);
    font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────
 * УДАЛЕНО: .bb-subnav__link--cta (зелёный «+ Добавить» в sub-nav).
 * Причина: по эталону CTA живёт в main-bar, а в sub-nav
 * остаются только обычные ссылки-подразделы. Если нужно вернуть —
 * восстановить из git history.
 * ───────────────────────────────────────────────────────────── */

/* ============================================================
 * MOBILE (≤ 900px)
 * ============================================================ */
@media (max-width: 900px) {
    .bb-container { padding: 0 1rem; }

    /* Top bar: компактнее, скрываем имя пользователя — только иконки */
    .bb-topbar__inner { height: 40px; font-size: 0.8rem; }
    .bb-topbar__user { gap: 0.75rem; }
    .bb-topbar__user-name { display: none; }
    .bb-topbar__logout span { display: none; } /* оставляем только иконку двери */
    .bb-breadcrumb__home,
    .bb-breadcrumb__current { font-size: 0.8rem; }

    /* Main bar: переносим навигацию вниз */
    .bb-mainbar__inner {
        height: auto; padding: 0.75rem 0; gap: 0.75rem; flex-wrap: wrap;
    }
    .bb-nav {
        order: 3; width: 100%;
        justify-content: space-around; gap: 0;
    }
    .bb-nav__link { padding: 0.5rem; font-size: 0.75rem; }
    .bb-nav__link span { display: none; }   /* на мобиле — только иконки */
    .bb-nav__link i { font-size: 1.1rem; }
    .bb-nav__link.is-active::after { bottom: -8px; left: 0; right: 0; }

    .bb-logo__text { font-size: 1.25rem; }

    /* CTA: схлопываем до иконки «+» */
    .bb-mainbar__cta .bb-btn span { display: none; }
    .bb-mainbar__cta .bb-btn { padding: 0.625rem; }

    /* Sub-nav: горизонтальный скролл */
    .bb-subnav__inner {
        justify-content: flex-start;
        overflow-x: auto;
        gap: 1rem;
        -webkit-overflow-scrolling: touch;
    }
    .bb-subnav__link { white-space: nowrap; flex-shrink: 0; }
}