/**
 * Softaware Layered Navigation.
 * Shared rules (both themes) plus Luma look under .sw-ln--luma. Hyvä merges this file into the theme CSS
 * (view/frontend/tailwind/tailwind-source.css) and adds Tailwind classes in the template.
 */
.sw-ln {
    --sw-ln-accent: #1979c3;
    --sw-ln-border: #c2c2c2;
    --sw-ln-muted: #6b6b6b;
}
.sw-ln--hyva {
    --sw-ln-accent: var(--color-primary, #1d4ed8);
    --sw-ln-border: var(--color-gray-300, #d1d5db);
    --sw-ln-muted: var(--color-gray-500, #6b7280);
}

/* ------------------------------------------------------------------ shared */
.sw-ln__sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.sw-ln__toggle {
    appearance: none;
    background: none;
    border: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    text-align: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: default;
}
.sw-ln__toggle:hover,
.sw-ln__toggle:focus,
.sw-ln__toggle:active {
    background: none;
    border: 0;
    box-shadow: none;
    color: inherit;
}
.sw-ln__toggle:disabled {
    opacity: 1;
    color: inherit;
    cursor: default;
}
.sw-ln__toggle-icon {
    display: none;
}
.sw-ln__summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.sw-ln__summary::-webkit-details-marker {
    display: none;
}
.sw-ln__chevron,
.sw-ln__toggle-icon {
    flex: none;
    width: 26px;
    height: 26px;
    position: relative;
}
.sw-ln__chevron::after,
.sw-ln__toggle-icon::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 45%;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translate(-50%, -50%) rotate(45deg);
    transition: transform .15s ease;
}
.sw-ln__filter[open] > .sw-ln__summary .sw-ln__chevron::after,
.sw-ln__toggle[aria-expanded="true"] .sw-ln__toggle-icon::after {
    top: 55%;
    transform: translate(-50%, -50%) rotate(-135deg);
}
.sw-ln__badge {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    margin-left: 6px;
    border-radius: 9px;
    background: var(--sw-ln-accent);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
}
.sw-ln__items,
.sw-ln__chips {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sw-ln__item {
    margin: 0;
}
.sw-ln [data-sw-ln-extra] {
    display: none;
}
.sw-ln .sw-ln__items--all [data-sw-ln-extra],
.sw-ln .sw-ln__items--searching [data-sw-ln-extra] {
    display: block;
}
.sw-ln .sw-ln__item--no-match {
    display: none !important;
}
.sw-ln__link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    color: inherit;
    text-decoration: none;
    line-height: 1.4;
}
.sw-ln__link:hover {
    text-decoration: none;
}
.sw-ln__link:hover .sw-ln__label {
    text-decoration: underline;
}
.sw-ln__link--disabled {
    opacity: .45;
    cursor: default;
}
.sw-ln__link--selected .sw-ln__label,
.sw-ln__link[aria-current="true"] .sw-ln__label {
    font-weight: 600;
}
.sw-ln__box {
    flex: none;
    position: relative;
    width: 16px;
    height: 16px;
    border: 1px solid #8f8f8f;
    border-radius: 3px;
    background: #fff;
    box-sizing: border-box;
}
.sw-ln__link--selected .sw-ln__box {
    background: var(--sw-ln-accent);
    border-color: var(--sw-ln-accent);
}
.sw-ln__link--selected .sw-ln__box::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
}
.sw-ln__count {
    margin-left: auto;
    padding-left: 8px;
    color: var(--sw-ln-muted);
    font-size: .9em;
}
.sw-ln__more,
.sw-ln__filter-clear,
.sw-ln__clear {
    background: none;
    border: 0;
    padding: 0;
    margin-top: 8px;
    color: var(--sw-ln-accent);
    font: inherit;
    font-size: .9em;
    text-decoration: underline;
    cursor: pointer;
    display: inline-block;
    box-shadow: none;
}
.sw-ln__more:hover,
.sw-ln__filter-clear:hover,
.sw-ln__clear:hover {
    background: none;
    border: 0;
    color: var(--sw-ln-accent);
    text-decoration: none;
}
.sw-ln__filter-clear {
    display: block;
}
.sw-ln__search {
    width: 100%;
    margin-bottom: 8px;
    box-sizing: border-box;
}
.sw-ln__no-match {
    margin: 4px 0;
    color: var(--sw-ln-muted);
    font-size: .9em;
}
.sw-ln__select {
    width: 100%;
}

/* chips */
.sw-ln__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.sw-ln__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1px solid var(--sw-ln-border);
    border-radius: 16px;
    background: #fff;
    color: inherit;
    font-size: 13px;
    line-height: 1.5;
    text-decoration: none;
}
.sw-ln__chip:hover {
    border-color: var(--sw-ln-accent);
    text-decoration: none;
}
.sw-ln__chip-name {
    color: var(--sw-ln-muted);
}
.sw-ln__chip-x {
    font-size: 17px;
    line-height: 1;
    margin-left: 2px;
}

/* swatches */
.sw-ln__swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 2px;
}
.sw-ln__swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #f3f3f3;
    color: #333;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    overflow: hidden;
}
.sw-ln__swatch--color,
.sw-ln__swatch--image {
    width: 32px;
    padding: 0;
}
.sw-ln__swatch--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sw-ln__swatch:hover {
    outline: 1px solid #8f8f8f;
    outline-offset: 1px;
    text-decoration: none;
    color: #333;
}
.sw-ln__swatch--selected,
.sw-ln__swatch--selected:hover {
    outline: 2px solid var(--sw-ln-accent);
    outline-offset: 2px;
}
.sw-ln__swatch--text.sw-ln__swatch--selected {
    background: #fff;
    border-color: var(--sw-ln-accent);
}
.sw-ln__swatch--disabled {
    opacity: .35;
    cursor: default;
}

/* range slider */
.sw-ln__range {
    position: relative;
    height: 28px;
    margin: 4px 0 12px;
}
.sw-ln__track {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 12px;
    height: 4px;
    border-radius: 2px;
    background: #d6d6d6;
}
.sw-ln__fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 2px;
    background: var(--sw-ln-accent);
}
.sw-ln__thumb {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    left: 0;
    top: 4px;
    width: 100%;
    height: 20px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    pointer-events: none;
    outline: none;
}
.sw-ln__thumb::-webkit-slider-runnable-track {
    background: transparent;
    border: 0;
    height: 20px;
}
.sw-ln__thumb::-moz-range-track {
    background: transparent;
    border: 0;
}
.sw-ln__thumb::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--sw-ln-accent);
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.sw-ln__thumb::-moz-range-thumb {
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--sw-ln-accent);
    background: #fff;
    cursor: pointer;
}
.sw-ln__thumb:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(25, 121, 195, .35);
}
.sw-ln__thumb:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 3px rgba(25, 121, 195, .35);
}
.sw-ln__inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sw-ln__input {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
}
.sw-ln__input input {
    width: 100%;
    box-sizing: border-box;
}
.sw-ln__dash {
    flex: none;
}
.sw-ln__apply {
    flex: none;
}
.sw-ln__range-label {
    margin: 8px 0 0;
    color: var(--sw-ln-muted);
    font-size: .9em;
}

/* loading state while an Ajax update runs */
.sw-ln-loading {
    opacity: .45;
    pointer-events: none;
    transition: opacity .15s ease;
}

/* mobile: the whole block collapses behind "Shop By" (JavaScript adds sw-ln--closed) */
@media (min-width: 768px) {
    .sw-ln__badge--mobile {
        display: none;
    }
}
@media (max-width: 767px) {
    .sw-ln__toggle {
        cursor: pointer;
    }
    .sw-ln__toggle-icon {
        display: inline-block;
    }
    .sw-ln--closed .sw-ln__content {
        display: none;
    }
}

/* ------------------------------------------------------------------ Luma look */
.sw-ln--luma {
    margin-bottom: 40px;
}
.sw-ln--luma .sw-ln__heading {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.2;
}
@media (min-width: 768px) {
    .sw-ln--luma .sw-ln__heading {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }
}
.sw-ln--luma .sw-ln__subtitle {
    display: block;
    padding: 10px 10px 20px;
    font-size: 1.4rem;
    font-weight: 600;
}
.sw-ln--luma .sw-ln__active {
    padding: 0 10px 15px;
}
.sw-ln--luma .sw-ln__active .sw-ln__subtitle {
    padding: 0 0 10px;
}
.sw-ln--luma .sw-ln__filters {
    border-bottom: 1px solid #ccc;
}
.sw-ln--luma .sw-ln__filter {
    border-top: 1px solid #ccc;
}
.sw-ln--luma .sw-ln__summary {
    padding: 8px 4px 8px 10px;
    font-size: 1.4rem;
    font-weight: 600;
    text-transform: uppercase;
    word-break: break-word;
}
.sw-ln--luma .sw-ln__body {
    padding: 0 10px 18px;
}
.sw-ln--luma .sw-ln__link {
    color: #006bb4;
}
.sw-ln--luma .sw-ln__link--disabled {
    color: #333;
}
.sw-ln--luma .sw-ln__count {
    color: #757575;
}
.sw-ln--luma .sw-ln__toggle-icon {
    border: 1px solid #ccc;
    border-radius: 3px;
}
@media (max-width: 767px) {
    .sw-ln--luma {
        margin-bottom: 20px;
    }
    .sw-ln--luma .sw-ln__heading {
        margin: 0;
        border: 1px solid #ccc;
        border-radius: 3px;
        background: #f0f0f0;
        font-size: 1.4rem;
        font-weight: 600;
        text-transform: uppercase;
    }
    .sw-ln--luma .sw-ln__toggle {
        padding: 10px 12px;
    }
    .sw-ln--luma .sw-ln__toggle-icon {
        border: 0;
    }
    .sw-ln--luma .sw-ln__content {
        padding-top: 10px;
    }
}

/* ------------------------------------------------------------------ Hyvä additions */
.sw-ln--hyva .sw-ln__summary {
    text-transform: none;
}
.sw-ln--hyva .sw-ln__thumb:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sw-ln-accent) 35%, transparent);
}
.sw-ln--hyva .sw-ln__swatch--color,
.sw-ln--hyva .sw-ln__swatch--image {
    border-radius: 50%;
}
.sw-ln--hyva .sw-ln__swatch--text {
    min-width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    font-weight: 400;
}
