/* FuxCheck — Clean, minimal, mobile-first */
:root {
  --safe: #22c55e;
  --safe-bg: #dcfce7;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ─── HEADER ─── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

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

nav { display: flex; gap: 24px; align-items: center; }
nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
nav a:hover, nav a.active { color: var(--text); }

.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* ─── HERO ─── */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover { background: var(--accent); color: #fff; }

.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ─── SECTIONS ─── */
section { padding: 60px 0; }

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 32px;
  letter-spacing: -0.5px;
}

.section-title.center { text-align: center; }

/* ─── PRODUCT CARDS ─── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}

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

.product-card-img {
  width: 100%;
  height: 180px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  object-fit: cover;
}

.product-card-body { padding: 16px; }

.product-card-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.3;
}

.product-card-brand {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.product-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.product-price {
  font-weight: 700;
  font-size: 1.1rem;
}

.product-store {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ─── SAFETY BADGE ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-safe { background: var(--safe-bg); color: #166534; }
.badge-warning { background: var(--warning-bg); color: #92400e; }
.badge-danger { background: var(--danger-bg); color: #991b1b; }

.rating-stars { color: var(--warning); font-size: 0.9rem; }

/* ─── CATEGORY PILLS ─── */
.categories {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 40px;
}

.category-pill {
  padding: 10px 24px;
  border: 2px solid var(--border);
  border-radius: 40px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
}

.category-pill:hover, .category-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #eff6ff;
}

/* ─── SCANNER ─── */
.scanner-section {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 720px;
  margin: 0 auto;
}

.scanner-section h2 { margin-bottom: 8px; }
.scanner-section p { color: var(--text-muted); margin-bottom: 24px; }

.scanner-input {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s;
}

.scanner-input:focus {
  outline: none;
  border-color: var(--accent);
}

.scanner-btn {
  margin-top: 16px;
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
}

/* ─── SCANNER RESULTS ─── */
.scanner-results {
  margin-top: 32px;
  display: none;
}

.scanner-results.visible { display: block; }

.scanner-results h3 { margin-bottom: 16px; }

.ingredient-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: background 0.15s;
}

.ingredient-row:hover { background: #f9fafb; }

.ingredient-name { font-weight: 600; flex: 1; }
.ingredient-desc { font-size: 0.85rem; color: var(--text-muted); flex: 2; padding: 0 16px; }

.score-summary {
  margin-top: 24px;
  padding: 24px;
  border-radius: var(--radius);
  text-align: center;
}

.score-summary h3 { font-size: 1.3rem; margin-bottom: 8px; }

.score-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  margin-top: 12px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* ─── PRODUCT DETAIL ─── */
.product-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.product-detail-header {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
}

.product-detail-img {
  width: 280px;
  height: 280px;
  background: #f3f4f6;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  flex-shrink: 0;
  object-fit: cover;
  overflow: hidden;
}

.product-detail-photo {
  width: 280px;
  height: 280px;
  border-radius: var(--radius);
  object-fit: cover;
  background: #f3f4f6;
}

.product-detail-info h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.product-detail-info .brand {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 16px;
}

.ingredient-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

.ingredient-table th {
  text-align: left;
  padding: 12px;
  border-bottom: 2px solid var(--border);
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ingredient-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 32px 0;
}

.pros h3 { color: var(--safe); }
.cons h3 { color: var(--danger); }
.pros li, .cons li { margin: 8px 0; font-size: 0.95rem; }

.buy-btn {
  display: block;
  text-align: center;
  padding: 16px;
  font-size: 1.1rem;
  margin-top: 24px;
}

/* ─── NEWSLETTER ─── */
.newsletter {
  background: #1e293b;
  color: #fff;
  padding: 60px 0;
  text-align: center;
}

.newsletter h2 { font-size: 1.6rem; margin-bottom: 8px; }
.newsletter p { color: #94a3b8; margin-bottom: 24px; }

.newsletter-form {
  display: flex;
  gap: 8px;
  max-width: 440px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1;
  padding: 14px 16px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
}

.newsletter-form button {
  padding: 14px 28px;
  border-radius: 8px;
}

/* ─── FOOTER ─── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); }

.footer-links { display: flex; gap: 24px; justify-content: center; margin-bottom: 16px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero { padding: 48px 0 32px; }
  
  nav { display: none; }
  nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--surface);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  
  .nav-toggle { display: block; }
  
  .product-detail-header { flex-direction: column; }
  .product-detail-img { width: 100%; height: 200px; }
  .pros-cons { grid-template-columns: 1fr; }
  
  .scanner-section { padding: 24px; }
  
  .newsletter-form { flex-direction: column; }
}
