/* ==========================================================================
   baumheilkraft.com — Design-System «Organic Modern»
   1 Tokens · 2 Reset/Basis · 3 Typografie · 4 Layout · 5 Komponenten
   6 Header · 7 Footer · 8 Utilities
   ========================================================================== */

/* 1 ── Design-Tokens */
:root {
  /* Farben (Spec 3.1) */
  --c-primary: #2D4A32;        /* tiefes Waldgrün: Header, Buttons, Links */
  --c-primary-dark: #223826;   /* Hover/aktiv */
  --c-secondary: #8FAE8B;      /* Salbei: Akzente, Tags */
  --c-secondary-soft: #DCE7DA; /* Salbei aufgehellt: Chips, Hover-Flächen */
  --c-bg: #FDF9F6;             /* warmes Creme — exakt der Logo-Hintergrund */
  --c-surface: #EFE8DA;        /* Sand: Karten, alternierende Sektionen */
  --c-accent: #8B5E3C;         /* Erde: Preise, Zitate — sparsam */
  --c-text: #2B2B26;           /* dunkles Graubraun */
  --c-text-muted: #5C5C52;
  --c-border: #DDD5C4;
  --c-white: #FFFFFF;
  --c-error: #A23B3B;
  --c-success: #3E6B46;

  /* Typografie */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --fs-300: clamp(0.83rem, 0.8rem + 0.15vw, 0.92rem);
  --fs-400: clamp(1rem, 0.95rem + 0.25vw, 1.13rem);   /* Fliesstext */
  --fs-500: clamp(1.13rem, 1.05rem + 0.4vw, 1.35rem);
  --fs-600: clamp(1.35rem, 1.2rem + 0.75vw, 1.75rem);  /* h3 */
  --fs-700: clamp(1.65rem, 1.4rem + 1.25vw, 2.3rem);   /* h2 */
  --fs-800: clamp(2.1rem, 1.7rem + 2vw, 3.2rem);       /* h1 */
  --fs-900: clamp(2.5rem, 1.9rem + 3vw, 4.2rem);       /* Hero */
  --lh-tight: 1.15;
  --lh-body: 1.65;

  /* Raum & Form */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 1rem;
  --space-4: 1.5rem;  --space-5: 2.5rem; --space-6: 4rem; --space-7: 6rem;
  --radius-s: 8px; --radius-m: 16px; --radius-pill: 999px;
  --shadow-s: 0 1px 3px rgb(43 43 38 / 0.08), 0 4px 14px rgb(43 43 38 / 0.06);
  --shadow-m: 0 2px 6px rgb(43 43 38 / 0.10), 0 12px 32px rgb(43 43 38 / 0.10);
  --content-max: 72rem;          /* ~1200px */
  --content-narrow: 46rem;       /* Lesetexte */
  --transition: 200ms ease;
}

/* ── Breakpoints (Konvention) ──────────────────────────────────────────────
   Mobile-first: Basis-Styles gelten für Mobile; min-width-Queries bauen darauf
   auf. Reines CSS erlaubt keine Custom Properties in @media-Bedingungen — die
   Werte stehen daher literal in den Regeln, aber NUR diese zwei Punkte:

     640px   Mobile  → Tablet  : Karten-/Inhaltsraster werden mehrspaltig
     1024px  Tablet  → Desktop : volle Navigation statt Burger, Raster 3–4-spaltig
             (Gegenstück max-width 1023.98px = 1024px − 0.02 schaltet den Burger ein)

   Beim Schreiben neuer @media-Regeln ausschliesslich 640px / 1024px verwenden.
   ────────────────────────────────────────────────────────────────────────── */

/* 2 ── Reset & Basis */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-400);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: var(--radius-s);
}
::selection { background: var(--c-secondary); color: var(--c-white); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* 3 ── Typografie */
h1, h2, h3, .u-display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--c-primary);
  text-wrap: balance;
}
h1, .u-display { font-size: var(--fs-800); }
h2 { font-size: var(--fs-700); }
h3 { font-size: var(--fs-600); }
h4 { font-size: var(--fs-500); }
p, ul, ol { max-width: var(--content-narrow); }
p + p { margin-top: var(--space-3); }
a { color: var(--c-primary); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--c-accent); }
blockquote {
  font-family: var(--font-display);
  font-size: var(--fs-500);
  font-style: italic;
  color: var(--c-accent);
  border-left: 3px solid var(--c-secondary);
  padding-left: var(--space-4);
  margin-block: var(--space-4);
}
.u-lead { font-size: var(--fs-500); color: var(--c-text-muted); }
.u-eyebrow {
  font-size: var(--fs-300);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-accent);
}

/* 4 ── Layout */
.container {
  width: min(100% - 2.5rem, var(--content-max));
  margin-inline: auto;
}
/* Lese-Sektionen behalten dieselbe linke Kante wie volle Sektionen; nur die
   Textbreite wird auf angenehme Lesebreite begrenzt (linksbündig, nicht zentriert). */
.container--narrow > * { max-width: var(--content-narrow); }
.section { padding-block: var(--space-6); }
.section--alt { background: var(--c-surface); }
.grid { display: grid; gap: var(--space-4); }
.grid--cards { grid-template-columns: 1fr; }
@media (min-width: 640px)  { .grid--cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid--cards { grid-template-columns: repeat(3, 1fr); }
                             .grid--cards-4 { grid-template-columns: repeat(4, 1fr); } }
.section-divider { display: block; width: 100%; height: 56px; color: var(--c-surface); }
.section-divider--flip { transform: scaleY(-1); }
/* Zwei-Spalten-Raster (Text|Bild) — kollabiert auf Mobile, 2-spaltig ab 640px.
   Ergänzt für Startseite (Newsletter/Praxis); es gab keine generische 2-Spalten-Utility. */
.grid--two { grid-template-columns: 1fr; align-items: center; }
@media (min-width: 640px) { .grid--two { grid-template-columns: 1fr 1fr; } }
/* Karten-Raster als <ul> ohne Listen-Marker (Ergänzung Startseite). */
.grid--cards.u-list-reset { list-style: none; padding: 0; margin: 0; }
.u-rounded { border-radius: var(--radius-m); }

/* 5 ── Komponenten */
/* Skip-Link */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--c-primary); color: var(--c-white);
  padding: var(--space-2) var(--space-3); border-radius: 0 0 var(--radius-s) 0;
}
.skip-link:focus { left: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: var(--c-primary); color: var(--c-white);
  font-weight: 600; text-decoration: none; cursor: pointer;
  border: 2px solid var(--c-primary);
  border-radius: var(--radius-pill);
  padding: 0.65em 1.5em;
  transition: background var(--transition), color var(--transition),
              transform var(--transition), box-shadow var(--transition);
}
.btn:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark);
             color: var(--c-white); transform: translateY(-1px); box-shadow: var(--shadow-s); }
.btn--secondary { background: transparent; color: var(--c-primary); }
.btn--secondary:hover { background: var(--c-secondary-soft); color: var(--c-primary); }
.btn--small { padding: 0.4em 1em; font-size: var(--fs-300); }

/* Karten */
.card {
  position: relative;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-m); }
.card__media { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.card__body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.card__title { font-size: var(--fs-500); }
.card__title a { text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; } /* ganze Karte klickbar */
.card__footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.card__footer .btn, .card .chip { position: relative; z-index: 1; } /* über dem Stretched-Link */

/* Kategorie-Karten (Startseite): zentrierte, umbrechende Reihe — die letzte Zeile
   bleibt mittig statt als 3+2-Lücke; Titel zentriert für gleichmässige Kacheln. */
.cat-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(2, 1fr);
            list-style: none; padding: 0; margin: 0; }
@media (min-width: 640px)  { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(5, 1fr); } }
.cat-grid .card__body { text-align: center; justify-content: center; }
.cat-grid .card__title { font-size: var(--fs-400); }

/* Favicon der verlinkten Seite neben dem Link (Links-Seite): Icon bleibt links
   neben dem Text, auch wenn die Domain auf zwei Zeilen umbricht. */
.card__title a:has(.link-icon) { display: flex; align-items: center; gap: 0.5em; }
.link-icon { flex: 0 0 auto; width: 1.3em; height: 1.3em; border-radius: 3px; }

/* Gästebuch-Einträge: Zeilenumbrüche aus dem Eintragstext beibehalten */
.gb-eintrag p { white-space: pre-line; }
.price { font-weight: 700; color: var(--c-accent); font-size: var(--fs-500); }

/* Chips / Tags */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-1);
  background: var(--c-secondary-soft); color: var(--c-primary);
  font-size: var(--fs-300); font-weight: 600;
  border: 1px solid transparent; border-radius: var(--radius-pill);
  padding: 0.25em 0.9em; text-decoration: none; cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.chip:hover { border-color: var(--c-secondary); }
.chip[aria-pressed="true"], .chip--active { background: var(--c-primary); color: var(--c-white); }

/* Formulare */
.form-field { display: grid; gap: var(--space-1); margin-bottom: var(--space-3); }
.form-field > label { font-weight: 600; }
.form-field > label .req { color: var(--c-error); }
.input {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-s);
  padding: 0.6em 0.9em;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-secondary-soft); outline: none; }
.input--error { border-color: var(--c-error); }
.form-hint { font-size: var(--fs-300); color: var(--c-text-muted); }
.form-error { font-size: var(--fs-300); color: var(--c-error); font-weight: 600; }
.form-success {
  background: var(--c-secondary-soft); border: 1px solid var(--c-secondary);
  color: var(--c-success); border-radius: var(--radius-s);
  padding: var(--space-3); font-weight: 600;
}

/* Hero */
.hero { position: relative; isolation: isolate; color: var(--c-white);
        padding-block: var(--space-7); }
.hero__bg { position: absolute; inset: 0; z-index: -2; object-fit: cover;
            width: 100%; height: 100%; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1;
               background: linear-gradient(160deg, rgb(34 56 38 / 0.78), rgb(34 56 38 / 0.35)); }
.hero h1, .hero .u-display { color: var(--c-white); font-size: var(--fs-900); }
.hero .u-lead { color: rgb(255 255 255 / 0.88); }
.hero .u-eyebrow { color: var(--c-secondary-soft); }
/* Hero-Schlagwort-Liste (Regeneration · Stärkung · Förderung) ohne Listen-Marker */
.hero__pillars { list-style: none; padding: 0; margin-top: var(--space-3);
  display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Badge (Warenkorb-Zähler) */
.badge {
  display: inline-grid; place-items: center;
  min-width: 1.4em; height: 1.4em; padding-inline: 0.3em;
  background: var(--c-accent); color: var(--c-white);
  border-radius: var(--radius-pill);
  font-size: var(--fs-300); font-weight: 700; line-height: 1;
}
.badge:empty { display: none; }

/* 6 ── Header & Navigation */
.site-header {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 50;
}
.site-header__inner {
  display: flex; align-items: center; gap: var(--space-4);
  min-height: 4.25rem;
}
.site-logo {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--fs-600); color: var(--c-primary);
  text-decoration: none; line-height: 1; margin-right: auto;
}
.site-logo span { display: block; font-family: var(--font-body); font-weight: 400;
                  font-size: var(--fs-300); color: var(--c-text-muted); letter-spacing: 0.06em; }
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: var(--space-2); border-radius: var(--radius-s);
}
.nav-toggle__bar { display: block; width: 26px; height: 3px; margin: 5px 0;
  background: var(--c-primary); border-radius: 2px; transition: transform var(--transition), opacity var(--transition); }
.site-nav > ul { list-style: none; padding: 0; display: flex; align-items: center; gap: var(--space-1); max-width: none; }
.site-nav a {
  display: flex; align-items: center; text-decoration: none; font-weight: 600;
  padding: 0.5em 0.8em; border-radius: var(--radius-s); line-height: 1.2;
  white-space: nowrap;
  transition: background var(--transition);
}
.site-nav a:hover { background: var(--c-secondary-soft); color: var(--c-primary); }
.site-nav a[aria-current="page"] { background: var(--c-primary); color: var(--c-white); }
.nav-item--sub { position: relative; }
.nav-sub-toggle {
  background: none; border: none; cursor: pointer; font-weight: 600;
  padding: 0.5em 0.8em; border-radius: var(--radius-s); display: flex; align-items: center; gap: 0.3em;
  line-height: 1.2; white-space: nowrap; color: inherit; font-size: inherit;
}
.nav-sub-toggle::after { content: "▾"; font-size: 0.7em; }
.nav-sub-toggle:hover { background: var(--c-secondary-soft); }
.nav-sub-toggle--current { background: var(--c-primary); color: var(--c-white); }
.site-nav .nav-sub {
  list-style: none; padding: var(--space-2); margin: 0;
  position: absolute; top: 100%; left: 0; min-width: 13rem;
  background: var(--c-white); border: 1px solid var(--c-border);
  border-radius: var(--radius-s); box-shadow: var(--shadow-m);
  display: none; flex-direction: column;
}
.nav-item--sub[data-open="true"] .nav-sub { display: flex; }
.cart-link { display: flex; align-items: center; gap: var(--space-1); text-decoration: none; font-weight: 600;
             padding: 0.5em 0.8em; border-radius: var(--radius-s); }
.cart-link:hover { background: var(--c-secondary-soft); }
.nav-cart { margin-left: var(--space-4); }  /* etwas Abstand zum letzten Menüpunkt (Desktop) */

@media (max-width: 1023.98px) {
  .nav-toggle { display: block; }
  .nav-cart { margin-left: 0; }  /* im Burger-Menü bündig mit den anderen Punkten */
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--c-bg); border-bottom: 1px solid var(--c-border);
    display: none; padding: var(--space-3);
  }
  .site-nav[data-open="true"] { display: block; }
  .site-nav > ul { flex-direction: column; gap: 0; }
  .site-nav .nav-sub { position: static; box-shadow: none; border: none; background: transparent; padding-left: var(--space-4); }
}

/* 7 ── Footer */
.site-footer {
  background: var(--c-primary); color: rgb(255 255 255 / 0.85);
  padding-block: var(--space-6) var(--space-4);
  font-size: var(--fs-300);
}
.site-footer a { color: var(--c-white); }
.site-footer h2 { color: var(--c-white); font-size: var(--fs-500); margin-bottom: var(--space-2); }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: var(--space-1); }
.site-footer__grid { display: grid; gap: var(--space-5); }
@media (min-width: 640px) { .site-footer__grid { grid-template-columns: repeat(3, 1fr); } }
.site-footer__meta {
  margin-top: var(--space-5); padding-top: var(--space-3);
  border-top: 1px solid rgb(255 255 255 / 0.2);
  display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between;
}

/* Intro-Bildraster (Baumheilkunde): Figur = Bild + Caption (fetter Titel über
   kursivem/normalem Untertext). figure/figcaption hatten noch kein Styling;
   strong/em/span im Caption sind inline → hier als Blöcke gestapelt. */
figure { margin: 0; }
figure img { border-radius: var(--radius-m); width: 100%; }
figcaption { margin-top: var(--space-3); }
figcaption strong { display: block; font-family: var(--font-display);
  font-size: var(--fs-500); color: var(--c-primary); line-height: var(--lh-tight); }
figcaption em, figcaption span { display: block; margin-top: var(--space-2);
  color: var(--c-text-muted); }

/* Inhalts-Tabelle (Lieferländer/Versandkosten). Das Design-System hatte noch kein
   <table>-Styling; ergänzt für die Liefer- und Zahlungsbedingungen. */
.content-table {
  width: 100%;
  border-collapse: collapse;
  margin-block: var(--space-4);
  font-size: var(--fs-400);
}
.content-table caption {
  text-align: left;
  color: var(--c-text-muted);
  font-size: var(--fs-300);
  margin-bottom: var(--space-2);
}
.content-table th, .content-table td {
  padding: 0.55em 0.9em;
  border: 1px solid var(--c-border);
  text-align: left;
  vertical-align: top;
}
.content-table thead th { background: var(--c-surface); color: var(--c-primary); }
.content-table tbody th { font-weight: 600; color: var(--c-text); }
.content-table tbody tr:nth-child(even) { background: var(--c-surface); }

/* 8 ── Utilities */
.u-center { text-align: center; }
.u-muted { color: var(--c-text-muted); }
.u-mt-2 { margin-top: var(--space-2); } .u-mt-4 { margin-top: var(--space-4); }
.u-mb-4 { margin-bottom: var(--space-4); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---------- Shop ---------- */
.shop-filter { display: flex; flex-wrap: wrap; gap: var(--space-2, 1rem); align-items: center; margin-block: 1.5rem; }
.shop-filter__chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.shop-filter__suche { flex: 1 1 12rem; }
.shop-filter__sort { flex: 0 0 auto; }
.shop-count { margin-top: 0.5rem; }
.card__media-link { display: block; }
.card__media--placeholder { object-fit: contain; background: var(--c-surface); padding: 1rem; }
@media (min-width: 640px) { .shop-filter { flex-wrap: nowrap; } }

/* ---------- Produktdetail ---------- */
.breadcrumb { padding-block: 1rem; font-size: var(--fs-300, 0.9rem); }
.breadcrumb a { color: var(--c-primary); }
.produkt-detail { display: grid; gap: 2rem; }
.produkt-detail__media img { width: 100%; height: auto; border-radius: 16px; }
.produkt-detail__video video { width: 100%; border-radius: 12px; margin-top: 1rem; }
.produkt-detail__kauf { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-top: 1.5rem; }
.menge-input { width: 6rem; }
.produkt-detail__beschreibung { max-width: 46rem; }
@media (min-width: 1024px) {
  .produkt-detail { grid-template-columns: 1fr 1fr; align-items: start; }
  .produkt-detail__beschreibung { grid-column: 1 / -1; }
}

/* ---------- Warenkorb ---------- */
.warenkorb-zeile { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; align-items: center;
  padding-block: 1rem; border-bottom: 1px solid var(--c-border); }
.warenkorb-zeile__name { font-weight: 600; }
.warenkorb-zeile .menge-input { width: 5rem; }
.warenkorb-summe { margin-top: 1.5rem; }
.warenkorb-total { font-size: var(--fs-500, 1.2rem); }
.warenkorb-bestellung { margin-top: 2.5rem; max-width: 40rem; }
@media (min-width: 640px) {
  .warenkorb-zeile { grid-template-columns: 2fr 1fr 5rem 1fr auto; }
}

/* Blog-Teaser: max. 4 Zeilen, Rest abgeschnitten (Button-Ausrichtung via .card__footer) */
.blog-teaser { display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* Abstand unter jeder h1 (globaler *{margin:0}-Reset lässt Headings sonst am Folgeinhalt kleben) */
h1 { margin-bottom: var(--space-4); }

/* Produktbilder (hochformatige Flaschenfotos) nicht beschneiden: contain statt cover */
[data-produkt-grid] .card__media, [data-featured-grid] .card__media {
  object-fit: contain; background: var(--c-white); padding: 0.75rem;
}
