/* ============================================================
   AlimentCheck — Design System "Organic Clinical"
   Nature meets science. Warm, trustworthy, premium health.
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Nutri-Score (couleurs officielles) */
    --ns-a: #038141;
    --ns-b: #85BB2F;
    --ns-c: #FECB02;
    --ns-d: #EE8100;
    --ns-e: #E63E11;

    /* NOVA */
    --nova-1: #038141;
    --nova-2: #85BB2F;
    --nova-3: #EE8100;
    --nova-4: #E63E11;

    /* Éco-Score */
    --eco-a: #1E8F4E;
    --eco-b: #60AC0E;
    --eco-c: #FECB02;
    --eco-d: #EF7F1A;
    --eco-e: #E63E11;

    /* Risque additifs */
    --risk-safe: #038141;
    --risk-limited: #85BB2F;
    --risk-caution: #EE8100;
    --risk-avoid: #E63E11;

    /* Identité — palette organique/clinique */
    --primary: #0C7C82;
    --primary-light: #0E959D;
    --primary-dark: #095B5F;
    --primary-glow: rgba(12, 124, 130, 0.12);
    --accent: #34D399;
    --accent-warm: #F59E0B;
    --accent-rose: #F472B6;

    /* Surfaces */
    --bg: #FAFBFC;
    --bg-alt: #F0F4F3;
    --bg-card: #FFFFFF;
    --bg-hero: linear-gradient(135deg, #F0FDF9 0%, #ECFDF5 30%, #F0F9FF 70%, #FAFBFC 100%);
    --surface: #FFFFFF;
    --border: rgba(0, 0, 0, 0.06);
    --border-strong: rgba(0, 0, 0, 0.12);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.06);

    /* Texte */
    --text: #1A1A2E;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --text-inverse: #FFFFFF;

    /* Typographie */
    --font-heading: 'Instrument Serif', Georgia, serif;
    --font-body: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-2xs: 0.125rem;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Layout */
    --container-max: 1200px;
    --radius-xs: 4px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration: 250ms;
    --duration-slow: 400ms;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
    --bg: #0C1222;
    --bg-alt: #151D30;
    --bg-card: #1A2438;
    --bg-hero: linear-gradient(135deg, #0C1222 0%, #0F1A2E 30%, #101828 70%, #0C1222 100%);
    --surface: #1A2438;
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4), 0 4px 10px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.5);
    --text: #E2E8F0;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-inverse: #0C1222;
    --primary-glow: rgba(14, 149, 157, 0.15);
}

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

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

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--duration-fast) ease;
}
a:hover {
    color: var(--primary-light);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
}

table {
    border-collapse: collapse;
    width: 100%;
}

/* --- Accessibility --- */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    z-index: 9999;
    background: var(--primary);
    color: var(--text-inverse);
    padding: var(--space-sm) var(--space-lg);
    border-radius: 0 0 var(--radius) var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
    transition: top var(--duration) var(--ease-out);
    text-decoration: none;
}
.skip-to-content:focus {
    top: 0;
    text-decoration: none;
    color: var(--text-inverse);
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

:focus:not(:focus-visible) {
    outline: none;
}

/* --- Typographie --- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--text);
    line-height: 1.15;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: var(--space-lg);
}
h2 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    margin-bottom: var(--space-md);
    margin-top: var(--space-2xl);
}
h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
    margin-top: var(--space-xl);
}
h4 {
    font-size: 1.05rem;
    margin-bottom: var(--space-sm);
    margin-top: var(--space-lg);
}

p { margin-bottom: var(--space-md); }

/* --- Layout --- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* --- Staggered Fade-In Animation --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp var(--duration-slow) var(--ease-out) both;
}

.delay-1 { animation-delay: 80ms; }
.delay-2 { animation-delay: 160ms; }
.delay-3 { animation-delay: 240ms; }
.delay-4 { animation-delay: 320ms; }
.delay-5 { animation-delay: 400ms; }

/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */
.site-header {
    background: rgba(250, 251, 252, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: var(--space-sm) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow var(--duration) ease;
}

[data-theme="dark"] .site-header {
    background: rgba(12, 18, 34, 0.88);
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.site-logo {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-shrink: 0;
}
.site-logo:hover {
    text-decoration: none;
    color: var(--primary-light);
}
.site-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

/* Desktop navigation */
.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.site-nav a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius);
    transition: all var(--duration-fast) ease;
    white-space: nowrap;
}
.site-nav a:hover {
    color: var(--primary);
    background: var(--primary-glow);
    text-decoration: none;
}
.site-nav a.active {
    color: var(--primary);
    background: var(--primary-glow);
    font-weight: 600;
}

/* Header search */
.nav-search {
    position: relative;
    margin-left: var(--space-xs);
}

.nav-search input {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    padding: 0.45rem 1rem 0.45rem 2.4rem;
    font-size: 0.8125rem;
    font-family: var(--font-body);
    background: var(--bg-alt);
    color: var(--text);
    width: 220px;
    transition: all var(--duration) var(--ease-out);
}
.nav-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    width: 300px;
    background: var(--surface);
}
.nav-search input::placeholder {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.nav-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Dark mode toggle */
.theme-toggle {
    background: var(--bg-alt);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: all var(--duration-fast) ease;
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: var(--primary-glow);
    color: var(--primary);
    border-color: var(--primary);
}

/* === Hamburger Menu (Mobile) === */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    padding: 6px;
    border-radius: var(--radius);
    position: relative;
    z-index: 201;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    margin: 5px auto;
    transition: all var(--duration) var(--ease-out);
}

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

/* Mobile navigation overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 199;
    opacity: 0;
    transition: opacity var(--duration) ease;
}
.mobile-nav-overlay.active {
    opacity: 1;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: min(320px, 85vw);
    height: 100vh;
    background: var(--surface);
    z-index: 200;
    padding: 5rem var(--space-xl) var(--space-xl);
    transition: right var(--duration-slow) var(--ease-out);
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}
.mobile-nav.open {
    right: 0;
}

.mobile-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-sm);
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    transition: all var(--duration-fast) ease;
}
.mobile-nav a:hover {
    color: var(--primary);
    background: var(--primary-glow);
    text-decoration: none;
}

.mobile-nav .mobile-search {
    margin-bottom: var(--space-lg);
}
.mobile-nav .mobile-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: var(--bg-alt);
    color: var(--text);
    font-family: var(--font-body);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
main {
    min-height: calc(100vh - 140px);
    padding: var(--space-xl) 0 var(--space-3xl);
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-muted);
    transition: color var(--duration-fast) ease;
}
.breadcrumb a:hover {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb .separator {
    margin: 0 0.15rem;
    opacity: 0.5;
}

/* ============================================================
   CARDS — Base card system
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow);
    transition: all var(--duration) var(--ease-out);
    position: relative;
}

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

.card-flat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

/* ============================================================
   HERO SECTION (Homepage)
   ============================================================ */
.hero {
    background: var(--bg-hero);
    border-radius: var(--radius-xl);
    padding: var(--space-4xl) var(--space-2xl);
    text-align: center;
    margin-bottom: var(--space-3xl);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -15%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(12, 124, 130, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: var(--space-md);
    position: relative;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto var(--space-xl);
    line-height: 1.7;
    position: relative;
}

/* Hero search bar */
.hero-search {
    max-width: 540px;
    margin: 0 auto;
    position: relative;
}

.hero-search input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3rem;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-family: var(--font-body);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-md);
    transition: all var(--duration) var(--ease-out);
}
.hero-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-lg), 0 0 0 4px var(--primary-glow);
}
.hero-search input::placeholder {
    color: var(--text-muted);
}

.hero-search-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.hero-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
    font-size: 0.8rem;
    color: var(--text-muted);
    position: relative;
}
.hero-badges span {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all var(--duration) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--duration) ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.kpi-card:hover::after {
    opacity: 1;
}

.kpi-card .kpi-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--primary);
    line-height: 1.2;
}

.kpi-card .kpi-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: var(--space-xs);
    font-weight: 500;
}

/* ============================================================
   CATEGORY CARD (Homepage)
   ============================================================ */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xl) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: all var(--duration) var(--ease-out);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.category-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    text-decoration: none;
    color: inherit;
}

.category-card .cat-icon {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: var(--space-2xs);
}

.category-card .cat-name {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.category-card .cat-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================================
   FILTER BADGES / LABEL BADGES
   ============================================================ */
.label-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--bg-alt);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    transition: all var(--duration-fast) ease;
    text-decoration: none;
    cursor: pointer;
}

.label-badge:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-glow);
    text-decoration: none;
    transform: translateY(-1px);
}

.label-badge.bio { border-color: #4caf50; color: #2e7d32; background: rgba(76, 175, 80, 0.08); }
.label-badge.bio:hover { background: rgba(76, 175, 80, 0.15); }
.label-badge.vegan { border-color: #66bb6a; color: #388e3c; background: rgba(102, 187, 106, 0.08); }
.label-badge.vegan:hover { background: rgba(102, 187, 106, 0.15); }

[data-theme="dark"] .label-badge.bio { color: #81c784; background: rgba(76, 175, 80, 0.12); }
[data-theme="dark"] .label-badge.vegan { color: #a5d6a7; background: rgba(102, 187, 106, 0.12); }

/* ============================================================
   NUTRI-SCORE BADGE
   ============================================================ */
.nutriscore {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-weight: 700;
    font-size: 0.75rem;
}

.nutriscore .ns-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-xs);
    color: white;
    font-size: 0.8rem;
    opacity: 0.25;
    transition: all var(--duration) var(--ease-spring);
}

.nutriscore .ns-letter.active {
    opacity: 1;
    transform: scale(1.3);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nutriscore .ns-a { background: var(--ns-a); }
.nutriscore .ns-b { background: var(--ns-b); }
.nutriscore .ns-c { background: var(--ns-c); color: #333; }
.nutriscore .ns-d { background: var(--ns-d); }
.nutriscore .ns-e { background: var(--ns-e); }

/* Large variant (product page) */
.nutriscore-lg .ns-letter {
    width: 38px;
    height: 38px;
    font-size: 1.05rem;
}

/* ============================================================
   NOVA BADGE
   ============================================================ */
.nova-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    color: white;
    letter-spacing: 0.01em;
}

.nova-1 { background: var(--nova-1); }
.nova-2 { background: var(--nova-2); }
.nova-3 { background: var(--nova-3); }
.nova-4 { background: var(--nova-4); }

/* Small NOVA pill for product cards */
.nova-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.02em;
}

/* ============================================================
   SCORES GRID (Above the fold — product page)
   ============================================================ */
.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.score-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-sm);
    text-align: center;
    transition: all var(--duration) var(--ease-out);
}

.score-card:hover {
    box-shadow: var(--shadow-md);
}

.score-card .score-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-xs);
    font-weight: 500;
}

.score-card .score-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

/* --- Sticky Score Bar (product page scroll) --- */
.sticky-scores {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99;
    background: rgba(250, 251, 252, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: var(--space-xs) 0;
    transform: translateY(-100%);
    transition: transform var(--duration) var(--ease-out);
    box-shadow: var(--shadow-md);
}

.sticky-scores.visible {
    transform: translateY(0);
}

[data-theme="dark"] .sticky-scores {
    background: rgba(12, 18, 34, 0.95);
}

.sticky-scores .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.sticky-scores .sticky-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.sticky-scores .sticky-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-shrink: 0;
}

/* ============================================================
   NUTRITION TABLE
   ============================================================ */
.nutrition-table {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-xl);
}

.nutrition-table thead {
    background: var(--bg-alt);
}

.nutrition-table th,
.nutrition-table td {
    padding: 0.65rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.nutrition-table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

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

.nutrition-table tr:hover {
    background: var(--primary-glow);
}

.nutrition-table .indent {
    padding-left: 2rem;
    color: var(--text-secondary);
}

/* ============================================================
   NUTRIENT BARS (visual gauges)
   ============================================================ */
.nutrient-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.nutrient-bar .bar-label {
    width: 110px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    font-weight: 500;
}

.nutrient-bar .bar-track {
    flex: 1;
    height: 10px;
    background: var(--bg-alt);
    border-radius: var(--radius-full);
    position: relative;
    overflow: hidden;
}

.nutrient-bar .bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.8s var(--ease-out);
    position: relative;
}

.nutrient-bar .bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent 60%, rgba(255,255,255,0.25));
    border-radius: var(--radius-full);
}

.nutrient-bar .bar-value {
    width: 65px;
    text-align: right;
    font-size: 0.82rem;
    font-weight: 600;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   ADDITIVE PILLS
   ============================================================ */
.additive-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
    transition: all var(--duration-fast) ease;
    border: 1px solid transparent;
}
.additive-pill:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.additive-pill.safe { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.additive-pill.limited { background: #fff8e1; color: #f57f17; border-color: #ffecb3; }
.additive-pill.caution { background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.additive-pill.avoid { background: #ffebee; color: #c62828; border-color: #ffcdd2; }

[data-theme="dark"] .additive-pill.safe { background: rgba(46, 125, 50, 0.2); color: #a5d6a7; border-color: rgba(46, 125, 50, 0.3); }
[data-theme="dark"] .additive-pill.limited { background: rgba(245, 127, 23, 0.2); color: #ffcc80; border-color: rgba(245, 127, 23, 0.3); }
[data-theme="dark"] .additive-pill.caution { background: rgba(230, 81, 0, 0.2); color: #ffab91; border-color: rgba(230, 81, 0, 0.3); }
[data-theme="dark"] .additive-pill.avoid { background: rgba(198, 40, 40, 0.2); color: #ef9a9a; border-color: rgba(198, 40, 40, 0.3); }

/* ============================================================
   PRODUCT CARD (réutilisable)
   ============================================================ */
.product-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--duration) var(--ease-out);
    text-decoration: none;
    color: inherit;
    position: relative;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.product-card .pc-image-wrap {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card .pc-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-card .pc-placeholder {
    font-size: 1.5rem;
    opacity: 0.3;
}

.product-card .pc-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-card .pc-name {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.product-card .pc-brand {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.product-card .pc-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.78rem;
}

.product-card .pc-kcal {
    color: var(--text-muted);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   VERDICT BOX (product page)
   ============================================================ */
.verdict-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-2xl);
    position: relative;
    overflow: hidden;
}

.verdict-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
}

.verdict-box.grade-a::before { background: var(--ns-a); }
.verdict-box.grade-b::before { background: var(--ns-b); }
.verdict-box.grade-c::before { background: var(--ns-c); }
.verdict-box.grade-d::before { background: var(--ns-d); }
.verdict-box.grade-e::before { background: var(--ns-e); }

.verdict-pros { color: var(--ns-a); font-weight: 600; }
.verdict-cons { color: var(--ns-e); font-weight: 600; }

/* ============================================================
   COMPARE BUTTON
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--duration) var(--ease-out);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(12, 124, 130, 0.25);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(12, 124, 130, 0.35);
    text-decoration: none;
    color: var(--text-inverse);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary-glow);
    transform: translateY(-1px);
    text-decoration: none;
    color: var(--primary);
}

.btn-ghost {
    background: var(--bg-alt);
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
    background: var(--primary-glow);
    color: var(--primary);
    border-color: var(--primary);
    text-decoration: none;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

/* ============================================================
   COMPARISON TABLE
   ============================================================ */
.comparison-table {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.comparison-table th {
    background: var(--bg-alt);
    font-weight: 600;
    text-align: center;
}

.comparison-table th:first-child {
    text-align: left;
}

.comparison-table tr:hover {
    background: var(--primary-glow);
}

.comparison-table .winner,
.winner {
    background: rgba(3, 129, 65, 0.06);
    font-weight: 600;
    color: var(--ns-a);
}

.loser {
    color: var(--text-muted);
}

/* ============================================================
   SEARCH DROPDOWN (autocomplete)
   ============================================================ */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    display: none;
    z-index: 110;
    max-height: 420px;
    overflow-y: auto;
    margin-top: var(--space-xs);
}

.search-dropdown .search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border);
    transition: background var(--duration-fast) ease;
}

.search-dropdown .search-result-item:hover,
.search-dropdown .search-result-item.kb-active {
    background: var(--primary-glow);
}

.search-dropdown .search-result-item:last-child {
    border-bottom: none;
}

.search-dropdown .sr-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    flex-shrink: 0;
}

.search-dropdown .sr-name {
    font-weight: 500;
    font-size: 0.88rem;
}

.search-dropdown .sr-brand {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    color: var(--text-muted);
    font-size: 0.85rem;
    gap: var(--space-sm);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-2xl);
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--duration-fast) ease;
    font-weight: 500;
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-glow);
    text-decoration: none;
}

.pagination .current {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(12, 124, 130, 0.25);
}

.pagination .dots {
    border: none;
    color: var(--text-muted);
}

/* ============================================================
   FAQ SECTION
   ============================================================ */
.faq-section {
    margin-top: var(--space-2xl);
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    transition: all var(--duration-fast) ease;
    overflow: hidden;
}

.faq-item:hover {
    border-color: var(--border-strong);
}

.faq-item[open] {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary-glow);
}

.faq-item summary {
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    transition: background var(--duration-fast) ease;
}

.faq-item summary:hover {
    background: var(--primary-glow);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: transform var(--duration) var(--ease-out);
    flex-shrink: 0;
    margin-left: var(--space-md);
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
    color: var(--primary);
}

.faq-item .faq-answer {
    padding: 0 var(--space-lg) var(--space-lg);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.75;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: var(--space-3xl) 0 var(--space-xl);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--space-3xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-col h4 {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.footer-col p {
    line-height: 1.65;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    font-size: 0.82rem;
    transition: color var(--duration-fast) ease;
}
.footer-col a:hover {
    color: var(--primary);
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

.footer-bottom .attribution {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.footer-bottom .attribution a {
    display: inline;
    margin: 0;
}

/* ============================================================
   SECTION HEADINGS — with decorative line
   ============================================================ */
.section-heading {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    margin-top: var(--space-2xl);
}

.section-heading h2 {
    margin: 0;
    white-space: nowrap;
}

.section-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-strong), transparent);
}

/* ============================================================
   DISCOVER LINKS (product page bottom)
   ============================================================ */
.discover-box {
    margin-top: var(--space-2xl);
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.discover-box h3 {
    margin-top: 0;
    margin-bottom: var(--space-md);
}

/* ============================================================
   DISTRIBUTION BAR (brand page)
   ============================================================ */
.nutriscore-distribution {
    display: flex;
    gap: 3px;
    height: 36px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.nutriscore-distribution > div {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.72rem;
    min-width: 28px;
    transition: flex-grow var(--duration) var(--ease-out);
}

/* ============================================================
   404 PAGE
   ============================================================ */
.page-404 {
    text-align: center;
    padding: var(--space-4xl) 0;
}

.page-404 .error-code {
    font-size: 6rem;
    font-family: var(--font-heading);
    color: var(--primary);
    opacity: 0.2;
    line-height: 1;
    margin-bottom: var(--space-md);
}

/* ============================================================
   EDITORIAL CONTENT
   ============================================================ */
.editorial {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.editorial p {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* ============================================================
   RESPONSIVE — Tablet (768–1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

    .nav-search input {
        width: 180px;
    }
    .nav-search input:focus {
        width: 240px;
    }
}

/* ============================================================
   RESPONSIVE — Mobile (< 768px)
   ============================================================ */
@media (max-width: 768px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }

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

    /* Hide desktop nav, show hamburger */
    .site-nav {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .mobile-nav {
        display: block;
    }

    .mobile-nav-overlay {
        display: block;
    }

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

    .grid-3, .grid-4 {
        grid-template-columns: 1fr 1fr;
    }

    /* Hero */
    .hero {
        padding: var(--space-2xl) var(--space-md);
        border-radius: var(--radius-lg);
    }

    .hero-badges {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    /* Scores */
    .scores-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    /* Comparison */
    .comparison-table {
        font-size: 0.78rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem 0.6rem;
    }

    /* Footer */
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }

    /* Sticky scores hide on mobile — too cramped */
    .sticky-scores {
        display: none;
    }

    /* Product card layout */
    .product-card .pc-image-wrap {
        width: 64px;
        height: 64px;
    }
}

@media (max-width: 480px) {
    .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

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

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

    .hero-badges {
        flex-direction: column;
        gap: var(--space-xs);
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    .site-header, .site-footer, .breadcrumb, .sticky-scores,
    .theme-toggle, .hamburger, .mobile-nav, .mobile-nav-overlay { display: none !important; }
    body { background: white; color: black; }
    .card, .product-card, .kpi-card, .score-card { box-shadow: none; border: 1px solid #ccc; }
}
