/* /static/websy/styles/sidebar.css
   Moderne, schöne Sidebar inkl. Sticky, Toggle-Switch, Chips & Mobile Slide-In
   LIGHT ONLY – Dark Mode vollständig entfernt */

/* ====== Container ====== */
.sidebar {
  position: sticky;         /* bleibt sichtbar beim Scrollen (Desktop) */
  top: 1.25rem;
  align-self: start;

  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);

  display: flex;
  flex-direction: column;
  gap: 1.25rem;

  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

/* Sektionen */
.sidebar section {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.sidebar h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  gap: .5rem;
  position: relative;
}

.sidebar h3::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(0,0,0,.06), rgba(0,0,0,0));
  margin-left: .5rem;
}

/* ====== Suche ====== */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar::before {
  content: "🔎";
  position: absolute;
  left: .9rem;
  font-size: 1rem;
  opacity: .75;
  pointer-events: none;
}

.search-bar input[type="text"] {
  width: 100%;
  padding: .7rem 1rem .7rem 2.2rem; /* Platz für Icon */
  font-size: 1rem;
  color: #333;

  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);

  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.search-bar input[type="text"]::placeholder { color: #9aa3a8; }
.search-bar input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0,127,127,.12);
}

/* ====== Verfügbarkeit: moderner Toggle-Switch ====== */
.sidebar label {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .92rem;
  color: #3e4b52;
  cursor: pointer;
  user-select: none;
}

/* Standard-Checkbox „unsichtbar“ machen und als Switch stylen */
.sidebar input[type="checkbox"]#verfuegbarFilter {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #e9eef0;
  border: 1px solid #d6dde0;
  position: relative;
  outline: none;
  transition: background .2s, border-color .2s, box-shadow .2s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}

.sidebar input[type="checkbox"]#verfuegbarFilter::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
  transition: transform .18s ease;
}

.sidebar input[type="checkbox"]#verfuegbarFilter:checked {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  border-color: rgba(0,0,0,.06);
  box-shadow: 0 0 0 4px rgba(0,127,127,.12);
}

.sidebar input[type="checkbox"]#verfuegbarFilter:checked::before {
  transform: translateX(18px);
}

/* ====== Filter-Chips (Kategorie & Pyrokat) ====== */
#categoryFilter,
#pyrokatFilter {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: .5rem;
}

#categoryFilter button,
#pyrokatFilter button {
  width: 100%;
  padding: .5rem .7rem;
  border-radius: 999px;

  background: #fff;
  border: 1px solid var(--border);
  color: #2b3a40;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .2px;

  box-shadow: 0 2px 6px rgba(0,0,0,.04);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#categoryFilter button:hover,
#pyrokatFilter button:hover {
  background: #f7fbfb;
  border-color: rgba(0,127,127,.35);
  box-shadow: 0 3px 10px rgba(0,0,0,.06);
}

#categoryFilter button:focus-visible,
#pyrokatFilter button:focus-visible {
  box-shadow: 0 0 0 4px rgba(0,127,127,.18);
  border-color: var(--primary);
}

/* aktiver Chip */
#categoryFilter button.active,
#pyrokatFilter button.active {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-color: rgba(0,0,0,.06);
  box-shadow: 0 6px 16px rgba(0,127,127,.25);
}

/* ====== Reset-Button ====== */
#resetFilters {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: #2b3a40;

  padding: .65rem 1rem;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .2px;

  box-shadow: 0 2px 6px rgba(0,0,0,.05);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

#resetFilters:hover {
  background: #f7fbfb;
  border-color: rgba(0,127,127,.35);
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  transform: translateY(-1px);
}
#resetFilters:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0,0,0,.06);
}
#resetFilters:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0,127,127,.18);
  border-color: var(--primary);
}

/* ====== Mobile Slide-In Sidebar ====== */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: min(88vw, 340px);
    padding: 1.1rem;
    border-radius: 0;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    z-index: 2000;
    overflow-y: auto;
  }
  .sidebar.active {                 /* per JS-Klasse ein-/ausblenden */
    transform: translateX(0);
    box-shadow: 18px 0 40px rgba(0,0,0,.2);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.42);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    z-index: 1500;
  }
  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Grid enger auf Mobile */
  #categoryFilter, #pyrokatFilter {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

/* ====== A11y & Prefs ====== */
.sidebar :focus-visible {
  outline: 2px solid rgba(0,127,127,.6);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ====== Sortier-Select ====== */
.sort-wrapper {
  position: relative;
}
.sort-select {
  width: 100%;
  padding: .55rem .9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: .95rem;
  font-weight: 700;
  color: #2b3a40;
  letter-spacing: .2px;
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  appearance: none;             /* native Arrow ausblenden */
  background-image: linear-gradient(45deg, transparent 50%, #9aa3a8 50%),
                    linear-gradient(135deg, #9aa3a8 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 13px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.sort-select:hover {
  background-color: #f7fbfb;
  border-color: rgba(0,127,127,.35);
}
.sort-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0,127,127,.12);
}
