/* === KW Seilwinden-Filter Block ===
 * WAS:    Sidebar (Desktop ≥880px) / Bottom-Sheet (Mobile <880px) Filter-UI
 * WARUM:  Matcht archive-seilwinde Pattern + Handoff §7.2
 *         Mobile-First Base 375px, Aufstockung min-width:880px
 */

.kw-swf { padding: 48px 0; background: #fff; }
.kw-swf .kw-container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* === Mobile Toggle (sichtbar <880px) === */
.kw-swf__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    padding: 12px 20px;
    background: #97233F;
    color: #fff;
    border: 0;
    border-radius: 8px;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    margin-bottom: 24px;
}
.kw-swf__toggle:hover { background: #7E1C32; }
.kw-swf__toggle-count { font-weight: 400; opacity: 0.85; text-transform: none; letter-spacing: 0; }

/* === Layout === */
.kw-swf__layout { display: flex; flex-direction: column; gap: 24px; position: relative; }

/* === Sidebar (Mobile = Bottom-Sheet) === */
.kw-swf__sidebar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-height: 85vh;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 201;
    display: flex;
    flex-direction: column;
}
.kw-swf__sidebar.is-open { transform: translateY(0); }
.kw-swf__sidebar-handle {
    width: 40px; height: 4px;
    background: #C9B89A;
    border-radius: 2px;
    margin: 10px auto 0;
}
.kw-swf__sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #E8E2DA;
}
.kw-swf__sidebar-title {
    margin: 0;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1A1A1A;
}
.kw-swf__sidebar-close {
    background: none; border: 0;
    width: 44px; height: 44px;
    font-size: 28px; line-height: 1;
    color: #5C5C5C;
    cursor: pointer;
}
.kw-swf__sidebar-close:hover { color: #97233F; }
.kw-swf__sidebar-inner { padding: 20px; overflow-y: auto; flex: 1; }
.kw-swf__sidebar-footer {
    display: flex; gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #E8E2DA;
    background: #fff;
}
.kw-swf__sidebar-footer .kw-btn { flex: 1; min-height: 48px; }
/* Reset-Button: explizit Bordeaux-on-cream, sonst auf cream-Sidebar unlesbar */
.kw-swf__sidebar-footer .kw-swf__reset {
    color: #97233F;
    border: 1.5px solid #97233F;
    background: transparent;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 13px;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.kw-swf__sidebar-footer .kw-swf__reset:hover {
    background: #97233F;
    color: #fff;
}

/* === Overlay === */
.kw-swf__overlay {
    position: fixed; inset: 0;
    background: rgba(20,15,10,0.55);
    z-index: 200;
}

/* === Group === */
.kw-swf__group { border: 0; padding: 0; margin: 0 0 24px; }
.kw-swf__group legend {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #1A1A1A;
    margin-bottom: 12px;
    padding: 0;
}
.kw-swf__hint { font-weight: 400; font-size: 11px; color: #888; margin-left: 6px; text-transform: none; letter-spacing: 0; }

/* === Custom Checkbox === */
.kw-swf__check {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 10px 0; min-height: 48px;
    cursor: pointer; user-select: none;
    color: #1A1A1A;
    font-size: 15px;
    font-family: 'PT Serif', Georgia, serif;
}
.kw-swf__check input[type=checkbox] {
    appearance: none; -webkit-appearance: none;
    width: 20px; height: 20px;
    margin: 4px 0 0;
    border: 1.5px solid #C9B89A;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0; position: relative;
    transition: border-color .15s, background .15s;
}
.kw-swf__check input[type=checkbox]:hover { border-color: #97233F; }
.kw-swf__check input[type=checkbox]:checked { background: #97233F; border-color: #97233F; }
.kw-swf__check input[type=checkbox]:checked::after {
    content: ""; position: absolute;
    left: 6px; top: 2px;
    width: 5px; height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.kw-swf__check input[type=checkbox]:focus-visible { outline: 2px solid #97233F; outline-offset: 2px; }
.kw-swf__check input[type=checkbox]:disabled,
.kw-swf__check.kw-swf__disabled { opacity: 0.4; cursor: not-allowed; }
.kw-swf__check.kw-swf__disabled input { pointer-events: none; }

.kw-swf__check--with-desc { align-items: flex-start; }
.kw-swf__check-text { display: flex; flex-direction: column; gap: 2px; }
.kw-swf__check-title { font-weight: 600; }
.kw-swf__check-desc { font-size: 12px; color: #5C5C5C; line-height: 1.4; font-family: 'PT Serif', Georgia, serif; font-style: italic; }

/* === Pill-Buttons (Bauart) === */
.kw-swf__pills { display: flex; flex-direction: column; gap: 8px; }
.kw-swf__pill {
    display: flex; align-items: center; justify-content: center;
    padding: 6px 14px; min-height: 34px;
    border: 1.5px solid #C9B89A;
    border-radius: 999px;
    background: #fff;
    color: #1A1A1A;
    font-family: 'PT Serif', Georgia, serif;
    font-size: 14px;
    cursor: pointer; user-select: none;
    transition: border-color .15s, background .15s, color .15s;
    text-align: center;
}
.kw-swf__pill input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.kw-swf__pill:hover { border-color: #97233F; }
.kw-swf__pill:has(input:checked) {
    background: #97233F;
    border-color: #97233F;
    color: #fff;
}
.kw-swf__pill:has(input:focus-visible) { outline: 2px solid #97233F; outline-offset: 2px; }
.kw-swf__pill.kw-swf__disabled,
.kw-swf__pill:has(input:disabled) { opacity: 0.4; cursor: not-allowed; }

/* === Range === */
.kw-swf__range legend { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kw-swf__range-vals {
    font-family: 'PT Serif', Georgia, serif;
    font-size: 13px; color: #97233F;
    font-weight: 700; font-style: italic;
    text-transform: none; letter-spacing: 0;
}

.kw-swf__dual { position: relative; height: 32px; margin-top: 12px; padding: 0 10px; }
.kw-swf__dual-track {
    position: absolute; left: 10px; right: 10px; top: 50%;
    height: 4px; transform: translateY(-50%);
    background: #E8E2DA; border-radius: 2px;
}
.kw-swf__dual-fill {
    position: absolute; top: 50%;
    height: 4px; transform: translateY(-50%);
    background: #97233F; border-radius: 2px;
}
.kw-swf__dual input[type=range] {
    position: absolute; top: 50%;
    left: 0; width: 100%;
    height: 0; margin: 0; padding: 0;
    background: none; pointer-events: none;
    -webkit-appearance: none; appearance: none;
    z-index: 3; outline: none;
}
.kw-swf__dual input[type=range]::-webkit-slider-runnable-track { height: 0; background: transparent; border: none; }
.kw-swf__dual input[type=range]::-moz-range-track { height: 0; background: transparent; border: none; }
.kw-swf__dual input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    pointer-events: auto;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #97233F; border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    cursor: grab;
    margin-top: -12px;
    transition: transform .12s;
    position: relative; z-index: 4;
}
.kw-swf__dual input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.12); }
.kw-swf__dual input[type=range]::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.18); }
.kw-swf__dual input[type=range]::-moz-range-thumb {
    pointer-events: auto;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #97233F; border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    cursor: grab;
}
@media (max-width: 480px) {
    .kw-swf__dual input[type=range]::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -14px; }
    .kw-swf__dual input[type=range]::-moz-range-thumb { width: 28px; height: 28px; }
}

/* === Advanced Details === */
.kw-swf__advanced { margin: 8px 0 24px; }
.kw-swf__advanced summary {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600; font-size: 13px;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: #5C5C5C; cursor: pointer;
    padding: 8px 0; min-height: 44px;
    display: flex; align-items: center;
}
.kw-swf__advanced summary:hover { color: #97233F; }
.kw-swf__advanced[open] summary { color: #97233F; margin-bottom: 8px; }

/* === Main / Counter === */
.kw-swf__main { flex: 1; min-width: 0; }
.kw-card-grid.kw-swf__grid,
.kw-swf__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
/* Grid-Items: width:100% + min-width:0 zwingt die Card auf die Grid-Zelle, unabhängig von intrinsischer Bildgröße. */
.kw-swf__grid > .kw-card { width: 100%; min-width: 0; max-width: none; }
/* Card-Thumb: SSOT-Foto-Standard ist 5:4 (4:5 W:H Portrait). Querformat-Bilder werden
   center-gecropt, damit alle Cards in einer Zeile gleich hoch sind. */
.kw-swf__grid .kw-card__thumb {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--kw-cream-dark, #E8E2DA);
}
.kw-swf__grid .kw-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s ease;
}
.kw-swf__grid .kw-card:hover .kw-card__thumb img { transform: scale(1.04); }
/* Card-Layout: ab 560px horizontal (Bild links, Info rechts). Unter 560 vertikal. */
.kw-swf__grid .kw-card { display: flex; flex-direction: column; }
.kw-swf__grid .kw-card .kw-card-body { flex: 1 1 auto; display: flex; flex-direction: column; padding: 16px 20px; }
@media (min-width: 560px) {
    .kw-swf__grid .kw-card { flex-direction: row; align-items: stretch; }
    /* Horizontal: Thumb in Portrait-Aspect 4:5 (SSOT-Foto-Standard), Image dadurch unbeschnitten.
       Card-Höhe = thumb_height. Bodies stretchen mit, Buttons via margin-top:auto unten bündig. */
    .kw-swf__grid .kw-card__thumb {
        width: 42%;
        flex-shrink: 0;
        aspect-ratio: 4 / 5;
        align-self: flex-start;
        position: relative;
    }
    .kw-swf__grid .kw-card__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
    .kw-swf__grid .kw-card .kw-card-body { width: 58%; padding: 16px 18px; }
    /* Issue #684: Card ohne echtes Produktfoto — Body füllt die volle Breite,
       kein 42%-Leerraum links. */
    .kw-swf__grid .kw-card--no-thumb .kw-card-body { width: 100%; }
}
/* Mehr Pills auf der Card */
.kw-swf__grid .kw-product-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.kw-swf__grid .kw-product-badge {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 999px;
    background: #F6EFE5;
    color: #5C5C5C;
    white-space: nowrap;
}
.kw-swf__grid h3 { font-size: 18px; margin: 0 0 2px; }
.kw-swf__grid .kw-card__serie {
    font-family: 'PT Serif', Georgia, serif;
    font-size: 12px;
    font-style: italic;
    color: #97233F;
    margin: 0 0 10px;
    letter-spacing: 0.02em;
}
.kw-swf__grid .kw-product-badge.kw-badge--feature {
    background: #97233F;
    color: #fff;
}
.kw-swf__grid .kw-product-badge { display: inline-flex; align-items: center; gap: 5px; }
.kw-product-badge__icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    /* Tint Black-SVG zu mid-gray, passt zu Pill-Text */
    filter: brightness(0) saturate(0) opacity(0.55);
}
.kw-badge--feature .kw-product-badge__icon { filter: brightness(0) invert(1) opacity(0.95); }
.kw-swf__card-actions { display: flex; gap: 8px; margin-top: auto; }
.kw-swf__card-actions .kw-btn {
    flex: 1;
    padding: 8px 12px;
    min-height: 36px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}
@media (min-width: 560px) {
    .kw-card-grid.kw-swf__grid,
    .kw-swf__grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
@media (min-width: 1100px) {
    .kw-card-grid.kw-swf__grid,
    .kw-swf__grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
.kw-swf__main-header {
    display: flex; align-items: center; justify-content: flex-end;
    padding: 0 0 16px;
    border-bottom: 1px solid #E8E2DA;
    margin-bottom: 24px;
}
.kw-swf__counter { margin: 0; font-family: 'PT Serif', Georgia, serif; color: #5C5C5C; font-size: 14px; }
.kw-swf__counter strong { color: #97233F; font-family: 'Josefin Sans', sans-serif; font-size: 16px; margin-right: 4px; }

/* === Empty === */
.kw-swf__empty {
    text-align: center; padding: 48px 16px;
    color: #5C5C5C; font-size: 16px;
    font-family: 'PT Serif', Georgia, serif;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.kw-swf__empty[hidden] { display: none; }
.kw-swf__empty-text { margin: 0; }
.kw-swf__empty-reset { min-width: 200px; }

/* === Empfehlungs-Chip auf Card === */
.kw-card { position: relative; }
.kw-card__thumb { position: relative; display: block; }
.kw-card__chip-recommend {
    position: absolute; top: 8px; right: 8px;
    background: #97233F; color: #fff;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    padding: 4px 10px; border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 2;
}

/* SSOT-Status Chip „Auslaufend" (Issue #368) — Amber, kein Grün. */
.kw-card__chip-status {
    position: absolute; top: 8px; left: 8px;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    padding: 4px 10px; border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 2; line-height: 1.2;
}
.kw-card__chip-status--auslaufend {
    background: var(--kw-warning, #B8860B); color: #fff;
}

/* === Desktop ≥880px === */
@media (min-width: 880px) {
    .kw-swf { padding: 72px 0; }
    .kw-swf .kw-container { padding: 0 32px; }

    .kw-swf__toggle { display: none; }
    .kw-swf__sidebar-close { display: none; }
    .kw-swf__sidebar-handle { display: none; }
    .kw-swf__overlay { display: none !important; }

    .kw-swf__layout { flex-direction: row; gap: 40px; align-items: flex-start; }
    .kw-swf__sidebar {
        position: sticky; top: 88px;
        width: 280px; flex-shrink: 0;
        max-height: calc(100vh - 120px);
        transform: none;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.04);
        background: #F5F0EB;
        border: 1px solid #E8E2DA;
    }
    .kw-swf__sidebar-header { background: transparent; padding: 20px 20px 16px; }
    .kw-swf__sidebar-footer { background: transparent; padding: 16px 20px 20px; flex-direction: row; }
    .kw-swf__sidebar-footer .kw-swf__apply { display: none; }
    .kw-swf__sidebar-footer .kw-swf__reset { flex: 1; }
}
