/* Catalog filter panel (desktop + mobile) */
.catalog-filter-panel.is-ui {
    margin: 0 0 24px;
    font-family: inherit;
    color: #2c2c2c;
}

.catalog-filter-panel.is-ui * {
    box-sizing: border-box;
}

.cfp-card {
    background: #fff;
    border: 1px solid #E8E3DC;
    border-radius: 12px;
    padding: 20px;
}

.cfp-mobile-toggle {
    display: none;
}

.cfp-row--primary {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 12px;
}

.cfp-row--primary > .cfp-range {
    flex: 1 1 0;
    min-width: 0;
}

.cfp-row--primary > .cfp-actions {
    flex: 0 0 auto;
    align-self: stretch;
}

.cfp-row--extra {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #E8E3DC;
}

.cfp-extra[hidden] {
    display: none !important;
}

.cfp-range {
    background: #F7F5F1;
    border: 1px solid #E5E2DA;
    border-radius: 10px;
    padding: 14px 16px 10px;
    min-width: 0;
}

.cfp-range__top {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cfp-range__title {
    flex: 0 1 auto;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1f1f1f;
    white-space: nowrap;
    line-height: 1.2;
}

.cfp-range__unit {
    font-weight: 500;
    font-size: 13px;
    color: #9a948c;
}

.cfp-range__fields {
    display: flex;
    gap: 8px;
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
}

.cfp-field {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 0;
    min-width: 84px;
    max-width: 148px;
    width: auto;
    background: #fff;
    border: 1px solid #E5E2DA;
    border-radius: 6px;
    padding: 0 10px;
    height: 36px;
    font-size: 13px;
    color: #9a948c;
}

.cfp-range[data-cfp-range="price"] .cfp-field {
    max-width: 158px;
}

.cfp-field span {
    flex: 0 0 auto;
    white-space: nowrap;
}

.cfp-field input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 14px;
    font-weight: 700;
    color: #1f1f1f;
    width: 100%;
}

.cfp-range__slider {
    position: relative;
    height: 28px;
    margin-top: 10px;
}

.cfp-range__track,
.cfp-range__fill {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    margin-top: -2px;
    border-radius: 2px;
    background: #E8E3DC;
    pointer-events: none;
}

.cfp-range__fill {
    background: #8B4513;
    right: auto;
}

.cfp-range__thumb {
    position: absolute;
    left: 0;
    width: 100%;
    top: 50%;
    margin-top: -9px;
    height: 18px;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    margin-left: 0;
    padding: 0;
}

.cfp-range__thumb::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
    border: none;
}

.cfp-range__thumb::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #8B4513;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
    pointer-events: auto;
    cursor: pointer;
    margin-top: -7px;
}

.cfp-range__thumb::-moz-range-track {
    height: 4px;
    background: transparent;
    border: none;
}

.cfp-range__thumb::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #8B4513;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
    pointer-events: auto;
    cursor: pointer;
}

.cfp-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #E8E3DC;
    background: #F9F7F4;
    color: #8B4513;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.cfp-more__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #8B4513;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.cfp-more__chev {
    font-size: 12px;
    transition: transform .2s ease;
}

.cfp-more.is-open .cfp-more__chev {
    transform: rotate(180deg);
}

.cfp-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    width: 168px;
    flex-shrink: 0;
}

.cfp-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 36px;
    min-width: 0;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: #8B4513;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.cfp-submit:hover {
    background: #6b3410;
}

.cfp-materials .cfp-checks {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.cfp-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #3a2c1c;
    user-select: none;
}

.cfp-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cfp-check__box {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid #E8E3DC;
    background: #fff;
    position: relative;
    flex: 0 0 auto;
}

.cfp-check input:checked + .cfp-check__box {
    background: #8B4513;
    border-color: #8B4513;
}

.cfp-check input:checked + .cfp-check__box::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.cfp-sortbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #E8E3DC;
    border-radius: 12px;
    flex-wrap: wrap;
}

.cfp-sortbar__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #3a2c1c;
    white-space: nowrap;
}

.cfp-sortbar__label-mob {
    display: none;
}

.cfp-sort-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.cfp-sort-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #E8E3DC;
    background: #fff;
    color: #3a2c1c;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.cfp-sort-tab.is-active {
    border-color: #8B4513;
    color: #8B4513;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px #8B4513;
}

.cfp-sort-mob {
    display: none;
    position: relative;
}

.cfp-found {
    margin-left: auto;
    font-size: 14px;
    color: #5a5a5a;
    white-space: nowrap;
}

.cfp-found span {
    font-weight: 700;
    color: #2c2c2c;
}

.catalog-filter-empty {
    padding: 24px;
    text-align: center;
    color: #5a5a5a;
    font-size: 15px;
}

@media (max-width: 1280px) {
    .cfp-row--primary {
        flex-wrap: wrap;
    }
    .cfp-row--primary > .cfp-range {
        flex: 1 1 calc(50% - 6px);
        min-width: 280px;
    }
    .cfp-row--primary > .cfp-actions {
        flex: 1 1 100%;
        width: auto;
        flex-direction: row;
        align-items: center;
    }
    .cfp-more,
    .cfp-submit {
        width: auto;
        flex: 1;
    }
    .cfp-row--extra {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767.98px) {
    .catalog-filter-panel.is-ui {
        margin-bottom: 16px;
    }

    .cfp-card {
        padding: 0;
        overflow: hidden;
    }

    .cfp-mobile-toggle {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 16px;
        border: 0;
        background: #8B4513;
        color: #fff;
        font-size: 15px;
        font-weight: 700;
        cursor: pointer;
        border-radius: 12px;
    }

    .catalog-filter-panel.is-ui.is-mobile-open .cfp-mobile-toggle {
        border-radius: 12px 12px 0 0;
    }

    .cfp-mobile-toggle__left,
    .cfp-mobile-toggle__right {
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }

    .cfp-mobile-toggle__right {
        font-weight: 600;
        font-size: 14px;
    }

    .cfp-mobile-toggle__right i {
        transition: transform .2s ease;
    }

    .catalog-filter-panel.is-ui.is-mobile-open .cfp-mobile-toggle__right i {
        transform: rotate(180deg);
    }

    .cfp-body {
        display: none;
        padding: 16px;
    }

    .catalog-filter-panel.is-ui.is-mobile-open .cfp-body {
        display: block;
    }

    .cfp-row--primary,
    .cfp-row--extra {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cfp-range__top {
        flex-wrap: wrap;
        gap: 10px;
    }

    .cfp-range__fields {
        width: 100%;
    }

    .cfp-field,
    .cfp-range[data-cfp-range="price"] .cfp-field {
        flex: 1;
        width: auto;
    }

    .cfp-more {
        display: none;
    }

    .cfp-extra[hidden] {
        display: block !important;
    }

    .cfp-extra {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }

    .cfp-row--extra {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }

    .cfp-actions {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding-top: 8px;
    }

    .cfp-submit {
        width: 100%;
        min-width: 0;
    }

    .cfp-sortbar {
        flex-wrap: nowrap;
        justify-content: space-between;
        padding: 12px 14px;
    }

    .cfp-sortbar__label-desk {
        display: none;
    }

    .cfp-sortbar__label-mob {
        display: inline;
    }

    .cfp-sort-tabs,
    .cfp-found {
        display: none;
    }

    .cfp-sort-mob {
        display: block;
        margin-left: auto;
    }

    .cfp-sort-mob__btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        height: 36px;
        padding: 0 12px;
        border-radius: 8px;
        border: 1px solid #8B4513;
        background: #fff;
        color: #8B4513;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
    }

    .cfp-sort-mob__menu {
        position: absolute;
        right: 0;
        top: calc(100% + 6px);
        min-width: 220px;
        background: #fff;
        border: 1px solid #E8E3DC;
        border-radius: 10px;
        box-shadow: 0 10px 24px rgba(0,0,0,.12);
        padding: 6px;
        z-index: 20;
    }

    .cfp-sort-mob__menu[hidden] {
        display: none !important;
    }

    .cfp-sort-mob__item {
        display: block;
        width: 100%;
        text-align: left;
        border: 0;
        background: transparent;
        padding: 10px 12px;
        border-radius: 8px;
        font-size: 13px;
        color: #3a2c1c;
        cursor: pointer;
    }

    .cfp-sort-mob__item.is-active,
    .cfp-sort-mob__item:hover {
        background: #F9F7F4;
        color: #8B4513;
        font-weight: 700;
    }
}
