:root {
  --bg: #17181c;
  --surface: #1f2126;
  --surface-2: #262930;
  --border: #33363d;
  --text: #edeff2;
  --text-muted: #8d9199;
  --accent: #2fd8ff;
  --accent-dim: #1a8fb3;
  --accent-glow: rgba(47, 216, 255, 0.35);
  --danger: #ff6b6b;
  --content-width: 900px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } html { scroll-behavior: auto; } }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: rgba(23, 24, 28, 0.85);
  backdrop-filter: blur(8px); z-index: 10;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--content-width); margin: 0 auto; padding: 22px 24px;
}
.admin-header-inner { max-width: none; padding: 22px 5vw; }
.logo { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.04em; text-decoration: none; font-size: 1.05rem; }
.nav { display: flex; gap: 28px; }
.nav a { text-decoration: none; color: var(--text-muted); font-size: 0.92rem; transition: color 0.15s ease; padding-bottom: 4px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--accent); }
.nav a.active { color: var(--text); border-bottom-color: var(--accent); }

/* Hero */
.hero { padding: 96px 24px 64px; max-width: var(--content-width); margin: 0 auto; }
.eyebrow { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; color: var(--accent); margin: 0 0 14px; }
.hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.15; margin: 0 0 20px; font-weight: 600; }
.hero-sub { color: var(--text-muted); font-size: 1.05rem; max-width: 520px; margin: 0; }

/* Sections */
.products, .faq { padding: 48px 24px 80px; max-width: var(--content-width); margin: 0 auto; }
.section-head {
  margin-bottom: 28px; display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 12px 24px; border-bottom: 1px solid var(--border); padding-bottom: 20px;
}
.section-head-title { display: flex; align-items: baseline; gap: 12px; }
.section-num { font-family: var(--font-mono); color: var(--accent); font-size: 0.85rem; }
.section-head h2 { font-family: var(--font-display); font-size: 1.5rem; margin: 0; font-weight: 600; }
.section-head-sub { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.section-head .category-filter { width: 100%; }

/* Category filter */
.category-filter { display: flex; gap: 10px; flex-wrap: wrap; }
.cat-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  font-family: var(--font-mono); font-size: 0.8rem; padding: 7px 14px; border-radius: 20px;
  cursor: pointer; transition: all 0.15s ease;
}
.cat-btn:hover { border-color: var(--accent-dim); color: var(--text); }
.cat-btn.active { background: var(--accent); border-color: var(--accent); color: #0c1013; }

/* Slider */
.slider {
  position: relative; overflow: hidden; max-width: var(--content-width); margin: 32px auto 24px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
}
.slider-track { display: flex; transition: transform 0.5s ease; }
@media (prefers-reduced-motion: reduce) { .slider-track { transition: none; } }

.slide {
  min-width: 100%; display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  gap: 28px; padding: 36px 32px;
}
.slide-img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); }
.slide-img-placeholder, .card-img-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--accent-dim);
  font-family: var(--font-display); font-size: 3rem; font-weight: 600;
}
.slide-info h2 { font-family: var(--font-display); font-size: 1.8rem; margin: 8px 0 12px; }
.slide-price { font-family: var(--font-mono); color: var(--accent); font-size: 1.3rem; margin: 0 0 18px; }
.slide-cta { display: inline-block; }

.slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); background: rgba(23,24,28,0.7);
  border: 1px solid var(--border); color: var(--text); width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; font-size: 1.4rem; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.slider-arrow:hover { border-color: var(--accent); color: var(--accent); }
.slider-prev { left: 16px; }
.slider-next { right: 16px; }

.slider-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.slider-dot { width: 8px; height: 8px; border-radius: 50%; border: none; background: var(--border); cursor: pointer; padding: 0; }
.slider-dot.active { background: var(--accent); }

@media (max-width: 720px) {
  .slide { grid-template-columns: 1fr; text-align: center; padding: 28px 24px; }
}

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card-img {
  width: 100%; height: 160px; object-fit: cover; border-radius: 3px;
  border: 1px solid var(--border); margin-bottom: 4px;
}
.cat-badge {
  font-family: var(--font-body); background: var(--surface-2); color: var(--text-muted);
  font-size: 0.7rem; padding: 2px 8px; border-radius: 10px; margin-left: 8px;
}
.ref-tag {
  position: absolute; top: 24px; right: 24px; background: rgba(10,11,13,0.75);
  color: var(--accent); font-family: var(--font-mono); font-size: 0.68rem;
  padding: 3px 9px; border-radius: 3px; letter-spacing: 0.04em;
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-left: 2px solid var(--border);
  border-radius: 4px; padding: 24px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { border-left-color: var(--accent); box-shadow: -1px 0 18px -4px var(--accent-glow); transform: translateY(-2px); }
.card .code { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent-dim); letter-spacing: 0.08em; }
.card h3 { font-family: var(--font-display); margin: 0; font-size: 1.15rem; font-weight: 600; }
.card p.desc { color: var(--text-muted); font-size: 0.92rem; margin: 0; flex-grow: 1; }
.card .price { font-family: var(--font-mono); color: var(--text); font-size: 1.1rem; margin-top: 6px; }

.buy-btn, .btn {
  margin-top: 8px; background: transparent; border: 1px solid var(--accent-dim); color: var(--accent);
  font-family: var(--font-body); font-weight: 600; padding: 10px 16px; border-radius: 3px; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease; text-decoration: none; display: inline-block; text-align: center;
}
.buy-btn:hover, .btn:hover { background: var(--accent); color: #0c1013; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #17181c; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--border); padding: 16px 0; }
.faq summary { cursor: pointer; font-family: var(--font-display); font-weight: 500; font-size: 1rem; }
.faq p { color: var(--text-muted); margin: 12px 0 0; font-size: 0.94rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); }
.footer-inner {
  max-width: var(--content-width); margin: 0 auto; padding: 28px 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  color: var(--text-muted); font-size: 0.85rem;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { text-decoration: none; color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 11, 13, 0.75); display: none;
  align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 32px; max-width: 420px; width: 100%; position: relative; }
.modal-close { position: absolute; top: 14px; right: 14px; background: none; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--accent); }
.modal h3 { font-family: var(--font-display); margin: 0 0 10px; font-size: 1.3rem; }
.modal-desc { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 16px; }
.modal-price { font-family: var(--font-mono); font-size: 1.3rem; margin: 0 0 20px; color: var(--accent); }

.consent-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; font-size: 0.85rem; color: var(--text-muted); }
.consent-row input { margin-top: 3px; }

.checkout-success { text-align: center; padding: 8px 0; }
.success-check { color: var(--accent); font-weight: 600; font-size: 1.05rem; }
.download-btn { display: inline-block; margin-top: 12px; background: var(--accent); color: #0c1013; text-decoration: none; font-weight: 600; padding: 12px 22px; border-radius: 3px; }
.success-note { color: var(--text-muted); font-size: 0.8rem; margin-top: 14px; }
.checkout-error { color: var(--danger); font-size: 0.9rem; }

@media (max-width: 560px) {
  .header-inner { padding: 18px 20px; }
  .hero { padding: 64px 20px 40px; }
}

/* Cart link in nav */
.cart-link { display: flex; align-items: center; gap: 6px; }
.cart-count {
  background: var(--accent); color: #0c1013; font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 600; padding: 1px 7px; border-radius: 10px;
}

/* Compact product cards */
.grid-compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card-compact { padding: 0; overflow: hidden; }
.card-compact .card-link { display: block; text-decoration: none; color: inherit; padding: 16px 16px 0; }
.card-compact .card-img { height: 130px; margin-bottom: 10px; }
.card-compact h3 { font-size: 1rem; margin-bottom: 4px; }
.desc-short { color: var(--text-muted); font-size: 0.82rem; margin: 0 0 12px; line-height: 1.45; }
.card-footer { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 16px; gap: 10px; }
.card-footer .price { margin: 0; font-size: 1rem; }
.card-footer .buy-btn { margin: 0; font-size: 0.82rem; padding: 8px 12px; white-space: nowrap; }

/* Product detail page */
.breadcrumb { padding: 24px 24px 0; margin: 0; color: var(--text-muted); font-size: 0.85rem; max-width: var(--content-width); margin-inline: auto; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.product-detail { padding-bottom: 80px; }
.product-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; max-width: var(--content-width);
  margin: 24px auto 0; padding: 0 24px; align-items: start;
}
.gallery-layout { display: flex; gap: 12px; }
.gallery-thumbs-vertical {
  display: flex; flex-direction: column; gap: 8px; flex-shrink: 0;
  max-height: 460px; overflow-y: auto; padding-right: 2px;
}
.gallery-main { flex: 1; min-width: 0; position: relative; }
.gallery-main img {
  width: 100%; border-radius: 6px; border: 1px solid var(--border); object-fit: cover;
}
.gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); background: rgba(23,24,28,0.7);
  border: 1px solid var(--border); color: var(--text); width: 38px; height: 38px; border-radius: 50%;
  cursor: pointer; font-size: 1.3rem; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.gallery-arrow:hover { border-color: var(--accent); color: var(--accent); }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-thumbs-vertical .gallery-thumb {
  width: 56px; height: 56px; object-fit: cover; border-radius: 4px; cursor: pointer;
  border: 2px solid var(--border); opacity: 0.7; flex-shrink: 0;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.active { opacity: 1; border-color: var(--accent); }

@media (max-width: 640px) {
  .gallery-layout { flex-direction: column-reverse; }
  .gallery-thumbs-vertical { flex-direction: row; max-height: none; overflow-x: auto; padding-right: 0; padding-bottom: 2px; }
}

.product-detail-info h1 { font-family: var(--font-display); font-size: 1.9rem; margin: 10px 0 16px; }
.product-detail-desc { color: var(--text-muted); font-size: 0.98rem; line-height: 1.6; margin-bottom: 20px; }
.product-detail-desc p { margin: 0 0 12px; }
.product-detail-desc ul, .product-detail-desc ol { margin: 0 0 12px; padding-left: 22px; }
.product-detail-desc a { color: var(--accent); }
@media (max-width: 760px) {
  .product-detail-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* Cart page */
.cart-row {
  display: grid; grid-template-columns: 56px 1fr auto auto auto; align-items: center;
  gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border);
}
.cart-row-img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); }
.cart-row-title { margin: 0; font-family: var(--font-display); font-size: 0.95rem; }
.cart-row-code { margin: 2px 0 0; color: var(--text-muted); font-family: var(--font-mono); font-size: 0.72rem; }
.cart-row-qty { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); }
.qty-btn {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border);
  background: transparent; color: var(--text); cursor: pointer; line-height: 1;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.cart-row-price { font-family: var(--font-mono); margin: 0; min-width: 80px; text-align: right; }
.cart-row-remove {
  background: none; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; line-height: 1;
}
.cart-row-remove:hover { color: var(--danger); }
.cart-total { font-family: var(--font-mono); font-size: 1.2rem; text-align: right; margin: 20px 0; color: var(--accent); }

@media (max-width: 560px) {
  .cart-row { grid-template-columns: 44px 1fr; grid-template-areas: "img info" "img qty" "img price"; row-gap: 6px; }
  .cart-row-img { grid-area: img; }
  .cart-row-info { grid-area: info; }
  .cart-row-qty { grid-area: qty; }
  .cart-row-price { grid-area: price; text-align: left; }
  .cart-row-remove { position: absolute; margin-left: 200px; }
}

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface-2); border: 1px solid var(--accent-dim); color: var(--text);
  padding: 12px 22px; border-radius: 30px; font-size: 0.9rem; opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Zoomable product images */
.zoomable { cursor: zoom-in; }

/* Lightbox */
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(10, 11, 13, 0.9); display: none;
  align-items: center; justify-content: center; padding: 40px; z-index: 300;
}
.lightbox-overlay.open { display: flex; }
.lightbox-img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 4px; cursor: zoom-out; }
.lightbox-close {
  position: absolute; top: 20px; right: 24px; background: none; border: none;
  color: var(--text); font-size: 2rem; cursor: pointer; line-height: 1;
}
.lightbox-close:hover { color: var(--accent); }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-shell { max-width: 1100px; margin: 0 auto; padding: 40px 5vw 80px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; flex-wrap: wrap; gap: 12px; }
.admin-header h1 { font-family: var(--font-display); font-size: 1.6rem; margin: 0; }

.login-shell { max-width: 480px; margin: 96px auto; padding: 0 5vw; }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 40px; }
.login-box h1 { font-family: var(--font-display); font-size: 1.3rem; margin: 0 0 20px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 3px;
  padding: 10px 12px; color: var(--text); font-family: var(--font-body); font-size: 0.95rem;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }

.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 20px; font-size: 0.9rem; }
.alert-error { background: rgba(255,107,107,0.1); border: 1px solid var(--danger); color: var(--danger); }
.alert-success { background: rgba(47,216,255,0.08); border: 1px solid var(--accent-dim); color: var(--accent); }

table.admin-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; }
table.admin-table th, table.admin-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.4; }
table.admin-table th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
table.admin-table tr:hover { background: var(--surface); }
.title-clamp {
  max-width: 260px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
}
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px; }

.badge { font-family: var(--font-mono); font-size: 0.72rem; padding: 0 8px; border-radius: 3px; display: inline-block; line-height: 20px; vertical-align: top; }
.badge-completed { background: rgba(47,216,255,0.12); color: var(--accent); }
.badge-pending { background: rgba(141,145,153,0.15); color: var(--text-muted); }
.badge-inactive { background: rgba(255,107,107,0.12); color: var(--danger); }

.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 24px; max-width: 520px; margin-bottom: 32px; }
.form-card h2 { font-family: var(--font-display); font-size: 1.1rem; margin: 0 0 20px; }

.action-links { display: flex; gap: 12px; align-items: center; }
.action-links a { color: var(--accent-dim); text-decoration: none; font-size: 0.85rem; line-height: 20px; }
.action-links a:hover { color: var(--accent); }

/* Rich text editor (Produktbeschreibung) */
.richtext-toolbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.richtext-toolbar button {
  background: var(--bg); border: 1px solid var(--border); color: var(--text-muted);
  font-family: var(--font-body); font-size: 0.82rem; padding: 6px 10px; border-radius: 3px; cursor: pointer;
  min-width: 34px;
}
.richtext-toolbar button:hover { border-color: var(--accent-dim); color: var(--text); }
.richtext-editable {
  min-height: 120px; background: var(--bg); border: 1px solid var(--border); border-radius: 3px;
  padding: 10px 12px; color: var(--text); font-family: var(--font-body); font-size: 0.95rem; line-height: 1.5;
}
.richtext-editable:focus { outline: none; border-color: var(--accent); }
.richtext-editable ul, .richtext-editable ol { margin: 8px 0; padding-left: 22px; }
.richtext-editable p { margin: 0 0 8px; }

/* Formular + Vorschau nebeneinander */
.form-with-preview { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
@media (max-width: 900px) {
  .form-with-preview { grid-template-columns: 1fr; }
}

.preview-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 20px; position: sticky; top: 90px;
}
.preview-card .eyebrow { margin-bottom: 12px; }
.preview-image {
  width: 100%; height: 160px; border-radius: 4px; border: 1px solid var(--border);
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-family: var(--font-mono); font-size: 0.8rem; overflow: hidden; margin-bottom: 14px;
}
.preview-title { font-family: var(--font-display); font-size: 1.1rem; margin: 0 0 6px; }
.preview-price { font-family: var(--font-mono); color: var(--accent); font-size: 1.1rem; margin: 0 0 14px; }
.preview-desc { color: var(--text-muted); font-size: 0.88rem; line-height: 1.55; border-top: 1px solid var(--border); padding-top: 14px; }
.preview-desc ul, .preview-desc ol { padding-left: 20px; }
