/* =============================================================================
   Styles – LIGHT ONLY (Dark Mode vollständig entfernt)
   Belassen wie gewünscht: reines Light Theme mit bestehenden Farben/Abständen.
   ============================================================================= */

/* Tokens – Light */
:root {
  --primary: #007F7F;
  --primary-dark: #006666;
  --background: #f9f9f9;
  --text: #333;
  --card-bg: #ffffff;
  --border: #ddd;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  --radius: 8px;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, sans-serif;
  background-color: var(--background);
  color: var(--text);
}

* { box-sizing: border-box; }

/* ========================= Layout: Grid mit Sidebar ========================= */
.container.grid-layout {
  display: grid;
  grid-template-columns: 250px 1fr; /* Sidebar + Content */
  gap: 2rem;
  margin: 2rem;
  padding: 1rem;
  max-width: none;
  align-items: flex-start;
}

/* =============================== Sidebar =================================== */
.sidebar {
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: transform 0.3s ease;
}

.sidebar label {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: #444;
}

.sidebar input[type="checkbox"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  margin: 0;
}

.sidebar section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--primary-dark);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ============================ Header / Toolbar ============================== */
header {
  background-color: white;
  color: var(--primary);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
}

#toolbar {
  display: none;
  justify-content: flex-end;  /* rechtsbündig */
  align-items: center;
  gap: 1.2rem;
  padding: 0.5rem 2rem;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(3px);
  font-size: 0.92rem;
  font-family: "Segoe UI", Roboto, sans-serif;
  box-shadow: none;
}

#toolbar a {
  color: #444;
  text-decoration: none;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  transition: all 0.2s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

#toolbar a:hover {
  background-color: rgba(230, 230, 230, 0.6);
  color: #000;
}

/* ================================ Container ================================= */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 1rem;
}

/* ============================= Suchleiste =================================== */
.search-bar {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0 0 1rem 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 50px;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s ease;
}

.search-bar input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  padding: 0.5rem;
  border-radius: 50px;
  background: transparent;
  color: #333;
}

.search-bar button {
  background: var(--primary);
  border: none;
  color: white;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-bar button:hover { background-color: var(--primary-dark); }

/* ============================= Filterleisten ================================ */
#categoryFilter,
#pyrokatFilter {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); /* letzter Stand */
  gap: 0.5rem;
}

.category-filter button,
#pyrokatFilter button {
  background: white;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.category-filter button:hover,
#pyrokatFilter button:hover {
  background: var(--primary);
  color: white;
}

.category-filter button.active,
#pyrokatFilter button.active {
  background: var(--primary);
  color: white;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 127, 127, 0.3);
}

/* Farbliche Spezial-Buttons für Pyro-Kategorien */
.pyrokat-button-f1 { border-color: #2ecc71; color: #2ecc71; }
.pyrokat-button-f2 { border-color: #007F7F; color: #007F7F; }
.pyrokat-button-f3 { border-color: #e67e22; color: #e67e22; }
.pyrokat-button-f4 { border-color: #c0392b; color: #c0392b; font-weight: bold; }
.pyrokat-button-p2 { border-color: #888; color: #888; }
.pyrokat-button-keine { border-color: #aaa; color: #aaa; }

/* ============================== Produktliste ================================ */
.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
}

.product {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  transition: transform 0.2s;
  min-height: 480px;
  cursor: pointer;
}

.product:hover { transform: translateY(-4px); }

.product img {
  max-width: 100%;
  max-height: 100%;
  object-fit: scale-down;
  display: block;
}

.product h3 {
  font-size: 1.3rem;
  text-align: center;
  color: var(--primary);
  margin: 0.3rem 0 0.3rem 0;
}

/* Klickdurchlässigkeit feinjustieren */
.product { cursor: pointer; }
.product .beschreibung,
.product .lageranzeige,
.product .preis,
.product .cart-controls { cursor: default; }

/* Pyro-Kat Label (oben links) */
.pyrokat-label {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 1.1rem;
  font-weight: bold;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: transparent;
  color: #333;
  z-index: 1;
}

/* Farbklassen je nach PyroKat */
.pyrokat-F1 { color: #2ecc71; }
.pyrokat-F2 { color: #007F7F; }
.pyrokat-F3 { color: #e67e22; }
.pyrokat-F4 { color: #c0392b; font-weight: 800; }

.product .pyrokat-label.empty {
  visibility: hidden;
  height: 1.5rem;
}

/* Zusatzinfos */
.artikelnummer-label {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.75rem;
  color: #999;
  font-style: italic;
}

.kategorie-label {
  font-size: 0.75rem;
  color: #666;
  text-align: center;
  margin-top: 0.25rem;
  margin-bottom: -1rem;
}

.hersteller-label {
  font-size: 0.75rem;
  color: #999;
  text-align: center;
  margin-top: -1rem;
  margin-bottom: 0.6rem;
}

.produkt-info p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  text-align: center;
}

.produkt-info .beschreibung {
  color: #444;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.produkt-info .preis {
  font-size: 1.1rem;
  font-weight: bold;
  color: #000;
  margin-top: 0.5rem;
  text-align: center;
}

/* Details-Block */
.product-details {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #555;
  margin-bottom: 1rem;
}

.product-details strong {
  display: inline-block;
  width: 110px;
  font-weight: 600;
  color: #333;
}

/* Preis (zentriert) */
.product-price {
  font-size: 1rem;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 0.8rem;
  text-align: center;
}

/* Bildrahmen */
.bild-wrapper {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 6px;
  margin-bottom: 1rem;
}

/* Verkaufslevel Badge */
.verkaufslevel-label-wrapper {
  text-align: center;
  margin-top: 0.4rem;
}

.verkaufslevel-label {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: bold;
  color: white;
  border-radius: 6px;
}

.level-0 { background-color: #7f8c8d; }
.level-1 { background-color: #e67e22; }
.level-2 { background-color: #9b59b6; }
.level-3 { background-color: #c0392b; }

/* Produkt-Buttons */
.product button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
  display: block;
  margin: 0 auto 0.4rem auto;
}

.product button:hover { background: var(--primary-dark); }

/* ============================= Warenkorb / Checkout ========================= */
.delivery, .cart {
  margin-top: 2rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.cart h2 { margin-top: 0; }

.cart ul {
  list-style: none;
  padding: 0;
}

.cart li {
  padding: 0.6rem 0;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Segoe UI', sans-serif;
}

.cart-item-info { display: flex; align-items: center; gap: 1rem; }
.cart-item-text { display: flex; flex-direction: column; }

.cart-item-prices {
  text-align: right;
  min-width: 100px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 0.85rem;
  color: #666;
}
.cart-item-prices span {
  display: block;
  font-size: 0.75rem;
}
.cart-item-prices strong {
  display: block;
  font-size: 1rem;
  color: #000;
}

#cartTotal {
  font-weight: bold;
  font-size: 1.3rem;
  text-align: right;
  margin-top: 1rem;
  color: #000;
}

.cart button {
  margin-top: 1rem;
  width: 100%;
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem;
  font-weight: bold;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
}

.cart button:hover { background-color: var(--primary-dark); }

.cart .remove-btn {
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  width: 100px;
  text-align: center;
}

/* Mengensteuerung */
.cart-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.cart-controls input[type="number"] {
  width: 70px;
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  text-align: center;
  font-size: 1rem;
}

.cart-controls button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.cart-controls button:hover { background: var(--primary-dark); }

.menge-input {
  width: 60px;
  margin-left: 10px;
  padding: 0.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* Floating Cart Button */
#floatingCartBtn {
  position: fixed;
  bottom: 1.6rem;
  right: 1.6rem;
  width: 52px;
  height: 52px;
  background-color: var(--primary);
  color: white;
  font-size: 1.4rem;
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  z-index: 999;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

#floatingCartBtn:hover {
  transform: scale(1.12);
  background-color: var(--primary-dark);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  color: white;
}

/* =============================== Snackbar ================================== */
#snackbar {
  visibility: hidden;
  min-width: 260px;
  background-color: var(--primary);
  color: white;
  border-radius: var(--radius);
  padding: 1rem;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
#snackbar.show {
  visibility: visible;
  opacity: 1;
}

/* ================================= Footer ================================== */
footer {
  background-color: #f8f8f8;
  color: #777;
  font-size: 0.9rem;
  text-align: center;
  padding: 1.5rem;
  margin-top: 3rem;
  border-top: 1px solid #ddd;
}

/* ============================== Login-Card ================================= */
.login-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 75vh;
}

.login-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2.2rem;
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 1px solid #eee;
  position: relative;
}

.login-card .logo-box {
  text-align: center;
  margin-bottom: 2.5rem;
  margin-top: 1.2rem;
}

.login-card .logo-box img {
  max-width: 200px;
  height: auto;
  display: inline-block;
  filter: drop-shadow(0 2px 8px rgba(0,127,127,0.06));
}

.login-card label {
  font-size: 1rem;
  font-weight: 500;
  margin-top: 1rem;
  margin-bottom: 0.3rem;
  color: #444;
}

.login-card input[type="text"],
.login-card input[type="email"],
.login-card input[type="password"],
.login-card input[type="date"] {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  outline: none;
  background: #fafafa;
  transition: border 0.2s ease;
}

.login-card input:focus {
  border-color: var(--primary);
  background: #fff;
}

.login-card button {
  margin-top: 1.2rem;
  width: 100%;
  padding: 0.7rem;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 1.07rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(0,127,127,0.08);
  transition: background 0.2s;
}

.login-card button:hover { background: var(--primary-dark); }

.login-card .register-link {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.95rem;
  color: #555;
}

.login-card .register-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  margin-left: 0.2rem;
}

.login-card .register-link a:hover { text-decoration: underline; }

/* Back-Button (z. B. im Header) */
.back-btn {
  background: none;
  border: none;
  padding: 0;
  margin-right: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--primary-dark);
  font-size: 1.5rem;
  transition: color 0.2s;
}

.back-btn:hover { color: var(--primary); }

/* Formular-Reihen */
.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-row > div {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
}

/* ============================== Mobile Styles ============================== */
/* Sidebar als Slide-in Panel bei Mobile */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 260px;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 2000;
    padding: 1.5rem;
    overflow-y: auto;
  }
  .sidebar.active { transform: translateX(0); }

  /* Overlay für abgedunkelten Hintergrund beim Öffnen der Sidebar */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out;
    z-index: 1500;
  }
  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  #sidebarToggle {
    display: inline-block;
    font-size: 1.8rem;
    margin-left: 0.5rem;
  }
}

/* ===== Smartphone: 2 Produkte pro Reihe ===== */
@media (max-width: 600px) {
  .container { margin: 1rem auto; padding: 0.75rem; }

  .product-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* genau 2 Spalten */
    gap: 0.9rem;
  }

  .product {
    padding: 0.9rem;
    min-height: unset;             /* nicht künstlich strecken */
  }

  .product h3 { font-size: 1.06rem; }
  .produkt-info .preis { font-size: 1rem; }
  .bild-wrapper { border-radius: 6px; margin-bottom: 0.75rem; }
  .cart-controls input[type="number"] { width: 64px; }
  .form-row { flex-direction: column; }
}
