/*
 * Desktop WooCommerce archive filters — Figma implementation.
 *
 * This file intentionally overrides the legacy archive filter presentation
 * without changing the existing query/filter backend. Mobile gets its own
 * implementation in a later phase.
 */

@media (min-width: 1025px) {
    .kaman-archive__layout {
        grid-template-columns: 253px minmax(0, 1fr);
        gap: 20px;
    }

    .kaman-archive__filters {
        position: sticky;
        top: 75px;
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
        overflow: hidden;
        background: var(--kaman-color-surface, #FFFFFF);
        border: 1px solid var(--kaman-color-border, #EBEBEB);
        border-radius: 8px;
        box-shadow: none;
    }

    .kaman-filter-card,
    .kaman-filter-panel {
        width: 100%;
        margin: 0;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .kaman-filter-card[hidden] {
        display: block !important;
    }

    .kaman-filter-card__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 60px;
        margin: 0;
        padding: 0 12px;
    }

    .kaman-filter-card__header h3 {
        margin: 0;
        color: var(--kaman-color-text, #121212);
        font-family: var(--kaman-font-family, "Dana2", sans-serif);
        font-size: 18px;
        font-weight: 600;
        line-height: 1;
    }

    .kaman-filter-card__header button {
        min-height: 24px;
        margin: 0;
        padding: 0;
        color: #303030;
        background: transparent;
        border: 0;
        border-radius: 6px;
        font-family: var(--kaman-font-family, "Dana2", sans-serif);
        font-size: 13px;
        font-weight: 500;
        line-height: 16px;
        cursor: pointer;
    }

    .kaman-filter-card__header button:hover,
    .kaman-filter-card__header button:focus-visible {
        color: var(--kaman-color-primary, #AA0002);
    }

    .kaman-filter-card__applied {
        display: none !important;
    }

    .kaman-filter-panel {
        padding: 0 12px;
    }

    .kaman-filter-panel__row {
        width: 100%;
        min-height: 60px;
        margin: 0;
        padding: 20px 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        color: #4D4D4D;
        background: transparent;
        border: 0;
        border-bottom: 1px solid var(--kaman-color-border, #EBEBEB);
        border-radius: 0;
        font-family: var(--kaman-font-family, "Dana2", sans-serif);
        font-size: 14px;
        font-weight: 400;
        line-height: 1;
        text-align: right;
        cursor: pointer;
    }

    .kaman-filter-panel__row:hover {
        color: var(--kaman-color-text, #121212);
    }

    .kaman-filter-panel__row.is-expanded {
        padding-bottom: 12px;
        border-bottom-color: transparent;
    }

    .kaman-filter-panel__row > span:first-child {
        flex: 0 1 auto;
    }

    .kaman-filter-panel__toggle {
        position: relative;
        flex: 0 0 44px;
        width: 44px;
        height: 24px;
        border-radius: 999px;
        background: #E0E0E0;
        transition: background-color 180ms ease;
    }

    .kaman-filter-panel__toggle::after {
        content: "";
        position: absolute;
        top: 2px;
        right: 2px;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #FFFFFF;
        box-shadow: none;
        transition: right 180ms ease;
    }

    .kaman-filter-panel__row.is-active .kaman-filter-panel__toggle {
        background: var(--kaman-color-primary, #AA0002);
    }

    .kaman-filter-panel__row.is-active .kaman-filter-panel__toggle::after {
        right: 22px;
    }

    .kaman-filter-panel__chevron {
        width: 18px;
        height: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 18px;
        color: var(--kaman-color-text-muted, #898989);
        transition: transform 180ms ease;
    }

    .kaman-filter-panel__chevron svg {
        width: 18px;
        height: 18px;
        display: block;
    }

    .kaman-filter-panel__row.is-expanded .kaman-filter-panel__chevron {
        transform: rotate(180deg);
    }

    .kaman-filter-panel__content {
        display: none;
        margin: 0;
        padding: 0 12px 20px;
        border-bottom: 1px solid var(--kaman-color-border, #EBEBEB);
    }

    .kaman-filter-panel__content.is-open {
        display: block;
    }

    .kaman-filter-panel__attribute {
        margin: 0;
        padding: 0;
        border: 0;
    }

    .kaman-filter-panel__search {
        position: relative;
        display: block;
        margin: 0 0 12px;
    }

    .kaman-filter-panel__search::before {
        content: "\f002";
        position: absolute;
        top: 50%;
        right: 16px;
        z-index: 2;
        color: #A4A4A4;
        font-family: "Font Awesome 5 Free";
        font-size: 14px;
        font-weight: 900;
        line-height: 1;
        transform: translateY(-50%);
        pointer-events: none;
    }

    .kaman-filter-panel__search input {
        width: 100%;
        height: 40px;
        margin: 0;
        padding: 8px 40px 8px 16px;
        color: var(--kaman-color-text, #121212);
        background: var(--kaman-color-surface, #FFFFFF);
        border: 1px solid var(--kaman-color-border, #EBEBEB);
        border-radius: 8px;
        outline: none;
        box-shadow: none;
        font-family: var(--kaman-font-family, "Dana2", sans-serif);
        font-size: 14px;
        font-weight: 400;
        line-height: 1;
    }

    .kaman-filter-panel__search input::placeholder {
        color: #A4A4A4;
    }

    .kaman-filter-panel__search input:focus {
        border-color: var(--kaman-color-primary, #AA0002);
        box-shadow: 0 0 0 3px rgba(170, 0, 2, 0.08);
    }

    .kaman-filter-panel__options {
        max-height: none;
        margin: 0;
        padding: 0;
        overflow: visible;
        display: flex;
        flex-direction: column;
        gap: 8px;
        border: 0;
    }

    .kaman-filter-panel__option {
        min-height: 16px;
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        color: #696969;
        font-family: var(--kaman-font-family, "Dana2", sans-serif);
        font-size: 12px;
        font-weight: 500;
        line-height: 1;
        cursor: pointer;
    }

    .kaman-filter-panel__option input[type="checkbox"] {
        flex: 0 0 16px;
        width: 16px;
        height: 16px;
        margin: 0;
        accent-color: var(--kaman-color-primary, #AA0002);
        cursor: pointer;
    }

    .kaman-filter-panel__content--brand .kaman-filter-panel__options {
        gap: 8px;
    }

    .kaman-filter-panel__brand-main {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .kaman-filter-panel__brand-main > span {
        overflow: hidden;
        color: #696969;
        font-size: 12px;
        font-weight: 500;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .kaman-filter-panel__brand-latin {
        margin-inline-start: auto;
        color: var(--kaman-color-text-muted, #898989);
        font-size: 12px;
        font-weight: 400;
        direction: ltr;
        text-align: left;
        white-space: nowrap;
    }

    .kaman-filter-panel__content--color .kaman-filter-panel__search {
        display: none;
    }

    .kaman-filter-panel__content--color .kaman-filter-panel__options {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px 8px;
        align-items: start;
    }

    .kaman-filter-panel__option--color {
        position: relative;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 4px;
        color: #696969;
        font-size: 12px;
        font-weight: 400;
        text-align: center;
    }

    .kaman-filter-panel__option--color input[type="checkbox"] {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        opacity: 0;
        cursor: pointer;
    }

    .kaman-filter-panel__color-swatch {
        width: 41px;
        height: 41px;
        padding: 2px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--kaman-color-border, #EBEBEB);
        border-radius: 8px;
        background: #FFFFFF;
        pointer-events: none;
    }

    .kaman-filter-panel__option--color.is-selected .kaman-filter-panel__color-swatch {
        padding: 1px;
        border: 2px solid var(--kaman-color-primary, #AA0002);
    }

    .kaman-filter-panel__color-swatch-inner {
        width: 35px;
        height: 35px;
        border-radius: 5px;
        box-shadow: inset 0 0 0 1px rgba(18, 18, 18, 0.04);
    }

    .kaman-filter-panel__option--color > span:not(.kaman-filter-panel__color-swatch) {
        width: 100%;
        overflow: hidden;
        color: #696969;
        font-size: 12px;
        font-weight: 400;
        line-height: 1;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
        pointer-events: none;
    }

    .kaman-filter-panel__content--price {
        padding-bottom: 20px;
    }

    .kaman-filter-panel__price {
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 20px;
        border: 0;
    }

    .kaman-filter-panel__price label {
        position: relative;
        width: 100%;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        color: #303030;
        font-family: var(--kaman-font-family, "Dana2", sans-serif);
        font-size: 14px;
        font-weight: 500;
        line-height: 1;
    }

    .kaman-filter-panel__price label > span {
        width: 100%;
        color: #303030;
        font-size: 14px;
        font-weight: 500;
        text-align: right;
    }

    .kaman-filter-panel__price input {
        width: 100%;
        height: 48px;
        margin: 0;
        padding: 10px 16px 10px 72px;
        color: #212121;
        background: var(--kaman-color-surface, #FFFFFF);
        border: 1px solid var(--kaman-color-border, #EBEBEB);
        border-radius: 8px;
        outline: none;
        box-shadow: none;
        font-family: var(--kaman-font-family, "Dana2", sans-serif);
        font-size: 14px;
        font-weight: 400;
        line-height: 1;
        text-align: right;
    }

    .kaman-filter-panel__price input:focus {
        border-color: var(--kaman-color-primary, #AA0002);
        box-shadow: 0 0 0 3px rgba(170, 0, 2, 0.08);
    }

    .kaman-filter-panel__price small {
        position: absolute;
        left: 16px;
        bottom: 17px;
        color: #696969;
        font-family: var(--kaman-font-family, "Dana2", sans-serif);
        font-size: 13px;
        font-weight: 400;
        line-height: 1;
        pointer-events: none;
    }

    .kaman-filter-panel__range {
        position: relative;
        width: 100%;
        height: 20px;
        margin: 0;
        display: flex;
        align-items: center;
    }

    .kaman-filter-panel__range-line {
        position: absolute;
        top: 8px;
        right: 0;
        left: 0;
        width: auto;
        height: 4px;
        border-radius: 2px;
        background: var(--kaman-color-primary, #AA0002);
    }

    .kaman-filter-panel__range-handle {
        position: absolute;
        top: 0;
        width: 20px;
        height: 20px;
        border: 2px solid #FFFFFF;
        border-radius: 50%;
        background: var(--kaman-color-primary, #AA0002);
        z-index: 5;
    }

    .kaman-filter-panel__range-labels {
        width: 100%;
        margin-top: -12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: #696969;
        font-family: var(--kaman-font-family, "Dana2", sans-serif);
        font-size: 12px;
        font-weight: 400;
        line-height: 1;
        direction: ltr;
    }

    .kaman-filter-panel__range-labels > span {
        direction: rtl;
    }

    .kaman-filter-panel__apply {
        display: none !important;
    }
}
