/* =============================================================================
   Expert eCommerce Suite — Product Filter Stylesheet
   Palette: #F8F6F1 cream · #D0D8C8 sage · #EAD6CF blush · #4A5D4F forest
   ============================================================================= */

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

.ee-filter-wrap {
    font-family: inherit;
}

/* ── Active filter tags ──────────────────────────────────────────────────── */

.ee-filter-active {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #D0D8C8;
}

.ee-filter-active__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.ee-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 12px;
    background: #D0D8C8;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #3a4d3f;
    text-decoration: none;
    transition: background .12s;
    border: none;
}

.ee-filter-tag:hover {
    background: #c0ccc0;
    color: #2a3d2f;
}

.ee-filter-tag svg {
    flex-shrink: 0;
    color: #4A5D4F;
}

.ee-filter-clear {
    font-size: 12px;
    color: #4A5D4F;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: inline-block;
}

.ee-filter-clear:hover {
    color: #2a3d2f;
}

/* ── Filter form ─────────────────────────────────────────────────────────── */

.ee-filter-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Filter section ──────────────────────────────────────────────────────── */

.ee-filter-section {
    border-top: 1px solid #E8EDE8;
    padding: 4px 0;
}

.ee-filter-section:first-of-type {
    border-top: none;
}

.ee-filter-section__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #3a3a3a;
    text-align: left;
    appearance: none;
    box-shadow: none;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.4;
}

.ee-filter-section__toggle:hover {
    color: #4A5D4F;
}

.ee-filter-chevron {
    flex-shrink: 0;
    color: #4A5D4F;
    transition: transform .2s;
}

.ee-filter-section__toggle[aria-expanded="false"] .ee-filter-chevron {
    transform: rotate(-90deg);
}

.ee-filter-section__body {
    padding-bottom: 12px;
    overflow: hidden;
}

.ee-filter-section__body.is-collapsed {
    display: none;
}

/* ── Price slider ────────────────────────────────────────────────────────── */

.ee-price-slider {
    padding: 8px 4px 4px;
}

.ee-price-slider__track {
    position: relative;
    height: 4px;
    background: #D0D8C8;
    border-radius: 2px;
    margin: 12px 8px;
    cursor: pointer;
}

.ee-price-slider__fill {
    position: absolute;
    height: 100%;
    background: #4A5D4F;
    border-radius: 2px;
}

.ee-price-slider__thumb {
    position: absolute;
    width: 18px;
    height: 18px;
    background: #4A5D4F;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    border: 2.5px solid #fff;
    box-shadow: 0 0 0 1.5px #4A5D4F;
    transition: box-shadow .12s;
    z-index: 2;
    touch-action: none;
}

.ee-price-slider__thumb:active,
.ee-price-slider__thumb.is-dragging {
    cursor: grabbing;
    box-shadow: 0 0 0 4px rgba(74,93,79,.2);
}

.ee-price-slider__thumb:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(74,93,79,.25);
}

.ee-price-slider__labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #4A5D4F;
}

/* ── Checkbox items ──────────────────────────────────────────────────────── */

.ee-filter-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
}

.ee-filter-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    border: 1.5px solid #D0D8C8;
    border-radius: 3px;
    cursor: pointer;
    accent-color: #4A5D4F;
    flex-shrink: 0;
    margin: 0;
}

.ee-filter-check__label {
    font-size: 13px;
    color: #3a3a3a;
    cursor: pointer;
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1.4;
}

.ee-filter-check__count {
    font-size: 11px;
    color: #9a9a9a;
    font-weight: 400;
}

.ee-filter-check:hover .ee-filter-check__label {
    color: #4A5D4F;
}

/* ── Colour swatches ─────────────────────────────────────────────────────── */

.ee-filter-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}

.ee-filter-swatch {
    position: relative;
    cursor: pointer;
}

.ee-filter-swatch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.ee-filter-swatch__dot {
    display: block;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--swatch-color, #ccc);
    border: 2px solid transparent;
    box-shadow: 0 0 0 1.5px rgba(0,0,0,.1);
    transition: border-color .12s, box-shadow .12s;
}

.ee-filter-swatch:hover .ee-filter-swatch__dot {
    border-color: #4A5D4F;
}

.ee-filter-swatch.is-active .ee-filter-swatch__dot {
    border-color: #4A5D4F;
    box-shadow: 0 0 0 2px #4A5D4F;
}

/* ── WooCommerce sort dropdown — styled to match palette ─────────────────── */

.woocommerce-ordering select,
.woocommerce .woocommerce-ordering select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #D0D8C8;
    border-radius: 8px;
    background-color: #F8F6F1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%234A5D4F' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    appearance: none;
    -webkit-appearance: none;
    font-size: 13px;
    color: #3a3a3a;
    cursor: pointer;
    min-width: 180px;
}

.woocommerce-ordering select:focus {
    outline: none;
    border-color: #4A5D4F;
    box-shadow: 0 0 0 3px rgba(74,93,79,.12);
}

/* ── Results count ───────────────────────────────────────────────────────── */

.woocommerce-result-count {
    font-size: 13px;
    color: #888;
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .ee-filter-chevron,
    .ee-price-slider__thumb,
    .ee-filter-swatch__dot {
        transition: none;
    }
}
