/* ============================================================
   AutoGrad — main.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #F2F4F8;
  --white:        #FFFFFF;
  --blue:         #182d45;
  --blue-mid:     #195da0;
  --blue-light:   #E3F2FD;
  --orange:       #F57C00;
  --orange-light: #e0ffe9;
  --green:        #2E7D32;
  --green-light:  #E8F5E9;
  --red:          #C62828;
  --red-light:    #FFEBEE;
  --premium:      #4a8cab;
  --gray:         #6B7280;
  --gray-light:   #F1F3F6;
  --gray-border:  #E5E7EB;
  --text:         #111827;
  --text2:        #4B5563;
  --text3:        #9CA3AF;
  --shadow:       0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg:    0 8px 24px rgba(0,0,0,0.13);
  --radius:       10px;
  --radius-lg:    16px;
}

body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }

/* ── NAVBAR ──────────────────────────────────────────────── */
.navbar {
  background: var(--blue);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  height: 56px;
  flex-wrap: nowrap;
}
.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo span { color: #FFC107; }

/* Блок кнопок пользователя — десктоп: инлайн */
.nav-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Search в шапке ─────────────────────────────────────── */
.nav-search-form {
  flex: 1;
  display: flex;
  gap: 6px;
  max-width: 480px;
}
.nav-search-input {
  flex: 1;
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  font-size: .84rem;
  font-family: inherit;
  background: rgba(255,255,255,0.15);
  color: #fff;
  outline: none;
  transition: background .18s;
}
.nav-search-input::placeholder { color: rgba(255,255,255,0.6); }
.nav-search-input:focus { background: rgba(255,255,255,0.22); }
.nav-search-btn {
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s;
}
.nav-search-btn:hover { background: rgba(255,255,255,0.28); }
.nav-right { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.nav-btn {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.28);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all .18s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-btn:hover { background: rgba(255,255,255,0.25); }
.nav-btn.primary { background: #FFC107; color: #111; border-color: #FFC107; }
.nav-btn.primary:hover { background: #FFB300; }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-user-btn { cursor: pointer; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 210px;
  overflow: hidden;
  z-index: 200;
}
.nav-dropdown-menu.open { display: block; }
.nav-dropdown-menu a {
  display: block;
  padding: 10px 16px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
  transition: background .15s;
  border-bottom: 1px solid var(--gray-border);
}
.nav-dropdown-menu a:last-child { border-bottom: none; }
.nav-dropdown-menu a:hover { background: var(--gray-light); }
.nav-user-btn.active { background: rgba(255,255,255,0.28); }

.bell-badge {
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: .65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #273442 0%, #273442 100%);
  padding: 2rem 1rem;
  color: #fff;
}
.hero-inner { max-width: 1240px; margin: 0 auto; }
.hero h1 { font-size: 1.9rem; font-weight: 800; margin-bottom: .4rem; }
.hero p   { opacity: .85; font-size: .9rem; margin-bottom: 1.5rem; }

/* ── SEARCH BOX ──────────────────────────────────────────── */
.search-box {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
}
.search-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 1rem;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.search-tabs::-webkit-scrollbar { display: none; }
.s-tab { flex-shrink: 0; }
.s-tab {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--gray-light);
  color: var(--text2);
  border: none;
  transition: all .18s;
}
.s-tab:hover, .s-tab.active { background: var(--blue); color: #fff; }
.search-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.s-select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-border);
  border-radius: 8px;
  font-size: .85rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: border-color .18s;
}
.s-select:focus { border-color: var(--blue); outline: none; }
.search-btn {
  width: 100%;
  background: var(--blue);
  color: #fff;
  padding: 12px;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background .18s;
}
.search-btn:hover { background: var(--blue-mid); }

/* ── STATS STRIP ─────────────────────────────────────────── */
.stats-strip { background: #fff; border-bottom: 1px solid var(--gray-border); }
.stats-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}
.stats-inner::-webkit-scrollbar { display: none; }
.stat-pill {
  padding: 10px 22px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text2);
  border-right: 1px solid var(--gray-border);
  white-space: nowrap;
  cursor: pointer;
  transition: all .18s;
  flex-shrink: 0;
}
.stat-pill:hover { background: var(--blue-light); color: var(--blue); }
.stat-pill span  { font-size: 1rem; font-weight: 800; color: var(--blue); display: block; }

/* ── MAIN WRAPPER ────────────────────────────────────────── */
.main { max-width: 1240px; margin: 0 auto; padding: 1.5rem 1rem; }

/* ── CATEGORY GRID ───────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 1.75rem;
}
.cat-card {
  background: #fff;
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius);
  padding: .75rem .5rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.cat-card:hover { border-color: var(--blue); background: var(--blue-light); transform: translateY(-2px); }
.cat-icon  { font-size: 1.8rem; margin-bottom: 4px; }
.cat-name  { font-size: .76rem; font-weight: 700; color: var(--text); }
.cat-count { font-size: .68rem; color: var(--text3); margin-top: 2px; }

/* ── LISTINGS GRID ───────────────────────────────────────── */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.section-title { font-size: 1.1rem; font-weight: 700; }

/* ── CAR CARD ────────────────────────────────────────────── */
.car-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all .22s;
  position: relative;
  border: 1.5px solid transparent;
  display: block;
  color: inherit;
}
.car-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.car-card.premium {
  border-color: var(--premium);
  box-shadow: 0 4px 16px rgba(230,81,0,0.15);
}
.premium-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--premium);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 2;
  letter-spacing: .3px;
}
.car-img {
  width: 100%;
  height: 175px;
  overflow: hidden;
  position: relative;
  background: var(--gray-light);
}
.car-img img { width: 100%; height: 100%; object-fit: cover; }
.car-img-placeholder {
  width: 100%;
  height: 175px;
  background: linear-gradient(135deg, #1a2535, #273442);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
}
/* Заглушка без фото — тёмный фон */
.car-img-no-photo {
  width: 100%;
  height: 175px;
  background: linear-gradient(135deg, #1a2535, #273442);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}
.car-img-no-photo .no-photo-cat-icon {
  width: 70px;
  height: 70px;
  object-fit: contain;
  opacity: 0.5;
  display: block;
}
.car-img-no-photo .no-photo-logo {
  width: auto;
  height: 56px;
  max-width: 80%;
  object-fit: contain;
  opacity: 0.45;
  display: block;
}
/* Заглушка в миниатюре дашборда */
.no-photo-thumb {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a2535, #273442);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.no-photo-thumb img {
  width: 46px;
  height: 36px;
  object-fit: contain;
  opacity: 0.4;
}
.sold-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.52);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sold-overlay span, .sold-overlay.big span {
  background: #fff;
  color: var(--red);
  font-weight: 800;
  font-size: .95rem;
  padding: 7px 18px;
  border-radius: 8px;
  transform: rotate(-5deg);
  display: block;
}
.sold-overlay.big span { font-size: 1.2rem; }

.car-body  { padding: 12px; }
.car-title { font-size: .88rem; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-price { font-size: 1.1rem; font-weight: 800; color: var(--blue); margin-bottom: 7px; }
.car-meta  { display: flex; gap: 5px; flex-wrap: wrap; }
.car-tag   { font-size: .68rem; padding: 2px 7px; border-radius: 6px; background: var(--gray-light); color: var(--text2); font-weight: 600; }
.car-footer {
  padding: 7px 12px;
  border-top: 1px solid var(--gray-border);
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  color: var(--gray);
}

/* ── PREMIUM SECTION ─────────────────────────────────────── */
.premium-section {
  background: linear-gradient(135deg, #FFFFFF, #FFFFFF);
  border: 1.5px solid #31567d;
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1.75rem;
}
.premium-section-title {
  font-size: .88rem;
  font-weight: 800;
  color: var(--premium);
  margin-bottom: .75rem;
}

/* ── SEARCH PAGE LAYOUT ──────────────────────────────────── */
.content-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
}
.sidebar {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 68px;
}
.filter-section {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-border);
}
.filter-section:last-of-type { border-bottom: none; }
.filter-title {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.filter-input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--gray-border);
  border-radius: 8px;
  font-size: .83rem;
  font-family: inherit;
  background: #fff;
  transition: border-color .18s;
}
.filter-input:focus { border-color: var(--blue); outline: none; }
.price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.filter-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  margin-bottom: 5px;
  cursor: pointer;
  color: var(--text2);
}
.filter-check input { accent-color: var(--blue); cursor: pointer; }
.apply-btn {
  width: 100%;
  background: var(--blue);
  color: #fff;
  padding: 9px;
  border-radius: 8px;
  font-weight: 700;
  font-size: .85rem;
  border: none;
  cursor: pointer;
  transition: background .18s;
  margin-top: 4px;
}
.apply-btn:hover { background: var(--blue-mid); }
.reset-btn {
  display: block;
  width: 100%;
  background: none;
  color: var(--gray);
  padding: 7px;
  border-radius: 8px;
  font-size: .8rem;
  margin-top: 6px;
  border: 1px solid var(--gray-border);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.listings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.listings-count { font-size: .85rem; color: var(--gray); }
.sort-select {
  padding: 7px 12px;
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  font-size: .8rem;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
}

/* ── PAGINATION ──────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.page-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--gray-border);
  background: #fff;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text2);
  transition: all .18s;
}
.page-btn:hover, .page-btn.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* ── BREADCRUMB ──────────────────────────────────────────── */
.breadcrumb {
  font-size: .78rem;
  color: var(--gray);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--blue); }
.breadcrumb a:hover { text-decoration: underline; }

/* ── DETAIL PAGE ─────────────────────────────────────────── */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
}
.detail-layout > * { min-width: 0; }
.premium-banner {
  background: linear-gradient(135deg, #FF6F00, #FFA000);
  color: #fff;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: .85rem;
  margin-bottom: 1rem;
  display: inline-block;
}
.detail-gallery {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  max-width: 100%;
  min-width: 0;
}
.gallery-main {
  height: 360px;
  background: var(--gray-light);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  width: 100%;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: 100%;
  display: block;
}
.no-photo { font-size: 5rem; display:flex;align-items:center;justify-content:center;width:100%;height:100%; }
/* ── Gallery arrows & counter ─────────────────────────────── */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.42);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, transform .18s;
  line-height: 1;
}
.gallery-arrow:hover {
  background: rgba(0,0,0,0.72);
  transform: translateY(-50%) scale(1.08);
}
.gallery-arrow-left  { left: 10px; }
.gallery-arrow-right { right: 10px; }
.gallery-counter {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  pointer-events: none;
}
.gallery-main img:hover::after { content: '🔍'; }
.gallery-thumbs {
  display: flex;
  gap: 6px;
  padding: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.gallery-thumb {
  width: 72px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: border-color .18s;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--blue); }

.detail-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--gray-border);
  flex-wrap: wrap;
  max-width: 100%;
}
.d-tab {
  padding: 8px 16px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .18s;
  white-space: nowrap;
}
.d-tab:hover, .d-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-content {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.description-box {
  line-height: 1.8;
  font-size: .88rem;
  color: var(--text2);
}
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.spec-item {
  background: var(--gray-light);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
  overflow: hidden;
}
.spec-label { font-size: .66rem; color: var(--gray); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.spec-val   { font-size: .88rem; font-weight: 700; color: var(--text); margin-top: 1px; word-break: break-word; }

@media (max-width: 480px) {
  .specs-grid { grid-template-columns: 1fr; }
}

.seller-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}
.seller-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-mid));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.seller-name { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.verified-badge {
  background: var(--green-light);
  color: var(--green);
  font-size: .68rem;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
}

/* ── DETAIL INFO PANEL ───────────────────────────────────── */
.detail-info-panel {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 68px;
}
.detail-price { font-size: 1.6rem; font-weight: 800; color: var(--blue); margin-bottom: .25rem; }
.detail-title { font-size: .95rem; font-weight: 700; margin-bottom: .75rem; line-height: 1.4; }
.detail-meta  { font-size: .75rem; color: var(--gray); margin-bottom: 1rem; }
.detail-btn {
  display: block;
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 700;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .18s;
  text-align: center;
  border: none;
}
.detail-btn.main { background: var(--blue); color: #fff; }
.detail-btn.main:hover { background: var(--blue-mid); }
.detail-btn.out { background: #fff; color: var(--blue); border: 2px solid var(--blue); }
.detail-btn.out:hover { background: var(--blue-light); }
.detail-btn.fav-btn.active { color: var(--red); border-color: var(--red); }

.detail-specs-mini {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 1rem;
}
.spec-mini {
  background: var(--gray-light);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}
.spec-mini-icon  { font-size: 1.1rem; }
.spec-mini-val   { font-size: .85rem; font-weight: 700; margin-top: 2px; }
.spec-mini-label { font-size: .66rem; color: var(--gray); }

/* ── FORMS ───────────────────────────────────────────────── */
.form-group   { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .8rem; font-weight: 600; color: var(--text2); margin-bottom: 5px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-border);
  border-radius: 8px;
  font-size: .88rem;
  font-family: inherit;
  transition: border-color .18s;
  background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--blue); outline: none; }
.form-group textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.submit-btn {
  width: 100%;
  background: var(--blue);
  color: #fff;
  padding: 12px;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background .18s;
  display: block;
}
.submit-btn:hover { background: var(--blue-mid); }

/* ── AUTH ────────────────────────────────────────────────── */
.auth-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}
.auth-alt { text-align: center; font-size: .82rem; color: var(--gray); margin-top: 1rem; }
.auth-alt a { color: var(--blue); font-weight: 600; }

/* ── ALERTS ──────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 8px; font-size: .85rem; font-weight: 600; margin-bottom: 1rem; }
.alert-error   { background: var(--red-light);   color: var(--red); }
.alert-success { background: var(--green-light); color: var(--green); }

/* ── STATUS BADGES ───────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.status-badge.active  { background: var(--green-light); color: var(--green); }
.status-badge.pending { background: var(--orange-light); color: var(--orange); }
.status-badge.sold    { background: var(--red-light); color: var(--red); }
.status-badge.premium { background: #FFF3E0; color: var(--premium); }

/* ── DASHBOARD ───────────────────────────────────────────── */
.dash-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
}
.dash-sidebar {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 68px;
}
.dash-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-mid));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 800; color: #fff;
  margin: 0 auto 10px;
}
.dash-name  { text-align: center; font-weight: 700; font-size: .95rem; }
.dash-email { text-align: center; font-size: .75rem; color: var(--gray); margin-bottom: 1rem; }
.dash-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: .83rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all .18s;
  margin-bottom: 2px;
}
.dash-menu-item:hover, .dash-menu-item.active { background: var(--blue-light); color: var(--blue); }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.dash-stat {
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.dash-stat .num { font-size: 1.6rem; font-weight: 800; color: var(--blue); }
.dash-stat .lbl { font-size: .72rem; color: var(--gray); margin-top: 2px; }
.dash-content { background: #fff; border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow); min-width: 0; overflow: hidden; }

/* Строка сообщения в дашборде */
.dash-msg-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  transition: background .2s;
  min-width: 0;
  overflow: hidden;
}
.dash-msg-row:hover { background: var(--gray-light); }

/* ── LISTING ROW (dashboard) ─────────────────────────────── */
.listing-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 12px;
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  margin-bottom: 8px;
  transition: background .18s;
  min-width: 0;
}
.listing-row:hover { background: var(--gray-light); }
.listing-thumb {
  width: 82px; height: 62px;
  border-radius: 8px;
  background: var(--gray-light);
  flex-shrink: 0;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.listing-info  { flex: 1; min-width: 0; }
.listing-title { font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); display: block; }
.listing-meta  { font-size: .75rem; color: var(--gray); margin-top: 2px; }
.listing-price { font-weight: 800; color: var(--blue); font-size: .95rem; white-space: nowrap; flex-shrink: 0; }
.listing-actions { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; }

@media (max-width: 580px) {
  /* Listing row — 3 строки на мобиле */
  .listing-row {
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    align-items: flex-start;
  }
  /* Строка 1: thumb */
  .listing-thumb {
    width: 60px;
    height: 48px;
    border-radius: 6px;
    flex-shrink: 0;
  }
  /* Строка 1: info рядом с thumb */
  .listing-info {
    flex: 1;
    min-width: 0;
  }
  .listing-title { font-size: .82rem; }
  /* Строка 2: цена на всю ширину */
  .listing-price {
    order: 3;
    flex: 0 0 100%;
    font-size: .95rem;
    padding-top: 2px;
    border-top: 1px solid var(--gray-border);
    padding-left: 2px;
  }
  /* Строка 3: кнопки на всю ширину */
  .listing-actions {
    order: 4;
    flex: 0 0 100%;
    gap: 6px;
    border-top: 1px solid var(--gray-border);
    padding-top: 6px;
  }
  .act-btn {
    flex: 1;
    text-align: center;
    padding: 6px 4px;
    font-size: .72rem;
  }
}
.act-btn {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  border: none;
}
.act-btn.edit       { background: var(--blue-light);  color: var(--blue); }
.act-btn.sold       { background: var(--green-light); color: var(--green); }
.act-btn.del        { background: var(--red-light);   color: var(--red); }
.act-btn.premium-btn{ background: linear-gradient(135deg,#FF6F00,#FFC107); color:#fff; }

/* ── ADD FORM ────────────────────────────────────────────── */
.add-form { background: #fff; border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow); }
.form-section { margin-bottom: 1.5rem; }
.form-section-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 1rem;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--blue-light);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.img-upload-area {
  border: 2px dashed var(--gray-border);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  color: var(--gray);
  font-size: .88rem;
}
.img-upload-area:hover { border-color: var(--blue); background: var(--blue-light); color: var(--blue); }

/* ── PREMIUM UPSELL ──────────────────────────────────────── */
.premium-upsell {
  background: linear-gradient(135deg, #FFF8E1, #FFF3CD);
  border: 2px solid #e0da91;
  border-radius: 12px;
  padding: 1.25rem;
}
.premium-upsell h3 { color: var(--premium); font-size: .95rem; font-weight: 700; margin-bottom: .5rem; }
.premium-upsell p  { font-size: .82rem; color: var(--text2); margin-bottom: .75rem; }
.premium-options   { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.premium-opt {
  padding: 10px;
  border-radius: 8px;
  border: 2px solid var(--gray-border);
  cursor: pointer;
  text-align: center;
  transition: all .2s;
  background: #fff;
}
.premium-opt:hover, .premium-opt.selected { border-color: var(--premium); background: var(--orange-light); }
.premium-opt .days      { font-size: .95rem; font-weight: 800; color: var(--premium); }
.premium-opt .plan-name { font-size: .7rem; color: var(--text2); font-weight: 600; }
.premium-opt .price     { font-size: .75rem; color: var(--gray); margin-top: 2px; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 430px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: var(--gray-light);
  border: none;
  border-radius: 50%;
  width: 30px; height: 30px;
  cursor: pointer;
  font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2);
}

/* ── TOAST ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  max-width: 320px;
  animation: toastIn .3s ease;
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── FOOTER ──────────────────────────────────────────────── */
.footer { background: #273442; color: rgba(255,255,255,.8); margin-top: 3rem; }
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2.5rem 1rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
}
.footer-title { font-weight: 700; font-size: .85rem; color: #fff; margin-bottom: .75rem; }
.footer-col a {
  display: block;
  font-size: .8rem;
  color: rgba(255,255,255,.7);
  margin-bottom: 5px;
  transition: color .18s;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  text-align: center;
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .78rem;
  color: rgba(255,255,255,.5);
}

/* ── btn-link ────────────────────────────────────────────── */
.btn-link { color: var(--blue); font-size: .82rem; font-weight: 600; }
.btn-link:hover { text-decoration: underline; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 960px) {
  .content-layout { grid-template-columns: 1fr; }
  .detail-layout  { grid-template-columns: 1fr; }
  .dash-layout    { grid-template-columns: 1fr; }
  .sidebar        { display: none; }
  .dash-sidebar   { display: none; }
}

@media (max-width: 640px) {
  .specs-grid { grid-template-columns: 1fr; }
  .spec-val   { word-break: break-word; overflow-wrap: anywhere; }
  .nav-search-form { display: none; }

  .nav-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 6px 10px;
    gap: 6px;
    align-items: center;
  }

  .logo { order: 1; flex-shrink: 0; font-size: 1.15rem; }

  .nav-add-btn {
    order: 2;
    margin-left: auto;
    font-size: .75rem;
    padding: 5px 10px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .nav-user-row {
    order: 3;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0 6px;
    border-top: 1px solid rgba(255,255,255,0.12);
  }

  .nav-btn-msg {
    flex-shrink: 0;
    font-size: .8rem;
    padding: 5px 9px;
    white-space: nowrap;
  }

  .nav-user-btn {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .78rem;
    padding: 5px 10px;
  }
  .nav-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
    display: inline-block;
    vertical-align: middle;
  }

  .nav-user-row .nav-btn {
    font-size: .78rem;
    padding: 5px 10px;
  }

  .nav-dropdown { position: static; }
  .nav-dropdown-menu {
    position: fixed;
    right: 8px;
    left: 8px;
    top: auto;
    width: auto;
    min-width: unset;
    max-height: 70vh;
    overflow-y: auto;
  }

  .hero h1        { font-size: 1.2rem; }
  .search-row     { grid-template-columns: 1fr 1fr; }
  .listings-grid  { grid-template-columns: repeat(2, 1fr); }
  .dash-stats     { grid-template-columns: repeat(2, 1fr); }
  .form-row       { grid-template-columns: 1fr; }
  .specs-grid     { grid-template-columns: 1fr; }
  .gallery-main   { height: 220px; }
  .cat-grid       { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 400px) {
  .listings-grid { grid-template-columns: 1fr; }
  .cat-grid      { grid-template-columns: repeat(2, 1fr); }
  .nav-user-name { max-width: 70px; }
}

/* ── Кнопка «в избранное» на карточках (как в моб. приложениях) ── */
.car-img { position: relative; }
.fav-icon-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: background .15s ease, transform .15s ease;
  border: none;
}
.fav-icon-btn:hover {
  background: rgba(0, 0, 0, .65);
  transform: scale(1.08);
}
.fav-icon-btn:active {
  transform: scale(.95);
}
.fav-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linejoin: round;
  pointer-events: none;
  transition: fill .2s ease;
}
.fav-icon-btn.active svg {
  fill: #fff;
  stroke: #fff;
}
.fav-icon-btn.is-loading {
  pointer-events: none;
  opacity: .7;
}
@keyframes favPop {
  0%   { transform: scale(1);    }
  40%  { transform: scale(1.25); }
  100% { transform: scale(1);    }
}
.fav-icon-btn.just-added svg {
  animation: favPop .35s ease;
}

/* ── STORE BADGES (App Store / Google Play в hero) ──────────── */
.store-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #000;
  color: #fff;
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.22);
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
  white-space: nowrap;
}
.store-badge:hover {
  background: #1a1a1a;
  transform: translateY(-1px);
}
.store-badge-logo {
  width: 22px;
  height: 22px;
  fill: #fff;
  flex-shrink: 0;
}
.store-badge-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}
.store-badge-pre {
  font-size: 9px;
  opacity: 0.78;
  font-weight: 400;
  letter-spacing: 0.2px;
}
.store-badge-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.1px;
}
@media (max-width: 480px) {
  .store-badge { padding: 6px 12px; gap: 6px; }
  .store-badge-logo { width: 20px; height: 20px; }
  .store-badge-name { font-size: 13px; }
}
