:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-hover: #1c2128;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #00d9d9;
  --accent-hover: #00b8b8;
  --accent-dim: rgba(0, 217, 217, 0.12);
  --danger: #f85149;
  --success: #3fb950;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font: system-ui, -apple-system, 'Segoe UI', 'Inter', Roboto, sans-serif;
  --max-width: 1100px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.logo:hover {
  color: var(--accent-hover);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1.2rem;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
}

/* Main */
main {
  flex: 1;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 4rem 1.25rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto 2rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--bg);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-secondary:hover {
  background: var(--accent-dim);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #da3633;
  color: #fff;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

/* Sections */
.section {
  padding: 3rem 0;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.section-text {
  color: var(--text-muted);
  max-width: 680px;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Shop Search */
.shop-search {
  margin-bottom: 1.5rem;
  max-width: 480px;
}

.shop-search-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.shop-search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.857 1.106a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.85rem center;
  transition: border-color 0.2s;
}

.shop-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.shop-search-input::placeholder {
  color: var(--text-muted);
}

.shop-search-count {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Shop Grid */
.shop-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.product-image {
  aspect-ratio: 16 / 10;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-placeholder {
  color: var(--text-muted);
  font-size: 3rem;
}

.product-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-body h3 {
  font-size: 1.1rem;
}

.product-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
}

.product-price {
  font-weight: 600;
  color: var(--accent);
  font-size: 1rem;
}

.product-body .btn {
  margin-top: 0.5rem;
  width: 100%;
}

.shop-notice {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Anleitungen List */
.anleitungen-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.anleitung-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.anleitung-item h3 {
  font-size: 1.05rem;
}

.anleitung-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.anleitung-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.anleitung-item .btn {
  align-self: flex-start;
  margin-top: 0.25rem;
}

/* Legal pages */
.legal-content h1 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.legal-content h2 {
  font-size: 1.2rem;
  margin: 2rem 0 0.75rem;
  color: var(--accent);
}

.legal-content p,
.legal-content li {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.legal-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-content .placeholder {
  background: var(--accent-dim);
  border: 1px dashed var(--accent);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--accent);
  font-family: monospace;
  font-size: 0.9em;
}

/* Loading / Empty states */
.loading,
.empty-state,
.error-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.error-state {
  color: var(--danger);
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 1.25rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Admin styles */
.admin-body {
  background: var(--bg);
}

.admin-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header h1 {
  font-size: 1.2rem;
  color: var(--accent);
}

.admin-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin-nav a:hover,
.admin-nav a.active {
  color: var(--accent);
}

.admin-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-card h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form-group input[type='text'],
.form-group input[type='url'],
.form-group input[type='number'],
.form-group input[type='password'],
.form-group input[type='file'],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-check input[type='checkbox'] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: rgba(248, 81, 73, 0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.alert-success {
  background: rgba(63, 185, 80, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-table tr:hover td {
  background: var(--surface-hover);
}

.table-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg);
}

.table-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-active {
  background: rgba(63, 185, 80, 0.15);
  color: var(--success);
}

.status-inactive {
  background: rgba(139, 148, 158, 0.15);
  color: var(--text-muted);
}

.image-preview {
  margin-top: 0.5rem;
  max-width: 200px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.login-card h1 {
  text-align: center;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.login-card p {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.table-wrapper {
  overflow-x: auto;
}

/* Responsive */
@media (min-width: 600px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }

  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .anleitung-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .anleitung-item .btn {
    flex-shrink: 0;
  }
}

@media (min-width: 900px) {
  .shop-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
  }

  .site-nav.open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0.75rem;
  }

  .header-inner {
    position: relative;
    flex-wrap: wrap;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
