/* =========================================================================
   Kai Blobel Shop – Apple-Designsprache
   Monochrom (Schwarz/Weiß/Grau) + Apple-Blau als Akzent.
   Typografie & Weißraum tragen die Seite. Keine Verläufe. Light zuerst.
   ========================================================================= */

:root {
  /* Apple-Palette */
  --bg:        #ffffff;
  --bg-grey:   #f5f5f7;   /* Apple-Signaturgrau */
  --surface:   #ffffff;
  --ink:       #1d1d1f;   /* Apple-Fast-Schwarz */
  --ink-2:     #424245;
  --muted:     #6e6e73;
  --muted-2:   #86868b;
  --border:    #d2d2d7;   /* Hairline */
  --border-2:  #e8e8ed;

  --blue:      #0071e3;   /* Button */
  --blue-hover:#0077ed;
  --link:      #0066cc;   /* Text-Link */
  --link-hover:#0071e3;

  --radius:      18px;
  --radius-lg:   28px;
  --radius-sm:   12px;
  --radius-pill: 980px;

  --maxw:    1024px;     /* Apple hält den Content schmal */
  --maxw-wide: 1180px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;

  --ease: cubic-bezier(.28, .11, .32, 1);
}

[data-theme="dark"] {
  --bg:        #000000;
  --bg-grey:   #101012;
  --surface:   #1c1c1e;
  --ink:       #f5f5f7;
  --ink-2:     #d6d6d8;
  --muted:     #a1a1a6;
  --muted-2:   #86868b;
  --border:    #2a2a2c;
  --border-2:  #242426;
  --blue:      #0a84ff;
  --blue-hover:#3395ff;
  --link:      #2997ff;
  --link-hover:#54a9ff;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.container-wide { max-width: var(--maxw-wide); }
.section { padding-block: clamp(64px, 10vw, 120px); }
.section-head { margin-bottom: clamp(32px, 5vw, 56px); text-align: center; }
.section-head .eyebrow { display: block; font-size: 17px; font-weight: 600; color: var(--muted); margin-bottom: 10px; letter-spacing: -0.01em; }
.section-head h2 { font-size: clamp(32px, 5vw, 56px); font-weight: 700; letter-spacing: -0.025em; }
.section-head p { color: var(--muted); max-width: 60ch; margin: 14px auto 0; font-size: clamp(19px, 2.2vw, 21px); }

/* ---------- Links & Buttons ---------- */
.link {
  color: var(--link); font-size: 17px; display: inline-flex; align-items: center; gap: 2px;
  transition: color .2s var(--ease);
}
.link:hover { color: var(--link-hover); }
.link::after { content: "\203A"; font-size: 1.2em; line-height: 0; margin-left: 3px; transition: transform .2s var(--ease); }
.link:hover::after { transform: translateX(3px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 17px; font-weight: 400; letter-spacing: -0.01em;
  padding: 12px 23px; border-radius: var(--radius-pill); border: 1px solid transparent;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-secondary { background: transparent; color: var(--link); border-color: transparent; padding-inline: 6px; }
.btn-secondary::after { content: "\203A"; font-size: 1.2em; line-height: 0; margin-left: 2px; transition: transform .2s var(--ease); }
.btn-secondary:hover::after { transform: translateX(3px); }
.btn-outline { background: transparent; color: var(--link); border-color: var(--border); }
.btn-outline:hover { border-color: var(--muted-2); }
.btn-lg { font-size: 19px; padding: 14px 28px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border-radius: var(--radius-pill); background: transparent; color: var(--ink);
  transition: background .2s var(--ease); border: none;
}
.icon-btn:hover { background: var(--bg-grey); }
.theme-toggle .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon-moon { display: block; }

/* ---------- Header (Apple-Navbar) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: 48px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-2);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 48px; max-width: var(--maxw-wide); margin-inline: auto; padding-inline: 22px; }
.brand { display: inline-flex; align-items: baseline; gap: 7px; margin-right: auto; }
.brand strong { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.brand small { font-size: 12px; color: var(--muted-2); font-weight: 400; letter-spacing: 0; }
.site-nav { display: flex; gap: 28px; }
.site-nav a { font-size: 14px; font-weight: 400; color: var(--ink-2); transition: color .2s var(--ease); }
.site-nav a:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* Kategorien-Dropdown (Desktop) */
.nav-item.has-dropdown { position: relative; display: inline-flex; align-items: center; }
.nav-trigger { background: none; border: none; padding: 0; font: inherit; font-size: 14px; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: color .2s var(--ease); }
.nav-trigger::after { content: ""; display: inline-block; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-top: -3px; transition: transform .25s var(--ease); }
.nav-item.has-dropdown:hover .nav-trigger,
.nav-item.has-dropdown:focus-within .nav-trigger { color: var(--ink); }
.nav-item.has-dropdown:hover .nav-trigger::after,
.nav-item.has-dropdown:focus-within .nav-trigger::after { transform: rotate(-135deg); margin-top: 2px; }
.dropdown { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); padding-top: 12px; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s var(--ease); z-index: 60; }
.nav-item.has-dropdown:hover .dropdown,
.nav-item.has-dropdown:focus-within .dropdown { opacity: 1; visibility: visible; pointer-events: auto; }
.dropdown-inner { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.12); padding: 8px; min-width: 230px; display: grid; gap: 2px; }
.dropdown-inner a { padding: 10px 14px; border-radius: 9px; font-size: 15px; color: var(--ink); white-space: nowrap; transition: background .15s var(--ease); }
.dropdown-inner a:hover { background: var(--bg-grey); }

/* ---------- Hero (zentriert, Typo-getrieben) ---------- */
.hero { text-align: center; padding-block: clamp(72px, 12vw, 140px) clamp(48px, 8vw, 96px); }
.hero h1 {
  font-size: clamp(40px, 8vw, 80px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.04;
  max-width: 16ch; margin-inline: auto;
}
.hero p.sub {
  font-size: clamp(19px, 2.6vw, 26px); font-weight: 400; color: var(--ink-2); line-height: 1.38;
  letter-spacing: -0.012em; margin: 22px auto 0; max-width: 44ch;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 8px 30px; justify-content: center; align-items: center; margin-top: 34px; }

/* ---------- Produkt-Kacheln (Apple-Store-Bento) ---------- */
.product-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.featured-grid {
  display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
}
.product-card {
  display: flex; flex-direction: column; text-align: center;
  background: var(--bg-grey); border-radius: var(--radius-lg);
  padding: 44px 28px 36px; position: relative; overflow: hidden;
  transition: transform .3s var(--ease);
}
.product-card:hover { transform: translateY(-3px); }
.product-badge {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted);
  text-transform: uppercase;
}
.product-cat { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.product-title { font-size: clamp(24px, 3vw, 28px); font-weight: 600; letter-spacing: -0.02em; }
.product-title a:hover { color: var(--link); }
.product-sub { color: var(--muted); font-size: 17px; margin-top: 8px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-icon {
  margin: 28px auto 24px; width: 96px; height: 96px; border-radius: 24px;
  display: grid; place-items: center; background: var(--bg);
  color: var(--muted-2);
}
[data-theme="dark"] .product-icon { background: #000; }
.product-icon img, .product-icon svg { width: 44px; height: 44px; }
.product-media-img { margin: 24px auto; width: 100%; max-width: 280px; aspect-ratio: 4/3; object-fit: cover; border-radius: 16px; }
.product-foot { margin-top: auto; padding-top: 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.price { display: inline-flex; align-items: baseline; gap: 8px; }
.price .now { font-size: 19px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.price .was { font-size: 15px; color: var(--muted-2); text-decoration: line-through; }
.price .free { color: var(--ink); }

/* ---------- Produktdetail ---------- */
.detail { padding-block: 40px clamp(64px, 9vw, 110px); }
.breadcrumb { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; margin-bottom: 36px; flex-wrap: wrap; }
.breadcrumb a { color: var(--link); }
.breadcrumb a:hover { color: var(--link-hover); }
.detail-grid { display: grid; gap: clamp(32px, 5vw, 72px); grid-template-columns: 1fr; }
@media (min-width: 900px) { .detail-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.detail-media {
  border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 1/1;
  background: var(--bg-grey); display: grid; place-items: center;
}
@media (min-width: 900px) { .detail-media { position: sticky; top: 80px; } }
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-media .product-icon { background: var(--bg); width: 128px; height: 128px; border-radius: 32px; }
.detail-media .product-icon svg { width: 60px; height: 60px; }
.detail-cat { font-size: 14px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-2); }
.detail h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 700; letter-spacing: -0.025em; margin-top: 8px; }
.detail .lead { font-size: clamp(19px, 2.4vw, 21px); color: var(--ink-2); margin-top: 16px; line-height: 1.42; }
.detail .price-block { display: flex; align-items: baseline; gap: 12px; margin: 26px 0; }
.detail .price-block .now { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.detail .price-block .was { color: var(--muted-2); text-decoration: line-through; font-size: 19px; }
.detail .buy-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.detail .buy-note { font-size: 14px; color: var(--muted); margin-top: 16px; display: flex; align-items: center; gap: 6px; }
.detail .desc { margin-top: 32px; color: var(--ink-2); font-size: 17px; }

.feature-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); font-size: 17px; }
.feature-list li svg { flex: none; color: var(--blue); margin-top: 4px; }

.panel { border-top: 1px solid var(--border); padding-top: 28px; margin-top: 36px; }
.panel h3 { font-size: 21px; font-weight: 600; margin-bottom: 14px; }

/* FAQ */
.faq { margin-top: 16px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { padding: 20px 0; font-weight: 500; font-size: 19px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 24px; font-weight: 300; color: var(--link); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 22px; color: var(--muted); font-size: 17px; max-width: 60ch; }

/* ---------- Statusseiten ---------- */
.status-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 64px 0; }
.status-card { max-width: 520px; }
.status-icon { width: 80px; height: 80px; margin: 0 auto 28px; display: grid; place-items: center; border-radius: 50%; background: var(--bg-grey); color: var(--ink); }
.status-icon.ok { color: #1d8a34; }
.status-card h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 700; letter-spacing: -0.025em; }
.status-card p { color: var(--muted); margin-top: 16px; font-size: 19px; }
.status-card .btn, .status-card .link { margin-top: 28px; }

/* ---------- Notice / Empty ---------- */
.notice { background: var(--bg-grey); border-radius: var(--radius-sm); padding: 16px 20px; font-size: 15px; color: var(--ink-2); }
.empty-state { text-align: center; padding: 64px 16px; color: var(--muted); font-size: 19px; }

/* ---------- Kategorie-Filter ---------- */
.cat-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  font-size: 14px; font-weight: 400; padding: 9px 17px; border-radius: var(--radius-pill);
  background: var(--bg-grey); color: var(--ink-2); border: 1px solid transparent;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.chip:hover { color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--bg); }
.chip .count { color: var(--muted-2); margin-left: 4px; }
.chip.is-active .count { color: color-mix(in srgb, var(--bg) 60%, transparent); }

/* ---------- Login ---------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px; }
.auth-card { width: 100%; max-width: 380px; text-align: center; }
.auth-card h2 { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; }
.auth-card p { color: var(--muted); margin-top: 6px; font-size: 17px; }
.auth-card label { display: block; text-align: left; font-size: 14px; font-weight: 500; margin: 28px 0 6px; color: var(--ink-2); }
.field {
  width: 100%; padding: 13px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 17px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent); }
.auth-error { background: color-mix(in srgb, #ff3b30 12%, transparent); color: #d70015; border-radius: var(--radius-sm); padding: 12px 16px; font-size: 15px; margin-top: 16px; }

/* ---------- Admin ---------- */
.admin-bar { background: var(--surface); border-bottom: 1px solid var(--border); }
.admin-bar .container { display: flex; align-items: center; gap: 16px; height: 56px; max-width: var(--maxw-wide); }
.admin-main { padding-block: 32px 80px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--border); font-size: 15px; vertical-align: middle; }
.admin-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.tag { display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; }
.tag-live { background: color-mix(in srgb, #1d8a34 14%, transparent); color: #1d8a34; }
.tag-draft { background: var(--bg-grey); color: var(--muted); }
.admin-form { display: grid; gap: 20px; max-width: 860px; }
.admin-form .row { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 680px){ .admin-form .row.two { grid-template-columns: 1fr 1fr; } .admin-form .row.three { grid-template-columns: 1fr 1fr 1fr; } }
.admin-form label { font-size: 14px; font-weight: 500; display: block; margin-bottom: 6px; color: var(--ink-2); }
.admin-form textarea.field { min-height: 96px; resize: vertical; }
.admin-form .hint { font-size: 13px; color: var(--muted); margin-top: 5px; }
select.field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2386868b' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.checkbox-row { display: flex; gap: 24px; flex-wrap: wrap; }
.checkbox-row label { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; }
.flash { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 24px; font-size: 15px; }
.flash-ok { background: color-mix(in srgb, #1d8a34 12%, transparent); color: #1d8a34; }

/* ---------- Footer (Apple-Stil, klein & grau) ---------- */
.site-footer { background: var(--bg-grey); border-top: 1px solid var(--border); margin-top: 0; }
.footer-inner { max-width: var(--maxw-wide); margin-inline: auto; padding: 40px 22px 0; display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 720px){ .footer-inner { grid-template-columns: 1.6fr 1fr; } }
.footer-brand strong { font-size: 15px; font-weight: 600; color: var(--ink); }
.footer-brand p { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 28px; align-content: start; }
.footer-links a { color: var(--ink-2); font-size: 12px; transition: color .2s var(--ease); }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.footer-bottom { max-width: var(--maxw-wide); margin: 0 auto; padding: 20px 22px; margin-top: 28px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }

/* ---------- Reveal ---------- */
/* Nur wenn JS aktiv ist verstecken (ausfallsicher: ohne JS immer sichtbar) */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } .reveal { opacity: 1 !important; transform: none !important; transition: none; } }

/* ---------- Barrierefreiheit ---------- */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-size: 15px; transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }
#inhalt { scroll-margin-top: 64px; }
main section[id] { scroll-margin-top: 64px; }

/* ---------- Ganze Produktkachel klickbar (stretched link) ---------- */
.product-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.product-foot .link { position: relative; z-index: 2; } /* eigener Link bleibt eigenständig */

/* ---------- Hamburger-Menü (mobil) ---------- */
.nav-toggle { display: none; }
.nav-toggle .icon-close { display: none; }
.site-header.menu-open .nav-toggle .icon-open { display: none; }
.site-header.menu-open .nav-toggle .icon-close { display: block; }

/* ---------- Fixe Kauf-Leiste (mobil, Detailseite) ---------- */
.buybar { display: none; }
@media (max-width: 767px) {
  .buybar {
    display: flex; align-items: center; gap: 14px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--border);
  }
  .buybar .buybar-price { font-size: 19px; font-weight: 600; margin-right: auto; }
  .buybar .buybar-price .was { font-size: 14px; color: var(--muted-2); text-decoration: line-through; margin-left: 6px; }
  .buybar .btn { flex: none; }
  .detail { padding-bottom: 96px; }   /* Platz für die Leiste */
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .brand small { display: none; }
  .nav-toggle { display: inline-grid; }
  .site-nav {
    display: none; position: absolute; top: 48px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 6px 22px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 28px rgba(0,0,0,.08);
    max-height: calc(100vh - 48px); overflow-y: auto;
  }
  .site-header.menu-open .site-nav { display: flex; }
  .site-nav > a, .nav-trigger { padding: 14px 2px; font-size: 17px; color: var(--ink); border-bottom: 1px solid var(--border-2); }

  /* Kategorien-Dropdown wird im offenen Menü zur aufgeklappten Liste */
  .nav-item.has-dropdown { display: block; }
  .nav-trigger { width: 100%; text-align: left; justify-content: space-between; }
  .nav-trigger::after { margin-top: 0; }
  .dropdown { position: static; opacity: 1; visibility: visible; pointer-events: auto; transform: none; padding: 0; }
  .dropdown-inner { border: none; box-shadow: none; padding: 4px 0 6px; min-width: 0; background: transparent; gap: 0; }
  .dropdown-inner a { padding: 11px 14px; font-size: 15px; color: var(--ink-2); }
}
