/* ============================================================
   SmartHome Kompass v2 — Design System
   Professionelles Tech-Magazin | Mobile-first | Dark-Mode
   ============================================================ */

:root {
  /* Farben — Light Theme */
  --bg: #f7f8fb;
  --bg-elevated: #ffffff;
  --bg-subtle: #eef1f6;
  --text: #14181f;
  --text-muted: #5b6472;
  --text-faint: #8a93a3;
  --border: #e3e7ee;
  --border-strong: #ccd3dd;

  /* Marke */
  --brand: #0d7a5f;          /* Tiefes Smaragd — Vertrauen, Energie */
  --brand-strong: #0a5c48;
  --brand-soft: #e2f4ee;
  --accent: #f59e0b;         /* Bernstein — Deals, CTAs */
  --accent-soft: #fef3e2;
  --info: #2563eb;
  --info-soft: #e8effd;
  --danger: #dc2626;
  --danger-soft: #fdeaea;

  /* Typografie */
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Geometrie */
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .07);
  --shadow-md: 0 6px 24px rgba(16, 24, 40, .09);
  --shadow-lg: 0 16px 48px rgba(16, 24, 40, .14);
  --container: 1180px;
}

[data-theme="dark"] {
  --bg: #0d1117;
  --bg-elevated: #161c25;
  --bg-subtle: #1c2430;
  --text: #e8ecf2;
  --text-muted: #9aa5b5;
  --text-faint: #6b7585;
  --border: #28303d;
  --border-strong: #3a4452;
  --brand: #2dd4a8;
  --brand-strong: #5eead4;
  --brand-soft: #11302a;
  --accent: #fbbf24;
  --accent-soft: #33260d;
  --info: #60a5fa;
  --info-soft: #16233b;
  --danger: #f87171;
  --danger-soft: #3a1414;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .55);
}

/* ---------- Reset & Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
img, video { max-width: 100%; display: block; }
svg { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 .5em;
  letter-spacing: -.015em;
}
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 650; }
p  { margin: 0 0 1em; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section-alt { background: var(--bg-subtle); }

/* ---------- Header / Navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.18rem;
  color: var(--text); text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #14b8a6);
  display: grid; place-items: center; color: #fff; font-size: 18px;
}
.logo span em { color: var(--brand); font-style: normal; }

.main-nav { display: flex; gap: 4px; align-items: center; }
.main-nav a {
  padding: 8px 14px; border-radius: var(--radius-pill);
  color: var(--text-muted); font-weight: 550; font-size: .95rem;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--text); background: var(--bg-subtle); text-decoration: none;
}
.nav-cta {
  background: var(--brand) !important; color: #fff !important;
  font-weight: 650 !important;
}
.nav-cta:hover { background: var(--brand-strong) !important; }

.theme-toggle, .nav-burger {
  border: 1px solid var(--border); background: var(--bg-elevated);
  color: var(--text); width: 38px; height: 38px; border-radius: 50%;
  cursor: pointer; display: grid; place-items: center; font-size: 16px;
}
.nav-burger { display: none; }

.cart-link {
  border: 1px solid var(--border); background: var(--bg-elevated);
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-size: 17px; line-height: 1;
}
.cart-link:hover { border-color: var(--brand); text-decoration: none; box-shadow: var(--shadow-sm); }

@media (max-width: 880px) {
  .nav-burger { display: grid; }
  .main-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; padding: 12px 20px 20px;
    background: var(--bg-elevated); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 14px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-pill);
  font-family: var(--font-body); font-weight: 650; font-size: .98rem;
  border: none; cursor: pointer; text-decoration: none !important;
  transition: transform .15s, box-shadow .15s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); box-shadow: var(--shadow-md); }
.btn-accent { background: var(--accent); color: #1f1503; }
.btn-accent:hover { filter: brightness(1.07); box-shadow: var(--shadow-md); }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border-strong);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 8px 16px; font-size: .88rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Badges & Pills ---------- */
.badge {
  display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: .78rem; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase;
}
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.badge-accent { background: var(--accent-soft); color: #b45309; }
[data-theme="dark"] .badge-accent { color: var(--accent); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* Affiliate-Kennzeichnung (Pflicht!) */
.affiliate-hint {
  font-size: .75rem; color: var(--text-faint);
  display: inline-flex; align-items: center; gap: 4px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-img-top {
  margin: -24px -24px 16px; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  aspect-ratio: 16/9; object-fit: cover; width: calc(100% + 48px); max-width: none;
}

.grid-2 { display: grid; gap: 24px; grid-template-columns: repeat(2, 1fr); }
.grid-3 { display: grid; gap: 24px; grid-template-columns: repeat(3, 1fr); }
.grid-4 { display: grid; gap: 20px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 84px 0 72px;
  background:
    radial-gradient(900px 420px at 85% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent),
    radial-gradient(700px 380px at 0% 110%, color-mix(in srgb, var(--accent) 12%, transparent), transparent),
    var(--bg);
}
.hero-grid {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
}
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: .85rem; color: var(--brand);
  background: var(--brand-soft); padding: 6px 14px; border-radius: var(--radius-pill);
  margin-bottom: 18px;
}
.hero p.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 56ch; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.hero-stats {
  display: flex; gap: 32px; margin-top: 38px; flex-wrap: wrap;
}
.hero-stat strong {
  display: block; font-family: var(--font-display);
  font-size: 1.6rem; color: var(--brand);
}
.hero-stat span { font-size: .85rem; color: var(--text-muted); }

/* ---------- Sterne-Rating ---------- */
.stars { color: var(--accent); letter-spacing: 2px; font-size: .95rem; }
.score-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand); color: #fff; font-weight: 800;
  padding: 6px 14px; border-radius: var(--radius-pill);
  font-family: var(--font-display); font-size: 1.05rem;
}

/* ---------- Vergleichstabellen ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.cmp {
  width: 100%; border-collapse: collapse; background: var(--bg-elevated);
  font-size: .94rem; min-width: 560px;
}
table.cmp th, table.cmp td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); }
table.cmp thead th {
  background: var(--bg-subtle); font-family: var(--font-display);
  font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em;
}
table.cmp tbody tr:last-child td { border-bottom: none; }
table.cmp tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 40%, transparent); }
.cmp-winner { box-shadow: inset 3px 0 0 var(--brand); }

/* ---------- Pro / Contra ---------- */
.pro-contra { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .pro-contra { grid-template-columns: 1fr; } }
.pro-box, .contra-box {
  border-radius: var(--radius); padding: 20px 22px;
  border: 1px solid var(--border); background: var(--bg-elevated);
}
.pro-box { border-top: 4px solid var(--brand); }
.contra-box { border-top: 4px solid var(--danger); }
.pro-box ul, .contra-box ul { margin: 8px 0 0; padding-left: 0; list-style: none; }
.pro-box li, .contra-box li { padding: 6px 0 6px 28px; position: relative; }
.pro-box li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 800; }
.contra-box li::before { content: "✕"; position: absolute; left: 0; color: var(--danger); font-weight: 800; }

/* ---------- Rechner / Tools ---------- */
.tool-panel {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-md);
}
.tool-panel label { font-weight: 600; font-size: .92rem; display: block; margin-bottom: 6px; }
.tool-panel input[type="number"], .tool-panel input[type="text"],
.tool-panel select {
  width: 100%; padding: 12px 14px; border-radius: var(--radius);
  border: 1.5px solid var(--border-strong); background: var(--bg);
  color: var(--text); font-size: 1rem; font-family: var(--font-body);
}
.tool-panel input:focus, .tool-panel select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
.tool-panel input[type="range"] { width: 100%; accent-color: var(--brand); }
.tool-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin-bottom: 18px; }
.tool-result {
  margin-top: 22px; padding: 22px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 50%, var(--bg-elevated)));
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border));
}
.tool-result .big-number {
  font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800; color: var(--brand);
}

/* ---------- FAQ (Accordion) ---------- */
.faq details {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 18px 22px; font-weight: 650;
  font-family: var(--font-display); list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--brand); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 22px 18px; color: var(--text-muted); }

/* ---------- Artikel-Layout ---------- */
.article-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px;
  align-items: start;
}
@media (max-width: 980px) { .article-layout { grid-template-columns: 1fr; } }
.article-layout > * { min-width: 0; }
.article-body { font-size: 1.04rem; }
.article-body h2 { margin-top: 1.8em; }
.article-body h3 { margin-top: 1.4em; }
.article-meta {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  color: var(--text-faint); font-size: .88rem; margin: 14px 0 28px;
}
.article-sidebar { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 20px; }
.toc { font-size: .92rem; }
.toc a { display: block; padding: 5px 0; color: var(--text-muted); }
.toc a:hover { color: var(--brand); }

.info-box, .warning-box, .tip-box {
  border-radius: var(--radius); padding: 18px 20px 18px 54px;
  margin: 1.4em 0; position: relative; font-size: .97rem;
}
.info-box::before, .warning-box::before, .tip-box::before {
  position: absolute; left: 18px; top: 16px; font-size: 1.3rem;
}
.info-box { background: var(--info-soft); }
.info-box::before { content: "ℹ️"; }
.warning-box { background: var(--danger-soft); }
.warning-box::before { content: "⚠️"; }
.tip-box { background: var(--brand-soft); }
.tip-box::before { content: "💡"; }

/* ---------- Produkt-/Deal-Karte ---------- */
.deal-card { display: flex; flex-direction: column; }
.deal-card .deal-img {
  aspect-ratio: 4/3; border-radius: var(--radius); object-fit: cover;
  background: var(--bg-subtle); margin-bottom: 14px;
}
.deal-price-row { display: flex; align-items: baseline; gap: 10px; margin: 8px 0; }
.deal-price { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--text); }
.deal-old-price { text-decoration: line-through; color: var(--text-faint); font-size: .95rem; }
.deal-save { background: var(--danger); color: #fff; font-weight: 700; font-size: .8rem; padding: 3px 9px; border-radius: var(--radius-pill); }
.deal-card .btn { margin-top: auto; }

/* ---------- Newsletter ---------- */
.newsletter-box {
  background: linear-gradient(135deg, #0a5c48, #0d7a5f 55%, #14b8a6);
  color: #fff; border-radius: var(--radius-lg); padding: 42px 36px;
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center;
}
@media (max-width: 760px) { .newsletter-box { grid-template-columns: 1fr; } }
.newsletter-box h2, .newsletter-box h3 { color: #fff; }
.newsletter-box p { color: rgba(255,255,255,.85); }
.newsletter-form { display: flex; gap: 10px; }
.newsletter-form input {
  flex: 1; padding: 13px 16px; border-radius: var(--radius-pill);
  border: none; font-size: 1rem;
}
@media (max-width: 480px) { .newsletter-form { flex-direction: column; } }

/* ---------- Footer ---------- */
.site-footer {
  background: #0e141c; color: #aab4c2; padding: 56px 0 28px; margin-top: 64px;
}
[data-theme="dark"] .site-footer { background: #090d13; border-top: 1px solid var(--border); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; margin-bottom: 36px;
}
@media (max-width: 880px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 14px; }
.site-footer a { color: #aab4c2; display: block; padding: 4px 0; font-size: .92rem; }
.site-footer a:hover { color: #fff; }
.footer-social {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 26px;
}
.footer-social > span { font-size: .88rem; color: #717d8e; margin-right: 4px; }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; padding: 0;
  background: rgba(255,255,255,.08); transition: background .15s ease;
}
.footer-social a:hover { background: var(--brand); }
.footer-social svg { width: 17px; height: 17px; fill: #cdd6e0; }
.footer-social a:hover svg { fill: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); padding-top: 22px;
  font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.footer-disclaimer { font-size: .8rem; color: #717d8e; max-width: 70ch; margin-top: 14px; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: .85rem; color: var(--text-faint); padding: 18px 0 0; }
.breadcrumbs a { color: var(--text-muted); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
.section-head { max-width: 720px; margin: 0 auto 42px; text-align: center; }
.section-head .badge { margin-bottom: 14px; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; }

/* ---------- Animationen ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; }
.reveal.in { animation: fadeUp .6s ease forwards; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.live-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--danger); animation: pulse-dot 1.6s infinite; margin-right: 6px;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; } .reveal.in { animation: none; }
}

/* ---------- Cookie-Consent ---------- */
.consent-banner {
  position: fixed; bottom: 16px; left: 16px; right: 16px; z-index: 200;
  max-width: 560px; margin: 0 auto;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-lg);
}
.consent-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- Top-3-Empfehlungsbox (Ratgeber) ---------- */
.top3-box { margin: 28px 0; border: 1px solid var(--border); }
.top3-list { list-style: none; margin: 0; padding: 0; }
.top3-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.top3-list li:last-child { border-bottom: 0; }
.top3-list .btn { flex-shrink: 0; white-space: nowrap; }
.top3-list .top3-note { display: block; font-size: .92rem; color: var(--text-muted); margin-top: 2px; }
@media (max-width: 560px) { .top3-list li { flex-direction: column; align-items: flex-start; gap: 8px; } }
