/* ============================================================================
   ADAPTIVE HEADER + MOBILE MENU
   ============================================================================ */

/* Поиск в шапке */
.header-search-form {
    flex: 1;
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 4px;
    min-width: 0;
}
.header-search-form .hero-search-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    min-width: 0;
}
.header-search-form .hero-search-city {
    flex: 0 0 180px;
    border-left: 1px solid var(--border-soft);
}
.header-search-form .hero-search-field i { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }
.header-search-form .hero-search-field input,
.header-search-form .hero-search-field select {
    width: 100%; border: 0; outline: 0; background: transparent;
    height: 40px; font-size: 14px; color: var(--text); min-width: 0;
}
.header-search-form .btn { flex-shrink: 0; height: 40px; }

/* Мобильное меню скрыто по умолчанию */
.mobile-menu {
    position: fixed;
    top: 0; right: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: var(--bg-elev);
    z-index: 200;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 32px rgba(0,0,0,0.15);
    overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu:not([hidden]) { display: flex; }

.mobile-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
}

.mobile-menu-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(135deg, var(--brand), var(--brand-accent));
    color: #fff;
    border-radius: var(--r);
    margin-bottom: 16px;
}
.mobile-menu-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 700; font-size: 18px;
    overflow: hidden; flex-shrink: 0;
}
.mobile-menu-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mobile-menu-name { font-weight: 700; font-size: 15px; }
.mobile-menu-balance { font-size: 13px; opacity: 0.9; margin-top: 2px; }

.mobile-menu-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.mobile-menu-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    transition: background 0.15s;
}
.mobile-menu-nav a:hover { background: var(--bg-soft); color: var(--brand); }
.mobile-menu-nav a i { width: 22px; text-align: center; color: var(--text-muted); }
.mobile-menu-nav a:hover i { color: var(--brand); }
.mobile-menu-nav a.logout { color: var(--color-danger); }
.mobile-menu-nav a.logout i { color: var(--color-danger); }
.mobile-menu-nav hr { border: 0; border-top: 1px solid var(--border-soft); margin: 8px 0; }

.mobile-menu-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
    backdrop-filter: blur(2px);
}
.mobile-menu-overlay:not([hidden]) { display: block; }

/* ── Адаптив шапки ── */

/* Планшет: прячем подписи в кнопках, сужаем */
@media (max-width: 1024px) {
    .cats-trigger span { display: none; }
    .cats-trigger { padding: 0 14px; }
    .header-search-form .hero-search-city { display: none; }
    .btn-submit-ad span { display: none; }
    .btn-submit-ad { padding: 0 14px !important; }
}

/* Мобилка: поиск уходит вниз отдельной строкой, лишнее прячется */
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 12px; gap: 10px; }
    .cats-trigger { order: 3; }
    .header-search-form { order: 4; flex-basis: 100%; }
    .header-actions { order: 2; margin-left: auto; }
    .header-hide-mobile { display: none !important; }
    .mobile-toggle { display: none; }
    .btn-submit-ad span { display: none; }
    .btn-submit-ad {display:none;}
}

/* Десктоп: мобильную кнопку прячем */
@media (min-width: 769px) {
    .mobile-toggle { display: none; }
}