:root {
  /* Nomi brand palette */
  --nomi-green: #22c55e;
  --nomi-green-dark: #16a34a;
  --nomi-green-light: #dcfce7;
  --nomi-green-subtle: #f0fdf4;
  --nomi-red: #ef4444;
  --nomi-red-dark: #dc2626;
  --nomi-red-light: #fee2e2;
  --nomi-red-subtle: #fef2f2;
  --nomi-amber: #f59e0b;
  --nomi-amber-light: #fef3c7;
  --surface: #fafaf9;
  --surface-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
}

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

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--surface);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* Header */
.header {
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-light);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.88);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.header-logo {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.header-title {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.3px;
}

.header-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.header-cta {
  background: var(--nomi-green);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.header-cta:hover {
  background: var(--nomi-green-dark);
  transform: translateY(-1px);
}

/* Container */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

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

.breadcrumb a:hover {
  color: var(--nomi-green-dark);
}

.breadcrumb svg {
  width: 14px;
  height: 14px;
  opacity: 0.4;
}

/* Product Hero */
.product-hero {
  background: var(--surface-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: fadeUp 0.5s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.product-image-area {
  background: linear-gradient(145deg, #f8faf8, #f0f4f0);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 280px;
}

.product-image-area::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 80%, rgba(34,197,94,0.06), transparent 70%);
}

.product-image {
  width: 200px;
  height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.1));
  position: relative;
  z-index: 1;
}

.product-image-placeholder {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.product-image-placeholder svg {
  width: 64px;
  height: 64px;
  color: var(--nomi-green);
  opacity: 0.5;
}

.product-info {
  padding: 28px 28px 32px;
}

.product-brand {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.product-name {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.product-barcode {
  font-size: 13px;
  color: var(--text-muted);
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  margin-bottom: 20px;
}

/* NOVA Badge */
.nova-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
}

.nova-badge--safe {
  background: var(--nomi-green-light);
  color: var(--nomi-green-dark);
}

.nova-badge--upf {
  background: var(--nomi-red-light);
  color: var(--nomi-red-dark);
}

.nova-badge__icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nova-badge--safe .nova-badge__icon {
  background: var(--nomi-green);
  color: white;
}

.nova-badge--upf .nova-badge__icon {
  background: var(--nomi-red);
  color: white;
}

.nova-badge__icon svg {
  width: 14px;
  height: 14px;
}

/* Cards */
.card {
  background: var(--surface-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-top: 16px;
  overflow: hidden;
  animation: fadeUp 0.5s ease-out both;
}

.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.16s; }
.card:nth-child(4) { animation-delay: 0.24s; }

.card-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header__icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-header__icon svg {
  width: 18px;
  height: 18px;
}

.card-header__icon--green {
  background: var(--nomi-green-light);
  color: var(--nomi-green-dark);
}

.card-header__icon--red {
  background: var(--nomi-red-light);
  color: var(--nomi-red-dark);
}

.card-header__icon--amber {
  background: var(--nomi-amber-light);
  color: var(--nomi-amber);
}

.card-header__icon--gray {
  background: var(--border-light);
  color: var(--text-secondary);
}

.card-header__title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.card-body {
  padding: 14px 24px 22px;
}

/* Classification Card */
.classification-card--safe {
  border-left: 3px solid var(--nomi-green);
}

.classification-card--upf {
  border-left: 3px solid var(--nomi-red);
}

.classification-summary {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.classification-nova-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 12px;
  padding: 4px 10px;
  background: var(--border-light);
  border-radius: 100px;
}

/* Ingredients */
.ingredients-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ingredient-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--border-light);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  transition: all 0.15s;
}

.ingredient-chip:hover {
  background: #e9eaed;
}

.ingredient-chip--flagged {
  background: var(--nomi-red-subtle);
  color: var(--nomi-red-dark);
  border: 1px solid rgba(239,68,68,0.15);
}

.ingredient-chip--flagged::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--nomi-red);
  border-radius: 50%;
  flex-shrink: 0;
}

.ingredient-chip--safe {
  background: var(--nomi-green-subtle);
  color: var(--nomi-green-dark);
}

/* Allergens */
.allergen-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.allergen-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--nomi-amber-light);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  color: #92400e;
}

.allergen-tag svg {
  width: 14px;
  height: 14px;
}

/* NOVA Explainer */
.nova-scale {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}

.nova-step {
  flex: 1;
  padding: 10px 8px;
  border-radius: var(--radius-xs);
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  position: relative;
  transition: all 0.2s;
  cursor: default;
}

.nova-step span {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: white;
  margin-bottom: 2px;
}

.nova-1 { background: #22c55e; }
.nova-2 { background: #84cc16; }
.nova-3 { background: #f59e0b; }
.nova-4 { background: #ef4444; }

.nova-step--active {
  transform: scale(1.05);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  z-index: 1;
}

.nova-step--inactive {
  opacity: 0.35;
}

.nova-description {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Footer CTA */
.footer-cta {
  margin-top: 32px;
  background: linear-gradient(135deg, #065f46, #064e3b);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.5s ease-out 0.3s both;
}

.footer-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(34,197,94,0.2), transparent 70%);
  pointer-events: none;
}

.footer-cta h3 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
  position: relative;
}

.footer-cta p {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 20px;
  position: relative;
}

.footer-cta-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
  border: none;
  cursor: pointer;
}

.footer-btn--primary {
  background: white;
  color: #065f46;
}

.footer-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.footer-btn--secondary {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.25);
}

.footer-btn--secondary:hover {
  background: rgba(255,255,255,0.25);
}

.footer-btn svg {
  width: 16px;
  height: 16px;
}

/* Disclaimer */
.disclaimer {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
  padding: 0 20px;
}

/* Footer */
.site-footer {
  margin-top: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.site-footer-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.site-footer-links a {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.site-footer-links a:hover {
  color: var(--nomi-green-dark);
}

.site-footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}

/* Error / Not Found Pages */
.error-page {
  text-align: center;
  padding: 60px 20px;
  max-width: 500px;
  margin: 0 auto;
}

.error-icon {
  width: 80px;
  height: 80px;
  background: var(--nomi-green-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 36px;
}

.error-title {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}

.error-message {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.error-card {
  background: var(--surface-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
  text-align: left;
}

.error-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.error-card ul {
  list-style: none;
  padding: 0;
}

.error-card li {
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.error-card li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--nomi-green);
  border-radius: 50%;
  flex-shrink: 0;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--nomi-green);
  color: white;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary:hover {
  background: var(--nomi-green-dark);
  transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 480px) {
  .container { padding: 20px 16px 60px; }
  .product-info { padding: 22px 20px 26px; }
  .product-name { font-size: 22px; }
  .card-body { padding: 12px 20px 18px; }
  .card-header { padding: 16px 20px 0; }
  .product-image-area { padding: 32px 20px; min-height: 220px; }
  .product-image, .product-image-placeholder { width: 160px; height: 160px; }
  .nova-step { font-size: 10px; padding: 8px 4px; }
  .nova-step span { font-size: 14px; }
  .footer-cta { padding: 24px 20px; }
  .footer-btn { padding: 10px 18px; font-size: 13px; }
  .error-page { padding: 40px 16px; }
}
