/* ============================================================
   Nutrition Hub – CSS
   Orientiert am Performance Hub Design-System (style.css)
   ============================================================ */

/* ── CSS-Variablen ──────────────────────────────────────────── */
.nutrition-hub-container {
    --nut-primary:       var(--ds-primary, #153043);
    --nut-secondary:     var(--ds-secondary, #0D2130);
    --nut-accent:        var(--ds-accent, #285180);
    --nut-accent-light:  var(--ds-accent-light, #c8d8f0);
    --nut-success:       var(--ds-success, #28a745);
    --nut-warning:       #e3ad3b;
    --nut-warning-soft:  var(--ds-warning-soft, #fff8e8);
    --nut-danger-soft:   var(--ds-danger-soft, #fff0f0);
    --nut-white:         var(--ds-white, #ffffff);
    --nut-bg:            var(--ds-bg, #f8f9fa);
    --nut-surface:       var(--ds-surface, #ffffff);
    --nut-surface-alt:   var(--ds-surface-alt, #f3f5f8);
    --nut-surface-soft:  var(--ds-surface-soft, #eceef2);
    --nut-border:        var(--ds-border, #d0d4db);
    --nut-border-soft:   var(--ds-border-soft, #e0e3e8);
    --nut-border-strong:  var(--ds-border-strong, #b0b5bf);
    --nut-text:          var(--ds-text, #222831);
    --nut-muted:         var(--ds-muted, #6c757d);
    --nut-danger:        var(--ds-danger, #dc3545);
    --nut-radius:        var(--ds-radius-sm, 8px);
    --nut-radius-lg:     var(--ds-radius-lg, 12px);
    --nut-shadow-sm:     var(--ds-shadow-sm, 0 2px 8px rgba(0,0,0,0.05));
    --nut-shadow-md:     var(--ds-shadow-md, 0 4px 12px rgba(0,0,0,0.08));
    --nut-shadow-lg:     var(--ds-shadow-lg, 0 8px 24px rgba(0,0,0,0.12));
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes nut-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.nut-animate        { animation: nut-fade-in 0.35s ease both; }
.nut-animate-delay  { animation: nut-fade-in 0.35s ease 0.1s both; }
.nut-animate-delay2 { animation: nut-fade-in 0.35s ease 0.2s both; }

/* ── Header ─────────────────────────────────────────────────── */
.nut-header {
    background: linear-gradient(135deg, var(--nut-primary) 0%, var(--nut-secondary) 100%);
    border-radius: var(--nut-radius);
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--nut-shadow-md);
}
.nut-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.nut-title {
    color: var(--nut-white);
    font-size: 1.9rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.nut-athlete-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.12);
}
.nut-athlete-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--nut-white);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.nut-subtitle {
    color: rgba(255,255,255,0.75);
    font-size: 0.95rem;
    margin: 0.4rem 0 0;
}
.nut-header-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
@media (max-width: 767.98px) {
  .nut-header-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .nut-header-actions .btn {
    width: 100%;
  }
}

/* Button im Farbschema des Login-Buttons (auth/templates/login.html .btn-primary) */
.nut-btn-login {
  --bs-btn-font-weight: 600;
  --bs-btn-bg: #dd9a2e;
  --bs-btn-border-color: #dd9a2e;
  --bs-btn-color: #0D2130;
  --bs-btn-hover-bg: #c98a24;
  --bs-btn-hover-border-color: #c98a24;
  --bs-btn-hover-color: #0D2130;
  --bs-btn-active-bg: #c98a24;
  --bs-btn-active-border-color: #c98a24;
  --bs-btn-active-color: #0D2130;
}

/* ── Suchleiste ─────────────────────────────────────────────── */
.nut-search-card {
    background:linear-gradient(135deg,var(--nut-primary) 0%,var(--nut-secondary) 100%);
    border-radius: 0;
    padding: 1rem 1.5rem;
  padding-right: 10rem;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: none;
    margin-bottom: 0;
  position: relative;
}

.nut-search-reset-corner {
  position: absolute;
  top: 0.85rem;
  right: 1.25rem;
  z-index: 5;
}

.nut-search-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
}

.nut-search-card-body {
  flex: 1 1 auto;
  min-width: 0;
}

.nut-result-count {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  padding: .15rem 1.75rem .15rem 0;
  border-right: 1px solid rgba(255,255,255,.14);
}

.nut-result-count-item { line-height: 1; text-align: center; }

.nut-result-count-item + .nut-result-count-item {
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid rgba(255,255,255,.18);
}

.nut-result-count-value {
  display: block;
  font-size: 2.6rem;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.nut-result-count-label {
  display: block;
  margin-top: .2rem;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.6);
}

.nut-filter-mobile-toggle {
  display: none;
}

.nut-filter-active-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e3ad3b;
  box-shadow: 0 0 6px rgba(227,173,59,0.8);
}

  .nut-search-card .row {
    align-items: flex-start !important;
  }

  .nut-search-card .col-md-2,
  .nut-search-card .col-md-4 {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  .nut-logo-filter-wrap {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    min-height: 31px;
    height: 31px;
  }

  .nut-icon-filter-col .form-label {
    min-height: 20px;
  }

  .nut-logo-filter-btn {
    width: 31px;
    height: 31px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
  }

  .nut-logo-filter-btn i {
    font-size: 1.1rem;
  }

  .nut-logo-filter-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.18);
  }

  .nut-logo-filter-btn.is-active {
    border-color: rgba(227,173,59,0.95);
    box-shadow: 0 0 0 2px rgba(227,173,59,0.2), 0 0 16px rgba(227,173,59,0.35);
    background: rgba(227,173,59,0.2);
  }

  .nut-logo-filter-btn.is-excluded {
    border-color: var(--nut-danger);
    box-shadow: 0 0 0 2px rgba(220,53,69,0.2), 0 0 16px rgba(220,53,69,0.3);
    background: rgba(220,53,69,0.2);
  }

  .nut-logo-filter-btn.is-excluded::after {
    content: '';
    position: absolute;
    left: 14%;
    right: 14%;
    top: 50%;
    height: 2px;
    background: var(--nut-danger);
    transform: translateY(-50%) rotate(-45deg);
    border-radius: 2px;
    pointer-events: none;
  }

  .nut-logo-filter-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
  }

  .nut-collapsible-btn {
    border: 1px solid rgba(255,255,255,0.28);
    color: rgba(255,255,255,0.92);
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
  }

  .nut-collapsible-btn:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.45);
    color: #fff;
  }

  .nut-collapsible-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
  }

  .nut-collapsible-btn--icon {
    padding: 0.2rem 0.45rem;
  }

  .nut-collapsible-panel {
    margin-top: 0.25rem;
    padding: 0.55rem 0.65rem;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
    border: 1px solid rgba(255,255,255,0.14);
  }

  .nut-filter-group {
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 12px;
    padding: 0.6rem 0.75rem 0.7rem;
    background: rgba(255,255,255,0.03);
  }

  /* Filterkopf (Kohlenhydrate/Portion, Portionsgröße, Hersteller): Label+Buttons
     und der aktuelle-Auswahl-Text (z.B. "0 g - 0 g" bzw. "3 ausgewählt") passen bei
     der Spaltenbreite (col-md-4) nicht zuverlässig in eine Zeile - der Auswahl-Text
     bekommt daher immer (nicht erst mobil) eine eigene volle Zeile darunter statt
     unschön umzubrechen. */
  .nut-filter-group .d-flex.justify-content-between {
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }

  .nut-filter-group .d-flex.justify-content-between span[id$="RangeLabel"],
  .nut-filter-group .d-flex.justify-content-between span[id$="CountLabel"] {
    flex: 0 0 100%;
    text-align: left;
  }

  .nut-manufacturer-checklist {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding-right: 0.25rem;
  }

  .nut-manufacturer-check-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.28rem 0.4rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.85);
  }

  .nut-manufacturer-check-item:hover {
    background: rgba(255,255,255,0.08);
  }

  .nut-manufacturer-check-item input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
  }

  .nut-manufacturer-check-item.nut-manufacturer-hidden {
    display: none;
  }

  .nut-manufacturer-empty {
    padding: 0.4rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.55);
  }

  .nut-dual-range {
    position: relative;
    height: 40px;
    padding-top: 6px;
    cursor: pointer;
    touch-action: pan-y;
  }

  .nut-dual-range-track {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    height: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.2);
    pointer-events: none;
    z-index: 0;
  }

  .nut-dual-range-fill {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(227,173,59,0.78), rgba(255,218,133,0.92));
    box-shadow: 0 0 14px rgba(227,173,59,0.45);
    pointer-events: none;
    z-index: 1;
  }

  .nut-dual-range-input {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 8px;
    margin: 0;
    background: transparent;
    pointer-events: none;
    touch-action: none;
    z-index: 2;
  }

  .nut-dual-range-input::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: transparent;
  }

  .nut-dual-range-input::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: transparent;
  }

  .nut-dual-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    margin-top: -7px;
    background: #f8fafc;
    border: 2px solid #111827;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    pointer-events: auto;
    cursor: grab;
    transition: transform .15s ease, box-shadow .15s ease;
  }

  .nut-dual-range-input::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f8fafc;
    border: 2px solid #111827;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    pointer-events: auto;
    cursor: grab;
    transition: transform .15s ease, box-shadow .15s ease;
  }

  .nut-dual-range-input:hover::-webkit-slider-thumb,
  .nut-dual-range-input:focus-visible::-webkit-slider-thumb,
  .nut-dual-range-input.is-dragging::-webkit-slider-thumb {
    transform: scale(1.12);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3), 0 0 0 5px rgba(227,173,59,0.35);
  }

  .nut-dual-range-input:hover::-moz-range-thumb,
  .nut-dual-range-input:focus-visible::-moz-range-thumb,
  .nut-dual-range-input.is-dragging::-moz-range-thumb {
    transform: scale(1.12);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3), 0 0 0 5px rgba(227,173,59,0.35);
  }

  .nut-dual-range-input:active::-webkit-slider-thumb { cursor: grabbing; }
  .nut-dual-range-input:active::-moz-range-thumb { cursor: grabbing; }

  .nut-dual-range-input-min {
    z-index: 3;
  }

  .nut-dual-range-input-max {
    z-index: 2;
  }

  .nut-dual-range-bubble {
    position: absolute;
    bottom: 26px;
    transform: translate(-50%, 4px);
    background: #111827;
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: opacity .12s ease, transform .12s ease;
  }

  .nut-dual-range-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #111827;
  }

  .nut-dual-range-bubble.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  @media (hover: none) {
    .nut-dual-range { height: 44px; }
  }

  .nut-range-manual-inputs {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-top: 0.5rem;
  }

  .nut-range-number-input {
    width: 4.5rem;
    text-align: center;
    padding: 0.2rem 0.35rem;
  }

  .nut-range-manual-sep,
  .nut-range-manual-unit {
    color: rgba(255,255,255,.55);
    font-size: .8rem;
  }

/* ── Produkt-Karten (Kachelansicht) ─────────────────────────── */
.nut-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.nut-product-card {
  background: var(--nut-surface);
    border-radius: var(--nut-radius-lg);
    overflow: hidden;
    box-shadow: var(--nut-shadow-md);
    transition: transform 0.25s, box-shadow 0.25s;
    border: 1px solid var(--nut-border);
    display: flex;
    flex-direction: column;
    position: relative;
}
.nut-product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--nut-shadow-lg);
}
.nut-product-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: var(--nut-bg);
}
.nut-product-img-placeholder {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nut-bg);
    color: var(--nut-muted);
    font-size: 2.5rem;
}
.nut-product-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.nut-product-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--nut-text);
    margin: 0 0 0.2rem;
    line-height: 1.3;
}
.nut-product-maker {
    font-size: 0.78rem;
    color: var(--nut-muted);
    margin: 0 0 0.6rem;
}
.nut-product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.6rem;
}
.nut-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.nut-badge-cat    { background: var(--nut-surface-alt); color: var(--nut-text); }
.nut-badge-vegan  { background: var(--nut-accent-light); color: #1a2a4a; }
.nut-badge-koffein{ background: var(--nut-bg); color: #212121; border: 1px solid var(--nut-border); }
.nut-badge-nada   { background: var(--nut-danger-soft); color: #b71c1c; }
.nut-badge-koeln  { background: var(--nut-surface-alt); color: var(--nut-text); }
.nut-badge-sponsored {
    background: rgba(255,255,255,.16);
    color: #fff;
    border: 1px solid rgba(255,255,255,.4);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .62rem;
    flex-shrink: 0;
}

.nut-product-macros {
    font-size: 0.75rem;
    color: var(--nut-muted);
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--nut-border);
}
.nut-product-actions {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--nut-border);
    display: flex;
    gap: 0.5rem;
}

/* ── NADA-Warnung Overlay ────────────────────────────────────── */
.nut-nada-overlay {
    position: absolute;
    inset: 0;
    background: rgba(183, 28, 28, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
    pointer-events: none;
    text-align: center;
    padding: 1rem;
}
.nut-nada-overlay i  { font-size: 2.5rem; color: var(--nut-white); }
.nut-nada-overlay span { color: var(--nut-white); font-weight: 700; font-size: 0.85rem; margin-top: 0.4rem; display: block; }
.nut-nada-overlay small { color: rgba(255,255,255,0.8); font-size: 0.72rem; }

/* ── Katalog-Suche: Ladeindikator-Overlay ───────────────────────
   Liegt ueber #catalogContainer, solange eine Filter-/Suchanfrage
   (reloadCatalog in nutrition_manage.js) laeuft und die Liste noch die
   Ergebnisse des vorherigen Stands zeigt. */
.nut-catalog-container { position: relative; min-height: 120px; }
.nut-catalog-search-overlay {
    position: absolute;
    inset: 0;
    background: rgba(248, 249, 250, 0.78);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2.5rem;
    z-index: 15;
    border-radius: var(--nut-radius-lg);
}
.nut-catalog-search-overlay-inner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--nut-surface);
    color: var(--nut-text);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    box-shadow: var(--nut-shadow-lg);
}

/* ── Detail-Seite ───────────────────────────────────────────── */
.nut-detail-img-wrap {
    border-radius: var(--nut-radius-lg);
    overflow: hidden;
    border: 1px solid var(--nut-border);
    background: var(--nut-bg);
    position: relative;
}
.nut-detail-img {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    padding: 1rem;
    background: var(--nut-bg);
}

/* ── Nährwert-Tabelle ───────────────────────────────────────── */
.nut-nw-table th, .nut-nw-table td { padding: 0.45rem 0.75rem; font-size: 0.9rem; }
.nut-nw-table tr.indent td:first-child { padding-left: 1.5rem; color: var(--nut-muted); }

/* ── Manage-Tabelle ─────────────────────────────────────────── */
.nut-table th    { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--nut-muted); font-weight: 600; }
.nut-table td    { vertical-align: middle; }
.nut-table tbody tr:hover { background: var(--nut-bg); }

/* ── Formular ───────────────────────────────────────────────── */
.nut-form-section {
  background: var(--nut-surface);
    border-radius: var(--nut-radius);
    border: 1px solid var(--nut-border);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--nut-shadow-sm);
}
.nut-form-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--nut-secondary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.nut-img-preview {
    width: 100%;
    border-radius: var(--nut-radius);
    max-height: 220px;
    object-fit: contain;
    background: var(--nut-bg);
    padding: 0.5rem;
    border: 1px solid var(--nut-border);
}
.nut-img-placeholder {
    width: 100%;
    height: 180px;
    border-radius: var(--nut-radius);
    background: var(--nut-bg);
    border: 2px dashed var(--nut-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--nut-muted);
    font-size: 2rem;
    gap: 0.4rem;
}
.nut-nada-alert {
  background: var(--nut-danger-soft);
    border: 1px solid #fca5a5;
    border-radius: var(--nut-radius);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #7f1d1d;
    margin-top: 0.75rem;
}

/* ── Empty States ───────────────────────────────────────────── */
.nut-empty {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--nut-muted);
}
.nut-empty i { font-size: 3rem; opacity: 0.4; display: block; margin-bottom: 0.75rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .nut-header { padding: 1.5rem 1.25rem; }
    .nut-title  { font-size: 1.9rem; }
    .nut-product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

    .nut-search-card {
      display: flex;
      flex-direction: column;
      padding-right: 1.5rem;
    }

    .nut-search-card-inner {
      flex-direction: column;
      align-items: stretch;
      gap: 0;
    }

    .nut-search-card-body {
      display: flex;
      flex-direction: column;
    }

    .nut-result-count {
      flex-direction: row;
      gap: 0;
      padding: 0 0 .85rem;
      margin-bottom: .65rem;
      border-right: none;
      border-bottom: 1px solid rgba(255,255,255,.14);
    }

    .nut-result-count-item {
      flex: 1 1 0;
    }

    .nut-result-count-item + .nut-result-count-item {
      margin-top: 0;
      padding-top: 0;
      padding-left: 1.75rem;
      margin-left: 1.75rem;
      border-top: none;
      border-left: 1px solid rgba(255,255,255,.18);
    }

    .nut-result-count-value {
      font-size: 1.9rem;
    }

    .nut-search-reset-corner {
      position: static;
      display: block;
      width: fit-content;
      margin: 0 0 .65rem auto;
      order: 2;
    }

    .nut-filter-mobile-toggle {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: .45rem;
      width: 100%;
      order: 1;
      margin-bottom: .65rem;
    }

    .nut-filter-mobile-toggle[aria-expanded="true"] {
      background: var(--nut-primary);
      border-color: var(--nut-primary);
    }

    .nut-filter-form {
      display: none;
      order: 3;
      margin-top: .25rem;
    }

    .nut-filter-form.is-open {
      display: flex;
    }
}

/* ── Produktkatalog (manage_products) ───────────────────────── */
.mfr-section { margin-bottom: 1.5rem; }
.mfr-header {
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem 1rem;
  background: linear-gradient(135deg, var(--nut-primary) 0%, var(--nut-secondary) 100%);
    border-radius: 10px 10px 0 0;
  color: var(--nut-white); cursor: pointer; user-select: none;
}
.mfr-header:hover { filter: brightness(1.12); }
.mfr-name { font-size: 1rem; font-weight: 700; letter-spacing: .02em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mfr-name a { color: var(--nut-white); text-decoration: none; }
.mfr-name a:hover { text-decoration: underline; }
.mfr-count { padding: .1rem .6rem; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.mfr-chevron { transition: transform .25s; font-size: .9rem; flex-shrink: 0; }
.mfr-header.collapsed .mfr-chevron { transform: rotate(-90deg); }
.mfr-body { background: var(--nut-surface); border: 1px solid var(--nut-border); border-top: none; border-radius: 0 0 10px 10px; padding: .75rem 1rem 1rem; }
.mfr-no-results { display: none; padding: .75rem; text-align: center; color: #999; font-size: .85rem; }

.cat-subheader {
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
    color: #393E46; border-bottom: 1px solid #d0d4db;
    padding: .3rem 0 .18rem; margin: .6rem 0 .3rem;
}
.cat-subheader:first-child { margin-top: 0; }

.pcard {
    position: relative; overflow: hidden;
    display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: .75rem; row-gap: 0;
  background: linear-gradient(180deg, var(--nut-bg) 0%, var(--nut-surface-alt) 100%);
  border: 1px solid var(--nut-border-soft); border-radius: 10px;
    padding: .55rem .75rem;
    transition: box-shadow .2s, border-color .2s;
    cursor: pointer;
}
.pcard:hover { box-shadow: 0 2px 10px rgba(34,40,49,.12); border-color: var(--nut-border-strong); }
.pcard:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(57, 62, 70, .18);
}
.pcard.pcard-actions-open {
    border-color: #8f97a5;
    box-shadow: 0 10px 24px rgba(34,40,49,.14);
}
.pcard-img { position: relative; width: 80px; height: 80px; flex-shrink: 0; border-radius: 6px; object-fit: cover; background: var(--nut-surface-soft); display: flex; align-items: center; justify-content: center; }
.pcard-img img { width: 80px; height: 80px; border-radius: 6px; object-fit: cover; }
.pcard--lg .pcard-img { width: 110px; height: 110px; }
.pcard--lg .pcard-img img { width: 110px; height: 110px; }

/* Generische Dummy-Grafik je Kategorie (static/img/nutrition) wenn keine
   Bildrechte-Freigabe des Herstellers vorliegt - ersetzt in .pcard-img das
   Herstellerfoto 1:1. object-fit: contain (statt cover) UND !important, da
   sonst die spezifischere .pcard-img img-Regel (cover, siehe oben) gewinnt
   und Hochformat-Dummy-Grafiken anschneidet - die Grafik muss immer
   vollständig sichtbar sein, egal ob Hoch- oder Querformat. */
.pcard-img img.nut-placeholder-img { object-fit: contain !important; padding: 6px; }
.pcard--lg .pcard-img img.nut-placeholder-img { padding: 8px; }

/* Bildquellen-Hinweis: kleines "i"-Badge oben links im Produktbild, zeigt beim
   Hover/Fokus die Quellenangabe (Herstellername + Link zur Originalseite) als
   eigens gestaltetes Tooltip (kein natives title-Attribut - erscheint dadurch
   sofort statt mit Browser-Verzögerung) - Produktfotos werden nur extern
   verlinkt, nie selbst gehostet. */
.img-source-badge {
    position: absolute; top: 6px; left: 6px; z-index: 3;
    width: 19px; height: 19px; border-radius: 50%;
    background: rgba(17,24,39,.68);
    border: 1px solid rgba(255,255,255,.55);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .62rem; line-height: 1; text-decoration: none;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.img-source-badge:hover,
.img-source-badge:focus-visible {
    background: #111827;
    border-color: #fff;
    color: #fff;
    transform: scale(1.12);
    outline: none;
}

.img-source-badge::before,
.img-source-badge::after {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .1s ease, visibility .1s ease, transform .1s ease;
}
.img-source-badge:hover::before, .img-source-badge:hover::after,
.img-source-badge:focus-visible::before, .img-source-badge:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Tooltip-Bubble */
.img-source-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 9px);
    left: 0;
    transform: translateY(-3px);
    width: max-content;
    max-width: 210px;
    background: #111827;
    color: #f9fafb;
    font-size: .72rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: .01em;
    padding: .45rem .65rem;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(17,24,39,.35), 0 0 0 1px rgba(255,255,255,.06);
    z-index: 20;
}
/* Sprechblasen-Pfeil, zeigt zum Badge */
.img-source-badge::before {
    content: '';
    position: absolute;
    top: calc(100% + 4px);
    left: 6px;
    transform: translateY(-3px);
    border: 5px solid transparent;
    border-bottom-color: #111827;
    z-index: 20;
}

/* "Zertifiziert"-Badge: Hover-/Fokus-Tooltip im selben Format wie die
   Coach-Sprechblase auf dem Public Dashboard (main/templates/public_dashboard.html,
   .pn-coach-badge-bubble) - weiße Sprechblase mit Pfeil, erscheint oberhalb des Badges. */
.nut-cert-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    line-height: 1;
    cursor: default;
    outline: none;
}
.nut-cert-badge > i {
    font-size: 1rem;
    color: var(--color-text-dark, #222831);
}
.nut-cert-badge-bubble {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    /* --nut-cert-shift wird per JS (nutrition_manage.js) gesetzt, damit die Blase
       bei Badges nahe am Bildschirmrand horizontal eingerückt statt abgeschnitten wird. */
    transform: translate(calc(-50% + var(--nut-cert-shift, 0px)), 6px);
    width: max-content;
    max-width: min(15rem, calc(100vw - 2rem));
    background: #fff;
    color: var(--color-text-dark, #222831);
    font-size: .8rem;
    font-weight: 500;
    line-height: 1.35;
    padding: .65rem .85rem;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 30;
    text-align: left;
    white-space: normal;
}
.nut-cert-badge-bubble::after {
    content: "";
    position: absolute;
    top: 100%;
    /* Pfeil bleibt auf den Badge-Mittelpunkt ausgerichtet, auch wenn die Blase
       selbst per --nut-cert-shift verschoben wurde (Verschiebung wird hier zurückgerechnet). */
    left: calc(50% - var(--nut-cert-shift, 0px));
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: #fff;
}
.nut-cert-badge:hover .nut-cert-badge-bubble,
.nut-cert-badge:focus .nut-cert-badge-bubble,
.nut-cert-badge:focus-within .nut-cert-badge-bubble {
    opacity: 1;
    transform: translate(calc(-50% + var(--nut-cert-shift, 0px)), 0);
    pointer-events: auto;
}
@media (max-width: 420px) {
    .nut-cert-badge-bubble { font-size: .75rem; }
}

/* AJAX Toast */
.nut-ajax-toast {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--nut-primary); color: var(--nut-white);
    padding: .6rem 1.2rem; border-radius: 999px;
    font-size: .85rem; font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    z-index: 9999; pointer-events: none;
    opacity: 0; transform: translateY(8px);
    transition: opacity .2s, transform .2s;
}
.nut-ajax-toast.show { opacity: 1; transform: translateY(0); }
.nut-ajax-toast--add    { background: var(--nut-success); }
.nut-ajax-toast--remove { background: var(--nut-muted); }
.pcard-body { flex: 1; min-width: 0; }
.pcard-name { font-weight: 600; font-size: .88rem; color: var(--nut-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-name a { color: inherit; text-decoration: none; }
.pcard-name a:hover { text-decoration: underline; }
.pcard-badges { display: flex; flex-wrap: wrap; gap: .2rem; margin-top: .18rem; }
.pcard-actions {
    width: calc(100% + 1.5rem);
    margin: 0 -.75rem -.55rem;
    padding: 0 .7rem;
    border-top: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.25) 0%, rgba(225,231,240,.72) 100%);
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .38rem;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, max-height .2s ease, padding .2s ease, margin .2s ease;
}
.pcard.pcard-actions-open .pcard-actions {
    margin: .45rem -.75rem -.55rem;
    padding: .42rem .7rem .48rem;
    border-top: 1px solid #dde2ea;
    opacity: 1;
    max-height: 120px;
    transform: translateY(0);
    pointer-events: auto;
}

/* pcard icon-buttons */
.pcard-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid #cfd5df;
    background: rgba(255,255,255,.92);
    color: #495365;
    font-size: .85rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .16s, border-color .16s, color .16s, transform .16s, box-shadow .16s;
    flex-shrink: 0;
    padding: 0;
}
.pcard-btn:hover {
    background: #ffffff;
    border-color: #8f97a5;
    color: #1f2937;
    transform: translateY(-1px);
    box-shadow: 0 5px 10px rgba(31,41,55,.13);
    text-decoration: none;
}
.pcard-btn--remove { border-color: var(--nut-danger); color: var(--nut-danger); }
.pcard-btn--remove:hover { background: var(--nut-danger); color: #fff; border-color: var(--nut-danger); }
.pcard-scrape-toggle {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    height: 30px;
    padding: 0 .5rem;
    margin-right: auto;
    border-radius: 9px;
    border: 1px solid #cfd5df;
    background: rgba(255,255,255,.92);
    color: #495365;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.pcard-scrape-toggle input { margin: 0; cursor: pointer; }
.pcard-stats { font-size: .75rem; color: #555; margin-top: .2rem; display: flex; flex-wrap: wrap; gap: .35rem; }

/* Geschmacksrichtungen-Liste auf der Produktkarte: bleibt zugeklappt bis die
   Karte angeklickt wird (siehe toggleCardActions in nutrition_manage.js), analog
   zu .pcard-actions oben. Nicht zu den aktiven Filtern passende Einträge werden
   ausgegraut statt ausgeblendet, damit klar bleibt, was es sonst noch gibt. */
.pcard-flavor-list {
    display: none;
    margin-top: .4rem;
    padding-top: .4rem;
    border-top: 1px solid var(--nut-border);
}
.pcard.pcard-flavors-open .pcard-flavor-list {
    display: block;
}
.pcard-flavor-list-title {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--nut-muted);
    margin-bottom: .2rem;
}
.pcard-flavor-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
    font-size: .78rem;
    line-height: 1.5;
}
.pcard-flavor-name {
    color: var(--nut-text);
}
.pcard-flavor-item--main .pcard-flavor-name {
    font-style: italic;
}
.pcard-flavor-item--dim .pcard-flavor-name {
    color: var(--nut-muted);
    font-weight: 400;
}
.pcard-flavor-item--match .pcard-flavor-name {
    font-weight: 700;
    color: var(--nut-text);
}
.pcard-flavor-kh {
    font-size: .72rem;
    color: var(--nut-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Prominenter "Zu meinen Produkten hinzufügen"-Button - immer sichtbar
   (anders als .pcard-actions, das erst beim Aufklappen der Karte erscheint),
   damit Nutzer ihn nicht erst per Klick auf die Karte suchen müssen. */
.pcard-add-row {
    width: calc(100% + 1.5rem);
    margin: .5rem -.75rem -.55rem;
}
.pcard-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    width: 100%;
    padding: .5rem .7rem;
    border: none;
    border-radius: 0 0 9px 9px;
    background: var(--nut-accent);
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .16s ease, transform .16s ease;
}
.pcard-add-btn i { font-size: 1rem; }
.pcard-add-btn:hover {
    background: var(--nut-success);
    transform: translateY(-1px);
}
.pcard-add-btn:disabled { opacity: .65; cursor: default; transform: none; }

@media (max-width: 768px) {
    .pcard-actions {
        justify-content: flex-start;
    }
}

.caffeine-corner-flag {
    position: absolute; top: 0; right: 0;
    width: 32px; height: 32px; z-index: 1; pointer-events: none;
}
.caffeine-corner-flag::before {
    content: ''; position: absolute; top: 0; right: 0;
    width: 0; height: 0; border-style: solid;
    border-width: 0 32px 32px 0;
    border-color: transparent #111111 transparent transparent;
}
.caffeine-corner-flag .caf-icon {
    position: absolute; top: 3px; right: 2px;
    color: #fff; font-size: .58rem; line-height: 1; z-index: 2;
}

/* Assigned-Produkt-Flag (oben-links, grün → rot auf Hover) */
.assigned-corner-flag {
    position: absolute; top: 0; left: 0;
    width: 36px; height: 36px; z-index: 2;
    background: none; border: none; padding: 0; cursor: pointer;
}
.assigned-corner-flag::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 0; height: 0; border-style: solid;
    border-width: 36px 36px 0 0;
    border-color: #28a745 transparent transparent transparent;
    transition: border-color .2s;
}
.assigned-corner-flag .flag-default,
.assigned-corner-flag .flag-remove {
    position: absolute; top: 3px; left: 3px;
    color: #fff; font-size: .6rem; line-height: 1; z-index: 3;
    transition: opacity .15s;
}
.assigned-corner-flag .flag-remove { opacity: 0; }
.assigned-corner-flag:hover::before { border-color: #dc3545 transparent transparent transparent; }
.assigned-corner-flag:hover .flag-default { opacity: 0; }
.assigned-corner-flag:hover .flag-remove  { opacity: 1; }

/* ── Produktdetail – Maurten-style ──────────────────────────── */
.pd-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}
.pd-back {
    color: var(--nut-muted);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    transition: color .2s;
}
.pd-back:hover { color: var(--nut-text); }

.pd-hero {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    margin-bottom: 3.5rem;
    align-items: start;
}
.pd-img-wrap {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pd-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1.5rem;
}
.pd-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pd-img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2.5rem;
}
.pd-flavor-sel {
    background: #f0f1f3;
    border-color: #d0d4db;
    color: var(--nut-text);
    border-radius: 999px;
    font-size: .85rem;
}

.pd-manufacturer {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: .2rem;
    color: var(--nut-text);
}

.pd-category-eyebrow {
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .18em;
    color: var(--nut-accent);
    margin-bottom: 0;
}
.pd-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .3rem;
}
.pd-meta-date {
    font-size: .7rem;
    font-weight: 600;
    color: var(--nut-muted);
    letter-spacing: .03em;
}
.pd-mfr-link { color: var(--nut-muted); text-decoration: none; }
.pd-mfr-link:hover { color: var(--nut-text); text-decoration: underline; }

.pd-name-link { display: block; color: inherit; text-decoration: none; }
.pd-name-link:hover .pd-name { text-decoration: underline; }
.pd-name-link:hover { color: inherit; }

.pd-name {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--nut-text);
    line-height: 1.08;
    margin: 0 0 1rem;
    letter-spacing: -.025em;
}

.pd-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.1rem;
}
.pd-tag {
  font-size: .72rem;
  font-weight: 700;
  padding: .22rem .65rem;
  border-radius: 999px;
  background: var(--nut-surface-alt);
  color: var(--nut-text);
  border: 1px solid var(--nut-border);
}
.pd-tag-cert { background: #e8f5e9; color: #1b5e20; border-color: #a5d6a7; }
.pd-tag-nada { background: var(--nut-danger-soft); color: #c0392b; border-color: #fca5a5; }
.pd-vegan-logo { height: 50px; width: auto; }

.pd-divider { height: 1px; background: #e0e3e8; margin: 1.4rem 0; }

.pd-stats { display: flex; flex-direction: column; }
.pd-stat {
    border-radius: 6px;
    display: grid;
    grid-template-columns: 9.5rem 1fr;
    align-items: baseline;
    gap: 0 1rem;
    padding: .6rem .5rem;
    border-bottom: 1px solid #f0f1f3;
    margin-left: -.5rem;
    transition: background .15s;
}
.pd-stat:last-child { border-bottom: none; }
.pd-stat:hover { background: rgba(74,144,226,.07); }
.pd-stat-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--nut-muted);
    flex-shrink: 0;
}
.pd-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--nut-text);
    text-align: left;
}
.pd-stat-sub {
    font-size: .72rem;
    font-weight: 400;
    color: var(--nut-muted);
    margin-left: .35rem;
}
.pd-carb-ratio { font-size: 1.05rem; letter-spacing: .1em; }

/* Akkordeon */
.pd-accordion { border-top: 1px solid #d0d4db; margin-bottom: 2rem; }
.pd-acc-item  { border-bottom: 1px solid #d0d4db; }
.pd-acc-trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 0;
    background: none;
    border: none;
    font-size: .95rem;
    font-weight: 700;
    color: var(--nut-text);
    cursor: pointer;
    letter-spacing: .01em;
    text-align: left;
    border-radius: 6px;
    padding-left: .5rem;
    padding-right: .5rem;
    margin-left: -.5rem;
    margin-right: -.5rem;
    transition: color .2s, background .15s;
}
.pd-acc-trigger:hover { color: #222831; background: rgba(74,144,226,.07); }
.pd-acc-chev { transition: transform .25s; font-size: .82rem; color: var(--nut-muted); flex-shrink: 0; }
.pd-acc-trigger[aria-expanded="true"] .pd-acc-chev { transform: rotate(180deg); }
.pd-acc-body { padding: 0 0 1.4rem; }

.pd-nw-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.pd-nw-table tr { border-bottom: 1px solid #f4f5f7; transition: background .15s; }
.pd-nw-table tr:last-child { border-bottom: none; }
.pd-nw-table tr:hover { background: rgba(74,144,226,.07); }
.pd-nw-table td, .pd-nw-table th { padding: .5rem .4rem; color: var(--nut-muted); }
.pd-nw-table td.val { text-align: right; font-weight: 700; color: var(--nut-text); white-space: nowrap; }
.pd-nw-table th { text-align: right; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.pd-nw-table th:first-child { text-align: left; }
.pd-nw-table tr.indent td:first-child { padding-left: 1.5rem; }
.pd-nw-table tr.pd-nw-sep-row { border-bottom: none; }
.pd-nw-table tr.pd-nw-sep-row:hover { background: none; }
.pd-nw-table tr.pd-nw-sep-row td {
  padding: .7rem .4rem .3rem;
  border-top: 1px solid #e2e4e9;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--nut-muted);
}
.pd-text { font-size: .9rem; color: var(--nut-muted); line-height: 1.75; margin: 0; }

.pd-nw-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: .4rem;
    margin: .8rem 0 0;
    padding: .6rem .75rem;
    font-size: .78rem;
    line-height: 1.5;
    color: var(--nut-muted);
    background: rgba(74,144,226,.06);
    border: 1px solid rgba(74,144,226,.15);
    border-radius: 8px;
}
.pd-nw-disclaimer i { flex-shrink: 0; margin-top: .1rem; }

@media (max-width: 768px) {
    .pd-hero  { grid-template-columns: 1fr; gap: 2rem; }
    .pd-name  { font-size: 2rem; }
    .pd-topbar {
        flex-wrap: wrap;
        gap: .5rem;
        flex-direction: column;
        align-items: stretch;
    }
    .pd-topbar .btn {
        width: 100%;
    }
    .pd-topbar > div {
        flex-direction: column;
        width: 100%;
    }
    .pd-img-wrap { max-width: 320px; margin: 0 auto; }

    .pd-stat {
        grid-template-columns: 1fr;
        gap: .2rem 0;
    }
    .pd-flavor-sel { width: 100%; }
}


  .nutrition-hub-container #nutritionTopTabs .nav-link {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.86);
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 0.42rem 0.9rem;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  }

  .nutrition-hub-container #nutritionTopTabs .nav-link:hover,
  .nutrition-hub-container #nutritionTopTabs .nav-link:focus {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.26);
    color: #ffffff;
  }

  .nutrition-hub-container #nutritionTopTabs .nav-link.active,
  .nutrition-hub-container #nutritionTopTabs .show > .nav-link {
    background: rgba(227, 173, 59, 0.22);
    border-color: rgba(227, 173, 59, 0.55);
    color: #ffe8b0;
    box-shadow: 0 0 0 1px rgba(227, 173, 59, 0.12) inset;
  }

  .nutrition-hub-container #nutritionTopTabs .nav-link i {
    margin-right: 0.3rem;
  }

  .nutrition-hub-container #nutritionTopTabsContent {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 12px;
    padding: 0.9rem;
  }

  .nutrition-hub-container .nut-label-muted {
    color: rgba(255, 255, 255, 0.65);
  }

  .nutrition-hub-container .nut-control-dark {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--nut-white);
  }

  .nutrition-hub-container .nut-control-dark option,
  .nutrition-hub-container .nut-control-dark optgroup {
    background: #2c323b;
    color: #ffffff;
  }

  .nutrition-hub-container .nut-control-dark option:checked,
  .nutrition-hub-container .nut-control-dark option:hover,
  .nutrition-hub-container .nut-control-dark option:focus {
    background: #3a4350;
    color: #ffffff;
  }

  .nutrition-hub-container .nut-option-dark {
    background: var(--nut-secondary);
  }

  .nutrition-hub-container .nut-list-select {
    font-size: .83rem;
  }

  .nutrition-hub-container #tab-assign .form-control,
  .nutrition-hub-container #tab-assign .form-select,
  .nutrition-hub-container #tab-assign .input-group-text {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
  }

  .nutrition-hub-container #tab-assign .form-control::placeholder {
    color: rgba(255, 255, 255, 0.65);
  }

  .nutrition-hub-container #tab-assign .form-select option,
  .nutrition-hub-container #tab-assign .form-select optgroup {
    color: #fff;
  }

  .nutrition-hub-container .athlete-note-box {
    /* Eigenes Flex-Item auf .pcard-Ebene (siehe Template) statt in .pcard-body
       verschachtelt - flex-basis:100% erzwingt den Umbruch unterhalb von
       Bild+Name und lässt die Box die volle Card-Breite nutzen, statt auf die
       schmale Body-Spalte neben dem Produktbild begrenzt zu sein. */
    flex: 1 1 100%;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.6rem 0.7rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--nut-border-soft);
  }

  .nutrition-hub-container .athlete-note-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
  }

  .nutrition-hub-container .athlete-note-label {
    display: block;
    margin-bottom: 0;
  }

  .nutrition-hub-container .athlete-note-updated {
    font-size: 0.68rem;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
  }

  .nutrition-hub-container .athlete-rating-wrap {
    margin-bottom: 0.5rem;
  }

  .nutrition-hub-container .athlete-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
  }

  .nutrition-hub-container .athlete-rating-star {
    border: none;
    background: transparent;
    color: #c5cbd5;
    padding: 0;
    font-size: 1.02rem;
    line-height: 1;
    cursor: pointer;
  }

  .nutrition-hub-container .athlete-rating-star.is-active {
    color: var(--nut-warning);
  }

  .nutrition-hub-container .athlete-rating-help {
    margin-left: 0.35rem;
    font-size: 0.72rem;
    color: #4b5563;
  }

  .nutrition-hub-container .athlete-note-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 60px;
    background: #f6f8fb;
    border: 1px solid #c9d1dc;
    color: #1f2937;
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
    font-size: 0.8rem;
    line-height: 1.3;
  }

  .nutrition-hub-container .athlete-note-input:focus {
    outline: none;
    border-color: #8ca2c0;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 163, 0.2);
  }

  .nutrition-hub-container .athlete-note-input::placeholder {
    color: #6b7280;
  }

  .nutrition-hub-container .athlete-note-save {
    margin-top: 0.35rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    border-radius: 999px;
    background: var(--nut-primary);
    border: 1px solid var(--nut-primary);
    color: var(--nut-white);
  }

  .nutrition-hub-container .athlete-note-save:hover,
  .nutrition-hub-container .athlete-note-save:focus {
    background: #11151b;
    border-color: #11151b;
    color: var(--nut-white);
  }

  .nutrition-hub-container .athlete-note-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
  }

  .nutrition-hub-container .athlete-note-actions .athlete-note-save {
    margin-top: 0;
  }

  .nutrition-hub-container .athlete-note-delete {
    margin-top: 0;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    border-radius: 999px;
    background: transparent;
    border: 1px solid #c9d1dc;
    color: #b91c1c;
  }

  .nutrition-hub-container .athlete-note-delete:hover,
  .nutrition-hub-container .athlete-note-delete:focus {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #7f1d1d;
  }

  .nutrition-hub-container .athlete-note-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 0.35rem;
    border-radius: 999px;
    background: #e3ad3b;
    color: #222831;
    font-size: 0.62rem;
    vertical-align: middle;
  }

  .nutrition-hub-container .pcard-expand-hint {
    position: absolute;
    top: 0.4rem;
    right: 0.45rem;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 40, 49, 0.08);
    color: #5b6472;
    z-index: 3;
    pointer-events: none;
  }

  .nutrition-hub-container .pcard-expand-hint i {
    font-size: 0.72rem;
    line-height: 1;
    transition: transform 0.2s ease;
  }

  .nutrition-hub-container .pcard.note-open .pcard-expand-hint i {
    transform: rotate(180deg);
  }

  .nutrition-hub-container .athlete-note-box {
    display: none;
  }

  .nutrition-hub-container .pcard.note-open .athlete-note-box {
    display: block;
  }

  .nutrition-hub-container .pcard-rating-chip {
    position: absolute;
    top: 0.42rem;
    left: 0.45rem;
    height: 18px;
    padding: 0 0.32rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.08rem;
    z-index: 3;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(0, 0, 0, 0.08);
  }

  .nutrition-hub-container .pcard-rating-chip .bi-star-fill {
    color: var(--nut-warning);
    font-size: 0.58rem;
    line-height: 1;
  }

  .nutrition-hub-container .pcard-rating-chip .bi-star {
    color: #c5cbd5;
    font-size: 0.58rem;
    line-height: 1;
  }

  .nut-prop-toggle {
  display:flex; align-items:center; gap:10px;
  padding:.5rem .75rem; border-radius:8px; cursor:pointer;
    background:#f9fdf9; border:1px solid #e0f0e5; transition:background .15s;
  user-select:none;
}
.nut-prop-toggle:hover { background:#edf7f0; }
.nut-prop-toggle .form-check-input { flex-shrink:0; }

/* Feldgruppen im Geschmacksrichtungs-Formular (Bearbeiten / Neu anlegen):
   trennt Identität, Eigenschaften, Bild, Portionierung und Nährwerte optisch
   voneinander, statt sie als eine einzige lange Reihe darzustellen. */
.flavor-field-group + .flavor-field-group {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--nut-border-soft);
}
.flavor-field-group-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--nut-muted);
  margin-bottom: .6rem;
}

/* Geerbte Flavor-Felder mit manuell gesetztem Wert hervorheben */
.flavor-override-field.is-overridden {
  border-color: #5a7a60;
  box-shadow: inset 0 0 0 1px #5a7a60;
}

.nut-nutrition-table {
  background: var(--nut-surface);
  border-color: #dbe9dd;
}
.nut-nutrition-table thead th {
  background: #f4faf5;
  color: #465b49;
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nut-nutrition-table tbody th,
.nut-nutrition-table tbody td {
  vertical-align: middle;
}
.nut-nutrition-label {
  min-width: 220px;
}
.nut-nutrition-input {
  min-width: 110px;
}
.nut-nutrition-serving,
.nut-nutrition-serving-100g {
  font-weight: 600;
  white-space: nowrap;
}
.nut-nutrition-serving small,
.nut-nutrition-serving-100g small {
  display: block;
  font-weight: 400;
  color: #66756b;
}
.nut-nutrition-extra-title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #60705f;
}

@media (max-width: 575.98px) {
  .nutrition-hub-container .row.g-4 {
    --bs-gutter-x: .75rem;
    --bs-gutter-y: .75rem;
  }
  .nut-header {
    padding: .85rem;
    margin-bottom: .75rem;
  }
  .nut-header-content {
    gap: .75rem;
  }
  .nut-title {
    font-size: 1.9rem;
    line-height: 0.9;
    margin-top: 20px;
  }
  .nut-subtitle {
    font-size: .82rem;
  }
  .nut-form-section {
    padding: .75rem;
    margin-bottom: .75rem !important;
  }
  .nut-form-section-title {
    font-size: .9rem;
    margin-bottom: .5rem;
  }
  .form-label,
  .small,
  .form-text {
    font-size: .78rem;
  }
  .input-group-sm > .form-control,
  .input-group-sm > .form-select,
  .input-group-sm > .input-group-text,
  .form-control-sm,
  .form-select-sm {
    padding: .28rem .5rem;
    font-size: .82rem;
  }
  .nut-prop-toggle {
    padding: .38rem .55rem;
    gap: 8px;
  }
  .nut-prop-toggle img {
    height: 22px !important;
  }

  .nut-nutrition-extra-title {
    font-size: .72rem;
  }
  .nut-nutrition-label {
    min-width: 0;
  }
  .nut-nutrition-input {
    min-width: 0;
  }
  .nut-flavor-nutrition-table thead {
    display: none;
  }
  .nut-flavor-nutrition-table,
  .nut-flavor-nutrition-table tbody,
  .nut-flavor-nutrition-table tr,
  .nut-flavor-nutrition-table th,
  .nut-flavor-nutrition-table td {
    display: block;
    width: 100%;
  }
  .nut-flavor-nutrition-table tr {
    margin-bottom: .55rem;
    border: 1px solid #dbe9dd;
    border-radius: .7rem;
    overflow: hidden;
    background: #fff;
  }
  .nut-flavor-nutrition-table tbody th {
    border: 0;
    padding: .55rem .7rem .15rem;
    font-size: .95rem;
    line-height: 1.15;
  }
  .nut-flavor-nutrition-table tbody td {
    border: 0;
    padding: .22rem .7rem .55rem;
  }
  .nut-flavor-nutrition-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: .22rem;
    font-size: .68rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #66756b;
  }
  .nut-nutrition-serving,
  .nut-nutrition-serving-100g {
    text-align: left;
    font-size: .86rem;
  }
  .nut-nutrition-serving small,
  .nut-nutrition-serving-100g small {
    margin-top: .08rem;
    font-size: .72rem;
    line-height: 1.2;
  }
  .table-responsive {
    margin-right: -0.25rem;
    margin-left: -0.25rem;
  }

  /* Geschmacksrichtungen-Übersicht: statt gequetschter Spalten je Zeile eine
     Karte mit Bild+Name oben, Kennzahlen darunter, Aktionen rechts daneben.
     Die eingeklappte Bearbeiten-Zeile (colspan-Formular) hat keine
     .nut-flt-row-Klasse und bleibt daher bewusst ein normaler Block. */
  .nut-flavor-list-table thead { display: none; }
  .nut-flavor-list-table,
  .nut-flavor-list-table tbody,
  .nut-flavor-list-table tr,
  .nut-flavor-list-table td {
    display: block;
    width: 100%;
  }
  .nut-flavor-list-table tr.nut-flt-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: .6rem;
    row-gap: .5rem;
    padding: .65rem .75rem;
    margin-bottom: .55rem;
    border: 1px solid var(--nut-border-soft);
    border-radius: .7rem;
    background: var(--nut-surface);
  }
  .nut-flavor-list-table tr.nut-flt-row > td { border: 0; padding: 0; width: auto; }
  .nut-flavor-list-table .nut-flt-thumb { order: 1; flex: 0 0 auto; }
  .nut-flavor-list-table .nut-flt-name { order: 2; flex: 1 1 auto; min-width: 0; font-size: .92rem; }
  .nut-flavor-list-table .nut-flt-actions { order: 3; flex: 0 0 auto; }
  .nut-flavor-list-table tr.nut-flt-row td[data-label] {
    order: 4;
    flex: 1 1 30%;
    text-align: left;
  }
  .nut-flavor-list-table tr.nut-flt-row td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: .15rem;
    font-size: .64rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--nut-muted);
  }
}

/* ── Hersteller-Kombobox (Produktformular) ── */
.mfr-combo-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 260px;
  overflow-y: auto;
  background: var(--nut-surface);
  border: 1px solid var(--nut-border);
  border-radius: var(--nut-radius);
  box-shadow: var(--nut-shadow-md);
}
.mfr-combo-item {
  padding: .45rem .75rem;
  font-size: .85rem;
  cursor: pointer;
}
.mfr-combo-item:hover { background: var(--nut-surface-alt); }
.mfr-combo-item--new {
  color: var(--nut-accent);
  font-weight: 600;
  border-top: 1px solid var(--nut-border-soft);
}
.mfr-combo-empty {
  padding: .45rem .75rem;
  font-size: .82rem;
  color: var(--nut-muted);
}

/* ── Herstellerseite (manufacturer_detail) ── */
.mfr-detail-hero {
  background: linear-gradient(135deg, #222831 0%, #393E46 100%);
  border-radius: var(--nut-radius-lg);
  box-shadow: var(--nut-shadow-md);
  padding: 1.75rem;
}
.mfr-detail-hero-body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.5rem;
}
.mfr-detail-logo {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: var(--nut-radius);
  background: rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.mfr-detail-logo img { width: 100%; height: 100%; object-fit: contain; }
.mfr-detail-logo i { font-size: 2.5rem; color: rgba(255,255,255,.5); }
.mfr-detail-info { flex: 1; min-width: 240px; color: var(--nut-white); }
.mfr-detail-badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.mfr-detail-description { color: rgba(255,255,255,.78); font-size: .9rem; max-width: 60ch; margin-bottom: .75rem; }
.mfr-detail-links { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; }
.mfr-detail-links a, .mfr-detail-links span { color: rgba(255,255,255,.85); text-decoration: none; }
.mfr-detail-links a:hover { text-decoration: underline; }
.mfr-detail-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-self: flex-start; }

/* ── Gel-Finder (kleines Frage-Tool auf product_list) ── */
.nut-gel-finder {
  background: var(--nut-surface);
  border: 1px solid var(--nut-border);
  border-radius: var(--nut-radius-lg);
  box-shadow: var(--nut-shadow-md);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.nut-gel-finder-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1.25rem;
  background: linear-gradient(135deg, var(--nut-primary) 0%, var(--nut-secondary) 100%);
  border: none;
  color: var(--nut-white);
  text-align: left;
  cursor: pointer;
}
.nut-gel-finder-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  font-size: 1.05rem;
  flex-shrink: 0;
}
.nut-gel-finder-toggle-text { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.nut-gel-finder-toggle-text strong { font-size: .98rem; }
.nut-gel-finder-toggle-text small { color: rgba(255,255,255,.75); font-size: .78rem; }
.nut-gel-finder-chevron { transition: transform .2s ease; color: rgba(255,255,255,.85); }
.nut-gel-finder-toggle[aria-expanded="true"] .nut-gel-finder-chevron { transform: rotate(180deg); }
.nut-gel-finder-body { padding: 1.1rem 1.25rem 1.25rem; }
.nut-gel-finder-question { margin-bottom: 1rem; }
.nut-gel-finder-question:last-of-type { margin-bottom: 0; }
.nut-gel-finder-q-title { font-size: .85rem; font-weight: 600; color: var(--nut-text); margin-bottom: .5rem; }
.nut-gel-finder-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.nut-gel-finder-opt {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  padding: .4rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--nut-border);
  background: var(--nut-surface-alt);
  color: var(--nut-text);
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.nut-gel-finder-opt span { font-size: .68rem; font-weight: 400; color: var(--nut-muted); }
.nut-gel-finder-opt:hover { transform: translateY(-1px); border-color: var(--nut-accent); }
.nut-gel-finder-opt.is-active {
  background: var(--nut-accent);
  border-color: var(--nut-accent);
  color: var(--nut-white);
}
.nut-gel-finder-opt.is-active span { color: rgba(255,255,255,.85); }
.nut-gel-finder-actions { display: flex; align-items: center; gap: .75rem; margin-top: 1.1rem; flex-wrap: wrap; }
.nut-gel-finder-status { font-size: .82rem; color: var(--nut-success); font-weight: 500; }
@media (max-width: 767.98px) {
  .nut-gel-finder-toggle { padding: .8rem 1rem; }
  .nut-gel-finder-body { padding: 1rem; }
}

@media (max-width: 767.98px) {
  .mfr-detail-hero-body { flex-direction: column; }
  .mfr-detail-actions { width: 100%; }
}