/* ============================================================
   eBikeAuthority — Main Stylesheet
   Mobile-first, lightweight, no dependencies
   ============================================================ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:      #16a34a;
  --green-dark: #15803d;
  --green-light:#dcfce7;
  --blue:       #2563eb;
  --blue-light: #eff6ff;
  --orange:     #ea580c;
  --gray-50:    #f9fafb;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-300:   #d1d5db;
  --gray-500:   #6b7280;
  --gray-700:   #374151;
  --gray-900:   #111827;
  --white:      #ffffff;
  --radius:     8px;
  --radius-lg:  12px;
  --shadow:     0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
  --font:       'Inter', system-ui, -apple-system, sans-serif;
  --max-w:      1180px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-700);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 16px; }

@media (min-width: 640px)  { .container { padding: 0 24px; } }
@media (min-width: 1024px) { .container { padding: 0 32px; } }

.section { padding: 56px 0; }
.section--gray { background: var(--gray-50); }
.section--dark { background: var(--gray-900); color: var(--white); }

/* ── Typography ── */
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 800; line-height: 1.15; color: var(--gray-900); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem);     font-weight: 700; line-height: 1.25; color: var(--gray-900); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem);   font-weight: 600; line-height: 1.3;  color: var(--gray-900); }
h4 { font-size: 1rem;  font-weight: 600; color: var(--gray-900); }
p  { margin-bottom: 1rem; }

.section-title { text-align: center; margin-bottom: 8px; }
.section-sub   { text-align: center; color: var(--gray-500); margin-bottom: 40px; font-size: 1.05rem; }

.text-green  { color: var(--green); }
.text-orange { color: var(--orange); }
.text-gray   { color: var(--gray-500); }
.text-sm     { font-size: .875rem; }
.text-xs     { font-size: .75rem; }
.font-bold   { font-weight: 700; }
.text-center { text-align: center; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border-radius: var(--radius); font-weight: 600;
  font-size: .95rem; cursor: pointer; border: none; transition: all .15s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary   { background: var(--green); color: var(--white); }
.btn-primary:hover   { background: var(--green-dark); text-decoration: none; color: var(--white); }
.btn-secondary { background: var(--blue); color: var(--white); }
.btn-secondary:hover { background: #1d4ed8; text-decoration: none; color: var(--white); }
.btn-outline   { background: transparent; color: var(--green); border: 2px solid var(--green); }
.btn-outline:hover   { background: var(--green-light); text-decoration: none; }
.btn-orange    { background: var(--orange); color: var(--white); }
.btn-orange:hover    { background: #c2410c; text-decoration: none; color: var(--white); }
.btn-lg  { padding: 14px 30px; font-size: 1.05rem; }
.btn-sm  { padding: 7px 14px;  font-size: .825rem; }
.btn-full { width: 100%; }

/* ── Header / Nav ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white); border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.logo {
  font-size: 1.3rem; font-weight: 800; color: var(--green);
  text-decoration: none; display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; color: var(--green-dark); }
.logo-icon { font-size: 1.5rem; }

.nav-links {
  display: none; list-style: none; gap: 4px;
}
@media (min-width: 768px) { .nav-links { display: flex; } }

.nav-links a {
  display: block; padding: 6px 12px; color: var(--gray-700);
  font-weight: 500; font-size: .9rem; border-radius: var(--radius);
  transition: background .12s;
}
.nav-links a:hover { background: var(--gray-100); text-decoration: none; color: var(--gray-900); }
.nav-links .active { color: var(--green); font-weight: 600; }

.nav-cta { display: none; }
@media (min-width: 900px) { .nav-cta { display: flex; } }

/* Mobile menu */
.hamburger {
  display: flex; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
@media (min-width: 768px) { .hamburger { display: none; } }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--gray-700); border-radius: 2px; transition: .2s; }

.mobile-menu {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: var(--white); padding: 20px 16px; overflow-y: auto;
}
.mobile-menu.open { display: block; }
.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.mobile-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--gray-700); }
.mobile-menu nav a {
  display: block; padding: 14px 0; font-size: 1.05rem; font-weight: 500;
  color: var(--gray-700); border-bottom: 1px solid var(--gray-200);
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #15803d 100%);
  color: var(--white); padding: 72px 0 80px;
}
.hero-grid {
  display: grid; gap: 40px;
}
@media (min-width: 768px) { .hero-grid { grid-template-columns: 1fr 1fr; align-items: center; } }

.hero h1 { color: var(--white); margin-bottom: 16px; }
.hero-sub { font-size: 1.1rem; opacity: .9; margin-bottom: 28px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.badge {
  background: rgba(255,255,255,.15); color: var(--white);
  padding: 4px 12px; border-radius: 99px; font-size: .8rem; font-weight: 500;
  backdrop-filter: blur(4px);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.stat-card {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-lg); padding: 20px 16px; text-align: center;
  backdrop-filter: blur(4px);
}
.stat-card .stat-num { font-size: 2rem; font-weight: 800; color: var(--white); display: block; }
.stat-card .stat-lbl { font-size: .78rem; opacity: .8; text-transform: uppercase; letter-spacing: .05em; }

/* ── Category Nav ── */
.cat-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 480px)  { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px)  { .cat-grid { grid-template-columns: repeat(6, 1fr); } }

.cat-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 12px; border-radius: var(--radius-lg);
  background: var(--white); border: 1px solid var(--gray-200);
  text-decoration: none; color: var(--gray-700);
  font-weight: 600; font-size: .85rem; text-align: center;
  transition: all .15s; box-shadow: var(--shadow);
}
.cat-card:hover { border-color: var(--green); color: var(--green); transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.cat-icon { font-size: 1.8rem; }

/* ── Bike Cards ── */
.bikes-grid {
  display: grid; gap: 24px;
  grid-template-columns: 1fr;
  padding-top: 20px; /* space for .top-pick-label overhangs on first row */
}
@media (min-width: 640px)  { .bikes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .bikes-grid { grid-template-columns: repeat(3, 1fr); } }

.bike-card {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s;
  display: flex; flex-direction: column;
  position: relative; z-index: 0; /* establish stacking context per card */
}
.bike-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); z-index: 1; }

.bike-card-img {
  position: relative; background: var(--gray-100);
  aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.bike-card-img img { width: 100%; height: 100%; object-fit: cover; }
.bike-card-img .placeholder-img {
  font-size: 4rem; opacity: .3;
}
.card-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--orange); color: var(--white);
  font-size: .72rem; font-weight: 700; padding: 3px 10px;
  border-radius: 99px; text-transform: uppercase; letter-spacing: .05em;
}
.card-badge.green { background: var(--green); }

.bike-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.bike-card-brand { font-size: .78rem; font-weight: 600; color: var(--green); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.bike-card-name  { font-size: 1.1rem; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }

.stars { color: #f59e0b; font-size: .9rem; }
.rating-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.rating-num { font-weight: 700; font-size: .95rem; }
.review-cnt { color: var(--gray-500); font-size: .82rem; }

.spec-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.spec-pill {
  background: var(--gray-100); border-radius: 99px;
  padding: 3px 10px; font-size: .75rem; font-weight: 500; color: var(--gray-700);
}
.spec-pill strong { color: var(--gray-900); }

.price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.price     { font-size: 1.4rem; font-weight: 800; color: var(--gray-900); }
.price-was { font-size: .9rem; color: var(--gray-500); text-decoration: line-through; }
.price-save { font-size: .8rem; color: var(--green); font-weight: 600; }

.bike-card-footer { margin-top: auto; display: flex; gap: 8px; }

/* ── Comparison Table ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }

.compare-table {
  width: 100%; border-collapse: collapse; background: var(--white);
  font-size: .9rem;
}
.compare-table thead { background: var(--gray-900); color: var(--white); }
.compare-table th {
  padding: 14px 16px; text-align: left; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
}
.compare-table th.sortable { cursor: pointer; user-select: none; }
.compare-table th.sortable:hover { background: var(--gray-700); }
.compare-table th .sort-icon { opacity: .5; font-size: .7rem; }
.compare-table th.sorted .sort-icon { opacity: 1; }

.compare-table tbody tr { border-bottom: 1px solid var(--gray-200); transition: background .1s; }
.compare-table tbody tr:hover { background: var(--gray-50); }
.compare-table tbody tr:last-child { border-bottom: none; }
.compare-table td { padding: 16px; vertical-align: middle; }

.table-bike-name { font-weight: 700; color: var(--gray-900); }
.table-bike-brand { font-size: .75rem; color: var(--gray-500); }
.table-price { font-weight: 700; font-size: 1.05rem; }
.score-bar-wrap { display: flex; align-items: center; gap: 8px; }
.score-bar { height: 8px; border-radius: 4px; background: var(--gray-200); flex: 1; min-width: 60px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--green), #86efac); transition: width .5s ease; }
.score-num { font-weight: 700; font-size: .85rem; min-width: 28px; }

.winner-badge { background: var(--green-light); color: var(--green-dark); font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }

/* ── Pros / Cons ── */
.pros-cons { display: grid; gap: 16px; }
@media (min-width: 640px) { .pros-cons { grid-template-columns: 1fr 1fr; } }

.pros-box, .cons-box { border-radius: var(--radius); padding: 20px; }
.pros-box { background: #f0fdf4; border: 1px solid #bbf7d0; }
.cons-box { background: #fff7ed; border: 1px solid #fed7aa; }
.pros-box h4 { color: #16a34a; margin-bottom: 12px; }
.cons-box h4 { color: #ea580c; margin-bottom: 12px; }
.pros-box ul, .cons-box ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pros-box li::before { content: "✓ "; color: var(--green); font-weight: 700; }
.cons-box li::before { content: "✗ "; color: var(--orange); font-weight: 700; }

/* ── Spec Grid ── */
.spec-grid {
  display: grid; gap: 0;
  grid-template-columns: 1fr;
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  overflow: hidden;
}
@media (min-width: 480px) { .spec-grid { grid-template-columns: 1fr 1fr; } }

.spec-item {
  padding: 12px 16px; border-bottom: 1px solid var(--gray-200);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.spec-item:nth-child(even) { background: var(--gray-50); }
.spec-label { font-size: .85rem; color: var(--gray-500); }
.spec-value { font-weight: 600; font-size: .9rem; color: var(--gray-900); text-align: right; }

/* ── Charts (SVG) ── */
.chart-section { padding: 40px 0; }
.radar-wrap { display: flex; justify-content: center; }

/* ── FAQ ── */
.faq-list { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; }
.faq-item { border-bottom: 1px solid var(--gray-200); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  width: 100%; text-align: left; padding: 18px 20px;
  background: var(--white); border: none; cursor: pointer; font-size: 1rem;
  font-weight: 600; color: var(--gray-900); display: flex; justify-content: space-between;
  align-items: center; gap: 12px; transition: background .12s;
}
.faq-q:hover { background: var(--gray-50); }
.faq-icon { font-size: 1.2rem; flex-shrink: 0; transition: transform .2s; color: var(--green); }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-a { display: none; padding: 0 20px 18px; color: var(--gray-700); line-height: 1.7; }
.faq-item.open .faq-a { display: block; }

/* ── Breadcrumb ── */
.breadcrumb { padding: 12px 0; }
.breadcrumb-list { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; font-size: .85rem; color: var(--gray-500); }
.breadcrumb-list li + li::before { content: "/"; margin-right: 4px; }
.breadcrumb-list a { color: var(--green); }

/* ── Alert / Callout ── */
.callout {
  border-radius: var(--radius); padding: 16px 20px; margin: 20px 0;
  display: flex; gap: 12px; align-items: flex-start;
}
.callout-green { background: var(--green-light); border-left: 4px solid var(--green); }
.callout-blue  { background: var(--blue-light);  border-left: 4px solid var(--blue); }
.callout-icon  { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.callout p     { margin: 0; font-size: .9rem; }

/* ── Top-pick highlight ── */
.top-pick {
  border: 2px solid var(--green); border-radius: var(--radius-lg);
  position: relative;
  overflow: visible !important; /* override .bike-card overflow:hidden */
  z-index: 2 !important;        /* sit above neighbouring grid cards */
}
.top-pick-label {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--green); color: var(--white);
  padding: 3px 16px; border-radius: 99px; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
  z-index: 3; /* above the card itself */
  pointer-events: none; /* label doesn't block hover on the card */
}

/* ── Value Score Ring ── */
.value-ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.value-ring-label { font-size: .75rem; color: var(--gray-500); font-weight: 500; }

/* ── Affiliate CTA Box ── */
.aff-box {
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
  color: var(--white); border-radius: var(--radius-lg);
  padding: 32px; text-align: center;
}
.aff-box h3 { color: var(--white); margin-bottom: 8px; }
.aff-box p  { opacity: .85; margin-bottom: 20px; }
.aff-disclaimer { font-size: .75rem; opacity: .5; margin-top: 12px; }

/* ── Footer ── */
.site-footer {
  background: var(--gray-900); color: var(--gray-300);
  padding: 56px 0 24px;
}
.footer-grid {
  display: grid; gap: 32px;
  grid-template-columns: 1fr;
  margin-bottom: 40px;
}
@media (min-width: 640px)  { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
@media (min-width: 768px)  { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }

.footer-brand .logo { color: #86efac; margin-bottom: 12px; }
.footer-brand p { font-size: .875rem; line-height: 1.7; opacity: .75; }

.footer-col h4 { color: var(--white); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { color: var(--gray-300); font-size: .875rem; transition: color .12s; }
.footer-col a:hover { color: var(--white); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 24px; display: flex; flex-wrap: wrap;
  justify-content: space-between; gap: 12px; font-size: .8rem; opacity: .6;
}

/* ── Utilities ── */
.mt-0  { margin-top: 0; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.gap-8  { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.flex   { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; gap: 24px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; gap: 24px; }
@media (min-width: 640px)  { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: 1fr 1fr 1fr; } }

/* ── Responsive overrides ── */
@media (max-width: 639px) {
  .hide-mobile { display: none !important; }
  .hero { padding: 48px 0 56px; }
  .section { padding: 40px 0; }
}

/* Print */
@media print {
  .site-header, .site-footer, .aff-box, .btn { display: none !important; }
}
