/* ===== Design-Tokens ===== */
:root{
  --bg:#0f1222; --fg:#e7e9f1; --muted:#a6abbd; --primary:#87cefa;
  --glass:rgba(255,255,255,.08); --card:rgba(255,255,255,.06);
  --border:rgba(255,255,255,.12); --radius:16px; --gap:1rem;
  --shadow:0 20px 40px rgba(0,0,0,.15);
  --shadow-hover:0 24px 50px rgba(0,0,0,.25);
  --focus: 0 0 0 3px rgba(106,167,255,.35);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

html[data-theme="light"]{
  --bg:#f6f7fb; --fg:#1c2230; --muted:#657089; --primary:#87cefa;
  --glass:rgba(0,0,0,.04); --card:#fff; --border:#e6e8ef;
  --shadow:0 10px 24px rgba(0,0,0,.08);
  --shadow-hover:0 18px 32px rgba(0,0,0,.14);
  --focus: 0 0 0 3px rgba(10,124,255,.25);
}

/* ===== Base ===== */
*{ box-sizing:border-box }
html,body{ height:100% }
body{
  margin:0; color:var(--fg); background:
    radial-gradient(1200px 600px at 10% 0%, #19203a 0%, var(--bg) 60%), var(--bg);
  font-family:var(--font); -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
.container{ max-width:1200px; margin:0 auto; padding:1.25rem }

a{ color:inherit; text-decoration:none }
a.link{ text-decoration:underline; text-underline-offset:3px }
img{ display:block; max-width:100%; height:auto }

:focus-visible{ outline:none; box-shadow:var(--focus) }

/* ===== Utility ===== */
.glass{ background:var(--glass); border:1px solid var(--border); border-radius:var(--radius) }
.muted{ color:var(--muted) }
.hide-sm{ display:inline }
@media (max-width:800px){ .hide-sm{ display:none } }

/* ===== Navigation ===== */
.brand{ font-weight:800; letter-spacing:.5px }
.nav-links{ display:flex; gap:.35rem; margin-left:.5rem }
.search{ margin-left:auto; display:flex; gap:.5rem; align-items:center }
.nav-right{ display:flex; gap:.5rem; align-items:center }

/* ===== Forms & Buttons ===== */
input, select, textarea{
  width:100%; padding:.6rem .7rem; border:1px solid var(--border);
  border-radius:12px; background:transparent; color:inherit; margin-top: 5px;
}
button, .btn{
  padding:.6rem .9rem; border-radius:12px; border:1px solid var(--border);
  background:transparent; color:inherit; cursor:pointer; transition:transform .06s ease;
}
.btn:active{ transform:translateY(1px) }
.btn.primary{ background:var(--primary); border-color:var(--primary); color:#030557 }
.btn.primary span { display: inline-block; position: relative; transition: 0.5s;}
.btn.primary span:after {content: '\00bb'; position: absolute; opacity: 0; right: -20px; transition: 0.5s;}
.btn.primary:hover span { padding-right: 25px;}
.btn.primary:hover span:after { opacity: 1; right: 0;}
.btn.ghost{ background:transparent; font-size: 17px; }
.ghost:hover { background-color: #f44336; color: white; cursor: pointer; }
.save_button:hover { background-color: #e7e7e7; color: black; cursor: pointer; }
.save_button span { display: inline-block; position: relative; transition: 0.5s;}
.save_button span:after {content: '\00bb'; position: absolute; opacity: 0; right: -20px; transition: 0.5s;}
.save_button:hover span { padding-right: 25px;}
.save_button:hover span:after { opacity: 1; right: 0;}
.secondary { font-size: 13.3333px; padding:.6rem .9rem; border-radius:12px; border:1px solid var(--border);background:transparent; color:inherit; transition:transform .06s ease; }
.secondary:hover { background-color: #f44336; color: white; cursor: pointer; }
.cart-btn { flex: 1; display: flex; }
.cart-btn .btn { width: 100%; }
.btn-secondary[disabled] { opacity: 0.6; cursor: not-allowed; background: #ccc; color: #666; }
.btn small { margin-bottom: 100px;}
form.card input,
form.card select { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .9rem; color: var(--fg); }
form.card label { font-weight: 600; margin-bottom: .3rem; display: block; }
.form-actions .btn { min-width: 120px; }

/* ===== Typography ===== */
h1,h2,h3{ margin:.3rem 0 1rem }
h1{ font-size:1.9rem; line-height:1.2 }
h2{ font-size:1.4rem }
h3{ font-size:1.1rem }

/* ===== Layout ===== */
.grid{ display:grid; gap:var(--gap); grid-template-columns:repeat(auto-fill, minmax(240px,1fr)) }
.grid {margin-top: 15px;}
.card{
  background:var(--card); border:1px solid var(--border); border-radius:var(--radius);
  padding:1rem; box-shadow:var(--shadow); transition:transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card.hover:hover{ transform:translateY(-4px); box-shadow:var(--shadow-hover) }
.cover-wrap{ display:block; border-radius:12px; overflow:hidden }
.card img, .product-detail .cover{ width:100%; height:220px; object-fit:cover; background:#13162a }
.card-body{ display:flex; flex-direction:column; gap:.6rem }
.inline{ display:inline-flex; gap:.5rem; align-items:center; margin-bottom: 100px; }
.price{ font-weight:800 }
.price.xl{ font-size:1.5rem }
.category-row {margin-top: 15px;}

/* ===== Hero ===== */
.hero{ display:grid; place-items:center; min-height:140px; background:
  linear-gradient(135deg, rgba(106,167,255,.18), transparent 60%) }
.hero-content{ width:100% }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1rem;
  margin-top: 3rem;
  background: var(--card);
}
.footer-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.footer a {
  color: var(--primary);
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}

/* ===== Tables & Forms layout (optionale Seiten) ===== */
.table{ width:100%; border-collapse:collapse }
.table th, .table td{ padding:.8rem; border-bottom:1px solid var(--border); text-align:left }
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:var(--gap) }
.form-grid .col-span{ grid-column:1 / -1 }

/* ===== Motion preferences ===== */
@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important }
}

.badge { display:inline-block; padding:.25rem .6rem; border-radius:999px; background:var(--glass); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.product_description { margin-top: 15px;}

/* ===== Einheitliches Admin-Tabellenlayout ===== */

/* Grundstruktur */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

/* Tabellenzellen kompakter machen */
.table th,
.table td {
  padding: 0.5rem 0.6rem;
  vertical-align: middle;
  line-height: 1.3;
}

.table tr:hover {
  background: var(--glass);
  transition: background 0.2s ease;
}

/* Tabellenkopf */
.table th {
  font-weight: 600;
  color: var(--muted);
  text-align: left;
}

/* Einheitliches Spaltenverhalten */
.table td img,
.table td .cover {
  border-radius: 10px;
  width: 100px;
  height: auto;
  object-fit: cover;
}

/* Einheitliche Actions-Zelle */
.table .actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 100%;
  padding-bottom: 36px !important;
}

/* Formulare in Aktionen ohne Margin */
.table .actions form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

/* Einheitliche Buttons */
.table .btn.small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

/* Hover-Effekt */
.table .btn.small:hover {
  background: var(--glass);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* ✏️ Bearbeiten */
.table .btn.small.edit {
  color: var(--primary);
  border-color: rgba(135, 206, 250, 0.3);
}
.table .btn.small.edit:hover {
  background: rgba(135, 206, 250, 0.15);
}

/* Löschen */
.table .btn.small.danger {
  color: #ff7b7b;
  border-color: rgba(255, 99, 99, 0.3);
}
.table .btn.small.danger:hover {
  background: rgba(255, 99, 99, 0.15);
  border-color: rgba(255, 99, 99, 0.4);
  color: #ffaaaa;
}

/* Kompaktere Badges */
.table .badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 999px;
  font-weight: 600;
}

/* ===== Benutzerverwaltung spezifisch ===== */

/* ===== Produktverwaltung spezifisch ===== */

}


}

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .table th, .table td {
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
  }

  .table .btn.small {
    height: 28px;
    min-width: 28px;
  }

  /* Bildzelle stabilisieren */
  .table.products td img.cover {
    display: block;
    width: auto;
    height: 60px !important;
    object-fit: cover;
    border-radius: 10px;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* =========================================================
   Fix: Einheitliches Admin-Layout & Buttons
   ========================================================= */

/* Gemeinsame Tabellenbasis */
.table th,
.table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
  line-height: 1.3;
  vertical-align: middle;
}

/* Benutzerverwaltung */
.table.users .actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.table.users .btn.small {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  transition: all 0.2s ease;
}

.table.users .btn.small:hover {
  background: var(--glass);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Produktverwaltung */
.table.products td {
  vertical-align: middle;
}

.table.products .actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 100%;
  padding-bottom: 20px ;
}

/* Formulare neutralisieren */
.table.products .actions form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

/* Buttons exakt gleich groß */
.table.products .btn.small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.table.products .btn.small:hover {
  background: var(--glass);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* ✏️ Bearbeiten */
.table .btn.small.edit {
  color: var(--primary);
  border-color: rgba(135, 206, 250, 0.3);
}
.table .btn.small.edit:hover {
  background: rgba(135, 206, 250, 0.15);
}
.table.products .btn.small.edit {
  color: var(--primary);
  border-color: rgba(135, 206, 250, 0.3);
}
.table.products .btn.small.edit:hover {
  background: rgba(135, 206, 250, 0.15);
}

/* 🗑️ Löschen */
.table .btn.small.danger {
  color: #ff7b7b;
  border-color: rgba(255, 99, 99, 0.3);
}
.table .btn.small.danger:hover {
  background: rgba(255, 99, 99, 0.15);
  border-color: rgba(255, 99, 99, 0.4);
  color: #ffaaaa;
}
.table.products .btn.small.danger {
  color: #ff7b7b;
  border-color: rgba(255, 99, 99, 0.3);
}
.table.products .btn.small.danger:hover {
  background: rgba(255, 99, 99, 0.15);
  border-color: rgba(255, 99, 99, 0.4);
  color: #ffaaaa;
}

/* Suchleiste */
.search-bar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}
.search-bar input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--fg);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}
.search-bar .btn.small {
  height: 36px;
  padding: 0.4rem 1rem;
  border-radius: 10px;
  background: var(--primary);
  border: none;
  color: #030557;
  cursor: pointer;
  transition: all 0.25s ease;
}
.search-bar .btn.small:hover {
  background: rgba(135, 206, 250, 0.85);
  transform: translateY(-1px);
}

/* =========================================================
   Haupt-Buttons (z. B. „Neues Produkt“) – optisch groß & klar
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.2;
}

/* große Buttons (nicht .small) */
.btn.primary:not(.small) {
  background: var(--primary);
  border-color: var(--primary);
  color: #030557;
  font-size: 0.95rem;
  padding: 0.6rem 1.2rem;
  box-shadow: 0 4px 12px rgba(135, 206, 250, 0.2);
}
.btn.primary:not(.small):hover {
  background: #5abfff;
  border-color: #5abfff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(135, 206, 250, 0.35);
}

/* =========================================================
   Header in Admin-Bereich – Titel links, Button rechts
   ========================================================= */

.admin-header {
  display: flex;
  justify-content: space-between; /* Titel links, Button rechts */
  align-items: center;             /* vertikal mittig */
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.admin-header h1 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Speziell für den + Neues Produkt Button */
.admin-header .btn.primary {
  font-size: 1rem;
  background: var(--primary);
  border-color: var(--primary);
  color: #030557;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(135, 206, 250, 0.2);
  transition: all 0.25s ease;
}

.admin-header .btn.primary:hover {
  background: #5abfff;
  border-color: #5abfff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(135, 206, 250, 0.35);
}

.checkout-form {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
    .checkout-form .grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem 2rem;
    }
    .checkout-form label {
        display: flex;
        flex-direction: column;
        font-weight: 500;
    }
    .actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 1rem;
    }
    @media (max-width: 768px) {
        .checkout-form .grid {
            grid-template-columns: 1fr;
        }
    }

    /* ===== Utility (einmalig!) ===== */
    .flex{display:flex}
    .between{justify-content:space-between}
    .align-center{align-items:center}
    .gap-sm{gap:.5rem}
    .muted{color:var(--muted)}
    .hide-sm{display:inline}
    @media (max-width:800px){ .hide-sm{display:none} }

    /* ===== Navigation – konsolidiert ===== */
    .nav.glass{
      position:sticky; top:0; z-index:1000;
      padding:.6rem 1rem;
      background:var(--glass); backdrop-filter:blur(12px);
      border:1px solid var(--border); border-radius:var(--radius);
    }
    .nav .container{
      max-width:1200px; margin:0 auto;
      display:flex; align-items:center; justify-content:space-between; gap:1rem;
    }
    .brand{ font-weight:800; letter-spacing:.3px }
    .nav .search{
      flex:1 1 420px; max-width:560px;
      display:flex; align-items:center; gap:.4rem; margin:0 1rem;
    }
    .nav .search input{
      flex:1 1 auto; min-width:160px;
      padding:.45rem .65rem; border:1px solid var(--border);
      border-radius:12px; background:var(--card); color:var(--fg);
    }
    .nav .search button{
      background:var(--primary); border:none; color:#030557;
      font-weight:600; border-radius:10px; padding:.45rem 1rem;
      transition:all .25s ease;
    }
    .nav .search button:hover{ transform:translateY(-1px) }
    .nav-right{ display:flex; align-items:center; gap:.5rem; white-space:nowrap }
    .nav .link{ color:inherit; text-decoration:none; padding:.35rem .5rem; border-radius:var(--radius) }
    .nav .link:hover{ background:var(--card) }

    /* ===== Burger / Mobile ===== */
    .only-sm{display:none}
    .burger{border:1px solid var(--border); background:var(--card); padding:.45rem .7rem; border-radius:10px}
    .mobile-menu{border-top:1px solid var(--border); background:var(--glass); padding:.75rem 1rem}
    .mobile-menu .stack{display:flex; flex-direction:column; gap:.5rem}
    .mobile-menu .search{margin:0 0 .5rem}

    /* ===== Responsive ===== */
    @media (max-width:780px){
      .only-sm{display:block}
      .hide-sm{display:none}
      .nav .search{display:none}              /* Suche oben ausblenden */
      .nav .container{flex-direction:column; align-items:stretch; gap:.5rem}
      .nav-right{justify-content:space-between; width:100%}
    }
