/*
 * Frontend-Produktseite (Stufe 2) – WASGAU-Design „Warm Editorial" (Karte 1c).
 * Typografie wird von der Seite geerbt (kein eigener Font-Load). Farben/Radius zentral
 * über CSS-Variablen; Kategorie-Farben als --cat-*-Variablen je .grs-pdb-cat--* Klasse.
 */

/* Tokens auch auf dem Modal-Root, weil das JS das Modal per appendChild ans <body>
 * portiert – dort sind die auf .grs-pdb definierten Variablen sonst nicht verfügbar. */
.grs-pdb,
.grs-pdb__modal-root {
    /* Akzent = Seitenfarbe --prime (WASGAU-Grün; Sortimentsseiten setzen per :root z. B.
     * Bäckerei-Orange oder Metzgerei-Rot). Hover-/Hintergrundtöne leiten sich davon ab. */
    --grs-pdb-accent: var(--prime, #427d26);
    --grs-pdb-accent-dark: color-mix(in srgb, var(--grs-pdb-accent) 78%, #000);   /* Hover/Links */
    --grs-pdb-accent-soft: color-mix(in srgb, var(--grs-pdb-accent) 9%, #fff);    /* Chip-/Hinweis-Hintergrund */
    --grs-pdb-accent-contrast: var(--on-prime, #fff);                              /* Text auf Akzent */
    --grs-pdb-ink: #1f1f1f;
    --grs-pdb-text: #4d535c;          /* Fließtextfarbe der WASGAU-Seite (body) */
    --grs-pdb-muted: #6f6d68;
    --grs-pdb-muted-2: #a49d90;       /* Verkehrsbezeichnung, Meta */
    --grs-pdb-border: #ece7dd;        /* warmer Rahmen */
    --grs-pdb-card-bg: #fffdf9;       /* warmes Kartenweiß */
    --grs-pdb-radius: 0;              /* Design ist durchgehend eckig */
    --grs-pdb-gap: 1.25rem;
}

/* Native Form-Controls erben die Schriftart nicht von selbst – erzwingen, damit
 * Buttons/Inputs (Filter zurücksetzen, Mehr laden, Suche …) die Seitentypografie nutzen. */
.grs-pdb button,
.grs-pdb input,
.grs-pdb__modal-root button,
.grs-pdb__modal-root input {
    font-family: inherit;
}

.grs-pdb {
    display: grid;
    grid-template-columns: clamp(300px, 32vw, 400px) 1fr;
    gap: 0;
    align-items: stretch; /* weiße Sidebar als durchgehendes Panel */
    color: var(--grs-pdb-ink);
}
.grs-pdb__main {
    min-width: 0;
    padding: 3rem;
}
/* Zugängliche, aber unsichtbare Beschriftung (falls das Theme sie nicht stellt). */
.grs-pdb .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Kategorie-Farben (Bereichsfarben) ---------- */
.grs-pdb-cat--metz    { --cat-color: #d30535; --cat-text: #d30535; --cat-badge-fg: #fff; }
.grs-pdb-cat--baeck   { --cat-color: #ff8c00; --cat-text: #b56400; --cat-badge-fg: #291600; }
.grs-pdb-cat--wein    { --cat-color: #7c1209; --cat-text: #7c1209; --cat-badge-fg: #fff; }
/* Käsetheke und alle unbekannten Kategorien */
.grs-pdb-cat--default { --cat-color: #427d26; --cat-text: #427d26; --cat-badge-fg: #fff; }

/* ---------- Sidebar (Variante 2a: weißes, abgesetztes Panel) ---------- */
/* Bewusst NICHT sticky: beim Scrollen würde die Position neu berechnet und die Sidebar
 * „wandern". Sie scrollt daher normal mit. (Mobil wird sie per Media-Query zum Drawer.) */
.grs-pdb__sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: #fff;
    border-right: 1px solid var(--grs-pdb-border);
    box-shadow: 6px 0 24px -14px rgba(0, 0, 0, 0.22);
    padding: 2rem;
}
.grs-pdb__sidebar-title {
    font-size: 1.3125rem;
    line-height: 1;
    font-weight: 900;
    color: var(--grs-pdb-ink);
}
.grs-pdb__filters {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.grs-pdb__fieldset {
    border: 0;
    border-bottom: 1px solid #efefef;
    padding: 0 0 0.75rem;
    margin: 0 0 1.25rem;
    min-width: 0;
}
.grs-pdb__legend {
    margin: 0 0 0.75rem;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--grs-pdb-muted);
}
.grs-pdb__checkbox {
    display: flex;
    align-items: center;
    gap: 0.5625rem;
    padding: 0.375rem 0;
    cursor: pointer;
    font-size: 0.9375rem;
    color: #3a3833;
    user-select: none;
}
.grs-pdb__checkbox:hover {
    color: var(--grs-pdb-ink);
}
/* Native Checkbox zugänglich lassen, aber visuell durch .grs-pdb__cbx ersetzen. */
.grs-pdb__checkbox input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}
.grs-pdb__cbx {
    width: 17px;
    height: 17px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #cfcabf;
    border-radius: 3px;
    background: #fff;
    color: #fff;                 /* Häkchen weiß → auf weißem Grund unsichtbar */
    transition: background 0.12s, border-color 0.12s;
}
.grs-pdb__checkbox input:checked ~ .grs-pdb__cbx {
    background: var(--grs-pdb-accent);
    border-color: var(--grs-pdb-accent);
    color: var(--grs-pdb-accent-contrast);
}
.grs-pdb__checkbox input:focus-visible ~ .grs-pdb__cbx {
    outline: 2px solid var(--grs-pdb-accent);
    outline-offset: 2px;
}
.grs-pdb__opt-label {
    line-height: 1.3;
}
.grs-pdb__opt-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--grs-pdb-muted-2);
}
.grs-pdb__reset {
    align-self: flex-start;
    margin-top: 1.5rem;
    background: none;
    border: 0;
    padding: 0;
    color: var(--grs-pdb-accent);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
.grs-pdb__reset:hover {
    color: var(--grs-pdb-accent-dark);
}

/* ---------- Suchfeld (in der Sidebar) ---------- */
.grs-pdb__search {
    position: relative;
    display: block;
    width: 100%;
}
.grs-pdb__search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: var(--grs-pdb-muted-2);
    pointer-events: none;
}
.grs-pdb__search input {
    width: 100%;
    padding: 0.8125rem 0.875rem 0.8125rem 2.5rem;
    border: 1px solid var(--grs-pdb-border);
    border-radius: var(--grs-pdb-radius);
    background: #faf9f6;
    font-size: 0.9375rem;
    color: var(--grs-pdb-ink);
}
.grs-pdb__search input:focus {
    outline: none;
    border-color: var(--grs-pdb-accent);
    background: #fff;
}

/* ---------- Kopfbereich (Breadcrumbs + Titel) ---------- */
.grs-pdb__header {
    margin-bottom: 1.75rem;
}
.grs-pdb__breadcrumbs {
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: var(--grs-pdb-muted-2);
}
.grs-pdb__breadcrumbs a {
    color: inherit;
    text-decoration: none;
}
.grs-pdb__breadcrumbs a:hover {
    color: var(--grs-pdb-accent);
}
.grs-pdb__title {
    margin: 0;
    font-size: 2.25rem;
    line-height: 1.05;
    font-weight: 900;
    color: var(--grs-pdb-ink);
}
.grs-pdb__intro {
    margin: 0.75rem 0 0;
    max-width: 680px;
    font-size: 1.0625rem;
    line-height: 1.5;
    color: var(--grs-pdb-muted);
}

/* ---------- Toolbar (Ergebnis-/Filterzeile) ---------- */
.grs-pdb__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: var(--grs-pdb-gap);
}
.grs-pdb__count {
    margin: 0;
    color: var(--grs-pdb-muted);
    white-space: nowrap;
    font-size: 0.95rem;
}

/* ---------- Aktive Filter-Tags ---------- */
.grs-pdb__chips {
    list-style: none;
    margin: 0 0 var(--grs-pdb-gap);
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.grs-pdb__tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    padding: 0.28em 0.28em 0.28em 0.7em;
    border-radius: 0.25em;
    font-size: 0.8125rem;
    background: var(--grs-pdb-accent-soft);
    color: var(--grs-pdb-accent-dark);
}
.grs-pdb__tag > span {
    margin-right: 0.2rem;
}
.grs-pdb__tag-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1875rem;
    height: 1.1875rem;
    padding: 0;
    border: 0;
    border-radius: 0.2em;
    background: transparent;
    opacity: 0.8;
    cursor: pointer;
}
.grs-pdb__tag-x svg {
    width: 9px;
    height: 9px;
    display: block;
}
.grs-pdb__tag-x:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.16);
}

/* ---------- Grid ---------- */
/* Spaltenzahl richtet sich nach der Min-Breite 300px (→ bis zu 4 bei 1920px), die Karten
 * dehnen sich per 1fr gleichmäßig aus (bei 1920px ~331px). Mehr Platz = mehr Karten pro
 * Reihe + größerer Gap. min(100%, 300px) verhindert Overflow auf sehr schmalen Screens. */
.grs-pdb__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: clamp(1.25rem, 1.6vw, 2rem);
}
/* Opacity/Stagger übernimmt GSAP (siehe produkte.js) – keine aria-busy-Dimmung mehr. */

/* ---------- Skeletons (Ladezustand) ---------- */
.grs-pdb-skeleton {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--grs-pdb-border);
    border-radius: var(--grs-pdb-radius);
    background: var(--grs-pdb-card-bg);
    overflow: hidden;
}
.grs-pdb-skeleton__media {
    aspect-ratio: 1 / 1;
}
.grs-pdb-skeleton__body {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 1.1875rem;
}
.grs-pdb-skeleton__line {
    height: 0.75rem;
    border-radius: 3px;
}
.grs-pdb-skeleton__line.is-cat {
    width: 40%;
    height: 0.6rem;
}
.grs-pdb-skeleton__line.is-title {
    width: 75%;
    height: 1.05rem;
}
.grs-pdb-skeleton__line.is-short {
    width: 55%;
}
.grs-pdb-skeleton__media,
.grs-pdb-skeleton__line {
    background: linear-gradient(100deg, #eeece7 30%, #f6f4f0 50%, #eeece7 70%);
    background-size: 200% 100%;
    animation: grs-pdb-shimmer 1.2s ease-in-out infinite;
}
@keyframes grs-pdb-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .grs-pdb-skeleton__media,
    .grs-pdb-skeleton__line {
        animation: none;
    }
}

/* ---------- Kachel (1c „Warm Editorial") ---------- */
.grs-pdb-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--grs-pdb-border);
    border-radius: var(--grs-pdb-radius);
    overflow: hidden;
    background: var(--grs-pdb-card-bg);
    cursor: pointer;
    transition: transform 0.24s cubic-bezier(0.2, 0.7, 0.3, 1), box-shadow 0.24s;
}
.grs-pdb-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 44px -16px rgba(0, 0, 0, 0.32);
}
.grs-pdb-card:focus-visible {
    outline: 2px solid var(--grs-pdb-accent);
    outline-offset: 2px;
}
.grs-pdb-card__media {
    position: relative;
    aspect-ratio: 3 / 2;
    background: #fff;
    overflow: hidden;
}
.grs-pdb-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
    display: block;
    transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
    will-change: transform;
}
.grs-pdb-card:hover .grs-pdb-card__img,
.grs-pdb-card:hover .grs-pdb-card__ph {
    transform: scale(1.07);
}
/* Platzhalter für Produkte ohne Bild (Fallback-Icon auf weißem Grund wie bei Produktfotos). */
.grs-pdb-card__ph {
    position: absolute;
    inset: 0;
    background: #fff url('fallback-grs-icon.svg') center / 40% auto no-repeat;
    transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.grs-pdb-card__seasonal {
    position: absolute;
    top: 11px;
    left: 11px;
    background: #fff;
    color: var(--grs-pdb-accent);
    border: 1px solid var(--grs-pdb-accent);
    font-size: 0.7rem;
    line-height: 1;
    padding: 0.3rem 0.5rem;
    border-radius: 0.25em;
}
.grs-pdb-card__diets {
    position: absolute;
    top: 11px;
    right: 11px;
    display: flex;
    gap: 5px;
}
.grs-pdb-card__diet {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grs-pdb-accent-dark);
}
/* Die Icons bringen ihren eigenen Kreis mit → füllen das Badge */
.grs-pdb-card__diet svg {
    display: block;
    width: 100%;
    height: 100%;
}
.grs-pdb-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.5625rem;
    padding: 1.1875rem 1.1875rem 1.3125rem;
    flex: 1;
}
.grs-pdb-card__cat {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
}
.grs-pdb-card__cat-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cat-text, #2b2b2b);
}
.grs-pdb-card__title {
    margin: 0;
    font-size: 1.1875rem;
    line-height: 1.22;
    font-weight: 700;
    color: var(--grs-pdb-ink);
    /* Lange Einwort-Namen („Bananenbuttercremetorte") deutsch trennen statt über den Rand
     * laufen lassen; höchstens 3 Zeilen, danach „…" (voller Titel steht im Modal). */
    hyphens: auto;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}
.grs-pdb-card__legal {
    margin-top: -0.375rem;
    font-style: italic;
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--grs-pdb-muted-2);
}
.grs-pdb-card__intro {
    margin: 0;
    color: var(--grs-pdb-muted);
    font-size: 0.85rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.grs-pdb-card__foot {
    margin-top: auto;
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.grs-pdb-card__allergens {
    font-size: 0.71875rem;
    line-height: 1.4;
    color: #9a938a;
}
.grs-pdb-card__more {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    color: var(--grs-pdb-text);
    font-size: 0.78rem;
    font-weight: 700;
}
/* Pfeil-Button wie .wa-arrow-btn der Seite (verkleinert): Kreis in Akzentfarbe, Pfeil in
 * Kontrastfarbe – als Maske, damit er --on-prime folgt (weiß auf Grün, dunkel auf Orange). */
.grs-pdb-card__more-arrow {
    position: relative;
    display: block;
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--grs-pdb-accent);
    transition: transform 0.2s ease;
}
.grs-pdb-card__more-arrow::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 8px;
    transform: translate(-50%, -50%);
    background: var(--grs-pdb-accent-contrast);
    -webkit-mask: url(/app/uploads/wa-arrow-btn.svg) center / contain no-repeat;
    mask: url(/app/uploads/wa-arrow-btn.svg) center / contain no-repeat;
}
.grs-pdb-card:hover .grs-pdb-card__more-arrow {
    transform: translateX(3px);
}

/* ---------- Zustände / Load-More ---------- */
.grs-pdb__status {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--grs-pdb-muted);
    padding: 2rem 0;
}
.grs-pdb__loadmore {
    text-align: center;
    margin-top: 1.875rem;
}
.grs-pdb__loadmore-btn {
    background: var(--grs-pdb-accent);
    color: var(--grs-pdb-accent-contrast);
    border: none;
    border-radius: var(--grs-pdb-radius);
    padding: 0.7rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.grs-pdb__loadmore-btn:hover {
    background: var(--grs-pdb-accent-dark);
}

/* ---------- Detail-Modal (rechts angedockt, wie die Website-Modals) ---------- */
body.grs-pdb-modal-open {
    overflow: hidden;
}
.grs-pdb__modal-root {
    position: fixed;
    inset: 0;
    /* Über fixierten Theme-Elementen (Oxygen-Header nutzt z-index 999999). */
    z-index: 2147483000;
    display: flex;
    justify-content: flex-end; /* Panel an der rechten Seite */
}
.grs-pdb__modal-root[hidden] {
    display: none;
}
/* WP-Admin-Bar berücksichtigen (Modal ist ans <body> portiert): Panel unter der Leiste
 * beginnen lassen. 32px ab 783px, 46px darunter (siehe Media-Query unten). */
body.admin-bar .grs-pdb__modal-root {
    top: 32px;
}
.grs-pdb__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(31, 31, 31, 0.55);
}
.grs-pdb__modal {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 720px;
    width: 100%;
    background: #fff;
    overflow: hidden;
    box-shadow: -20px 0 60px -20px rgba(0, 0, 0, 0.45);
}
.grs-pdb__modal:focus {
    outline: none;
}

/* Kopfbalken in Akzentfarbe mit Schließen-Button rechts */
.grs-pdb__modal-header {
    flex: none;
    background: var(--grs-pdb-accent);
    color: var(--grs-pdb-accent-contrast);
}
.grs-pdb__modal-close {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
    width: 100%;
    margin: 0;
    padding: 1rem 2rem;
    border: 0;
    background: none;
    color: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
}
.grs-pdb__modal-close-icon {
    display: block;
    width: 14px;
    height: 14px;
    /* X-SVG als Maske, damit es die Textfarbe (--on-prime) übernimmt */
    background: currentColor;
    -webkit-mask: url(/app/uploads/close-x.svg) center / contain no-repeat;
    mask: url(/app/uploads/close-x.svg) center / contain no-repeat;
    transition: transform 0.4s ease;
}
.grs-pdb__modal-close:hover .grs-pdb__modal-close-icon {
    transform: rotate(180deg);
}
.grs-pdb__modal-close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -4px;
}

/* Scrollbarer Inhaltsbereich */
.grs-pdb__modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 3rem 2.5rem;
}

/* Kopfblock (zentriert): Kategorie, Titel, Verkehrsbezeichnung, Intro, Key-Facts */
.grs-pdb__modal-head {
    text-align: center;
    margin-bottom: 1.5rem;
}
.grs-pdb__modal-cat {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cat-text, #2b2b2b);
}
.grs-pdb__modal-title {
    margin: 0;
    font-size: 1.75rem;
    line-height: 1.2;
    font-weight: 900;
    color: var(--grs-pdb-ink);
}
.grs-pdb__modal-legal {
    margin-top: 0.375rem;
    font-style: italic;
    font-size: 0.9375rem;
    line-height: 1.3;
    color: var(--grs-pdb-muted-2);
}
.grs-pdb__modal-intro {
    max-width: 460px;
    margin: 0.75rem auto 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #4a473f;
}
.grs-pdb__modal-diets {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}
/* Bewusst neutral (folgt nicht --prime) */
.grs-pdb__modal-diet {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    background: #f1f0ed;
    color: var(--grs-pdb-ink);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.4375rem 0.75rem;
    border-radius: var(--grs-pdb-radius);
}
.grs-pdb__modal-diet-icon,
.grs-pdb__modal-diet-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}

/* Produktbild (16:9, freigestellt) */
.grs-pdb__modal-media {
    position: relative;
    aspect-ratio: 16 / 9;
    margin: 0 0 1.75rem;
    background: #fff;
    overflow: hidden;
}
.grs-pdb__modal-media .grs-pdb-card__ph {
    position: absolute;
    inset: 0;
}
.grs-pdb__modal-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Detailabschnitte untereinander */
.grs-pdb__modal-sections {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.grs-pdb__modal-heading {
    margin: 0 0 0.4375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--grs-pdb-muted);
}
.grs-pdb__modal-description {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: #4a473f;
}
.grs-pdb__modal-description > :first-child { margin-top: 0; }
.grs-pdb__modal-description > :last-child { margin-bottom: 0; }
.grs-pdb__modal-allergens,
.grs-pdb__modal-ingredients,
.grs-pdb__modal-traces {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--grs-pdb-muted);
}
.grs-pdb__modal-allergens {
    color: #2b2b2b;
}
/* Spuren-Hinweis (#86): steht ohne Überschrift unter dem Zutatentext und wird
   zusätzlich zum Section-Gap etwas abgesetzt. */
.grs-pdb__modal-traces {
    margin-top: 0.25rem;
}
.grs-pdb__modal-note {
    margin: 0.4375rem 0 0;
    font-size: 0.6875rem;
    line-height: 1.4;
    color: var(--grs-pdb-muted-2);
}
.grs-pdb__modal-availability {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--grs-pdb-accent);
    background: var(--grs-pdb-accent-soft);
    padding: 0.625rem 0.8125rem;
    border-radius: var(--grs-pdb-radius);
}

/* Sortimentshinweis (#93): Kleingedrucktes am Ende jedes Datenblatts, durch eine
   dezente Linie vom übrigen Inhalt abgesetzt. */
.grs-pdb__modal-disclaimer {
    margin: 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--grs-pdb-border);
    font-size: 0.6875rem;
    line-height: 1.4;
    color: var(--grs-pdb-muted-2);
}

/* Footer-Button „Produkt schließen" */
.grs-pdb__modal-footer-close {
    width: 100%;
    margin-top: 2rem;
    padding: 0.8rem 1rem;
    border: 1px solid #909499;
    background: none;
    color: #909499;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.grs-pdb__modal-footer-close:hover {
    border-color: var(--grs-pdb-accent);
    color: var(--grs-pdb-accent);
}

/* Nährwert-Tabelle */
.grs-pdb__nutrition {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ece9e3;
}
.grs-pdb__nutrition thead th {
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--grs-pdb-accent-contrast);
    background: var(--grs-pdb-accent);
    padding: 0.5625rem 0.8125rem;
}
.grs-pdb__nutrition td {
    padding: 0.5rem 0.8125rem;
    font-size: 0.8125rem;
    line-height: 1.3;
    border-top: 1px solid #f2efe9;
    color: #4a473f;
}
.grs-pdb__nutrition .grs-pdb__nutrition-lbl.is-sub {
    padding-left: 1.5rem;
    color: #807a70;
    font-size: 0.78125rem;
}
.grs-pdb__nutrition thead th.grs-pdb__nutrition-val {
    text-align: right ;
}
.grs-pdb__nutrition-val {
    text-align: right ;
    font-weight: 600;
    color: var(--grs-pdb-ink);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.grs-pdb__nutrition tr.is-zebra td {
    background: #faf8f4;
}
.grs-pdb__nutrition tr.is-energy td {
    background: var(--grs-pdb-accent-soft);
    font-weight: 700;
    color: var(--grs-pdb-ink);
}

/* ---------- Mobiles Filter-Panel (Drawer) ---------- */
/* Toggle/Close nur mobil sichtbar (Basis: ausgeblendet). */
.grs-pdb__filter-toggle {
    display: none;
    align-items: center;
    gap: 0.625rem;
    background: var(--grs-pdb-accent);
    color: var(--grs-pdb-accent-contrast);
    border: 0;
    border-radius: 100px;
    padding: 0.75rem 1.5rem;
    font-size: 1.0625rem;
    font-weight: 700;
    cursor: pointer;
}
.grs-pdb__filter-toggle:hover {
    background: var(--grs-pdb-accent-dark);
}
.grs-pdb__filter-toggle-icon {
    display: block;
    width: 20px;
    height: 20px;
}
.grs-pdb__filter-close {
    display: none;
}
/* „Filter anwenden" nur im mobilen Drawer (schließt das Panel). */
.grs-pdb__filter-apply {
    display: none;
}
.grs-pdb__sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2147482999;
}

/* ---------- Layout „horizontal" (Einbindung in Content-Seiten) ---------- */
.grs-pdb--horizontal {
    display: block;
    width: 100%;
}
/* Oxygen packt normalen Seiteninhalt in ein inline-block-<span>, das sich an den Inhalt
 * anschmiegt – das Modul würde je nach Filterzustand seine Breite ändern. */
.ct-span:has(> .grs-pdb--horizontal) {
    display: block;
}
.grs-pdb--horizontal .grs-pdb__main {
    padding: 0;
}
.grs-pdb--horizontal .grs-pdb__title {
    font-size: 1.75rem;
}
/* Mind. 3 Karten pro Reihe ab ~800px Inhaltsbreite */
.grs-pdb--horizontal .grs-pdb__grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}
/* Leiste: Suche + Filter-Dropdowns */
.grs-pdb__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.625rem;
    margin-bottom: 1rem;
}
.grs-pdb--horizontal .grs-pdb__search {
    flex: 1 1 260px;
    width: auto;
}
.grs-pdb--horizontal .grs-pdb__search input {
    height: 100%;
    background: #fff;
}
.grs-pdb__dropdowns {
    flex: 0 0 auto; /* nicht schrumpfen – reicht der Platz nicht, rutscht die Gruppe unter die Suche */
    display: flex;
    flex-direction: row; /* überschreibt die Spalte von .grs-pdb__filters (Sidebar) */
    flex-wrap: wrap;
    gap: 0.625rem;
}
.grs-pdb__dd {
    position: relative;
}
.grs-pdb__dd-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 100%;
    min-height: 2.875rem;
    padding: 0 1rem;
    background: #fff;
    border: 1px solid var(--grs-pdb-border);
    border-radius: var(--grs-pdb-radius);
    color: var(--grs-pdb-ink);
    font-size: 0.9375rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.grs-pdb__dd-btn:hover,
.grs-pdb__dd.is-open .grs-pdb__dd-btn {
    border-color: var(--grs-pdb-accent);
}
.grs-pdb__dd-btn:focus-visible {
    outline: 2px solid var(--grs-pdb-accent);
    outline-offset: 2px;
}
.grs-pdb__dd.has-active .grs-pdb__dd-btn {
    border-color: var(--grs-pdb-accent);
    background: var(--grs-pdb-accent-soft);
    color: var(--grs-pdb-accent-dark);
}
.grs-pdb__dd-chevron {
    transition: transform 0.2s ease;
}
.grs-pdb__dd.is-open .grs-pdb__dd-chevron {
    transform: rotate(180deg);
}
.grs-pdb__dd-menu {
    position: absolute;
    top: calc(100% + 0.375rem);
    left: 0;
    z-index: 50;
    min-width: 260px;
    max-height: min(420px, 70vh);
    overflow-y: auto;
    padding: 0.75rem 1.125rem;
    background: #fff;
    border: 1px solid var(--grs-pdb-border);
    box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.25);
}
.grs-pdb__dd-hint {
    position: sticky; /* bleibt beim Scrollen langer Listen oben */
    top: -0.75rem;    /* = padding-top des Menüs */
    margin: -0.75rem -1.125rem 0.25rem;
    padding: 0.625rem 1.125rem 0.5rem;
    background: #fff;
    border-bottom: 1px solid #efefef;
    font-size: 0.75rem;
    color: var(--grs-pdb-muted);
}
.grs-pdb__dd-menu[hidden] {
    display: none;
}
.grs-pdb__dd.is-align-right .grs-pdb__dd-menu {
    left: auto;
    right: 0;
}
/* Aktive Filter-Tags + Zurücksetzen links, Trefferzahl rechts */
.grs-pdb__active {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}
.grs-pdb--horizontal .grs-pdb__chips {
    margin: 0;
}
.grs-pdb--horizontal .grs-pdb__reset {
    align-self: center;
    margin-top: 0;
}

/* ---------- Responsiv ---------- */
@media (max-width: 782px) {
    .grs-pdb {
        grid-template-columns: 1fr;
    }
    .grs-pdb__main {
        padding: 1.5rem;
    }
    .grs-pdb__filter-toggle {
        display: inline-flex;
    }
    .grs-pdb__filter-close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        width: 2.25rem;
        height: 2.25rem;
        border: none;
        border-radius: 50%;
        background: #f3f2ef;
        font-size: 1.1rem;
        line-height: 1;
        cursor: pointer;
    }
    .grs-pdb__sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: min(320px, 85vw);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 2147483000;
        background: #fff;
        overflow-y: auto;
        padding: 1.25rem;
        border-right: 0;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    }
    .grs-pdb.is-filter-open .grs-pdb__sidebar {
        transform: none;
    }
    .grs-pdb__filter-apply {
        display: block;
        width: 100%;
        background: var(--grs-pdb-accent);
        color: var(--grs-pdb-accent-contrast);
        border: none;
        border-radius: var(--grs-pdb-radius);
        padding: 0.7rem 1rem;
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
    }

    /* Modal auf Mobil: volle Breite, kompaktere Abstände. */
    body.admin-bar .grs-pdb__modal-root {
        top: 46px; /* Admin-Bar ist ≤782px 46px hoch */
    }
    .grs-pdb__modal {
        max-width: 100%;
    }
    .grs-pdb__modal-close {
        padding: 0.875rem 1.25rem;
    }
    .grs-pdb__modal-content {
        padding: 1.5rem 1.25rem 2rem;
    }
    .grs-pdb__modal-title {
        font-size: 1.5rem;
    }
}

/* Kleine Screens: möglichst 2 Karten nebeneinander (min. 150px), kompaktere Karte. */
@media (max-width: 700px) {
    .grs-pdb__dropdowns {
        flex: 1 1 100%;
    }
    /* Dropdown-Menüs über die volle Leistenbreite statt unter dem Button */
    .grs-pdb__bar {
        position: relative;
    }
    .grs-pdb__dd {
        position: static;
    }
    .grs-pdb__dd-menu,
    .grs-pdb__dd.is-align-right .grs-pdb__dd-menu {
        left: 0;
        right: 0;
        min-width: 0;
    }
    .grs-pdb__grid,
    .grs-pdb--horizontal .grs-pdb__grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
    }
    .grs-pdb-card__title {
        font-size: 1rem;
    }
    .grs-pdb-card__more-arrow {
        width: 20px;
        height: 20px;
    }
}

/* -------------------------------------------------- Einzel-Produktseite [grs_produkt]
 * Nutzt dieselben grs-pdb__modal-*-Bausteine wie das Detail-Modal, aber als eigenständige
 * Seite statt im andockenden Panel. Der Wrapper trägt .grs-pdb nur für die Farb-Tokens;
 * das zweispaltige Grid der Listenansicht wird hier zurückgesetzt. */
.grs-pdb__single {
    display: block;
    grid-template-columns: none;
    padding: 2.5rem 1.5rem 3.5rem;
}
.grs-pdb__single-inner {
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    padding: 2rem 3rem 2.5rem;
}
/* Am Seitenende, im „Mehr erfahren"-Stil (gleiche Farbe/Größe + gleicher Pfeil). */
.grs-pdb__single-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    margin-top: 2rem;
    color: var(--grs-pdb-text);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}
.grs-pdb__single-back:hover .grs-pdb-card__more-arrow {
    transform: translateX(3px);
}
.grs-pdb__single-back:focus-visible {
    outline: 2px solid var(--grs-pdb-accent);
    outline-offset: 3px;
}

@media (max-width: 700px) {
    .grs-pdb__single {
        padding: 1.5rem 0 2.5rem;
    }
    .grs-pdb__single-inner {
        padding: 1.5rem 1.25rem 2rem;
    }
}
