/*
  Zusatzstoffe & Allergene – Stile für das Listen-Fragment.
  Alle Regeln sind unter .alg gekapselt und übernehmen die Schriften und
  Farben der Website (Dosis für Titel, Verdana für Text, Grau #777 auf Weiß).
  Es werden keine Schriften nachgeladen.
*/
.alg {
  --alg-fg: #777;
  --alg-fg-strong: #333;
  --alg-muted: #999;
  --alg-line: #e5e5e5;
  --alg-surface: #f8f8f8;
  --alg-mark-bg: #efefef;
  --alg-mark-fg: #222;
  --alg-gold: #c0c000;
  --alg-gold-soft: #fbfbe6;
  --alg-dark: rgba(34, 34, 34, .9);
  --alg-font-title: Dosis, arial, sans-serif;
  --alg-font-body: verdana, "Open Sans", arial, sans-serif;
  --alg-nav-h: 75px;    /* Höhe der fixierten Hauptnavigation, wird per Script nachgeführt */
  --alg-bar-h: 100px;   /* Höhe der Suchleiste, wird per Script nachgeführt */

  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: calc(var(--alg-nav-h) + 40px) 15px 60px; /* Platz für die fixierte Navigation */
  font-family: var(--alg-font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--alg-fg);
}
.alg, .alg *, .alg *::before, .alg *::after { box-sizing: border-box; }
.alg [hidden] { display: none !important; }
.alg-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Kopf */
.alg-head {
  max-width: 720px;
  margin: 0 auto 30px;
  text-align: center;
}
.alg h2.alg-title {
  margin: 0 0 30px;
  font-family: var(--alg-font-title);
  font-size: 18px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .5em;
  line-height: 1.4;
  color: var(--alg-fg);
}
.alg-lead { margin: 0 0 20px; }
.alg-notice {
  margin: 0 0 20px;
  padding: 12px 18px;
  border-left: 3px solid var(--alg-gold);
  background: var(--alg-surface);
  font-weight: 700;
  color: var(--alg-fg-strong);
  text-align: left;
}
.alg-legend {
  margin: 0;
  font-size: 13px;
  color: var(--alg-muted);
}

/* Suchleiste. position: sticky scheitert am overflow: hidden des Seiten-Templates (.page),
   darum fixiert das Script die Leiste beim Scrollen und lässt einen Platzhalter zurück. */
.alg-searchbar {
  position: relative;
  z-index: 20;
  margin: 0 -15px 10px;
  padding: 12px 15px;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--alg-line);
}
.alg-searchbar.alg-fixed {
  position: fixed;
  top: var(--alg-nav-h);
  left: var(--alg-left, 0);
  width: var(--alg-width, 100%);
  margin: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
}
.alg-searchbar-placeholder { display: none; }
.alg-searchbar-placeholder.alg-active { display: block; margin-bottom: 10px; }
.alg-combo { position: relative; max-width: 640px; margin: 0 auto; }
.alg-combo input {
  width: 100%;
  margin: 0;
  padding: 10px 40px 10px 40px;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  color: var(--alg-fg-strong);
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 0;
  outline: none;
  transition: border-color .2s;
}
.alg-combo input::placeholder { color: var(--alg-muted); }
.alg-combo input:focus { border-color: var(--alg-fg-strong); }
.alg-combo-icon {
  position: absolute;
  left: 13px; top: 50%;
  width: 17px; height: 17px;
  transform: translateY(-50%);
  color: var(--alg-muted);
  pointer-events: none;
}
.alg-combo-clear {
  position: absolute;
  right: 6px; top: 50%;
  width: 30px; height: 30px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--alg-muted);
  cursor: pointer;
}
.alg-combo-clear:hover, .alg-combo-clear:focus-visible { color: var(--alg-fg-strong); outline: none; }
.alg-combo-list {
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  z-index: 30;
  max-height: min(50vh, 360px);
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  list-style: none;
  background: #fff;
  border: 1px solid #ccc;
  border-top: 0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
  text-align: left;
}
.alg-combo-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 7px 14px;
  cursor: pointer;
  color: var(--alg-fg-strong);
}
.alg-combo-list li .alg-opt-cat {
  flex-shrink: 0;
  font-family: var(--alg-font-title);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--alg-muted);
}
.alg-combo-list li[aria-selected="true"],
.alg-combo-list li:hover { background: var(--alg-dark); color: #fff; }
.alg-combo-list li[aria-selected="true"] .alg-opt-cat,
.alg-combo-list li:hover .alg-opt-cat { color: rgba(255, 255, 255, .7); }
.alg-combo-list li.alg-empty { color: var(--alg-muted); font-style: italic; cursor: default; }
.alg-combo-list li.alg-empty:hover { background: transparent; color: var(--alg-muted); }
.alg-combo-list mark {
  padding: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--alg-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.alg-jump {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  margin-top: 10px;
  font-family: var(--alg-font-title);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.alg-jump a {
  color: var(--alg-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.alg-jump a:hover, .alg-jump a:focus-visible {
  color: var(--alg-fg-strong);
  border-bottom-color: var(--alg-gold);
  outline: none;
}

/* Rubriken und Produkte */
.alg-cat {
  padding-top: 40px;
  scroll-margin-top: calc(var(--alg-nav-h) + var(--alg-bar-h) + 20px);
}
.alg h3.alg-cat-title {
  margin: 0 0 4px;
  font-family: var(--alg-font-title);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--alg-fg);
}
.alg-cat-count {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--alg-muted);
}
.alg-items { border-top: 1px solid var(--alg-line); }
.alg-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--alg-line);
  scroll-margin-top: calc(var(--alg-nav-h) + var(--alg-bar-h) + 20px);
  transition: background .5s ease, box-shadow .5s ease;
}
.alg-item:focus { outline: none; }
.alg-item.alg-flash {
  background: var(--alg-gold-soft);
  box-shadow: 0 0 0 12px var(--alg-gold-soft);
}
.alg h4.alg-item-title {
  margin: 0 0 8px;
  font-family: var(--alg-font-body);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--alg-fg);
}
.alg-item p {
  margin: 0;
}
.alg-al {
  padding: 0 .25em;
  border-radius: 2px;
  background: var(--alg-mark-bg);
  color: var(--alg-mark-fg);
  font-weight: 700;
  font-size: .9em;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.alg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}
.alg-chips li {
  margin: 0;
  padding: 1px 9px;
  border: 1px solid var(--alg-line);
  border-radius: 999px;
  font-family: var(--alg-font-title);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--alg-muted);
}
.alg-chips li.alg-none { border-style: dashed; }

/* Zurück nach oben */
.alg-totop {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: 46px; height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--alg-dark);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, background .2s;
}
.alg-totop.alg-show { opacity: 1; transform: none; pointer-events: auto; }
.alg-totop:hover { background: #000; }
.alg-totop:focus-visible { outline: none; border-color: var(--alg-gold); }
.alg-totop svg { width: 20px; height: 20px; }

@media (max-width: 767px) {
  .alg { padding-top: calc(var(--alg-nav-h) + 24px); }
  .alg h2.alg-title { letter-spacing: .3em; }
  .alg-head { text-align: left; }
  .alg-jump { justify-content: flex-start; }
  .alg-searchbar.alg-fixed .alg-jump { display: none; } /* fixierte Leiste kompakt halten */
}
@media (prefers-reduced-motion: reduce) {
  .alg *, .alg *::before, .alg *::after { transition: none !important; }
}
