.vk-product-filter {
    width: 100%;
    padding: 22px;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}

.vk-product-filter.vk-loading .vk-filter-grid,
.vk-product-filter.vk-loading .vk-range-block {
    opacity: .65;
}

.vk-filter-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.vk-filter-field { min-width: 0; }

.vk-filter-field label,
.vk-range-header label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
}

.vk-filter-field select {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #cfcfcf;
    border-radius: 4px;
    background: #fff;
}

.vk-range-block {
    --vk-range-left: 0%;
    --vk-range-right: 100%;
    margin-top: 24px;
}

.vk-range-header {
    display: block;
    margin-bottom: 8px;
}

.vk-range-header span {
    display: block;
    font-size: .92em;
    overflow-wrap: anywhere;
}

.vk-dual-range {
    position: relative;
    height: 32px;
}

.vk-dual-range::before,
.vk-dual-range::after {
    content: '';
    position: absolute;
    top: 14px;
    height: 4px;
    border-radius: 99px;
    pointer-events: none;
}

.vk-dual-range::before {
    left: 0;
    right: 0;
    background: #ddd;
}

.vk-dual-range::after {
    left: var(--vk-range-left);
    width: calc(var(--vk-range-right) - var(--vk-range-left));
    background: currentColor;
}

.vk-dual-range input[type="range"] {
    position: absolute;
    left: 0;
    top: 4px;
    width: 100%;
    margin: 0;
    background: transparent;
    pointer-events: none;
    appearance: none;
    -webkit-appearance: none;
    z-index: 2;
}

.vk-dual-range input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
}

.vk-dual-range input[type="range"]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -7px;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: #fff;
    pointer-events: auto;
    cursor: pointer;
    -webkit-appearance: none;
}

.vk-dual-range input[type="range"]::-moz-range-track {
    height: 4px;
    background: transparent;
}

.vk-dual-range input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: #fff;
    pointer-events: auto;
    cursor: pointer;
}

.vk-filter-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
}

.vk-filter-actions .button {
    box-sizing: border-box;
    width: 100%;
    text-align: center;
}

.vk-reset {
    opacity: .75;
}

/* Optional full-width layout; the default sidebar layout stays vertical. */
.vk-filter-horizontal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    align-items: start;
}

.vk-filter-horizontal .vk-filter-grid {
    display: contents;
}

.vk-filter-horizontal .vk-range-block {
    margin-top: 0;
    min-width: 0;
}

.vk-filter-horizontal .vk-filter-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 0;
}

.vk-filter-horizontal .vk-filter-actions .button {
    width: auto;
    min-width: 130px;
}

@media (max-width: 1100px) {
    .vk-filter-horizontal {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .vk-filter-horizontal {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .vk-filter-horizontal {
        grid-template-columns: minmax(0, 1fr);
    }
    .vk-filter-horizontal .vk-filter-actions .button {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .vk-product-filter {
        padding: 16px;
    }
}

/* [vk_haku] – etusivun vannehaku */
.vk-search-title {
    margin: 0 0 16px;
    font-size: 1.25em;
    font-weight: 700;
    line-height: 1.3;
}

.vk-search.vk-filter-horizontal .vk-search-title {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.vk-search .vk-filter-actions .button {
    min-height: 44px;
}

/* Vaakarivissä hakupainike samalle riville valikoiden kanssa, alareunaan tasattuna. */
.vk-search.vk-filter-horizontal .vk-filter-actions {
    grid-column: auto;
    align-self: end;
    flex-direction: column;
}

.vk-search.vk-filter-horizontal .vk-filter-actions .button {
    width: 100%;
    min-width: 0;
}

.vk-search.vk-filter-horizontal .vk-range-block {
    align-self: end;
}

@media (max-width: 480px) {
    .vk-search.vk-filter-horizontal .vk-filter-actions {
        grid-column: 1 / -1;
    }
}

/* Nappirivit ja väripallot (1.2.0) */
.vk-buttons .vk-select-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    pointer-events: none !important;
}
.vk-product-filter.vk-buttons .vk-filter-grid {
    display: flex;
    flex-direction: column;
    gap: 0 !important;
}
.vk-buttons .vk-filter-field,
.vk-buttons .vk-range-block {
    position: relative;
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid #e4e4e7;
}
.vk-buttons .vk-filter-field[hidden] {
    display: none;
}
.vk-buttons .vk-filter-field:first-child {
    padding-top: 0;
}
.vk-field-toggle,
.vk-field-toggle:hover,
.vk-field-toggle:focus {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 28px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--vk-ink, #111113);
    font-size: 15px;
    font-weight: 700;
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: none;
    cursor: pointer;
}
.vk-field-toggle::before {
    content: '';
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid currentColor;
    transition: transform 0.15s ease;
}
.is-open > .vk-field-toggle::before {
    transform: rotate(90deg);
}
.vk-field-current {
    margin-left: auto;
    font-size: 14px;
    font-weight: 400;
    color: #52525b;
}
.vk-opt-buttons,
.vk-opt-swatches,
.vk-opt-more,
.vk-buttons .vk-range-block > .vk-range-header,
.vk-buttons .vk-range-block > .vk-dual-range {
    display: none;
}
.vk-buttons .vk-range-block.is-open > .vk-range-header,
.vk-buttons .vk-range-block.is-open > .vk-dual-range {
    display: block;
    margin-top: 12px;
}
.is-open > .vk-opt-buttons {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.is-open > .vk-opt-buttons.is-wide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.is-open > .vk-opt-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}
.is-open > .vk-opt-more:not([hidden]) {
    display: inline-block;
}
.vk-opt,
.vk-opt:hover,
.vk-opt:focus {
    min-height: 44px;
    margin: 0;
    padding: 4px;
    border: 1px solid #d4d4d8;
    border-radius: 0;
    background: #fff;
    color: var(--vk-ink, #111113);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    box-shadow: none;
    cursor: pointer;
}
.vk-opt:hover {
    border-color: var(--vk-ink, #111113);
}
.vk-opt[aria-pressed="true"],
.vk-opt[aria-pressed="true"]:hover {
    border-color: var(--vk-ink, #111113);
    background: var(--vk-ink, #111113);
    color: #fff;
}
.vk-opt-swatch,
.vk-opt-swatch:hover,
.vk-opt-swatch:focus {
    width: 32px;
    height: 32px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}
.vk-opt-swatch[aria-pressed="true"],
.vk-opt-swatch[aria-pressed="true"]:hover {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15), 0 0 0 2px #fff, 0 0 0 4px var(--vk-ink, #111113);
}
.vk-opt-more,
.vk-opt-more:hover,
.vk-opt-more:focus {
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--vk-red, #BC0304);
    font-size: 14px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: none;
    cursor: pointer;
}
.vk-opt-more:hover {
    text-decoration: underline;
}
.vk-field-toggle:focus-visible,
.vk-opt:focus-visible,
.vk-opt-swatch:focus-visible,
.vk-opt-more:focus-visible {
    outline: 3px solid var(--vk-red, #BC0304);
    outline-offset: 2px;
}
