/* =============================================================================
   WC Produktų Filtras – filter.css
   ============================================================================= */

:root {
    --wcf-primary: #1a1a2e;
    --wcf-accent: #e94560;
    --wcf-accent-light: #fde8ec;
    --wcf-border: #e5e7eb;
    --wcf-bg: #ffffff;
    --wcf-bg-hover: #f9fafb;
    --wcf-text: #374151;
    --wcf-text-muted: #9ca3af;
    --wcf-radius: 8px;
    --wcf-radius-sm: 4px;
    --wcf-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
    --wcf-shadow-lg: 0 4px 16px rgba(0, 0, 0, .12);
    --wcf-transition: 160ms ease;
    --wcf-font: inherit;
}

/* ── Wrapper ───────────────────────────────────────────────────────────────── */

.wcf-filter-wrapper,
.wcf-filter-wrapper *,
.wcf-filter-wrapper *::before,
.wcf-filter-wrapper *::after {
    box-sizing: border-box !important;
}

.wcf-filter-wrapper {
    font-family: var(--wcf-font);
    font-size: 14px;
    color: var(--wcf-text);
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden;
}

.wcf-layout--vertical .wcf-form {
    width: 100% !important;
}

/* ── Form Header ────────────────────────────────────────────────────────────── */

.wcf-form__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 16px;
    border-bottom: 2px solid var(--wcf-primary);
    margin-bottom: 20px;
}

.wcf-form__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--wcf-primary);
}

.wcf-form__title svg {
    opacity: .7;
}

/* ── Reset All ──────────────────────────────────────────────────────────────── */

.wcf-reset-all {
    background: none;
    border: 1px solid var(--wcf-border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--wcf-text-muted);
    cursor: pointer;
    transition: all var(--wcf-transition);
    display: none;
}

.wcf-reset-all:hover {
    border-color: var(--wcf-accent);
    color: var(--wcf-accent);
}

/* ── Active Filters Bar ──────────────────────────────────────────────────────── */

.wcf-active-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 20px;
    min-height: 32px;
}

.wcf-active-bar__prefix {
    font-size: 12px;
    color: var(--wcf-text-muted);
    font-weight: 500;
}

.wcf-active-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--wcf-accent-light);
    color: var(--wcf-accent);
    border-radius: 20px;
    padding: 4px 10px 4px 12px;
    font-size: 12px;
    font-weight: 500;
    animation: wcf-tag-in .15s ease;
}

@keyframes wcf-tag-in {
    from {
        opacity: 0;
        transform: scale(.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.wcf-active-tag__remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: var(--wcf-accent);
    padding: 0;
    opacity: .7;
    transition: opacity var(--wcf-transition);
}

.wcf-active-tag__remove:hover {
    opacity: 1;
}

/* ── Single Filter Block ────────────────────────────────────────────────────── */

.wcf-filter {
    border-bottom: 1px solid var(--wcf-border);
    padding: 16px 0;
    width: 100%;
    box-sizing: border-box;
}

.wcf-filter:last-child {
    border-bottom: none;
}

.wcf-filter__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    cursor: default;
}

.wcf-filter__label {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--wcf-primary);
}

.wcf-filter__toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--wcf-text-muted);
    transition: transform var(--wcf-transition);
    display: flex;
    align-items: center;
}

.wcf-filter__toggle[aria-expanded="false"] {
    transform: rotate(180deg);
}

.wcf-filter__body {
    overflow: hidden;
}

/* ── Checklist ──────────────────────────────────────────────────────────────── */

.wcf-checklist {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    align-items: stretch !important;
}

.wcf-checklist__item {
    margin: 0;
}

.wcf-check {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 8px;
    border-radius: var(--wcf-radius-sm);
    cursor: pointer;
    transition: background var(--wcf-transition);
    user-select: none;
}

.wcf-check:hover {
    background: var(--wcf-bg-hover);
}

.wcf-check__input {
    display: none;
}

.wcf-check__box {
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 1.5px solid var(--wcf-border);
    border-radius: 3px;
    background: var(--wcf-bg);
    transition: all var(--wcf-transition);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcf-check__input:checked+.wcf-check__box {
    background: var(--wcf-accent);
    border-color: var(--wcf-accent);
}

.wcf-check__input:checked+.wcf-check__box::after {
    content: '';
    width: 9px;
    height: 5px;
    border: 2px solid #fff;
    border-top: none;
    border-right: none;
    transform: rotate(-45deg) translateY(-1px);
    display: block;
}

/* ── Radio Specific Styles ── */
.wcf-check__box--radio {
    border-radius: 50%;
}

.wcf-check__input:checked+.wcf-check__box--radio::after {
    content: '';
    width: 8px;
    height: 8px;
    background: #fff;
    border: none;
    border-radius: 50%;
    transform: none;
}

.wcf-check__name {
    flex: 1;
    font-size: 13.5px;
    color: var(--wcf-text);
}

.wcf-check__count {
    font-size: 11px;
    color: var(--wcf-text-muted);
    background: var(--wcf-bg-hover);
    border-radius: 10px;
    padding: 1px 7px;
    font-weight: 500;
}

/* ── Color Swatches ──────────────────────────────────────────────────────────── */

.wcf-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wcf-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    box-shadow: 0 0 0 1px var(--wcf-border);
    cursor: pointer;
    transition: all var(--wcf-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 600;
    color: #fff;
    background: var(--wcf-border);
    overflow: hidden;
}

.wcf-swatch.is-active {
    box-shadow: 0 0 0 2px var(--wcf-accent);
    border-color: #fff;
    transform: scale(1.1);
}

.wcf-swatch:hover {
    transform: scale(1.05);
}

/* ── Rating ─────────────────────────────────────────────────────────────────── */

.wcf-rating-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wcf-rating-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 6px 8px;
    border-radius: var(--wcf-radius-sm);
    cursor: pointer;
    width: 100%;
    transition: background var(--wcf-transition);
    color: var(--wcf-text);
}

.wcf-rating-btn:hover {
    background: var(--wcf-bg-hover);
}

.wcf-rating-btn.is-active {
    background: var(--wcf-accent-light);
}

.wcf-star {
    fill: var(--wcf-border);
    stroke: var(--wcf-border);
}

.wcf-star--filled {
    fill: #f59e0b;
    stroke: #f59e0b;
}

.wcf-rating-btn__label {
    font-size: 12px;
    color: var(--wcf-text-muted);
    margin-left: 4px;
}

/* ── Toggle ─────────────────────────────────────────────────────────────────── */

.wcf-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.wcf-toggle__input {
    display: none;
}

.wcf-toggle__switch {
    width: 40px;
    height: 22px;
    background: var(--wcf-border);
    border-radius: 11px;
    position: relative;
    transition: background var(--wcf-transition);
    flex-shrink: 0;
}

.wcf-toggle__switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--wcf-shadow);
    transition: transform var(--wcf-transition);
}

.wcf-toggle__input:checked+.wcf-toggle__switch {
    background: var(--wcf-accent);
}

.wcf-toggle__input:checked+.wcf-toggle__switch::after {
    transform: translateX(18px);
}

.wcf-toggle__label {
    font-size: 13.5px;
    font-weight: 500;
}

/* ── Range Slider ────────────────────────────────────────────────────────────── */

.wcf-range-slider {
    position: relative;
    height: 60px;
    /* Explicit height to contain everything */
    padding: 0;
    margin: 12px 6px 40px;
    /* Space for limits below */
}

.wcf-price-display {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 800;
    font-size: 14px;
    color: #000 !important;
    pointer-events: none;
    z-index: 5;
}

.wcf-range-slider--taxonomy {
    margin-top: 12px;
}

.wcf-range-slider__track {
    position: absolute;
    bottom: 12px;
    /* Position track near the bottom of 60px height */
    height: 4px;
    left: 0;
    right: 0;
    background: var(--wcf-border);
    border-radius: 2px;
}

.wcf-range-slider__fill {
    position: absolute;
    height: 100%;
    background: var(--wcf-accent);
    border-radius: 2px;
}

.wcf-range-slider__input {
    position: absolute;
    bottom: 12px;
    /* Must match track bottom */
    width: 100%;
    height: 20px;
    /* Short height focused around the track */
    margin: 0;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    outline: none;
    transform: translateY(8px);
    /* Center thumb on track */
}

.wcf-range-slider__input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--wcf-accent);
    box-shadow: var(--wcf-shadow);
    cursor: pointer;
    pointer-events: all;
    transition: transform var(--wcf-transition);
}

.wcf-range-slider__input::-webkit-slider-thumb:hover,
.wcf-range-slider__input:active::-webkit-slider-thumb {
    transform: scale(1.2);
}

.wcf-range-slider__input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--wcf-accent);
    box-shadow: var(--wcf-shadow);
    cursor: pointer;
    pointer-events: all;
}

.wcf-range-slider__limits {
    position: absolute;
    bottom: -22px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--wcf-text-muted);
    font-weight: 500;
}

.wcf-range-limit-min,
.wcf-range-limit-max {
    opacity: 0.7;
}

/* ── Orderby ────────────────────────────────────────────────────────────────── */

.wcf-orderby {
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wcf-orderby__label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--wcf-primary);
}

.wcf-orderby__select,
.wcf-select {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 10px 14px !important;
    padding-right: 36px !important;
    border: 1.5px solid var(--wcf-border);
    border-radius: var(--wcf-radius);
    font-size: 13.5px;
    color: var(--wcf-text);
    background: var(--wcf-bg);
    cursor: pointer;
    outline: none;
    transition: all var(--wcf-transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.wcf-orderby__select:hover,
.wcf-select:hover {
    border-color: #999;
}

.wcf-orderby__select:focus,
.wcf-select:focus {
    border-color: var(--wcf-accent);
    box-shadow: 0 0 0 3px var(--wcf-accent-light);
}

/* ── Loading Skeleton ────────────────────────────────────────────────────────── */

.woocommerce ul.products.wcf-loading {
    position: relative;
    pointer-events: none;
}

.woocommerce ul.products.wcf-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .7);
    z-index: 10;
    border-radius: var(--wcf-radius);
    animation: wcf-pulse 1.2s ease infinite;
}

@keyframes wcf-pulse {

    0%,
    100% {
        opacity: .6;
    }

    50% {
        opacity: 1;
    }
}

/* ── Load More Button ────────────────────────────────────────────────────────── */

#wcf-load-more-wrap {
    text-align: center;
    margin-top: 32px;
}

.wcf-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: var(--wcf-primary);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--wcf-transition);
    letter-spacing: .03em;
}

.wcf-load-more-btn:hover {
    background: var(--wcf-accent);
    transform: translateY(-2px);
    box-shadow: var(--wcf-shadow-lg);
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
    .wcf-filter-wrapper {
        position: relative;
    }

    .wcf-form {
        background: var(--wcf-bg);
        border: 1px solid var(--wcf-border);
        border-radius: var(--wcf-radius);
        padding: 16px;
        box-shadow: var(--wcf-shadow);
    }

    .wcf-filter__body {
        display: none;
    }

    .wcf-filter__toggle[aria-expanded="true"]~.wcf-filter__body {
        display: block;
    }
}

/* ── Sticky sidebar (desktop) ────────────────────────────────────────────────── */

@media (min-width: 768px) {
    .wcf-layout--vertical .wcf-filter-wrapper {
        position: sticky;
        top: 80px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--wcf-border) transparent;
    }

    .wcf-layout--vertical .wcf-filter-wrapper::-webkit-scrollbar {
        width: 4px;
    }

    .wcf-layout--vertical .wcf-filter-wrapper::-webkit-scrollbar-thumb {
        background: var(--wcf-border);
        border-radius: 2px;
    }
}

/* ── Chips Display Type ──────────────────────────────────────────────────────── */

.wcf-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid var(--wcf-border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--wcf-text);
    cursor: pointer;
    transition: all var(--wcf-transition);
    user-select: none;
}

.wcf-chip:hover {
    border-color: #999;
}

.wcf-chip.is-active {
    background: #111;
    color: #fff;
    border-color: #111;
}

.wcf-chip__count {
    font-size: 11px;
    color: inherit;
    opacity: 0.7;
}