/* ============================================================
   Schlender Design System v3.0
   Single Source of Truth für alle UI-Module.
   Aufgebaut nach SKILL-schlender-cd.md (v2.0).
   ============================================================ */

/* ===== MARKEN-KERNFARBEN (theme-unabhängig) ===== */
:root {
  /* Schlender-Rot (Marke) */
  --schlender-red: #E1223A;
  --schlender-red-soft: #FF4D63;
  --schlender-red-dark: #B71C30;

  /* Schlender-Grau (Marke, Logo-Rahmen, Sekundär) */
  --schlender-gray: #868686;
  --schlender-gray-dark: #4A4A4A;

  /* Schwarz (Logo-Original-Kontext) */
  --schlender-black: #000000;

  /* UI-Aktionsfarbe (Blau, wie Urlaubsplaner) */
  --accent-blue: #3B7AFE;
  --accent-blue-hover: #2563EB;
  --accent-blue-soft: rgba(59, 122, 254, 0.15);

  /* Status-Farben */
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;

  /* Radien — weich! */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Spacing-Skala (Basis 4px) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-14: 56px;
  --space-20: 80px;
}

/* ===== DARK THEME (Default für Admin, Fahrer, Tablet) ===== */
:root {
  --bg-deep: #0F1A2E;
  --bg-card: #1A2540;
  --bg-card-elevated: #233054;
  --bg-input: #1A2540;
  --bg-hover: #2A3A5C;

  --text-primary: #FFFFFF;
  --text-secondary: #B4BFD4;
  --text-tertiary: #6B7896;

  --border: rgba(255, 255, 255, 0.08);
  --border-input: rgba(255, 255, 255, 0.12);

  --success-bg: rgba(34, 197, 94, 0.15);
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger-bg: rgba(239, 68, 68, 0.15);

  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.2);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.4);
}

/* ===== LIGHT THEME (Default für Webshop) ===== */
[data-theme="light"] {
  --bg-deep: #F5F6FA;
  --bg-card: #FFFFFF;
  --bg-card-elevated: #FFFFFF;
  --bg-input: #F5F6FA;
  --bg-hover: #EEF1F8;

  --text-primary: #1A2540;
  --text-secondary: #4A5878;
  --text-tertiary: #8E9AB5;

  --border: rgba(0, 0, 0, 0.06);
  --border-input: rgba(0, 0, 0, 0.10);

  --success-bg: rgba(34, 197, 94, 0.12);
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger-bg: rgba(239, 68, 68, 0.10);

  --shadow-card: 0 2px 8px rgba(15, 26, 46, 0.04);
  --shadow: 0 4px 20px rgba(15, 26, 46, 0.06);
  --shadow-lg: 0 20px 50px rgba(15, 26, 46, 0.12);
}

/* ===== BASIS-RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ===== KOMPONENTEN-LIBRARY ============================================= */

/* ── Schlender-Logo (Header) ─────────────────────────────────────────── */
.schlender-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.schlender-logo .logo-img {
  height: 48px;
  width: auto;
  display: block;
  background: #fff;
  border-radius: 8px;
  padding: 4px 8px;
}
.schlender-wordmark {
  line-height: 0.95;
  font-family: 'Helvetica Neue', 'Arial Black', Arial, sans-serif;
}
.schlender-wordmark .line1 {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-secondary);
}
.schlender-wordmark .line2 {
  font-size: 22px; font-weight: 900; letter-spacing: 0.01em;
  text-transform: uppercase; color: var(--schlender-red);
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--schlender-red);
  color: #fff;
  padding: 14px 26px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(225, 34, 58, 0.30);
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover {
  background: var(--schlender-red-soft);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(225, 34, 58, 0.40);
}
.btn-primary:disabled {
  opacity: 0.55; cursor: not-allowed; transform: none;
}

.btn-action {
  background: var(--accent-blue);
  color: #fff;
  padding: 12px 22px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(59, 122, 254, 0.25);
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-action:hover {
  background: var(--accent-blue-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  padding: 12px 22px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-tertiary);
}

/* ── Inputs ──────────────────────────────────────────────────────────── */
.sd-input {
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  padding: 13px 16px;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.2s;
  width: 100%;
  font-family: inherit;
}
.sd-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 122, 254, 0.12);
}
.sd-input::placeholder { color: var(--text-tertiary); }

/* ── Cards ───────────────────────────────────────────────────────────── */
.sd-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
}
.sd-card-elevated {
  background: var(--bg-card-elevated);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow);
}

/* ── Status-Pills ────────────────────────────────────────────────────── */
.sd-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.02em;
}
.sd-pill.success { background: var(--success-bg); color: var(--success); }
.sd-pill.warning { background: var(--warning-bg); color: var(--warning); }
.sd-pill.danger  { background: var(--danger-bg);  color: var(--danger);  }
.sd-pill.info    { background: var(--accent-blue-soft); color: var(--accent-blue); }
.sd-pill.brand   { background: rgba(225,34,58,0.12); color: var(--schlender-red); }

/* ── Mengen-Stepper ──────────────────────────────────────────────────── */
.qty-control {
  display: inline-flex; align-items: center;
  background: var(--bg-input);
  border-radius: var(--radius-pill);
  padding: 4px;
  border: 1px solid var(--border-input);
}
.qty-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px; font-weight: 700;
  color: var(--text-primary);
  transition: all 0.15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background: var(--accent-blue); color: #fff; }
.qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-value {
  min-width: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}

/* ── Theme-Toggle ────────────────────────────────────────────────────── */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-pill);
  width: 38px; height: 38px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--text-primary);
  transition: all 0.15s;
  padding: 0;
}
.theme-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--text-tertiary);
}
/* Wechsel Sonne/Mond per Theme */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: inline-block; }
[data-theme="light"] .theme-toggle .icon-sun  { display: inline-block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ── Section-Headers (kleine Mikrolabels) ────────────────────────────── */
.sd-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ── Focus-Visible global ────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
.btn-primary:focus-visible {
  outline-color: #fff;
  outline-offset: -3px;
}

/* ── Skip-Link (Accessibility) ───────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -40px; left: 8px;
  background: var(--schlender-red); color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  z-index: 9999;
  text-decoration: none;
  font-weight: 700;
}
.skip-link:focus { top: 8px; }

/* ── Screen-Reader-Only ──────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
