:root {
  --bg: #0b1220;
  --surface: #131b2e;
  --surface-2: #182241;
  --border: #232f49;
  --text: #edeff5;
  --text-muted: #8b93a7;
  --amber: #ffb020;
  --amber-soft: rgba(255, 176, 32, 0.14);
  --emerald: #34d399;
  --emerald-soft: rgba(52, 211, 153, 0.14);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  position: relative;
  min-height: 100vh;
}

/* фоновая "радар"-сетка — тонкая, только в верхней части */
.scan-grid {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 640px;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent);
          mask-image: linear-gradient(to bottom, black, transparent);
  pointer-events: none;
  z-index: 0;
}

.topbar {
  position: relative;
  z-index: 1;
  padding: 24px clamp(20px, 5vw, 64px) 0;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--text);
}

main {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px) 80px;
}

.hero {
  padding: 64px 0 40px;
  text-align: left;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}

.hero-sub {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 0 36px;
}

/* --- поисковая строка --- */
.search-bar {
  display: grid;
  grid-template-columns: 1fr 160px auto;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  max-width: 760px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 14px 6px;
  border-radius: 10px;
}

.field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.field input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
}

.field input::placeholder { color: #545f78; }

.field-zip { border-left: 1px solid var(--border); }

#search-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--amber);
  color: #1a1204;
  border: none;
  border-radius: 10px;
  padding: 0 26px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

#search-btn:hover { background: #ffc04d; }
#search-btn:active { transform: scale(0.97); }

#search-btn:focus-visible,
.field input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.btn-ping {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #1a1204;
  opacity: 0;
}

#search-btn.loading .btn-ping {
  opacity: 1;
  animation: ping 0.9s ease-in-out infinite;
}

@keyframes ping {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.8); opacity: 0.35; }
}

/* --- результаты --- */
.results-wrap { position: relative; margin-top: 56px; min-height: 40px; }

.scan-beam {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  box-shadow: 0 0 16px 2px var(--amber);
  opacity: 0;
  pointer-events: none;
}

.scan-beam.active {
  opacity: 1;
  animation: sweep 1.1s linear infinite;
}

@keyframes sweep {
  0% { top: 0; }
  100% { top: 560px; }
}

.results-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.badge-source {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.empty-state {
  color: var(--text-muted);
  font-size: 15px;
  padding: 40px 0;
  border: 1px dashed var(--border);
  border-radius: 14px;
  text-align: center;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.product-card:hover {
  border-color: #3a476b;
  transform: translateY(-2px);
}

.card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #0e1526;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18px;
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.badge-best {
  background: var(--amber);
  color: #1a1204;
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  margin: 0;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-price {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 20px;
  color: var(--amber);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.card-rating { color: var(--text-muted); }
.card-rating strong { color: var(--text); }

.card-shipping {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--emerald-soft);
  color: var(--emerald);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.card-cta {
  margin-top: auto;
  text-align: center;
  padding: 9px 0;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.card-cta:hover {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--amber);
}

.site-footer {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 40px auto 0;
  padding: 24px clamp(20px, 5vw, 64px) 40px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
}

@media (max-width: 640px) {
  .search-bar {
    grid-template-columns: 1fr;
  }
  .field-zip { border-left: none; border-top: 1px solid var(--border); }
  #search-btn { padding: 14px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .scan-beam.active { animation: none; opacity: 0.6; }
  .btn-ping { animation: none !important; }
  .product-card:hover { transform: none; }
}

/* --- content pages (About / Contact / Privacy) --- */
.nav-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
}

.topbar .brand { display: flex; align-items: center; }
.topbar-inner { display: flex; align-items: center; width: 100%; }

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible { color: var(--text); }

.content-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 0 80px;
}

.content-page h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 4.4vw, 44px);
  line-height: 1.08;
  margin: 0 0 24px;
}

.content-page h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  margin: 36px 0 12px;
}

.content-page p {
  color: var(--text-muted);
  font-size: 15.5px;
  line-height: 1.7;
  margin: 0 0 16px;
}

.content-page a { color: var(--amber); }

.content-page .lede {
  color: var(--text);
  font-size: 18px;
  line-height: 1.6;
}

.contact-card {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.contact-card .icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--amber-soft);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.contact-card a {
  font-family: var(--font-mono);
  font-size: 15px;
}

.footer-links {
  margin-top: 8px !important;
  font-size: 12.5px;
}
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--amber); }

.amazon-more-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 14.5px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.amazon-more-link:hover {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: var(--amber);
}

.amazon-more-link span:last-child {
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.more-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}
.more-links .amazon-more-link { margin-top: 0; }

.badge-marketplace {
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.featured-section { margin-top: 48px; }
.featured-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 16px;
  color: var(--text);
}

.category-links { display: flex; flex-wrap: wrap; gap: 10px; }
.category-link {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.category-link:hover { border-color: var(--amber); color: var(--amber); }

.faq-q { font-size: 15px; font-weight: 600; margin: 18px 0 6px; }
.faq-a { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin: 0; }
