:root {
  --navy: #0a2e6e;
  --blue: #1a56db;
  --red: #c8102e;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --bg: #f5f7fb;
}

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

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  height: 64px;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.logo img {
  height: 44px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.nav a {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.nav a:hover {
  color: var(--blue);
}

.nav .btn-primary {
  margin-left: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 18px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: 0.15s;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--navy);
}

.btn-outline {
  background: #fff;
  border-color: #cbd5e1;
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-tg {
  background: var(--blue);
  color: #fff;
}

.btn-tg:hover {
  background: var(--navy);
}

.compact-search-wrap {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.search-compact {
  display: flex;
  gap: 8px;
}

.search-compact input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
}

.search-compact button {
  height: 44px;
  padding: 0 20px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.search-compact button:hover {
  background: var(--navy);
}

.main {
  padding: 32px 0 48px;
}

.hero {
  background: linear-gradient(135deg, #eef4ff, #e6ebf7);
  border-bottom: 1px solid var(--border);
  padding: 48px 0;
  margin: -32px 0 32px;
}

.hero .badge {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.15;
  font-weight: 900;
  margin: 16px 0;
  color: var(--navy);
}

.hl {
  background: linear-gradient(90deg, #ff6b7a, #c8102e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lead {
  font-size: 18px;
  color: #475569;
  max-width: 760px;
  margin-bottom: 24px;
}

.hero-search {
  display: flex;
  gap: 10px;
  max-width: 800px;
}

.hero-search input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 18px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 16px;
}

.hero-search button {
  height: 52px;
  padding: 0 28px;
}

.section-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  margin: 28px 0 16px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.category-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  font-weight: 700;
  color: var(--text);
}

.category-card:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.step {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.step h3 {
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}

.note {
  background: #fff;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 16px;
  color: #475569;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}

.filters select,
.filters input[type='number'] {
  height: 40px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
}

.filters .checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}

.filters button {
  margin-left: auto;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.chip:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.result-count {
  color: var(--muted);
  margin-bottom: 12px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 18px rgba(10, 46, 110, 0.08);
}

.card-image {
  aspect-ratio: 1 / 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
  min-height: 39px;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
}

.badge-auction {
  background: #fff7e6;
  color: #b7791f;
}

.card-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
}

.card-meta {
  font-size: 13px;
  color: var(--muted);
}

.meta-label {
  color: var(--muted);
  font-weight: 600;
}

.card-total {
  font-weight: 800;
  color: var(--blue);
  font-size: 14px;
  margin-top: 4px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 24px;
}

.page-link {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--text);
}

.page-link:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.page-link.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.page-dots {
  color: var(--muted);
}

.empty {
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 40px 20px;
  text-align: center;
}

.empty h2 {
  color: var(--navy);
  margin-bottom: 8px;
}

.empty p {
  color: var(--muted);
  margin-bottom: 16px;
}

.item-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.item-gallery {
  position: sticky;
  top: 84px;
}

.gallery-main {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.gallery-main img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
}

.gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.thumb-btn {
  width: 64px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  cursor: pointer;
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.item-info h1 {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}

.original-title {
  color: var(--muted);
  margin-bottom: 12px;
}

.item-sub {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.seller,
.location {
  margin-bottom: 8px;
  color: #475569;
}

.price-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin: 16px 0;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
}

.price-table td,
.price-table th {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}

.price-table tr:last-child td {
  border-bottom: none;
}

.price-table .total-row td {
  border-top: 2px solid var(--navy);
  padding-top: 12px;
  font-weight: 800;
  color: var(--navy);
}

.rub-line {
  color: var(--muted);
  font-size: 14px;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.item-note {
  color: var(--muted);
  font-size: 14px;
  margin-top: 12px;
}

.details-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-top: 20px;
}

.details-section h2 {
  color: var(--navy);
  margin-bottom: 12px;
  font-size: 20px;
}

.aspects {
  width: 100%;
  border-collapse: collapse;
}

.aspects td,
.aspects th {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.aspects th {
  color: var(--muted);
  font-weight: 600;
  width: 30%;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  font-size: 14px;
  background: #fff;
  text-align: center;
}

.footer p {
  margin: 4px 0;
}

.footer a {
  color: var(--blue);
}

@media (min-width: 720px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1080px) {
  .cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 860px) {
  .nav {
    display: none;
  }

  .item-layout {
    grid-template-columns: 1fr;
  }

  .item-gallery {
    position: static;
  }
}

@media (max-width: 560px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .hero {
    padding: 28px 0;
  }

  .hero-search {
    flex-direction: column;
  }

  .filters {
    gap: 8px;
  }

  .filters button {
    margin-left: 0;
  }

  .category-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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

/* fixes after review */
.hero { padding: 40px 32px; border-radius: 16px; margin-top: 16px; }
@media (max-width: 600px) { .hero { padding: 24px 16px; } }
.nav a.btn-primary, .nav a.btn-primary:hover { color: #fff; }
