/* ═══════════════════════════════════════════════════════════════════════════
   Gemeinsames Design aller Seiten (seit 2026-10-19): Schriften, Farben, Basis,
   Kopf- und Fußzeile (private/templates/site_header.php / site_footer.php)
   und eine Typografie-Schicht für Unterseiten (body.nd-sub).

   Die Startseite lädt zusätzlich css/home.css. Unterseiten binden diese Datei
   NACH ihrem eigenen <style>-Block ein – deshalb setzt .nd-header/.nd-footer
   alle Eigenschaften selbst, die alte Element-Regeln (header{…}, footer{…})
   sonst hineintragen würden.

   Überschriften: PP Fraktion Mono Bold. Ausnahmen setzen die Seiten selbst
   (z.B. „Deine Maschine ist nicht dabei?“ in Helvetica, home.css).
   Breakpoint 768 px = dieselbe Grenze wie das Shop-JS.
   ═══════════════════════════════════════════════════════════════════════════ */

@font-face {
    font-family: 'PP Fraktion Mono';
    src: url('../fonts/PPFraktionMono-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'PP Fraktion Sans';
    src: url('../fonts/PPFraktionSans-Variable.ttf') format('truetype-variations'),
         url('../fonts/PPFraktionSans-Variable.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --nd-text: #111;
    --nd-text-2: #333;
    --nd-text-3: #444;
    --nd-muted: #5F5F5F;
    --nd-faint: #8A8A8A;
    --nd-line: #E6E6E3;
    --nd-line-2: #DADAD6;
    --nd-field: #BDBDB8;
    --nd-soft: #F3F3F0;
    --nd-soft-2: #F5F5F3;
    --nd-stage: #EDEDEA;
    --nd-red: #c0392b;       /* Bestands-/Vorbestellhinweis, Fehler */
    --nd-orange: #d35400;    /* Vorbestellungs-Marker im Dropdown */
    --nd-star: #D7261E;
    --nd-ok: #1e8449;
    --nd-pad: 40px;
    --nd-head: 'PP Fraktion Mono', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --nd-sans: 'PP Fraktion Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --nd-body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ── Basis ──────────────────────────────────────────────────────────────── */
body.nd-body, body.nd-body *, body.nd-body *::before, body.nd-body *::after { box-sizing: border-box; }
/* clip statt hidden: hidden machte body zum Scroll-Container und bräche die
   window-Scroll-Events (Nach-oben-Button). */
html, body.nd-body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; }
body.nd-body [hidden] { display: none !important; }

body.nd-body {
    margin: 0;
    font-family: var(--nd-body);
    color: var(--nd-text);
    line-height: 1.5;
    background-color: #fff;
    background-image: radial-gradient(rgba(0,0,0,0.07) 1px, transparent 1px);
    background-size: 20px 20px;
}
/* :where() = Spezifität 0: Button-Links der Seiten (.btn, .button …) behalten ihre Farben. */
:where(.nd-body) a { color: var(--nd-text); }
:where(.nd-body) a:hover { color: #555; }
.nd-body img { max-width: 100%; }
.nd-body button { font-family: inherit; }
.nd-body h1, .nd-body h2, .nd-body h3 {
    font-family: var(--nd-head);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.nd-wrap { max-width: 1240px; margin: 0 auto; padding-left: var(--nd-pad); padding-right: var(--nd-pad); }

/* ── Kopfzeile ──────────────────────────────────────────────────────────── */
.nd-body .nd-header {
    position: sticky; top: 0; z-index: 50;
    margin: 0; padding: 0; text-align: left;
    background: rgba(255,255,255,0.94);
    border: 0; border-bottom: 1px solid var(--nd-line);
    -webkit-backdrop-filter: saturate(1.4) blur(6px);
    backdrop-filter: saturate(1.4) blur(6px);
}
.nd-header__inner {
    max-width: 1240px; margin: 0 auto; padding: 10px var(--nd-pad);
    display: flex; align-items: center; gap: 28px;
}
.nd-header .nd-logo { display: flex; align-items: center; min-height: 44px; position: static; transform: none; }
.nd-header .nd-logo img { height: 18px; width: auto; max-width: none; display: block; }
.nd-nav { display: flex; flex-wrap: wrap; gap: 24px; font-size: 14px; flex: 1 1 auto; }
.nd-body .nd-nav a { text-decoration: none; color: var(--nd-text); }
.nd-header__tools { display: flex; align-items: center; gap: 16px; font-size: 13px; margin-left: auto; }
.nd-body .nd-insta { display: flex; align-items: center; gap: 6px; min-height: 44px; text-decoration: none; color: var(--nd-text); }
.nd-header__sep { width: 1px; height: 20px; background: var(--nd-line-2); }
.nd-body .nd-lang a { text-decoration: none; color: var(--nd-muted); padding: 0; }
.nd-body .nd-lang a.is-active { color: var(--nd-text); font-weight: 700; }
.nd-lang--full { font-weight: 400; }
.nd-lang--full span { color: var(--nd-faint); margin: 0 3px; }
.nd-body .nd-cart-btn {
    position: relative; width: 44px; height: 44px; padding: 0; margin: 0;
    border: 1px solid var(--nd-line-2); border-radius: 10px; background: #fff;
    color: var(--nd-text); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.nd-body .nd-cart-btn:hover { border-color: var(--nd-text); color: var(--nd-text); }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.cart-badge {
    position: absolute; top: -7px; right: -7px;
    min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
    background: var(--nd-red); color: #fff;
    font-size: 11px; font-weight: 700; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.cart-badge--btn { top: -9px; right: -9px; min-width: 24px; height: 24px; border-radius: 12px; font-size: 13px; }
@keyframes badge-pop {
    0%   { transform: scale(0.3); opacity: 0; }
    70%  { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1);   opacity: 1; }
}
.cart-badge--pop { animation: badge-pop 0.3s ease-out forwards; }

/* ── Fußzeile ───────────────────────────────────────────────────────────── */
.nd-body .nd-footer {
    margin: 0; padding: 28px 0; text-align: left;
    border: 0; border-top: 1px solid var(--nd-line); background: #fff; color: var(--nd-muted);
    font-size: 13px; line-height: 1.5;
}
.nd-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--nd-muted); }
.nd-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.nd-body .nd-footer a { color: var(--nd-muted); margin: 0; text-decoration: underline; }
.nd-body .nd-footer a:hover { color: var(--nd-text); }
.nd-body .nd-footer__note { margin: 16px auto 0; font-size: 12px; color: var(--nd-faint); line-height: 1.5; text-align: left; }

/* ── Nach-oben ──────────────────────────────────────────────────────────── */
.back-to-top {
    position: fixed; right: 24px; bottom: 24px; z-index: 40;
    width: 44px; height: 44px; padding: 0; border-radius: 50%;
    border: 1px solid var(--nd-line-2); background: #fff; color: var(--nd-text);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }
.back-to-top svg { width: 20px; height: 20px; display: block; }

/* ═══ Unterseiten (body.nd-sub) ═════════════════════════════════════════════
   Rechtsseiten, FAQ, Bewertung, Erfolgsseite, Widerruf … Die Seiten behalten
   ihr Markup; hier kommen nur Schrift, Farben und die Bausteine dazu. */
.nd-sub main { background: transparent; line-height: 1.7; }
.nd-scan-rev { margin: 24px auto 0; padding-bottom: 16px; font-size: 12px; color: var(--nd-faint); text-align: center; }
.nd-sub main h1 { font-size: 40px; line-height: 1.1; margin: 0 0 14px; color: var(--nd-text); }
.nd-sub main h2 { font-size: 22px; line-height: 1.2; margin: 44px 0 12px; padding: 0; border: 0; color: var(--nd-text); }
.nd-sub main h3 { font-size: 17px; line-height: 1.3; margin: 24px 0 8px; color: var(--nd-text); }
.nd-sub main p, .nd-sub main li { color: var(--nd-text-3); }
.nd-sub .last-updated, .nd-sub .subtitle, .nd-sub .page-subtitle { color: var(--nd-faint); }
.nd-sub .highlight-box, .nd-sub .info-box, .nd-sub .note-box {
    background: #fff; border: 1px solid var(--nd-line); border-left: 0;
    border-radius: 14px; padding: 16px 20px;
}
.nd-sub table { border-collapse: separate; border-spacing: 0; width: 100%; background: #fff; border: 1px solid var(--nd-line); border-radius: 14px; overflow: hidden; }
.nd-sub th, .nd-sub td { border: 0; border-bottom: 1px solid var(--nd-line); padding: 10px 14px; text-align: left; }
.nd-sub tr:last-child td { border-bottom: 0; }
.nd-sub th { background: var(--nd-soft-2); font-weight: 700; color: var(--nd-text); }

/* Formularfelder und Buttons der Unterseiten */
.nd-sub main input[type="text"], .nd-sub main input[type="email"], .nd-sub main input[type="number"],
.nd-sub main input[type="tel"], .nd-sub main select, .nd-sub main textarea {
    border: 1px solid var(--nd-field); border-radius: 10px; background: #fff;
    font-family: inherit; font-size: 16px; color: var(--nd-text);
}
.nd-sub main input[type="text"], .nd-sub main input[type="email"], .nd-sub main input[type="number"],
.nd-sub main input[type="tel"], .nd-sub main select { min-height: 48px; padding: 0 14px; }
.nd-sub main textarea { padding: 12px 14px; }
.nd-sub main input:focus, .nd-sub main select:focus, .nd-sub main textarea:focus {
    outline: none; border-color: var(--nd-text); box-shadow: 0 0 0 3px rgba(17,17,17,0.08);
}
.nd-sub main button[type="submit"], .nd-sub main .btn, .nd-sub main .btn-primary, .nd-sub main .btn-submit {
    border-radius: 12px;
}

/* /datasheet: der body zentriert dort die Karte als Flex-Spalte – Kopf- und
   Fußzeile sollen trotzdem volle Breite haben. */
body.nd-datasheet { padding: 0; justify-content: flex-start; align-items: stretch; }
.nd-datasheet .datasheet-card { align-self: center; width: calc(100% - 40px); margin: 32px 0; }

@media print {
    .nd-header, .nd-footer, .back-to-top { display: none !important; }
    body.nd-body { background: #fff; }
}

@media (max-width: 1040px) {
    .nd-nav { display: none; }
}

@media (max-width: 768px) {
    :root { --nd-pad: 20px; }
    .nd-header__inner { height: 56px; padding: 0 8px 0 16px; gap: 8px; }
    .nd-header .nd-logo img { height: 15px; }
    .nd-header__tools { gap: 0; }
    .nd-body .nd-insta { width: 44px; justify-content: center; }
    .nd-insta span, .nd-header__sep { display: none; }
    /* DE / EN bleiben auch mobil nebeneinander (Wunsch des Betreibers). */
    .nd-lang--full { display: flex; align-items: center; min-height: 44px; padding: 0 8px; font-size: 13px; }
    .nd-body .nd-lang--full a { display: flex; align-items: center; min-height: 44px; padding: 0 4px; }
    .nd-body .nd-cart-btn { border: 0; background: transparent; }
    .nd-cart-btn svg { width: 22px; height: 22px; }

    .nd-body .nd-footer { padding: 24px 0; }
    .nd-footer__inner { font-size: 12px; gap: 8px 16px; justify-content: flex-start; }
    .nd-footer nav { gap: 8px 16px; }
    .back-to-top { right: 16px; }

    .nd-sub main h1 { font-size: 28px; }
    .nd-sub main h2 { font-size: 19px; margin-top: 36px; }
}
