/* ═══════════════════════════════
   WC Ajax Filter — filter.css v2
═══════════════════════════════ */

/* Widget shell */
.wcaf-widget {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    font-family: inherit;
    box-sizing: border-box;
    position: relative;
}

/* Header */
.wcaf-header   { margin-bottom: 14px; }
.wcaf-title    { font-size: 1.25rem; font-weight: 700; color: #e8341c; margin: 0 0 3px; }
.wcaf-subtitle { font-size: 0.78rem; color: #888; margin: 0; }

/* Skeleton loader */
.wcaf-skeleton { padding: 8px 0; }
.wcaf-skel-line {
    background: #f0f0f0;
    border-radius: 4px;
    animation: wcaf-pulse 1.4s ease-in-out infinite;
}
@keyframes wcaf-pulse {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

/* Active chips */
.wcaf-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}
.wcaf-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    background: #fff0ee;
    color: #e8341c;
    border: 1px solid #f5c0b7;
    border-radius: 20px;
    font-size: 0.73rem;
    cursor: pointer;
    line-height: 1.4;
}
.wcaf-chip-x { font-size: 1rem; line-height: 1; opacity: .7; }

/* ── Sections ── */
.wcaf-section {
    border-bottom: 1px solid #f0f0f0;
    padding: 11px 0;
}
.wcaf-section:last-child { border-bottom: none; }

.wcaf-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}
.wcaf-section-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111;
    margin: 0;
}
.wcaf-toggle-icon {
    width: 18px; height: 18px;
    color: #bbb;
    font-style: normal;
    font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    transition: transform .22s;
    flex-shrink: 0;
}
.wcaf-section.collapsed .wcaf-toggle-icon { transform: rotate(-90deg); }

.wcaf-section-body {
    overflow: hidden;
    max-height: 600px;
    opacity: 1;
    transition: max-height .28s ease, opacity .22s, margin .22s;
    margin-top: 10px;
}
.wcaf-section.collapsed .wcaf-section-body {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

/* ── Price ── */
.wcaf-price-wrap { padding: 4px 0 2px; }

/* dual range */
.wcaf-dual-range { position: relative; height: 38px; margin: 0 2px; }
.wcaf-dual-range input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    width: 100%;
    height: 4px;
    background: transparent;
    pointer-events: none;
    top: 16px; left: 0;
    outline: none;
}
.wcaf-dual-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #e8341c;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    pointer-events: all;
    cursor: pointer;
}
.wcaf-dual-range input[type="range"]::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #e8341c;
    border: 2px solid #fff;
    pointer-events: all;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.wcaf-track-bg {
    position: absolute;
    top: 24px; left: 0; right: 0;
    height: 4px;
    background: #e5e5e5;
    border-radius: 2px;
    pointer-events: none;
}
.wcaf-range-fill {
    position: absolute;
    height: 4px;
    background: #e8341c;
    border-radius: 2px;
}
.wcaf-price-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.78rem;
    color: #555;
}
.wcaf-price-inputs {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.wcaf-price-inputs input[type="number"] {
    width: 50%;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.82rem;
    text-align: center;
    outline: none;
    transition: border-color .15s;
    -moz-appearance: textfield;
}
.wcaf-price-inputs input[type="number"]::-webkit-outer-spin-button,
.wcaf-price-inputs input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.wcaf-price-inputs input[type="number"]:focus { border-color: #e8341c; }

/* ── Checkbox list ── */
.wcaf-cb-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}
.wcaf-cb-list::-webkit-scrollbar { width: 4px; }
.wcaf-cb-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.wcaf-cb-item { display: flex; }
.wcaf-cb-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 100%;
    font-size: 0.87rem;
    color: #333;
    padding: 1px 0;
}
.wcaf-cb-input { display: none; }
.wcaf-cb-box {
    width: 16px; height: 16px;
    border: 2px solid #ccc;
    border-radius: 3px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .14s, border-color .14s;
}
.wcaf-cb-input:checked + .wcaf-cb-box {
    background: #e8341c;
    border-color: #e8341c;
}
.wcaf-cb-box::after {
    content: '';
    display: block;
    width: 8px; height: 4px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
    opacity: 0;
    transition: opacity .12s;
}
.wcaf-cb-input:checked + .wcaf-cb-box::after { opacity: 1; }
.wcaf-cb-name  { flex: 1; line-height: 1.3; }
.wcaf-cb-count {
    font-size: 0.72rem;
    color: #aaa;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 1px 6px;
    flex-shrink: 0;
}

/* Show more */
.wcaf-show-more {
    display: inline-block;
    margin-top: 7px;
    font-size: 0.77rem;
    color: #e8341c;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px dashed #e8341c;
}

/* ── Color swatches ── */
.wcaf-swatch-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    list-style: none;
    margin: 0; padding: 2px;
}
.wcaf-swatch {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    outline: 2px solid transparent;
    cursor: pointer;
    transition: outline-color .15s, transform .15s;
    position: relative;
}
.wcaf-swatch:hover   { transform: scale(1.1); }
.wcaf-swatch.is-active { outline: 2px solid #333; transform: scale(1.1); }
.wcaf-swatch-tip {
    display: none;
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}
.wcaf-swatch:hover .wcaf-swatch-tip { display: block; }

/* ── Size pills ── */
.wcaf-size-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0; padding: 0;
}
.wcaf-size-pill {
    padding: 3px 11px;
    border: 1.5px solid #ddd;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all .14s;
    color: #555;
    background: #fff;
}
.wcaf-size-pill:hover { border-color: #e8341c; color: #e8341c; }
.wcaf-size-pill.is-active { background: #e8341c; border-color: #e8341c; color: #fff; }

/* ── Sort ── */
.wcaf-sort-select {
    width: 100%;
    padding: 7px 30px 7px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.87rem;
    color: #333;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E") no-repeat right 10px center;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    cursor: pointer;
}
.wcaf-sort-select:focus { border-color: #e8341c; }

/* ── Footer ── */
.wcaf-footer {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wcaf-btn-apply {
    width: 100%;
    padding: 11px;
    background: #e8341c;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: .3px;
    transition: background .2s, transform .1s;
}
.wcaf-btn-apply:hover  { background: #c9290f; }
.wcaf-btn-apply:active { transform: scale(0.98); }
.wcaf-btn-apply.loading { opacity: .7; pointer-events: none; }

.wcaf-btn-reset {
    width: 100%;
    padding: 8px;
    background: transparent;
    color: #888;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.83rem;
    cursor: pointer;
    transition: all .18s;
}
.wcaf-btn-reset:hover { border-color: #e8341c; color: #e8341c; }

/* ── Pagination ── */
.wcaf-pagination {
    margin-top: 20px;
    text-align: center;
}
.wcaf-pagination .page-numbers {
    display: inline-block;
    padding: 5px 11px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 2px;
    text-decoration: none;
    color: #333;
    font-size: 0.85rem;
    transition: all .15s;
}
.wcaf-pagination .page-numbers.current { background: #e8341c; border-color: #e8341c; color: #fff; }
.wcaf-pagination .page-numbers:hover   { border-color: #e8341c; color: #e8341c; }
