/* ============================================
   Buytelix — Design Tokens
   ============================================ */
:root {
  --bg: #FAFAFF;
  --surface: #FFFFFF;
  --surface-2: #F1F0FC;
  --ink: #14142B;
  --muted: #6E6E85;
  --line: #E4E2F5;

  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --primary-light: #EEECFD;
  --accent: #FF6B4A;
  --accent-dark: #E24D2C;
  --mint: #17B892;
  --mint-light: #E3FBF4;

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 28px;

  --shadow-sm: 0 1px 2px rgba(20, 20, 43, 0.06);
  --shadow-md: 0 8px 24px rgba(79, 70, 229, 0.12);
  --shadow-lg: 0 20px 50px rgba(20, 20, 43, 0.14);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  padding: 6px 14px;
  border-radius: 100px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 107, 74, 0.35);
}
.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm { padding: 9px 16px; font-size: 13px; border-radius: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo .dot { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 32px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
}
.nav-links a:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 14px; }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 96px;
  overflow: hidden;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  margin: 18px 0 20px;
}
.hero h1 .hl { color: var(--primary); }
.hero p.lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 28px; }

.search-bar {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px;
  box-shadow: var(--shadow-sm);
  max-width: 480px;
}
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 15px;
  background: transparent;
}
.trust-row {
  display: flex;
  gap: 22px;
  margin-top: 30px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.trust-row span { display: flex; align-items: center; gap: 6px; }

/* ---------- Price Race widget (signature element) ---------- */
.race-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  position: relative;
}
.race-card::before {
  content: "";
  position: absolute;
  inset: -18px;
  background: radial-gradient(circle at 30% 20%, rgba(79,70,229,0.18), transparent 60%),
              radial-gradient(circle at 80% 80%, rgba(255,107,74,0.16), transparent 55%);
  z-index: -1;
  border-radius: 40px;
}
.race-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.race-head .product {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
}
.race-head .thumb {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.race-head .live {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mint);
  display: flex;
  align-items: center;
  gap: 6px;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--mint);
  animation: pulse 1.6s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.race-track { display: flex; flex-direction: column; gap: 10px; }

.race-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  transition: order 0.6s ease, transform 0.6s cubic-bezier(.4,0,.2,1), background 0.4s ease, border-color 0.4s ease;
}
.race-row .store {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.race-row .store small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 11.5px;
}
.race-row .price {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
}
.race-row.is-best {
  background: var(--mint-light);
  border-color: var(--mint);
}
.race-row.is-best .price { color: var(--mint); }
.badge-best {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  background: var(--mint);
  color: #fff;
  padding: 3px 8px;
  border-radius: 100px;
  margin-left: 8px;
}
.race-foot {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
}
.race-foot .save {
  color: var(--accent-dark);
  font-weight: 700;
}

/* ---------- How it works ---------- */
.section { padding: 88px 0; }
.section-head { max-width: 620px; margin-bottom: 52px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 38px); margin-top: 14px; }
.section-head p { color: var(--muted); font-size: 16.5px; margin-top: 12px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 30px 26px;
  position: relative;
}
.step .num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--primary);
  background: var(--primary-light);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.step h3 { font-size: 19px; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 14.5px; }

/* ---------- Categories ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.cat-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.cat-card .icon { font-size: 26px; margin-bottom: 14px; }
.cat-card h4 { font-size: 15.5px; margin-bottom: 4px; }
.cat-card span { font-size: 12.5px; color: var(--muted); }

/* ---------- Stats band ---------- */
.stats-band {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.stat b {
  font-family: var(--font-mono);
  font-size: clamp(28px, 3vw, 38px);
  color: var(--mint);
  display: block;
}
.stat span { color: #A6A5C4; font-size: 13.5px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 32px;
  color: var(--muted);
  font-size: 13.5px;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.footer-cols { display: flex; gap: 64px; }
.footer-cols h5 {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 12px;
}
.footer-cols ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-cols a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Product page ---------- */
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  padding: 20px 0 0;
}
.breadcrumb a:hover { color: var(--primary); }

.product-hero {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  padding: 32px 0 64px;
}
.product-gallery {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 100px;
  aspect-ratio: 1 / 1;
}
.product-info .eyebrow { margin-bottom: 14px; }
.product-info h1 { font-size: clamp(28px, 3.6vw, 38px); margin-bottom: 10px; }
.product-info .subtitle { color: var(--muted); font-size: 15px; margin-bottom: 22px; }

.price-hero {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.price-hero .amount {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  color: var(--mint);
}
.price-hero .from { font-size: 13.5px; color: var(--muted); }
.price-note { font-size: 13px; color: var(--muted); margin-bottom: 26px; }

.spec-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.chip {
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: 100px;
  color: var(--muted);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.compare-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface-2);
  padding: 14px 18px;
  font-weight: 600;
}
.compare-table td {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
}
.compare-table tr.best-row td { background: var(--mint-light); }
.store-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.store-cell .dot-icon {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-family: var(--font-mono); font-weight: 700;
}
.price-cell { font-family: var(--font-mono); font-weight: 700; font-size: 15px; }
.delivery-cell { color: var(--muted); font-size: 13.5px; }

.history-section { padding: 64px 0; }
.history-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px;
}
.history-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 10px;
}
.history-head h3 { font-size: 18px; }
.history-stats { display: flex; gap: 22px; font-size: 13px; color: var(--muted); }
.history-stats b { color: var(--ink); font-family: var(--font-mono); }

.alert-cta {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--primary-light);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  flex-wrap: wrap;
}
.alert-cta p { font-size: 14px; color: var(--primary-dark); font-weight: 600; }
.alert-cta span.sub { display: block; font-weight: 400; color: var(--muted); margin-top: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .steps { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-band { grid-template-columns: 1fr; text-align: center; }
  .product-hero { grid-template-columns: 1fr; }
  .footer-grid { flex-direction: column; }
  .footer-cols { gap: 40px; }
  .compare-table { display: block; overflow-x: auto; white-space: nowrap; }
}
