/* sogo/kopf – Kopf nach DES-16 (Desktop B Spalten und Bild, Mobil C Bildraster). Quelle: Optimierungen/rahmen/02-header-megamenue/build.py,
   04-bausteine/build.py CSS_KOPF, build4-rahmen.py (Mobilregeln). Weltwerte --welt/--welt-hover/--akzent/--auf kommen inline vom Block. */
.sg-hd { position: sticky; top: 0; z-index: 50; background: var(--papier); color: var(--text); font-variant-numeric: tabular-nums; }
.sg-hd * { box-sizing: border-box; }
.sg-hd a { text-decoration: none; color: inherit; }
.sg-hd h2, .sg-hd h3, .sg-hd p { margin: 0; }
.sg-hd-in { max-width: 1280px; margin: 0 auto; padding: 0 48px; display: flex; align-items: center; }
.sg-hd-sg { border-bottom: 1px solid var(--linie); background: var(--papier); }
.sg-hd-sg .sg-hd-in { min-height: 63px; gap: 28px; }   /* Desktop 63 + 1 px Linie = 64, Weltzeile 56, Kopf gesamt 120 (Lukas 26.11.: luftiger; vorher 56 + 48 nach DES-16, am Handy weiter so) */
.sg-wort { font-weight: 800; font-size: 24px; line-height: 1; letter-spacing: -1px; color: var(--text); display: inline-flex; align-items: center; min-height: 44px; }
.sg-wort span { color: var(--welt, var(--text)); }
.sg-haupt { display: flex; gap: 4px; height: 64px; }
.sg-haupt a { display: flex; align-items: center; padding: 0 14px; font-weight: 500; font-size: 16px; line-height: 1; color: var(--text); }
.sg-haupt a:hover { background: var(--greige); }
.sg-haupt a[aria-current] { font-weight: 700; }   /* ohne Linien (Lukas 25.11.) */
.sg-haupt a.is-offen { background: var(--greige); }
.sg-akt { display: flex; gap: 4px; margin-left: auto; }
.sg-ib { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--text); border-radius: var(--radius, 6px); cursor: pointer; position: relative; padding: 0; font: inherit; }
.sg-ib:hover { background: var(--greige); }
.sg-ib--menu { display: none; }
.sg-z { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--text); color: #fff; font-weight: 700; font-size: 11px; line-height: 18px; }

/* Weltzeile; beim Scrollen schiebt sie sich weg, nur die sogo24-Zeile klebt (view.js setzt is-klein) */
.sg-wb { background: var(--welt); color: var(--auf); max-height: 56px; overflow: hidden; transition: max-height var(--dauer, 140ms) var(--ease, ease-out); }
.sg-hd.is-klein .sg-wb { max-height: 0; }
.sg-wb .sg-hd-in { gap: 24px; height: 56px; overflow: hidden; }
.sg-wb a:focus-visible { outline-color: var(--akzent); outline-offset: -2px; }
.sg-wlogo { flex: none; display: flex; align-items: center; min-height: 44px; font-weight: 700; font-size: 21px; line-height: 1; color: #fff; }
.sg-wlogo-img { display: block; width: 58px; height: 34px; }
.sg-kat { display: flex; gap: 4px; height: 100%; margin-left: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }   /* lange Kategoriezeilen (Waldin) scrollen statt zu überlaufen */
.sg-kat a { display: flex; align-items: center; gap: 6px; padding: 0 12px; font-weight: 500; font-size: 16px; line-height: 1; color: #fff; white-space: nowrap; }   /* weiß in beiden Welten (Lukas 26.11.) */
.sg-kat a:hover { background: var(--welt-hover); color: #fff; }
.sg-kat a[aria-current] { font-weight: 700; color: #fff; background: var(--welt-hover); }   /* ohne Linien (Lukas 25.11.) */
.sg-kat a.is-offen { background: var(--welt-hover); color: #fff; }
.sg-wb .sg-hd-in.is-eng .sg-alle { display: none; }
.sg-alle { margin-left: auto; flex: none; font-weight: 500; font-size: 14px; line-height: 1; color: #fff; display: flex; align-items: center; gap: 6px; white-space: nowrap; min-height: 44px; }

/* Panels (Desktop) */
.sg-panels { position: relative; z-index: 2; }
.sg-panel { position: absolute; left: 0; right: 0; top: 0; background: var(--papier); color: var(--text); border-bottom: 1px solid var(--linie); box-shadow: 0 16px 32px rgb(30 35 43 / 18%); z-index: 2; }
.sg-panel-in { display: block; padding-top: 40px; padding-bottom: 48px; }   /* luftiger, ohne Sätze (Lukas 26.11.) */
/* Panel-Kopf: hieß bis 08.11. .sg-pk und kollidierte mit der Produktkachel (.sg-pk p/a setzten Preis, Name und Knöpfe auf 15 px, Sichtprüfung SP-08) */
.sg-pkopf { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 28px; }
.sg-pkopf h2 { font-weight: 700; font-size: 24px; line-height: 1.1; color: var(--text); }
.sg-pkopf a { font-weight: 600; font-size: 15px; line-height: 1; color: var(--welt); display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.sg-panel-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 72px; }
.sg-spalten { display: grid; gap: 48px; }
.sg-spalte h3 { margin: 0 0 14px; font-weight: 600; font-size: 12px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; color: var(--text-leise); }
.sg-spalte a { display: flex; align-items: center; min-height: 44px; font-size: 16px; line-height: 1.3; color: var(--text); }
.sg-spalte a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sg-feature { display: flex; flex-direction: column; gap: 12px; }
.sg-bild { aspect-ratio: 4 / 3; border-radius: var(--radius, 6px); overflow: hidden; background: var(--greige); }
.sg-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sg-feature b { font-weight: 600; font-size: 16px; line-height: 1.3; }
.sg-feature span { font-size: 14px; line-height: 1.4; color: var(--text-leise); }
.sg-feature .sg-k { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; font-size: 15px; line-height: 1; color: var(--welt); }
.sg-kacheln { display: grid; gap: 28px; }
.sg-kachel { display: flex; flex-direction: column; gap: 14px; color: var(--text); }
.sg-kachel b { font-weight: 600; font-size: 17px; line-height: 1.3; }
.sg-kachel:hover b { text-decoration: underline; text-underline-offset: 3px; }
/* Ebenen im Kopf (wie Fassung DES-16 B): Abdunklung unter Kopfzeilen und Panel, nur die Seite wird abgedunkelt.
   Vorher lag .sg-dim (z 40) über allem: kein Panel-Link klickbar, kein Wechsel zwischen Auslösern (Sichtprüfung M1). */
.sg-dim { position: fixed; inset: 0; background: var(--overlay, rgb(30 35 43 / 38%)); z-index: 1; }
.sg-hd-sg, .sg-wb { position: relative; z-index: 3; }

/* Drawer (Mobil C) */
.sg-drawer { position: fixed; inset: 0; z-index: 60; background: var(--papier); color: var(--text); display: none; flex-direction: column; overflow-y: auto; }
.sg-drawer.is-offen, .sg-drawer:target { display: flex; }   /* :target = Fallback ohne JavaScript (Lehre 32) */
.sg-drawer-kopf { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--linie); font-weight: 700; font-size: 18px; line-height: 1; flex: none; }
.sg-tabs { display: flex; border-bottom: 1px solid var(--linie); flex: none; }
.sg-tabs button { flex: 1; display: flex; align-items: center; justify-content: center; height: 48px; font: inherit; font-weight: 600; font-size: 16px; line-height: 1; color: var(--text-leise); background: none; border: 0; box-shadow: inset 0 -3px 0 transparent; cursor: pointer; }
.sg-tabs button[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--welt); }
.sg-mtab { --welt: var(--text); }
.sg-mhub { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 16px 0; font-weight: 600; font-size: 16px; color: var(--welt); }
.sg-mgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.sg-mgrid a { display: flex; flex-direction: column; gap: 6px; min-height: 44px; color: var(--text); }
.sg-mgrid b { font-weight: 600; font-size: 15px; line-height: 1.2; }
.sg-mwelt { display: flex; gap: 12px; padding: 0 16px 16px; }
.sg-mwelt a { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 2 / 1; border-radius: var(--radius, 6px); overflow: hidden; position: relative; color: #fff; font-weight: 700; font-size: 18px; line-height: 1.1; padding: 12px; background: var(--welt); }
.sg-mwelt a img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.sg-mwelt a span { position: relative; text-shadow: 0 1px 8px rgb(0 0 0 / 60%); }
.sg-mfuss { margin-top: auto; padding: 16px; border-top: 1px solid var(--linie); display: flex; flex-direction: column; gap: 4px; }
.sg-mfuss a { display: flex; align-items: center; min-height: 44px; font-size: 15px; line-height: 1.3; color: var(--text); }
body.sg-drawer-offen { overflow: hidden; }

/* Portal (Startseite): nur die sogo24-Zeile ohne Linie */
.sg-hd--portal .sg-hd-sg { border-bottom: 0; }
.sg-hd--portal .sg-wort span { color: var(--text); }

@media (max-width: 760px) {
  .sg-hd-in { padding: 0 16px; }
  .sg-hd-sg .sg-hd-in { gap: 12px; min-height: 55px; }
  .sg-wb { max-height: 48px; }
  .sg-wort { font-size: 21px; }
  .sg-haupt { display: none; }
  .sg-ib--konto { display: none; }
  .sg-hd--portal .sg-ib--konto { display: inline-flex; }
  .sg-ib--menu { display: inline-flex; }
  .sg-wb .sg-hd-in { padding: 0 0 0 16px; gap: 12px; height: 48px; overflow-x: auto; scrollbar-width: none; }
  .sg-kat { margin-left: 0; }
  .sg-kat a { padding: 0 10px; font-size: 14px; }
  .sg-wlogo { font-size: 18px; }
  .sg-wlogo-img { width: 50px; height: 30px; }
  .sg-alle { display: none; }
  .sg-panels, .sg-dim { display: none; }
  /* Wisch-Hinweis (Lukas 26.11.): Verlauf und Pfeil am rechten Rand, solange weitere Kategorien folgen (view.js setzt is-wisch und is-ende) */
  .sg-wb.is-wisch::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 64px; pointer-events: none; transition: opacity var(--dauer, 140ms);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") right 6px center / 20px 20px no-repeat, linear-gradient(to right, transparent, var(--welt) 55%); }
  .sg-wb.is-wisch.is-ende::after { opacity: 0; }
}
@media (min-width: 761px) {
  .sg-drawer, .sg-drawer.is-offen, .sg-drawer:target { display: none; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .sg-panel-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; }
  .sg-spalten { gap: 28px; }
  .sg-kacheln { gap: 16px; }
}

/* DES-30: Marken als Logo in der oberen Zeile, Waldin-Logo in der Weltzeile. Zwei Klassen wegen „.woocommerce img { height: auto }“ */
.sg-hd .sg-hw-logo { display: block; width: auto; height: 34px; max-width: none; }
.sg-hd .sg-hw-logo--beddog { height: 36px; }
.sg-hd .sg-wlogo-img--waldin { width: 142px; height: 38px; }
@media (max-width: 1023.98px) {
  .sg-hd .sg-wlogo-img--waldin { width: 105px; height: 28px; }
}
/* DES-40: am Handy das Signet statt des ganzen Logos */
@media (max-width: 760px) {
  .sg-hd .sg-wlogo-img--waldin { width: 30px; height: 34px; }
}

/* Merkliste (DES-68): Herz-Knopf neben dem Kaufknopf der Produktseiten und die kurze Meldung nach dem Merken (assets/merkliste.js) */
.sg-merk-btn { flex: none; width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--linie-bedienung); border-radius: var(--radius, 6px); background: #fff; color: var(--text); cursor: pointer; }
.sg-merk-btn:hover { border-color: var(--text); }
.sg-merk-btn[aria-pressed="true"] { color: var(--welt, var(--text)); border-color: var(--welt, var(--text)); }
.sg-merk-btn[aria-pressed="true"] svg { fill: currentColor; }
/* Gemerktes Herz überall rot (Lukas 26.11.: „lass uns das herz rot machen wenn es markiert ist“, DES-79): eine Regel für alle [data-merken]
   (Produktseiten, Karten, Slider, Kacheln); der Kopf lädt auf jeder Seite mit Herzen. */
:root { --herz: #d0283c; }
[data-merken][aria-pressed="true"] { color: var(--herz) !important; }
[data-merken][aria-pressed="true"] svg { fill: currentColor; stroke: currentColor; }
.sg-merk-btn[data-merken][aria-pressed="true"] { border-color: var(--herz); }
.sg-meldung { position: fixed; left: 50%; bottom: calc(24px + var(--unten-frei, 0px)); z-index: 70; transform: translate(-50%, 12px); display: flex; align-items: center; gap: 16px; max-width: calc(100vw - 32px); padding: 14px 20px; border-radius: var(--radius, 6px); background: var(--text); color: #fff; font-size: 15px; line-height: 1.3; box-shadow: 0 8px 24px rgb(30 35 43 / 28%); opacity: 0; pointer-events: none; transition: opacity .18s ease-out, transform .18s ease-out; }
.sg-meldung.is-da { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.sg-meldung a { color: #fff; font-weight: 600; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .sg-meldung { transition: none; } }
