.wdsf {
    --wdsf-border: #e4e7eb;
    --wdsf-text: #1f2937;
    --wdsf-muted: #6b7280;
    --wdsf-bg: #ffffff;
    --wdsf-soft: #f7f8fa;
    --wdsf-accent: #111827;
    position: relative;
    margin: 0 0 24px;
    color: var(--wdsf-text);
    font-size: 14px;
}

.wdsf-panel {
    background: var(--wdsf-bg);
    border: 1px solid var(--wdsf-border);
    border-radius: 14px;
    padding: 18px;
}

.wdsf-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.wdsf-panel-header h2 {
    margin: 0;
    color: var(--wdsf-text);
    font-size: 19px;
    line-height: 1.25;
}

.wdsf-panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wdsf-clear-all,
.wdsf-close,
.wdsf-mobile-toggle,
.wdsf-mobile-apply,
.wdsf-chip {
    appearance: none;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.wdsf-clear-all {
    padding: 7px 10px;
    background: transparent;
    color: var(--wdsf-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.wdsf-clear-all:hover { color: var(--wdsf-text); }
.wdsf-close { display: none; }

.wdsf-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: start;
}

.wdsf-group {
    min-width: 0;
    margin: 0;
    padding: 13px;
    background: var(--wdsf-soft);
    border: 1px solid var(--wdsf-border);
    border-radius: 11px;
}

.wdsf-group-title {
    display: block;
    margin: 0 0 10px;
    color: var(--wdsf-text);
    font-weight: 700;
    font-size: 14px;
    list-style: none;
    cursor: default;
}

details.wdsf-group > summary::-webkit-details-marker { display: none; }

.wdsf-options {
    display: grid;
    gap: 8px;
    max-height: 210px;
    overflow: auto;
    padding-right: 3px;
    scrollbar-width: thin;
}

.wdsf-option {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--wdsf-text);
    cursor: pointer;
    line-height: 1.3;
}

.wdsf-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wdsf-checkmark {
    width: 18px;
    height: 18px;
    border: 1.5px solid #b9c0ca;
    border-radius: 5px;
    background: #fff;
    position: relative;
    transition: .15s ease;
}

.wdsf-option input:checked + .wdsf-checkmark {
    border-color: var(--wdsf-accent);
    background: var(--wdsf-accent);
}

.wdsf-option input:checked + .wdsf-checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.wdsf-option input:focus-visible + .wdsf-checkmark {
    outline: 2px solid #9ca3af;
    outline-offset: 2px;
}

.wdsf-option-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.wdsf-option-count {
    min-width: 24px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #fff;
    color: var(--wdsf-muted);
    font-size: 11px;
    text-align: center;
}

.wdsf-option-emphasis { font-weight: 700; }

.wdsf-price-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.wdsf-price-fields label { margin: 0; }
.wdsf-price-fields label span {
    display: block;
    margin-bottom: 5px;
    color: var(--wdsf-muted);
    font-size: 12px;
}

.wdsf-price-fields input {
    width: 100%;
    min-height: 38px;
    margin: 0;
    padding: 7px 9px;
    border: 1px solid var(--wdsf-border);
    border-radius: 8px;
    background: #fff;
    color: var(--wdsf-text);
    box-shadow: none;
}

.wdsf-active {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 14px;
}

.wdsf-active[hidden] { display: none; }

.wdsf-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 9px 6px 11px;
    border-radius: 999px;
    background: var(--wdsf-accent);
    color: #fff;
    line-height: 1;
}

.wdsf-chip b { font-size: 16px; font-weight: 400; }

.wdsf-status {
    min-height: 1px;
    margin-top: 8px;
    color: var(--wdsf-muted);
    font-size: 12px;
}

.wdsf .wdsf-mobile-toggle,
.wdsf .wdsf-mobile-apply {
    display: none !important;
}

@media (min-width: 768px) {
    .wdsf .wdsf-mobile-toggle {
        display: none !important;
        visibility: hidden !important;
    }
}

.wdsf-results-container {
    position: relative;
    min-height: 100px;
}

.wdsf.is-loading + .wdsf-results-container,
.wdsf-results-container[aria-busy="true"] {
    opacity: .55;
    pointer-events: none;
}

.wdsf-results-container[aria-busy="true"]::before {
    content: '';
    position: absolute;
    z-index: 10;
    top: 50px;
    left: 50%;
    width: 34px;
    height: 34px;
    margin-left: -17px;
    border: 3px solid rgba(0,0,0,.15);
    border-top-color: rgba(0,0,0,.7);
    border-radius: 50%;
    animation: wdsf-spin .75s linear infinite;
}

@keyframes wdsf-spin { to { transform: rotate(360deg); } }

@media (max-width: 767px) {
    html.wdsf-lock-scroll,
    html.wdsf-lock-scroll body { overflow: hidden; }

    .wdsf { margin-bottom: 16px; }

    .wdsf .wdsf-mobile-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 9px;
        width: 100%;
        min-height: 46px;
        padding: 10px 16px;
        border-radius: 10px;
        background: var(--wdsf-accent);
        color: #fff;
        font-weight: 700;
    }

    .wdsf-mobile-count {
        min-width: 22px;
        height: 22px;
        padding: 0 6px;
        border-radius: 999px;
        background: #fff;
        color: var(--wdsf-accent);
        line-height: 22px;
        text-align: center;
        font-size: 11px;
    }

    .wdsf-backdrop {
        position: fixed;
        z-index: 99998;
        inset: 0;
        background: rgba(0,0,0,.48);
    }

    .wdsf-panel {
        position: fixed;
        z-index: 99999;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(92vw, 420px);
        overflow-y: auto;
        padding: 18px 16px 90px;
        border: 0;
        border-radius: 0;
        transform: translateX(105%);
        transition: transform .25s ease;
        box-shadow: -12px 0 30px rgba(0,0,0,.18);
    }

    .wdsf-panel.is-open { transform: translateX(0); }

    .wdsf-panel-header {
        position: sticky;
        z-index: 2;
        top: -18px;
        margin: -18px -16px 14px;
        padding: 16px;
        background: #fff;
        border-bottom: 1px solid var(--wdsf-border);
    }

    .wdsf-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: var(--wdsf-soft);
        color: var(--wdsf-text);
        font-size: 24px;
        line-height: 1;
    }

    .wdsf-groups { grid-template-columns: 1fr; }
    .wdsf-group { padding: 14px; }
    .wdsf-options { max-height: none; }

    details.wdsf-group > summary {
        position: relative;
        padding-right: 22px;
        cursor: pointer;
    }

    details.wdsf-group > summary::after {
        content: '+';
        position: absolute;
        right: 0;
        top: -2px;
        color: var(--wdsf-muted);
        font-size: 18px;
        font-weight: 400;
    }

    details.wdsf-group[open] > summary::after { content: '−'; }

    .wdsf .wdsf-mobile-apply {
        display: block !important;
        position: fixed;
        z-index: 3;
        right: 16px;
        bottom: 16px;
        width: min(calc(92vw - 32px), 388px);
        min-height: 48px;
        border-radius: 10px;
        background: var(--wdsf-accent);
        color: #fff;
        font-weight: 800;
    }
}

/* v0.2.0: dynamic facets and color swatches */
.wdsf-option.has-color {
    grid-template-columns: 18px 20px minmax(0, 1fr) auto;
}

.wdsf-color-swatch {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(17, 24, 39, .18);
    border-radius: 50%;
    background: var(--wdsf-swatch, #fff);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
}

.wdsf-color-swatch.is-empty {
    background:
        linear-gradient(135deg, transparent 44%, #c7cbd1 45%, #c7cbd1 55%, transparent 56%),
        #fff;
}

.wdsf-option.is-unavailable {
    display: none;
}

.wdsf [data-facet][hidden] {
    display: none !important;
}

.wdsf.is-loading .wdsf-panel {
    cursor: progress;
}

.wdsf.is-loading .wdsf-option,
.wdsf.is-loading .wdsf-price-fields {
    opacity: .72;
}

/* v0.4.4: σωστή προσαρμογή σε στενές desktop πλαϊνές στήλες */
.wdsf,
.wdsf *,
.wdsf *::before,
.wdsf *::after {
    box-sizing: border-box;
}

.wdsf,
.wdsf-panel,
.wdsf-panel-header,
.wdsf-active,
.wdsf-groups,
.wdsf-group {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

@media (min-width: 768px) {
    .wdsf-panel {
        overflow: hidden;
        padding: 16px;
    }

    .wdsf-panel-header {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 10px;
    }

    .wdsf-panel-header h2 {
        flex: 1 1 90px;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .wdsf-panel-actions {
        flex: 0 1 auto;
        max-width: 100%;
        margin-left: auto;
    }

    .wdsf-clear-all {
        width: auto !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 9px 12px !important;
        white-space: nowrap;
        font-size: 12px !important;
        line-height: 1.2 !important;
    }

    .wdsf .wdsf-close {
        display: none !important;
        visibility: hidden !important;
    }

    .wdsf-active {
        align-items: stretch;
    }

    .wdsf-chip {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        justify-content: space-between;
        margin: 0 !important;
        padding: 8px 10px !important;
        border-radius: 8px;
        white-space: normal;
        line-height: 1.25;
        text-align: left;
    }

    .wdsf-chip span {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .wdsf-chip b {
        flex: 0 0 auto;
    }
}
