/* ================================================================
   BarginBuy v2 — Main Stylesheet
   Professional affiliate marketing & product review design
   Follows DESIGN.md design system tokens
   Optimized for Core Web Vitals & AdSense compatibility
   ================================================================ */

/* ----- Design Tokens ----- */
:root {
  /* Core brand */
  --color-brand: #1e293b;
  --color-accent: #e85d3a;
  --color-accent-hover: #c94a2c;
  --color-success: #0d9488;
  --color-success-hover: #0f766e;
  --color-star: #f59e0b;
  --color-deal: #dc2626;

  /* Neutrals */
  --color-bg: #fefdfb;
  --color-surface: #f8f6f3;
  --color-surface-alt: #f0ede8;
  --color-border: #e8e4df;
  --color-border-light: #f0ede8;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  --color-white: #ffffff;

  /* Badges */
  --color-badge-best: #0d9488;
  --color-badge-value: #6366f1;
  --color-badge-budget: #f59e0b;
  --color-badge-deal: #dc2626;
  --color-badge-new: #8b5cf6;
  --color-badge-bg: #f0fdfa;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.10);
  --shadow-product: 0 2px 12px rgba(13,148,136,0.08);

  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Merriweather", "Georgia", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;

  --text-hero: 2.75rem;
  --text-h1: 2.25rem;
  --text-h2: 1.625rem;
  --text-h3: 1.25rem;
  --text-h4: 1.05rem;
  --text-body: 1.05rem;
  --text-body-sm: 0.9rem;
  --text-caption: 0.8rem;
  --text-label: 0.75rem;
  --text-price: 1.35rem;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 5rem;

  /* Layout */
  --max-width: 1150px;
  --max-width-narrow: 750px;
  --max-width-wide: 1280px;

  /* Other */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 100px;
  --header-height: 64px;
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: var(--color-accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--color-accent-hover); }

/* ----- Navigation ----- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: rgba(254,253,251,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
}

.header-inner {
  max-width: var(--max-width-wide);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.logo a {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.logo span {
  color: var(--color-accent);
}

.main-nav {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.main-nav a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.main-nav a:hover {
  color: var(--color-text);
  border-bottom-color: var(--color-accent);
}

/* ----- Hero (Homepage) ----- */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-badge-bg);
  color: var(--color-success);
  font-size: var(--text-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
}

.hero-badge::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: 50%;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1.15;
  max-width: 780px;
  margin: 0 auto var(--space-md);
  color: var(--color-brand);
}

.hero p {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ----- Trust Bar ----- */
.trust-bar {
  max-width: var(--max-width);
  margin: 0 auto var(--space-xl);
  padding: 0 var(--space-lg);
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.trust-stat {
  text-align: center;
}

.trust-stat .stat-number {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-brand);
  display: block;
  line-height: 1.2;
}

.trust-stat .stat-label {
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
}

.trust-stat .stat-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
  display: block;
}

/* ----- Category Grid ----- */
.category-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-xl);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
}

.cat-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-white);
  transition: box-shadow 0.25s ease, transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.cat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-accent);
  transform: scaleY(0);
  transition: transform 0.25s ease;
  border-radius: 0 2px 2px 0;
}

.cat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--color-accent);
}

.cat-card:hover::before {
  transform: scaleY(1);
}

.cat-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
  line-height: 1;
}

.cat-card h3 {
  font-size: var(--text-h3);
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--color-brand);
}

.cat-card p {
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  line-height: 1.55;
}

/* ----- Section Headers ----- */
.section-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  font-weight: 700;
  color: var(--color-brand);
}

.section-header a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.15s, gap 0.2s;
}

.section-header a:hover {
  color: var(--color-accent-hover);
}

/* ----- Article Grid ----- */
.article-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-xl);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-lg);
}

.article-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-white);
  transition: box-shadow 0.25s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.article-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  position: relative;
  overflow: hidden;
}

.article-img .card-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
}

.article-body {
  padding: var(--space-md) 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-meta {
  display: flex;
  gap: var(--space-sm);
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
  align-items: center;
}

.article-meta .meta-dot {
  width: 3px;
  height: 3px;
  background: var(--color-text-muted);
  border-radius: 50%;
}

.article-body h3 {
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.article-body .badge {
  margin-bottom: 0.5rem;
}

.article-body h3 a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.15s;
}

.article-body h3 a:hover {
  color: var(--color-accent);
}

.article-body p {
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  flex: 1;
}

.card-stars {
  color: var(--color-star);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: var(--space-sm);
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: gap 0.2s;
}

.read-more:hover {
  gap: 0.5rem;
  color: var(--color-accent-hover);
}

/* ----- Badges ----- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  line-height: 1.4;
}

.badge-best {
  background: #ccfbf1;
  color: #0f766e;
}

.badge-value {
  background: #e0e7ff;
  color: #4338ca;
}

.badge-budget {
  background: #fef3c7;
  color: #92400e;
}

.badge-deal {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-new {
  background: #ede9fe;
  color: #6d28d9;
}

.badge-review {
  background: #f0fdfa;
  color: #0d9488;
  border: 1px solid #99f6e4;
}

/* ----- Product Card (in-article) ----- */
.product-card {
  border: 2px solid var(--color-success);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: var(--space-lg) 0;
  background: linear-gradient(135deg, #f0fdfa 0%, #fafdfb 100%);
  display: flex;
  gap: var(--space-md);
  align-items: center;
  flex-wrap: wrap;
  box-shadow: var(--shadow-product);
}

.product-card .product-img {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  border: 1px solid var(--color-border-light);
  background: var(--color-white);
}

.product-card .product-info {
  flex: 1;
  min-width: 220px;
}

.product-card .product-info h4 {
  font-size: var(--text-h4);
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--color-brand);
}

.product-card .stars {
  color: var(--color-star);
  font-size: 1rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.product-card .product-info p {
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.55;
}

.product-card .btn-buy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.75rem;
  background: var(--color-success);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(13,148,136,0.2);
}

.product-card .btn-buy:hover {
  background: var(--color-success-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(13,148,136,0.25);
  color: #fff;
}

.product-card .btn-buy:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ----- Pros/Cons ----- */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.pros, .cons {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
}

.pros {
  background: linear-gradient(135deg, #f0fdf4, #fafdfb);
  border-left: 3px solid #22c55e;
}

.cons {
  background: linear-gradient(135deg, #fef2f2, #fefdfb);
  border-left: 3px solid #ef4444;
}

.pros h4, .cons h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pros h4 { color: #166534; }
.cons h4 { color: #991b1b; }

.pros ul, .cons ul {
  margin: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pros li, .cons li {
  font-size: var(--text-body-sm);
  line-height: 1.5;
  padding-left: 1.25rem;
  position: relative;
}

.pros li::before {
  content: "+";
  position: absolute;
  left: 0;
  color: #22c55e;
  font-weight: 700;
}

.cons li::before {
  content: "\2212";
  position: absolute;
  left: 0;
  color: #ef4444;
  font-weight: 700;
}

/* ----- Comparison Table ----- */
.comparison-table-wrapper {
  overflow-x: auto;
  margin: var(--space-lg) 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-body-sm);
  min-width: 600px;
}

.comparison-table thead th {
  background: var(--color-surface-alt);
  padding: 0.85rem 1.25rem;
  text-align: left;
  font-weight: 700;
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.comparison-table tbody td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.comparison-table tbody tr:nth-child(even) td {
  background: var(--color-surface);
}

.comparison-table tbody tr:hover td {
  background: #f0fdfa;
}

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

.comparison-table .col-product {
  font-weight: 600;
  color: var(--color-brand);
}

.comparison-table .btn-sm {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1.1rem;
  background: var(--color-success);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-caption);
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, transform 0.15s;
}

.comparison-table .btn-sm:hover {
  background: var(--color-success-hover);
  color: #fff;
  transform: translateY(-1px);
}

.comparison-table .row-best td {
  background: #f0fdfa !important;
  border-left: 3px solid var(--color-success);
}

/* ----- Best-Of / Ranked List ----- */
.best-of-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-lg) var(--space-md);
}

.best-of-header h1 {
  font-family: var(--font-serif);
  font-size: var(--text-h1);
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-brand);
}

.best-of-header p {
  color: var(--color-text-secondary);
  font-size: var(--text-body);
  max-width: 680px;
  line-height: 1.7;
}

.ranked-list {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-xl);
}

.ranked-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
  align-items: flex-start;
  flex-wrap: wrap;
}

.ranked-item:first-child {
  padding-top: 0;
}

.rank-num {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  min-width: 55px;
  flex-shrink: 0;
}

.ranked-content {
  flex: 1;
  min-width: 280px;
}

.ranked-content h3 {
  font-size: var(--text-h3);
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--color-brand);
}

.ranked-content .stars {
  color: var(--color-star);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.ranked-content p {
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.ranked-content .price-line {
  font-size: var(--text-body-sm);
  color: var(--color-text);
  font-weight: 600;
}

.ranked-content .price-line a {
  font-weight: 500;
  margin-left: 0.5rem;
}

/* Deal badge in ranked list */
.deal-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--color-deal);
  color: #fff;
  font-size: var(--text-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-right: var(--space-sm);
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.2rem;
}

.price-was {
  text-decoration: line-through;
  color: var(--color-text-muted);
  font-weight: 400;
  margin-right: 0.35rem;
}

.price-now {
  color: var(--color-deal);
  font-weight: 700;
}

/* ----- Newsletter Banner ----- */
.newsletter-banner {
  max-width: var(--max-width);
  margin: 0 auto var(--space-xl);
  padding: var(--space-xl) var(--space-lg);
  background: linear-gradient(135deg, #f0f9ff 0%, #faf5ff 50%, #fff7ed 100%);
  border-radius: var(--radius-xl);
  text-align: center;
  border: 1px solid var(--color-border);
}

.newsletter-banner h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-brand);
}

.newsletter-banner p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  font-size: 0.95rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 480px;
  margin: 0 auto;
}

.newsletter-form input {
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  min-width: 280px;
  flex: 1;
  font-family: var(--font-sans);
  transition: border-color 0.2s;
  outline: none;
  background: var(--color-white);
}

.newsletter-form input:focus {
  border-color: var(--color-accent);
}

.newsletter-form button {
  padding: 0.75rem 1.75rem;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(232,93,58,0.2);
}

.newsletter-form button:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(232,93,58,0.25);
}

.newsletter-form button:active {
  transform: translateY(0);
}

/* ----- Article Page ----- */
.article-container {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-lg) var(--space-xl);
}

.breadcrumb {
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.breadcrumb a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--color-accent);
}

.article-container h1 {
  font-family: var(--font-serif);
  font-size: var(--text-h1);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-sm);
  color: var(--color-brand);
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: var(--space-lg);
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.article-byline .author-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.article-byline .author-name {
  font-weight: 600;
  color: var(--color-text);
}

.affiliate-disclosure {
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  font-style: italic;
  padding: 0.75rem 1.25rem;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  border-left: 3px solid var(--color-border);
  line-height: 1.5;
}

.article-content h2 {
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  font-weight: 700;
  margin: var(--space-xl) 0 var(--space-md);
  line-height: 1.3;
  color: var(--color-brand);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border-light);
}

.article-content h3 {
  font-size: var(--text-h3);
  font-weight: 600;
  margin: var(--space-lg) 0 var(--space-sm);
  color: var(--color-brand);
}

.article-content p {
  margin-bottom: var(--space-md);
  font-size: var(--text-body);
  line-height: 1.8;
  color: var(--color-text);
}

.article-content ul, .article-content ol {
  margin: 0 0 var(--space-md) 1.5rem;
  line-height: 1.8;
}

.article-content li {
  margin-bottom: 0.4rem;
  font-size: var(--text-body);
}

.article-content strong {
  color: var(--color-brand);
}

.article-content em {
  color: var(--color-text-secondary);
}

/* ----- Sidebar Widget ----- */
.article-sidebar {
  margin: var(--space-xl) 0;
  padding: var(--space-md) 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.article-sidebar h4 {
  font-size: var(--text-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-sm);
  color: var(--color-text-secondary);
}

.article-sidebar p {
  font-size: var(--text-body-sm);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.article-sidebar p:last-child {
  margin-bottom: 0;
}

.article-sidebar a {
  font-weight: 600;
}

/* ----- About Page ----- */
.about-container {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-lg) var(--space-xl);
}

.about-container h1 {
  font-family: var(--font-serif);
  font-size: var(--text-h1);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: var(--color-brand);
}

.about-container h2 {
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  font-weight: 700;
  margin: var(--space-xl) 0 var(--space-sm);
  color: var(--color-brand);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border-light);
}

.about-container p {
  font-size: var(--text-body);
  line-height: 1.8;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

/* ----- Blog Listing ----- */
.blog-listing {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-lg) var(--space-xl);
}

.blog-listing h1 {
  font-family: var(--font-serif);
  font-size: var(--text-h1);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: var(--color-brand);
}

/* ----- Reviews Listing ----- */
.reviews-listing {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-lg) var(--space-xl);
}

.reviews-listing h1 {
  font-family: var(--font-serif);
  font-size: var(--text-h1);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: var(--color-brand);
}

/* ----- Footer ----- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  background: var(--color-surface);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.footer-col h4 {
  font-size: var(--text-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.footer-col a {
  display: block;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: var(--text-body-sm);
  margin-bottom: 0.55rem;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: var(--space-lg) auto 0;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.6;
}

/* ----- Responsive ----- */
@media (max-width: 1024px) {
  :root {
    --text-hero: 2.25rem;
    --text-h1: 1.875rem;
    --text-h2: 1.45rem;
  }

  .article-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  :root {
    --text-hero: 1.75rem;
    --text-h1: 1.625rem;
    --text-h2: 1.3rem;
    --text-h3: 1.1rem;
    --text-body: 1rem;
    font-size: 16px;
  }

  .hero {
    padding: var(--space-lg) var(--space-md) var(--space-md);
  }

  .trust-bar {
    gap: var(--space-lg);
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    padding: 0 var(--space-md) var(--space-lg);
  }

  .cat-card {
    padding: 1.5rem 1.25rem;
  }

  .cat-icon {
    font-size: 2rem;
  }

  .article-grid {
    grid-template-columns: 1fr;
    padding: 0 var(--space-md) var(--space-lg);
  }

  .section-header {
    padding: 0 var(--space-md);
  }

  .pros-cons {
    grid-template-columns: 1fr;
  }

  .product-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .product-card .product-img {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }

  .main-nav {
    gap: 1.25rem;
  }

  .article-container {
    padding: var(--space-md) var(--space-md) var(--space-lg);
  }

  .ranked-list {
    padding: 0 var(--space-md) var(--space-lg);
  }

  .best-of-header {
    padding: var(--space-md) var(--space-md);
  }

  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  :root {
    --text-hero: 1.5rem;
    --text-h1: 1.4rem;
  }

  .main-nav a:nth-child(4),
  .main-nav a:nth-child(5) {
    display: none;
  }

  .main-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-white);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    padding: var(--space-xl) var(--space-lg);
    z-index: 90;
    overflow-y: auto;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav.open a {
    font-size: 1.1rem;
    padding: 0.5rem 0;
  }

  .main-nav.open a:nth-child(4),
  .main-nav.open a:nth-child(5) {
    display: block;
  }

  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 101;
  }

  .hamburger span {
    display: block;
    width: 100%;
    height: 2.5px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
  }

  .hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .hamburger.open span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

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

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .trust-bar {
    gap: var(--space-md);
  }

  .trust-stat .stat-number {
    font-size: 1.25rem;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-form input {
    min-width: unset;
    width: 100%;
  }

  .ranked-item {
    gap: var(--space-sm);
  }

  .rank-num {
    font-size: 2rem;
    min-width: 40px;
  }

  .header-inner {
    padding: 0 var(--space-md);
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

/* ----- Utility: Screen Reader Only ----- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ===== ADVANCED COMPONENTS ===== */

/* ----- Skip to Content (Accessibility) ----- */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-accent);
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-body-sm);
  z-index: 999;
  transition: top 0.2s;
}

.skip-to-content:focus {
  top: 0.75rem;
}

/* ----- Search Bar in Header ----- */
.search-trigger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}

.search-trigger:hover {
  color: var(--color-accent);
}

/* Hamburger menu (mobile) */
.hamburger {
  display: none;
}

.search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-md);
  z-index: 99;
}

.search-dropdown.active {
  display: block;
}

.search-form {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
}

.search-form input {
  flex: 1;
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
  background: var(--color-white);
}

.search-form input:focus {
  border-color: var(--color-accent);
}

.search-form button {
  padding: 0.75rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.2s;
}

.search-form button:hover {
  background: var(--color-accent-hover);
}

/* ----- Category Icons (SVG-style via CSS) ----- */
.cat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  position: relative;
}

.cat-card:nth-child(1) .cat-icon { background: #fef3c7; }
.cat-card:nth-child(2) .cat-icon { background: #dcfce7; }
.cat-card:nth-child(3) .cat-icon { background: #dbeafe; }
.cat-card:nth-child(4) .cat-icon { background: #fce7f3; }
.cat-card:nth-child(5) .cat-icon { background: #ede9fe; }
.cat-card:nth-child(6) .cat-icon { background: #e0f2fe; }

/* ----- Trust Bar Icons ----- */
.trust-stat .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  font-size: 1.1rem;
}

.trust-stat:nth-child(1) .stat-icon { background: #fef3c7; }
.trust-stat:nth-child(2) .stat-icon { background: #dcfce7; }
.trust-stat:nth-child(3) .stat-icon { background: #dbeafe; }
.trust-stat:nth-child(4) .stat-icon { background: #fce7f3; }

/* ----- Article Image Placeholder Icons ----- */
.article-img::after {
  font-size: 3.5rem;
  opacity: 0.25;
}

/* ----- Back to Top Button ----- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--color-brand);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(1rem);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.2s;
  z-index: 200;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-accent);
  transform: translateY(-2px);
}

/* ----- Table of Contents (in-article) ----- */
.toc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) 1.5rem;
  margin-bottom: var(--space-lg);
}

.toc-title {
  font-size: var(--text-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.toc-list {
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.toc-list a {
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 0.3rem 0;
  display: block;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  transition: color 0.15s, border-color 0.15s;
}

.toc-list a:hover,
.toc-list a.active {
  color: var(--color-accent);
  border-left-color: var(--color-accent);
}

/* ----- Related Articles ----- */
.related-articles {
  margin: var(--space-xl) 0;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.related-articles h3 {
  font-family: var(--font-serif);
  font-size: var(--text-h3);
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--color-brand);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
}

.related-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-white);
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  display: block;
}

.related-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.related-card-img {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.related-card-body {
  padding: 1rem 1.25rem;
}

.related-card-body h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
  margin: 0;
}

.related-card-body .related-meta {
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  margin-top: 0.4rem;
}

/* ----- Footer Brand Section ----- */
.footer-brand {
  max-width: var(--max-width);
  margin: 0 auto var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-brand);
}

.footer-logo span { color: var(--color-accent); }

.footer-social {
  display: flex;
  gap: var(--space-sm);
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  transition: all 0.2s;
  text-decoration: none;
}

.footer-social a:hover {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* ----- Focus & Accessibility ----- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ----- Text Selection ----- */
::selection {
  background: rgba(232,93,58,0.15);
  color: var(--color-text);
}

::-moz-selection {
  background: rgba(232,93,58,0.15);
  color: var(--color-text);
}

/* ----- Skeleton Loading Animation ----- */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--color-surface) 25%, var(--color-border-light) 37%, var(--color-surface) 63%);
  background-size: 200px 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-text:last-child { width: 70%; }

.skeleton-title {
  height: 1.5rem;
  width: 80%;
  margin-bottom: 0.75rem;
}

.skeleton-image {
  height: 220px;
  width: 100%;
}

/* ----- Print Styles ----- */
@media print {
  .site-header,
  .site-footer,
  .newsletter-banner,
  .back-to-top,
  .search-dropdown,
  .article-sidebar,
  .related-articles,
  .trust-bar,
  .category-grid,
  .hero-badge { display: none !important; }

  body {
    font-size: 12pt;
    line-height: 1.6;
    color: #000;
    background: #fff;
  }

  .article-container {
    max-width: 100%;
    padding: 0;
  }

  .article-container h1 { font-size: 18pt; }
  .article-content h2 { font-size: 14pt; }
  .article-content h3 { font-size: 12pt; }

  .product-card {
    border: 1px solid #ccc;
    background: none;
    box-shadow: none;
    page-break-inside: avoid;
  }

  .comparison-table-wrapper {
    border: 1px solid #ccc;
  }

  .comparison-table thead th {
    background: #eee;
    color: #000;
  }

  .btn-buy, .btn-sm {
    background: none;
    color: #000;
    border: 1px solid #000;
    box-shadow: none;
  }

  a { color: #000; text-decoration: underline; }
}

/* ----- Reduced Motion ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }
}

/* ----- AdSense Optimization ----- */
.ad-container {
  text-align: center;
  margin: var(--space-xl) auto;
  max-width: var(--max-width);
  padding: 0 var(--space-lg);
  overflow: hidden;
}

/* Content-first layout: push ads below the fold naturally */
.ad-in-content {
  margin: var(--space-lg) auto;
  text-align: center;
  min-height: 90px;
}

/* Prevent CLS from ad loading */
.ad-slot {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-caption);
  color: var(--color-text-muted);
}

/* Ensure content stays readable above ads */
.content-above-ad {
  min-height: 600px;
}

/* Mobile ad optimization */
@media (max-width: 768px) {
  .ad-container {
    padding: 0 var(--space-md);
  }
  .ad-in-content {
    min-height: 50px;
  }
  .ad-slot {
    min-height: 80px;
  }
}
