/* Compatible Systems – Filter-Tool (Dark Theme) */

:root {
    --c-bg:        #111111;
    --c-panel:     #242424;
    --c-panel-2:   #1c1c1c;
    --c-fg:        #ffffff;
    --c-fg-soft:   #e6e6e6;
    --c-muted:     #8a8a8a;
    --c-line:      #2e2e2e;
    --c-line-soft: #1c1c1c;
    --c-accent:    #ffffff;
    --c-gold:      #c8a233;

    --radius:      2px;
    --fs-base:     14px;
    --fs-small:    12px;
    --fs-h1:       38px;

    --gap:         12px;
    --gap-sm:      6px;

    --matrix-cell-w: 280px;
    --matrix-rail-w: 220px;

    --font: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--c-bg);
    color: var(--c-fg);
    font-family: var(--font);
    font-size: var(--fs-base);
    line-height: 1.4;
    min-height: 100vh;
}

button { font-family: inherit; color: inherit; }

/* ----- Header --------------------------------------------------------- */

.page-header { padding: 30px 32px 18px; }
.page-header__inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}
.page-header h1 {
    margin: 0;
    font-size: var(--fs-h1);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 300;
    color: var(--c-fg);
}

/* ----- Suche --------------------------------------------------------- */

.search-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 6px;
    flex: 0 1 480px;
    min-width: 280px;
}
.main-search {
    flex: 1 1 auto;
    background: var(--c-panel);
    border: 0;
    border-radius: var(--radius);
    color: var(--c-fg);
    padding: 14px 18px;
    font-size: var(--fs-base);
    outline: none;
}
.main-search::placeholder { color: var(--c-muted); }
.main-search:focus { box-shadow: 0 0 0 1px var(--c-line); }

.search-btn {
    background: var(--c-panel);
    border: 0;
    border-radius: var(--radius);
    color: var(--c-fg);
    padding: 0 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.search-btn:hover { background: #2e2e2e; }

.search-suggest {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--c-panel);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    box-shadow: 0 8px 28px rgba(0,0,0,0.5);
    z-index: 30;
    max-height: 480px;
    overflow-y: auto;
}
.search-suggest__group {
    padding: 10px 14px;
    border-bottom: 1px solid var(--c-line-soft);
}
.search-suggest__group:last-child { border-bottom: 0; }
.search-suggest__group h4 {
    margin: 0 0 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--c-muted);
    font-weight: 600;
}
.search-suggest__item {
    display: block;
    padding: 6px 4px;
    cursor: pointer;
    border-radius: 3px;
    color: var(--c-fg-soft);
    text-decoration: none;
}
.search-suggest__item:hover { background: #2e2e2e; color: var(--c-fg); }
.search-suggest__item .code {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    color: var(--c-muted);
    margin-right: 8px;
    font-size: 11px;
}
.search-suggest__empty { padding: 14px; color: var(--c-muted); text-align: center; font-size: 13px; }

/* ----- Filter toolbar ------------------------------------------------- */

.filter-area {
    padding: 0 0 80px;
}

.filter-toolbar {
    display: flex;
    align-items: stretch;
    gap: 5px;
    margin-bottom: 0;
}

.filter-pills {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    flex: 1 1 auto;
    min-width: 0;
}

.pill {
    appearance: none;
    background: var(--c-panel);
    color: var(--c-fg);
    border: 0;
    padding: 18px 14px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition: background 0.15s;
    min-height: 110px;
}
.pill:hover     { background: #2e2e2e; }
.pill__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    color: var(--c-fg-soft);
}
.pill__icon svg { width: 100%; height: 100%; max-width: 42px; max-height: 42px; }
.pill__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
}

/* Default: kein Wert ausgewählt → Label IST die prominente Zeile (groß, weiß) */
.pill__label {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0;
    color: var(--c-fg);
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (min-width: 1400px) {
    .pill__label { font-size: 18px; }
}

/* Mit Auswahl: Label wird Überschrift (klein, grau), Value ist die prominente Zeile */
.pill.is-active .pill__label {
    font-size: 14px;
    color: #AAAAAA;
    font-weight: 400;
}
.pill__value {
    display: block;
    font-size: 18px;
    color: var(--c-fg);
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.pill__value .more { color: var(--c-muted); font-weight: 400; margin-left: 4px; font-size: 12px; }

.reset-icon {
    background: var(--c-panel);
    border: 0;
    color: var(--c-fg);
    cursor: pointer;
    padding: 0 16px;
    min-width: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.reset-icon:hover { background: #2e2e2e; }
.reset-icon svg { width: 24px; height: 24px; }

/* ----- Status -------------------------------------------------------- */

.filter-status {
    margin: 26px 32px 14px;
    color: var(--c-muted);
    font-size: var(--fs-small);
}
.filter-status #result-count strong { color: var(--c-fg); }

/* ----- Result-Container --------------------------------------------- */

.result-grid {
    display: block;
}

/* ----- Browse-View: Hersteller + System-Kacheln --------------------- */

.browse-rows {
    --browse-cell-w: 220px;
    --browse-cell-h: 220px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.browse-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, var(--browse-cell-w));
    grid-auto-rows: var(--browse-cell-h);
    gap: 5px;
}

.browse-tile {
    position: relative;
    appearance: none;
    border: 0;
    padding: 24px;
    text-align: left;
    font-family: inherit;
    color: var(--c-fg);
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.2;
    cursor: default;
    overflow: hidden;
    transition: background 0.15s;
    /* Label vertikal mittig, horizontal links */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}
.browse-tile--producer { background: #595959; }
.browse-tile--system   { background: #242424; cursor: pointer; }
.browse-tile--system:hover { background: #2e2e2e; }

.browse-tile__label {
    display: block;
    max-width: 100%;
    word-wrap: break-word;
}
.browse-tile__icon {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    color: var(--c-fg-soft);
    opacity: 0.85;
    pointer-events: none;
}
.browse-tile__icon svg {
    width: 100%;
    height: 100%;
    max-width: 38px;
    max-height: 38px;
}

/* ----- Matrix-View: Type-Rows × Size-Columns ------------------------ */

.matrix-wrap {
    overflow-x: auto;
    padding: 0;
}

.matrix {
    display: grid;
    grid-auto-rows: minmax(240px, auto);
    row-gap: 1px;
    column-gap: 1px;
}

.matrix__head,
.matrix__row {
    display: grid;
    grid-template-columns: var(--matrix-template);
    column-gap: 1px;
}
.matrix__head { display: none; }

.matrix__corner,
.matrix__size {
    padding: 12px 14px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--c-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
}

.matrix__type {
    padding: 0;
    background: var(--c-panel);
    color: var(--c-fg);
    display: flex;
    flex-direction: column;
}
.matrix__type-label {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 22px 18px;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1.25;
    word-wrap: break-word;
}
.matrix__badges {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}
.matrix__badges:empty { display: none; }
.badge {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    text-align: center;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    color: #1a1a1a;
    background: #6f6f6f;
}
.badge--material { background: var(--c-gold);  color: #1a1a1a; }   /* GOLD = goldgelb */
.badge--height   { background: #6f6f6f;        color: #ffffff; }   /* Lxx = mittelgrau, weiße Schrift */
.badge--chimney  { background: #4a5b6e;        color: #ffffff; }   /* Kxx = blau-grau */

.matrix__cell {
    padding: 18px 14px;
    background: var(--c-bg);             /* schwarz wie der Body — nur die Type-Rail ist grau */
    color: var(--c-fg);
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.matrix__cell--empty {
    background: transparent;
}
.matrix__image {
    background: var(--c-bg);             /* schwarzer Hintergrund hinter dem Foto */
}

.matrix__article {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}
.matrix__image {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--c-bg);             /* schwarzer Hintergrund hinter dem Foto */
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.matrix__image img {
    max-width: 80%;
    max-height: 100%;
    object-fit: contain;
}
.matrix__image img.is-placeholder { opacity: 0.45; }
.matrix__title {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.35;
    color: var(--c-fg);
}
.matrix__meta {
    font-size: 12px;
    color: var(--c-muted);
}
.matrix__meta .value {
    color: var(--c-fg);
    font-family: ui-monospace, Menlo, Consolas, monospace;
}
.matrix__actions {
    margin-top: auto;
    display: flex;
    gap: 6px;
    align-items: stretch;
}
.matrix__cta {
    flex: 1 1 auto;
    border: 1px solid #4a4a4a;
    color: var(--c-fg);
    background: transparent;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 11px;
    padding: 10px 14px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, border-color 0.15s;
}
.matrix__cta:hover { background: #2e2e2e; border-color: #6a6a6a; }
.matrix__bookmark {
    width: 38px;
    border: 1px solid #4a4a4a;
    background: transparent;
    color: var(--c-fg);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
}
.matrix__bookmark:hover { background: #2e2e2e; border-color: #6a6a6a; }
.matrix__bookmark svg { width: 18px; height: 18px; }

.matrix-system-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--c-muted);
    margin: 22px 0 10px;
}
.matrix-system-title strong {
    color: var(--c-fg);
    font-size: 14px;
    margin-right: 8px;
}

/* ----- Card-Grid (Such-/Listenansicht) ----------------------------- */

.result-grid.is-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--matrix-cell-w), var(--matrix-cell-w)));
    gap: 1px;
    justify-content: start;
    padding: 0 32px;
}

.card {
    background: var(--c-panel);
    border: 0;
    border-radius: var(--radius);
    padding: 18px;
    color: var(--c-fg);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: background 0.15s;
}
.card:hover { background: #2c2c2c; }

.card__image {
    aspect-ratio: 4/3;
    background: var(--c-panel-2);
    border-radius: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}
.card__image img {
    max-width: 80%;
    max-height: 100%;
    object-fit: contain;
}
.card__image img.is-placeholder { opacity: 0.45; }

.card__title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.35;
    color: var(--c-fg);
}
.card__meta {
    font-size: 12px;
    color: var(--c-muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.card__meta .value { color: var(--c-fg); }
.card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.card__tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--c-muted);
    background: #1c1c1c;
    border-radius: 2px;
    padding: 2px 6px;
}
.card__cta {
    margin-top: auto;
    align-self: stretch;
    border: 1px solid #4a4a4a;
    color: var(--c-fg);
    background: transparent;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 11px;
    padding: 10px 14px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}
.card__cta:hover { background: #2e2e2e; }

.result-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--c-muted);
    padding: 60px 20px;
}

/* ----- Pager --------------------------------------------------------- */

.result-pager {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
}
.result-pager button {
    border: 1px solid var(--c-line);
    background: var(--c-panel);
    color: var(--c-fg);
    padding: 7px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: var(--fs-small);
}
.result-pager button.is-active {
    background: var(--c-fg);
    color: var(--c-bg);
    border-color: var(--c-fg);
}
.result-pager button[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ----- Popover ------------------------------------------------------- */

.popover {
    position: absolute;
    background: var(--c-panel);
    color: var(--c-fg);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0,0,0,0.6);
    z-index: 40;
    width: 340px;
    max-height: 460px;
    display: flex;
    flex-direction: column;
}
.popover[hidden] { display: none; }

.popover__header { padding: 12px; border-bottom: 1px solid var(--c-line); }
.popover-search {
    width: 100%;
    background: var(--c-panel-2);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: var(--fs-small);
    color: var(--c-fg);
}
.popover-search::placeholder { color: var(--c-muted); }
.popover-search:focus { outline: none; border-color: var(--c-fg); }

.popover__body { overflow-y: auto; flex: 1 1 auto; padding: 6px 0; }

.opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: var(--fs-base);
    color: var(--c-fg-soft);
}
.opt:hover { background: #2e2e2e; color: var(--c-fg); }
.opt input[type="checkbox"] { margin: 0; accent-color: var(--c-fg); }
.opt__label { flex: 1 1 auto; }
.opt__count { color: var(--c-muted); font-size: 11px; min-width: 26px; text-align: right; }
.opt.is-disabled { opacity: 0.4; pointer-events: none; }

.popover-empty {
    padding: 18px;
    color: var(--c-muted);
    text-align: center;
    font-size: 13px;
}

/* ----- Responsive --------------------------------------------------- */

@media (max-width: 960px) {
    .filter-pills { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
    .filter-pills { grid-template-columns: repeat(2, 1fr); }
    .page-header { padding: 18px 16px 12px; }
    .filter-area { padding: 0 16px 40px; }
    .popover { width: calc(100vw - 32px); left: 16px !important; right: auto; }
    .page-header h1 { font-size: 26px; }
}
