/**
 * Общая шапка сайта — визуально в духе личного кабинета (cabinet.php):
 * отступы между кнопками, скругления, спокойная тень и бордер.
 * Подключается после основного CSS раздела (/contragents/styles.css или /foreigners/styles.css).
 */

.header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 4px 24px rgba(2, 6, 23, 0.06);
    padding: 14px 0;
}

.header .container {
    gap: 16px;
    row-gap: 12px;
}

/* Кнопки справа — с нормальным интервалом (раньше flex без gap — «вплотную») */
.header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-left: auto;
}

.header-logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    padding: 4px 10px 4px 4px;
    margin: -4px -10px -4px -4px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.header-logo a:hover {
    background: #f8fafc;
    box-shadow: 0 0 0 1px #e5e7eb;
}

.header .logo-text {
    color: #1e293b;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Кнопки шапки — те же пропорции, что у .btn в cabinet.php */
.header-actions .btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
    font-family: inherit;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.header-actions .btn-outline {
    background: #fff;
    color: #1e40af;
    border: 2px solid #1e40af;
}

.header-actions .btn-outline:hover {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.12);
}

/* Авторизованный пользователь: иконка + подпись (на мобильных — только иконки) */
.header-actions .site-header-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.header-actions .site-header-auth-btn i {
    font-size: 1rem;
    line-height: 1;
}

/* Поле поиска в шапке */
.header .search-input {
    border-radius: 10px 0 0 10px;
    border-color: #e5e7eb;
    padding: 10px 14px;
    font-size: 0.9375rem;
}

.header .search-button {
    border-radius: 0 10px 10px 0;
    padding: 10px 18px;
}

.mobile-menu-btn {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    margin-right: 8px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.mobile-menu-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/**
 * Мобильная шапка: первая строка — бургер + логотип + кнопки (в одном ряду);
 * поле поиска — на всю ширину ниже (order задан в contragents/styles.css).
 */
@media (max-width: 992px) {
    .header .container {
        align-items: center;
        flex-wrap: wrap;
    }

    .header-mobile {
        flex: 1 1 auto;
        min-width: 0;
        order: 1;
    }

    .header-logo a {
        min-width: 0;
    }

    .header-logo .logo-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: min(42vw, 200px);
    }

    .header-actions {
        flex: 0 0 auto;
        width: auto;
        max-width: none;
        margin-left: 0;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 8px;
        order: 2;
    }

    .header-actions .btn {
        padding: 8px 12px;
        font-size: 0.8125rem;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .header-actions {
        gap: 6px;
    }

    .header-actions .btn {
        padding: 7px 10px;
        font-size: 0.75rem;
    }

    .header-logo .logo-text {
        max-width: min(36vw, 160px);
    }
}
