/* ================================================================
   eldauto.ru — Глобальные UI-компоненты, кнопки, футер и общие утилиты
   Версия: v=16 (Светлая тема полностью в тёмно-графитовом стиле без синего)
   ================================================================ */

/* ==========================================
   ПОИСК И БАЗОВЫЕ КНОПКИ
   ========================================== */

.search-wrap { flex: 1; min-width: 0; }
.search-inline { display: flex; gap: 0.5rem; align-items: center; }
.search-input-inline {
  flex: 1; min-width: 0;
  background: var(--input-bg); color: var(--text);
  padding: 0.7rem 1rem; min-height: 44px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 1rem;
}
.search-input-inline:focus { outline: none; border-color: var(--primary); background: var(--filter-focus-bg); }

.btn-search-inline, .btn-primary, .btn-secondary,
.btn-primary-large, .close-btn, .fav-btn, .cat-btn, .sub-tab, .filter-link,
.bottom-nav-item, .btn-mobile-filters, .mobile-filter-box, .btn-region, .btn-login-mobile, .btn-fav-desktop, .info-item, .footer-link, .btn-region-mobile, .btn-login-desktop {
  cursor: pointer; transition: all 0.2s ease; font-family: inherit;
}

.btn-search-inline {
  padding: 0.7rem 1.25rem; min-height: 44px;
  background: transparent; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 0.95rem; font-weight: 600; white-space: nowrap;
}
.btn-search-inline:hover { border-color: var(--primary); color: var(--primary); }

.btn-primary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-primary:hover { border-color: var(--primary); color: var(--primary); }

.nav-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; margin-left: auto; }

.btn-primary, .btn-secondary {
  border-radius: 10px; padding: 0.7rem 1.1rem; min-height: 44px;
  font-size: 0.95rem; font-weight: 500; white-space: nowrap;
}
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

header .btn-search-inline:hover,
header .btn-primary:hover,
header .btn-secondary:hover {
  background: transparent !important;
  border-color: #ff4d4d !important;
  color: #ff4d4d !important;
}

/* ==========================================
   КНОПКА "+ РАЗМЕСТИТЬ" (Светлая тема — тёмная)
   ========================================== */
.btn-add-listing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.7rem 1.25rem;
  min-height: 44px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border: 1px solid #0f172a;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-add-listing svg { width: 16px; height: 16px; }

header .btn-add-listing:hover {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border-color: #1e293b;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

@media (max-width: 768px) {
  .btn-add-listing { display: none; }
}

.btn-login-desktop {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px;
  padding: 0.7rem 1rem;
  min-height: 44px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
  width: auto;
  height: 44px;
}

.btn-login-desktop:hover { border-color: var(--primary); color: var(--primary); }
.btn-login-desktop svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-login-desktop.has-avatar {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background-color: var(--primary);
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  color: transparent !important;
  font-size: 0 !important;
  border: 2px solid var(--border);
}

.btn-login-desktop.has-avatar svg { display: none; }

.btn-fav-desktop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  position: relative;
  flex-shrink: 0;
}
.btn-fav-desktop svg { width: 20px; height: 20px; transition: fill 0.2s; }
.btn-fav-desktop:hover { border-color: #ff4d4d; color: #ff4d4d; }
.btn-fav-desktop:hover svg { fill: rgba(255, 77, 77, 0.1); }

.fav-count-top {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ff4d4d;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--card-bg);
}
.fav-count-top.hidden { display: none; }

.theme-toggle { background: none; border: none; padding: 4px 0; cursor: pointer; display: inline-flex; align-items: center; flex-shrink: 0; }
.theme-toggle-track {
  position: relative; width: 60px; height: 32px; border-radius: 999px;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  border: 1px solid #cbd5e1; display: flex; align-items: center; justify-content: space-between;
  padding: 0 7px; transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.theme-toggle:hover .theme-toggle-track { box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.14); }

.theme-toggle-track, .theme-toggle-thumb, .theme-toggle svg { pointer-events: none; }

.theme-toggle-thumb {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #ffffff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s ease-out, background-color 0.22s ease; z-index: 1;
}
.icon-sun, .icon-moon { width: 15px; height: 15px; z-index: 2; pointer-events: none; transition: all 0.22s ease; }
.icon-sun { color: #f59e0b; transform: rotate(0deg) scale(1.05); }
.icon-moon { color: #64748b; opacity: 0.65; }
/* ==========================================
   ССЫЛКА-ПРОФИЛЬ И ВЫПАДАЮЩЕЕ МЕНЮ "ЕЩЁ"
   ========================================== */
.header-user-btn {
    text-decoration: none !important;
    color: var(--text) !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}
.header-user-btn:hover {
    text-decoration: none !important;
    color: var(--text) !important;
}
.header-dropdown { position: relative; }
.header-dropdown-menu { 
  position: absolute; 
  top: calc(100% + 8px); 
  right: 0; 
  background: var(--card-bg); 
  border: 1px solid var(--border); 
  border-radius: 12px; 
  box-shadow: var(--shadow-hover); 
  min-width: 220px; 
  padding: 6px; 
  display: none; 
  flex-direction: column; 
  z-index: 999999 !important; 
  animation: fadeIn 0.15s ease; 
}
.header-dropdown-menu.active { display: flex; }
.header-dropdown-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-decoration: none; color: var(--text); font-size: 0.95rem; font-weight: 500; border-radius: 8px; transition: all 0.15s; }
.header-dropdown-menu a:hover { background: var(--input-bg); color: var(--primary); }
.header-dropdown-menu a svg { width: 16px !important; height: 16px !important; min-width: 16px !important; flex-shrink: 0 !important; color: var(--text-muted); }
.header-dropdown-menu a:hover svg { color: var(--primary); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================
   КРУПНАЯ КНОПКА ДЕЙСТВИЯ (ГЛОБАЛЬНАЯ)
   ========================================== */
.btn-primary-large {
  padding: 0.75rem 1.5rem;
  min-height: 44px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
}
.btn-primary-large:hover { border-color: #ff4d4d; color: #ff4d4d; }
.btn-primary-large:active { transform: scale(0.98); }

/* ==========================================
   НИЖНЕЕ МЕНЮ (MOBILE BOTTOM NAV) — скрыто
   ========================================== */
.bottom-nav { display: none; }
.mobile-filters-bar, .mobile-category-nav { display: none; }
.filters-sheet, .filters-sheet-overlay { display: none; }

/* ==========================================
   ВЫБОР РЕГИОНА
   ========================================== */
.btn-region { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; min-height: 44px; color: var(--text); font-size: 0.9rem; font-weight: 500; white-space: nowrap; transition: all 0.2s ease; flex-shrink: 0; }
.btn-region:hover { border-color: #ff4d4d; color: #ff4d4d; }
.btn-region .icon-pin { width: 16px; height: 16px; flex-shrink: 0; }

/* ==========================================
   ФУТЕР
   ========================================== */
.site-footer { display: none; background: var(--card-bg); border-top: 1px solid var(--border); padding: 1.5rem 1.25rem; margin-top: auto; width: 100%; }
@media (min-width: 769px) { .site-footer { display: block; } }
.footer-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 0.5rem; text-align: center; }
.footer-logo { font-size: 1rem; font-weight: 800; color: var(--text); margin-right: 4px; }
.footer-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.footer-copy { font-size: 0.85rem; color: var(--text-muted); }
.footer-sep { color: var(--text-muted); font-size: 0.85rem; }
.footer-link { background: none; border: none; padding: 0; font-size: 0.85rem; color: var(--text-muted); cursor: pointer; transition: color 0.2s ease; font-family: inherit; }
.footer-link:hover { color: var(--primary); text-decoration: underline; }

.theme-toggle-desktop { margin-left: auto !important; order: 9999 !important; }
header > .theme-toggle-desktop { margin-left: 0.5rem !important; }

/* ==========================================
   БАЗОВАЯ МОБИЛЬНАЯ ГИГИЕНА (до 768px)
   ========================================== */
@media (max-width: 768px) {
  h1 { font-size: 1.4rem !important; }
  body { overflow-x: hidden; }

  .chat-input-row {
    padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
  }
  .chat-messages {
    padding-bottom: 60px !important;
  }

  input, textarea, select {
    font-size: 16px !important;
  }
}

/* ==========================================
   ТИПОГРАФИКА ВСЕХ КАРТОЧЕК В СТИЛЕ АВТО.РУ (v=273)
   ========================================== */
.car-price-row,
.car-price,
.listing-price,
.ad-price,
.seller-listing-price,
.similar-price,
.fav-price,
.popular-card-price,
.car-card .car-price-row,
.car-card .car-price,
.listing-card .listing-price,
.seller-listing-card .seller-listing-price {
  font-family: 'Golos Text', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-weight: 600 !important;
  font-size: 1.22rem !important;
  line-height: 1.2 !important;
  letter-spacing: -0.015em !important;
  font-variant-numeric: tabular-nums !important;
}

.car-title,
.listing-title,
.ad-title,
.seller-listing-title,
.similar-title,
.fav-title,
.popular-card-title,
.car-card .car-title,
.car-card h3,
.listing-card .listing-title,
.seller-listing-card .seller-listing-title {
  font-family: 'Golos Text', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-weight: 400 !important;
  font-size: 0.98rem !important;
  line-height: 1.35 !important;
  letter-spacing: -0.005em !important;
}

/* Выпадающий поиск — строки объявлений */
.smart-search-dropdown .ss-dd-item[data-kind="listing"] .ss-dd-title {
  font-weight: 400 !important;
}
.smart-search-dropdown .ss-dd-item[data-kind="listing"] .ss-dd-price {
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums !important;
}

/* ==========================================
   ФИРМЕННЫЙ ЯНТАРНО-ОРАНЖЕВЫЙ ЛОГОТИП eldauto (v=279)
   ========================================== */
.logo,
.login-logo,
.reset-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0f172a;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo-wordmark {
  display: inline;
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.logo-auto {
  color: #ea580c !important;
}
.logo-bolt {
  display: block;
  flex-shrink: 0;
  width: 20px;
  height: 23px;
  transform: translateY(-0.5px);
}
.login-logo .logo-bolt {
  width: 26px;
  height: 30px;
}
.reset-logo .logo-bolt {
  width: 22px;
  height: 25px;
}
.logo-bolt .logo-bolt-main {
  fill: #f59e0b !important;
  stroke: none !important;
}
.logo-bolt .logo-bolt-accent {
  fill: #ea580c !important;
  stroke: none !important;
}
.logo svg:not(.logo-bolt),
.login-logo svg:not(.logo-bolt),
.reset-logo svg:not(.logo-bolt),
.m-top-brand svg:not(.logo-bolt),
.m-top-logo svg:not(.logo-bolt),
.mobile-logo svg:not(.logo-bolt),
.m-header-logo svg:not(.logo-bolt) {
  stroke: #ea580c !important;
}
.logo svg:not(.logo-bolt) path,
.login-logo svg:not(.logo-bolt) path,
.reset-logo svg:not(.logo-bolt) path,
.m-top-brand svg:not(.logo-bolt) path,
.m-top-logo svg:not(.logo-bolt) path,
.mobile-logo svg:not(.logo-bolt) path,
.m-header-logo svg:not(.logo-bolt) path {
  fill: #ea580c !important;
  stroke: #ea580c !important;
}
