:root {
  --blue: #58a6ff;
  --blue-light: #79c0ff;
  --blue-dark: #1a2a6c;
  --blue-steel: #6b76a1;
  --blue-glow: #58a6ffa6;
  --bg: #0d1117;
  --card: #161b22;
  --muted: #8b949e;
  --border: rgba(88, 166, 255, 0.15);
  --header-h: 72px;
  --promo-h: 52px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Unbounded", var(--font);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background:
    radial-gradient(ellipse 110% 80% at 50% -10%,
      #3b5a8c 0%,
      #344f7d 12%,
      #2d456f 24%,
      #263c5e 38%,
      #1e2f4a 52%,
      #182338 66%,
      #121a29 82%,
      #0a1018 100%);
  background-attachment: fixed;
  color: #f0f6fc;
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
.wrap { width: min(100% - 48px, 1280px); margin-inline: auto; }
.pink { color: var(--blue); font-weight: 700; }

/* ===== HEADER ===== */
.header {
  left: 0; right: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(13, 17, 23, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header.is-solid { position: sticky; top: 0; }

.header__inner {
  width: 90%;
  max-width: none;
  padding: 0;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.header__left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo__img {
  height: 36px; width: auto; display: block; object-fit: contain;
  transition: transform .2s ease;
}
.logo:hover .logo__img { transform: scale(1.05); }

/* ---- Поиск в шапке ---- */
.header__objects {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.header__objects-title {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  padding-right: 12px;
  border-right: 1px solid var(--border);
  margin-left: 100px;
  margin-right: 100px;
  background: linear-gradient(180deg, #ffffff 0%, #79c0ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header__search {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 520px;
}
.header__search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--muted);
  pointer-events: none;
}
#search {
  width: 100%;
  padding: 9px 14px 9px 34px;
  font-size: 13.5px;
  font-family: var(--font);
  background: #0d1117;
  border: 1px solid rgba(88, 166, 255, .2);
  border-radius: 10px;
  color: #f0f6fc;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#search::placeholder { color: #8b949e99; }
#search:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #58a6ff33;
}

.header__onlyimg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.header__onlyimg:hover { color: #f0f6fc; border-color: rgba(88,166,255,.4); }
.header__onlyimg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.header__onlyimg-box {
  width: 15px; height: 15px;
  border-radius: 4px;
  border: 1px solid rgba(88, 166, 255, .35);
  background: #0d1117;
  position: relative;
  transition: .15s;
  flex-shrink: 0;
}
.header__onlyimg input:checked + .header__onlyimg-box {
  background: linear-gradient(180deg, #6b76a1, #313857);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #58a6ff22;
}
.header__onlyimg input:checked + .header__onlyimg-box::after {
  content: "";
  position: absolute;
  left: 4px; top: 1px;
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---- Меню ---- */
.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}
.nav a {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .2s;
}
.nav a:hover { color: #f0f6fc; }
.nav a.is-active { color: #f0f6fc; }

.login-btn {
  padding: 8px 14px;
  border: 1px solid rgba(88, 166, 255, 0.25);
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  flex-shrink: 0;
}
.login-btn:hover { background: rgba(88, 166, 255, 0.08); }

.burger {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  place-items: center;
}
.burger span, .burger span::before, .burger span::after {
  display: block; width: 16px; height: 2px; background: #f0f6fc; position: relative;
}
.burger span::before { content:""; position:absolute; top:-5px; width:16px; height:2px; background:#f0f6fc; }
.burger span::after { content:""; position:absolute; top:5px; width:16px; height:2px; background:#f0f6fc; }

/* ===================== OBJECTS PAGE ===================== */
.objects-page {
  padding-bottom: 60px;
}

/* ===================== CATEGORIES ===================== */
.cats {
  position: sticky;
  top: var(--header-h);
  z-index: 9;
  width: 90%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 0;
}

.cat {
  padding: 8px 16px;
  background: #0d1117;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.cat:hover {
  color: #f0f6fc;
  border-color: rgba(88, 166, 255, .5);
  background: rgba(88, 166, 255, .06);
}
.cat.active {
  background: linear-gradient(180deg, #6b76a1, #313857);
  color: #f0f6fc;
  border-color: rgba(88, 166, 255, .4);
  box-shadow: 0 4px 20px rgba(26, 42, 108, .4);
}

/* ===================== СЧЁТЧИК ===================== */
.objects-meta {
  width: 90%;
  margin: 0 auto;
  padding: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* ===================== СЕТКА ===================== */
.objects-wrap {
  width: 90%;
  margin: 0 auto;
  padding: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  padding: 20px 0 40px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  position: relative;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(88, 166, 255, .5);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45), 0 0 40px rgba(88, 166, 255, .1);
}

.thumb {
  width: 100%;
  aspect-ratio: 1;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(88,166,255,.06), transparent 60%),
    #0d1117;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.thumb img {
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .5));
  transition: transform .2s;
}
.card:hover .thumb img { transform: scale(1.04); }

.thumb .no-img {
  color: #30363d;
  font-size: 11px;
  text-align: center;
  padding: 20px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.info {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ru {
  font-size: 14px;
  font-weight: 700;
  color: #f0f6fc;
  line-height: 1.3;
}

.model {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.4;
}

.cat-tag {
  display: inline-block;
  align-self: flex-start;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: rgba(88, 166, 255, .12);
  color: var(--blue-light);
  border: 1px solid rgba(88, 166, 255, .3);
}

.empty, .loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
  font-size: 15px;
}



/* ===================== FOOTER ===================== */
.footer {
  border-top: 1px solid var(--border);
  background: #05080d;
  padding: 48px 0 24px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
}
.footer__brand {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
}
.footer p, .footer a { color: #8b949e; font-size: 14px; }
.footer a { display: block; margin-top: 8px; }
.footer a:hover { color: var(--blue); }
.footer h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: #79c0ff99; margin-bottom: 8px;
}
.footer__copy {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: #8b949e66;
  font-size: 13px;
}

/* ===================== TOAST ===================== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(180deg, #6b76a1, #313857);
  color: #f0f6fc;
  padding: 12px 22px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5), 0 0 40px rgba(88, 166, 255, .25);
  transition: transform .25s ease;
  pointer-events: none;
  z-index: 100;
  border: 1px solid rgba(88, 166, 255, .35);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===================== АДАПТИВ ===================== */
@media (max-width: 1280px) {
  .header__objects-title { display: none; }
  .header__onlyimg-text { display: none; }
}

@media (max-width: 1100px) {
  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    background: #0d1117;
    border-bottom: 1px solid var(--border);
    margin: 0;
  }
  .nav.is-open { display: flex; }
  .burger { display: grid; margin-left: auto; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .header__inner { width: 94%; }
  .objects-wrap,
  .objects-meta { width: 94%; }
  .cats { width: 94%; }
}

@media (max-width: 640px) {
  .header__inner { width: 96%; gap: 10px; }
  .objects-wrap,
  .objects-meta { width: 96%; }
  .cats {
    width: 96%;
    gap: 6px;
    padding: 12px 0;
  }
  .cat {
    font-size: 12px;
    padding: 7px 12px;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
  #search { padding: 8px 10px 8px 30px; font-size: 13px; }
  .header__search-icon { left: 10px; width: 14px; height: 14px; }
  .header__onlyimg { padding: 7px 9px; }
  .login-btn { display: none; }
  .footer__grid { grid-template-columns: 1fr; }
}