/* ═══════════════════════════════════════════════════════════
   wie-gesund-ist.de – Stylesheet
   Clean health portal · DM Sans + DM Serif Display
   ═══════════════════════════════════════════════════════════ */

/* ─── Custom Properties ─────────────────────────────────── */
:root {
    /* Colors */
    --green-50: #f0faf4;
    --green-100: #d1f2e0;
    --green-200: #a3e4c1;
    --green-500: #2d9f5f;
    --green-600: #237a49;
    --green-700: #1a5e38;
    --green-800: #134428;
    --green-900: #0d2e1b;

    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-500: #d97706;
    --amber-600: #b45309;

    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-500: #dc2626;
    --red-600: #b91c1c;

    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-500: #3b82f6;

    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    --white: #ffffff;
    --bg: #fafcfa;
    --text: var(--slate-800);
    --text-light: var(--slate-500);
    --text-muted: var(--slate-400);
    --border: var(--slate-200);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.06), 0 4px 6px rgba(0,0,0,.03);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;

    /* Score colors */
    --score-track: var(--slate-100);
}

.score-excellent { --score-color: #16a34a; }
.score-good     { --score-color: #65a30d; }
.score-ok       { --score-color: #d97706; }
.score-poor     { --score-color: #ea580c; }
.score-bad      { --score-color: #dc2626; }


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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a {
    color: var(--green-600);
    text-decoration: none;
    transition: color .15s ease;
}

a:hover { color: var(--green-700); }

h1, h2, h3 {
    font-family: 'Fraunces', 'Georgia', serif;
    font-weight: 400;
    line-height: 1.25;
    color: var(--slate-900);
}

ul, ol { list-style: none; }


/* ─── Layout ────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 800px;
}

main { flex: 1; }


/* ─── Header ────────────────────────────────────────────── */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,.92);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--green-700);
    letter-spacing: -.02em;
}

.logo:hover { color: var(--green-800); }

.logo-icon { color: var(--green-500); }

.main-nav {
    display: flex;
    gap: 24px;
}

.main-nav a {
    font-size: .875rem;
    font-weight: 500;
    color: var(--slate-600);
}

.main-nav a:hover { color: var(--green-600); }


/* ─── Hero ──────────────────────────────────────────────── */
.hero {
    background: linear-gradient(160deg, var(--green-50) 0%, var(--white) 50%, var(--green-50) 100%);
    padding: 72px 0 56px;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    color: var(--slate-900);
    margin-bottom: 16px;
}

.hero-dots { color: var(--green-500); }

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--slate-600);
    max-width: 640px;
    margin: 0 auto 36px;
    line-height: 1.6;
}


/* ─── Search ────────────────────────────────────────────── */
.search-wrapper {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--slate-400);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--slate-200);
    border-radius: 50px;
    background: var(--white);
    color: var(--text);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.search-input:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 4px rgba(45,159,95,.1);
}

.search-input::placeholder { color: var(--slate-400); }

.search-results {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 50;
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    color: var(--text);
    transition: background .1s;
}

.search-result-item:hover { background: var(--green-50); }

.search-result-name { font-weight: 500; }

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
    color: var(--text-light);
}

.search-no-result {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: .9rem;
}


/* ─── Section Titles ────────────────────────────────────── */
.section-title {
    font-size: 1.6rem;
    margin-bottom: 24px;
    padding-top: 8px;
}

.section-heading {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--slate-800);
}

.section-heading svg { color: var(--green-500); flex-shrink: 0; }


/* ─── Category Tiles ────────────────────────────────────── */
.categories-section {
    padding: 56px 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.category-tile {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    transition: transform .15s, box-shadow .15s, border-color .15s;
    cursor: pointer;
}

.category-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--green-200);
}

.category-tile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.category-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--green-50);
    border-radius: 8px;
    color: var(--green-600);
    font-size: 1.1rem;
}

.category-count {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--slate-100);
    padding: 2px 8px;
    border-radius: 12px;
}

.category-tile-name {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--slate-800);
}

.category-tile-top3 {
    font-size: .8rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ─── Food Grid & Cards ─────────────────────────────────── */
.recent-section,
.category-detail {
    padding: 48px 0;
}

.category-detail:nth-child(even) {
    background: var(--slate-50);
}

.category-section-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.category-count-inline {
    font-family: 'DM Sans', sans-serif;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.food-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

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

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

.food-card-img {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--slate-100);
}

.food-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.food-card:hover .food-card-img img {
    transform: scale(1.04);
}

.food-card-body {
    padding: 14px 16px 16px;
}

.food-card-name {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: .95rem;
    margin-bottom: 8px;
    color: var(--slate-800);
}

.food-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.food-card-category {
    font-size: .78rem;
    color: var(--text-muted);
}


/* ─── Score Badge ────────────────────────────────────────── */
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 2px 8px;
    font-size: .75rem;
    font-weight: 700;
    border-radius: 6px;
    color: var(--white);
    background: var(--score-color, var(--slate-400));
}


/* ─── Danger Badge ──────────────────────────────────────── */
.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-danger {
    width: 28px;
    height: 28px;
    background: rgba(220,38,38,.9);
    color: var(--white);
    border-radius: 50%;
    backdrop-filter: blur(4px);
}

.badge-danger-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--red-600);
    background: var(--red-50);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--red-100);
}


/* ─── Type Badge ────────────────────────────────────────── */
.type-badge {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 3px 10px;
    border-radius: 20px;
}

.type-natural {
    background: var(--green-50);
    color: var(--green-700);
    border: 1px solid var(--green-100);
}

.type-supplement {
    background: var(--blue-50);
    color: var(--blue-500);
    border: 1px solid var(--blue-100);
}


/* ════════════════════════════════════════════════════════
   DETAIL PAGE
   ════════════════════════════════════════════════════════ */

.detail-main {
    padding-bottom: 64px;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px 0;
    font-size: .82rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumb a { color: var(--slate-500); }
.breadcrumb a:hover { color: var(--green-600); }
.breadcrumb svg { color: var(--slate-300); flex-shrink: 0; }

/* Detail Hero */
.detail-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: center;
    margin-bottom: 40px;
}

.detail-hero-img {
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 3/2;
    background: var(--slate-100);
}

.detail-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.detail-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin-bottom: 8px;
}

.detail-latin {
    font-style: italic;
    color: var(--text-muted);
    font-size: .95rem;
}

/* Score Section */
.score-section {
    margin-bottom: 40px;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
}

.score-ring {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.score-ring svg { width: 100%; height: 100%; }

.score-number {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--score-color);
}

.score-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.score-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--score-color);
}

.score-max {
    font-size: .85rem;
    color: var(--text-muted);
}

/* Intro */
.intro-section {
    margin-bottom: 40px;
}

.intro-text {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--slate-700);
    border-left: 3px solid var(--green-200);
    padding-left: 20px;
}

/* Nutrients */
.nutrients-section {
    margin-bottom: 40px;
}

.nutrient-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.nutrient-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.nutrient-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--green-600);
    margin-bottom: 2px;
}

.nutrient-label {
    font-size: .78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Tags / Einsatzgebiete */
.tags-section {
    margin-bottom: 40px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--green-700);
    background: var(--green-50);
    border: 1px solid var(--green-100);
    border-radius: 50px;
    transition: background .15s, color .15s;
}

.tag-pill:hover {
    background: var(--green-100);
    color: var(--green-800);
}

/* Warnings */
.warnings-section {
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.warning-box {
    border-radius: var(--radius);
    padding: 20px;
}

.warning-danger {
    background: var(--red-50);
    border: 1px solid var(--red-100);
}

.warning-caution {
    background: var(--amber-50);
    border: 1px solid var(--amber-100);
}

.warning-intolerance {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
}

.warning-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.warning-danger .warning-title { color: var(--red-600); }
.warning-danger .warning-title svg { color: var(--red-500); }
.warning-caution .warning-title { color: var(--amber-600); }
.warning-caution .warning-title svg { color: var(--amber-500); }
.warning-intolerance .warning-title { color: var(--slate-700); }

.warning-box ul {
    list-style: disc;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.warning-box li {
    font-size: .88rem;
    line-height: 1.5;
    color: var(--slate-700);
}


/* ─── Medicine Section (Side-by-Side) ────────────────────── */
.medicine-section {
    margin-bottom: 40px;
}

.medicine-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.medicine-card {
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
}

.medicine-west {
    background: linear-gradient(135deg, var(--blue-50) 0%, var(--white) 100%);
    border-color: var(--blue-100);
}

.medicine-tcm {
    background: linear-gradient(135deg, var(--amber-50) 0%, var(--white) 100%);
    border-color: var(--amber-100);
}

.medicine-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.medicine-card-header h3 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: .9rem;
}

.medicine-west .medicine-card-header svg { color: var(--blue-500); }
.medicine-west .medicine-card-header h3 { color: var(--slate-700); }
.medicine-tcm .medicine-card-header svg { color: var(--amber-500); }
.medicine-tcm .medicine-card-header h3 { color: var(--slate-700); }

.medicine-text {
    font-size: .88rem;
    line-height: 1.65;
    color: var(--slate-600);
    margin-bottom: 16px;
}

.medicine-props {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.medicine-prop {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: .82rem;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,.05);
}

.medicine-prop:last-child { border-bottom: none; }

.prop-name {
    font-weight: 500;
    color: var(--slate-700);
}

.prop-value {
    color: var(--slate-500);
    text-align: right;
    max-width: 55%;
}


/* ─── Dosage ────────────────────────────────────────────── */
.dosage-section {
    margin-bottom: 40px;
}

.dosage-box {
    background: var(--green-50);
    border: 1px solid var(--green-100);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.dosage-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--green-700);
    margin-bottom: 6px;
}

.dosage-detail {
    font-size: .88rem;
    color: var(--slate-600);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}


/* ─── Kauftipps ─────────────────────────────────────────── */
.kauftipps-section {
    margin-bottom: 32px; /* Space before FAQ */
}

.kauftipps-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.kauftipps-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kauftipps-list li {
    position: relative;
    padding-left: 24px;
    font-size: .9rem;
    line-height: 1.6;
    color: var(--slate-700);
}

.kauftipps-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 8px;
    height: 8px;
    background: var(--green-500);
    border-radius: 50%;
}


/* ─── FAQ ────────────────────────────────────────────────── */
.faq-section {
    margin-bottom: 40px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color .15s;
}

.faq-item[open] {
    border-color: var(--green-200);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: .9rem;
    color: var(--slate-800);
    list-style: none;
    user-select: none;
}

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

.faq-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform .2s;
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px 16px;
}

.faq-answer p {
    font-size: .88rem;
    line-height: 1.65;
    color: var(--slate-600);
}


/* ─── Related ───────────────────────────────────────────── */
.related-section {
    margin-bottom: 40px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

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

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

.related-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.related-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px 4px;
}

.related-name {
    font-weight: 600;
    font-size: .85rem;
    color: var(--slate-800);
}

.related-reason {
    padding: 0 12px 10px;
    font-size: .75rem;
    color: var(--text-muted);
    line-height: 1.4;
}


/* ─── Disclaimer ────────────────────────────────────────── */
.disclaimer-section {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    margin-top: 8px;
}

.disclaimer-text {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: .78rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.disclaimer-text svg { flex-shrink: 0; margin-top: 1px; }


/* ─── Tag Page ──────────────────────────────────────────── */
.tag-main {
    padding: 0 0 64px;
}

.tag-title {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    margin-bottom: 8px;
}

.tag-subtitle {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 32px;
}


/* ─── Static Pages ──────────────────────────────────────── */
.static-main {
    padding: 48px 0 80px;
}

.static-main h1 {
    font-size: 2rem;
    margin-bottom: 32px;
}

.static-main h2 {
    font-size: 1.2rem;
    margin-top: 28px;
    margin-bottom: 10px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
}

.static-main p {
    line-height: 1.7;
    color: var(--slate-600);
    margin-bottom: 12px;
}


/* ─── Footer ────────────────────────────────────────────── */
.site-footer {
    background: var(--slate-900);
    color: var(--slate-400);
    padding: 40px 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
}

.footer-brand {
    font-weight: 600;
    color: var(--white);
    margin-bottom: 6px;
    font-size: .95rem;
}

.footer-disclaimer {
    font-size: .78rem;
    margin-bottom: 16px;
    color: var(--slate-500);
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-nav a {
    font-size: .82rem;
    color: var(--slate-400);
}

.footer-nav a:hover { color: var(--white); }


/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .container { padding: 0 16px; }

    .hero { padding: 48px 0 40px; }

    .detail-hero {
        grid-template-columns: 1fr;
        gap: 20px;
    }

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

    .food-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .score-display {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .main-nav { gap: 16px; }
    .main-nav a { font-size: .8rem; }

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

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

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

    .category-tile { padding: 14px; }

    .detail-title {
        font-size: 1.6rem;
    }
}


/* ═══════════════════════════════════════════════════════
   HOMEPAGE – v15 warm style
   ═══════════════════════════════════════════════════════ */

body.home {
    background: #f3efe6;
}

/* ─── Home Header (dark green bar) ───────────────────── */
.home-header {
    background: #3a7d44;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.home-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    gap: 24px;
}

.home-logo {
    font-family: 'Fraunces', 'Georgia', serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #a8dbb0;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -.02em;
}

.home-logo .logo-tld { color: #fff; }

.home-logo:hover { color: #a8dbb0; }

.home-search-wrapper {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.home-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,.5);
    pointer-events: none;
}

.home-search-input {
    width: 100%;
    padding: 9px 16px 9px 42px;
    font-size: .88rem;
    font-family: inherit;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,.15);
    color: #fff;
    outline: none;
    transition: background .2s;
}

.home-search-input:focus {
    background: rgba(255,255,255,.25);
}

.home-search-input::placeholder {
    color: rgba(255,255,255,.55);
}

.home-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    overflow: hidden;
    z-index: 200;
}

.home-search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 16px;
    color: var(--slate-800);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
    transition: background .1s;
}

.home-search-item:hover { background: var(--green-50); }

.home-search-no-result {
    padding: 14px 16px;
    text-align: center;
    color: var(--slate-400);
    font-size: .88rem;
}


/* ─── Filter Tabs ────────────────────────────────────── */
.filter-section {
    padding: 24px 0 8px;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tab {
    padding: 8px 18px;
    font-size: .85rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    border: 1.5px solid #c5bfb3;
    border-radius: 50px;
    background: transparent;
    color: #5a5549;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.filter-tab:hover {
    border-color: #3a7d44;
    color: #3a7d44;
}

.filter-tab.active {
    background: #3a7d44;
    border-color: #3a7d44;
    color: #fff;
}


/* ─── Home Food Grid ─────────────────────────────────── */
.home-grid-section {
    padding: 20px 0 64px;
}

.home-food-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.home-food-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--slate-800);
    background: #fff;
    border-radius: 14px;
    padding: 14px 14px 16px;
    transition: transform .15s, box-shadow .15s;
}

.home-food-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
}

.home-card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.home-score {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    color: #fff;
    background: var(--score-color, #94a3b8);
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

.home-danger-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 800;
    color: #fff;
    background: #dc2626;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

.home-card-name {
    font-family: 'Fraunces', 'Georgia', serif;
    font-size: .95rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
    color: #2c3e2d;
}

.home-no-results {
    text-align: center;
    padding: 48px 0;
    color: var(--slate-400);
    font-size: .95rem;
}


/* ─── Homepage Responsive ────────────────────────────── */
@media (max-width: 768px) {
    .home-header-inner { gap: 12px; }
    .home-logo { font-size: 1rem; }
    .home-search-wrapper { max-width: none; }

    .filter-tabs { gap: 6px; }
    .filter-tab { padding: 6px 14px; font-size: .8rem; }

    .home-food-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .home-food-card { padding: 10px 10px 12px; border-radius: 12px; }
    .home-score { width: 30px; height: 30px; font-size: .72rem; }
}

@media (max-width: 480px) {
    .home-food-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .home-food-card { padding: 8px 8px 10px; }
    .home-card-name { font-size: .78rem; }
    .home-score { width: 26px; height: 26px; font-size: .68rem; }
}
