/* =========================================================
   Illusion Loop Filter — Sidebar styles
   ========================================================= */

.illusion-lf {
    --lf-primary: #0e3b73;
    --lf-primary-soft: #6fb0d8;
    --lf-primary-light: #b9d8ec;
    --lf-text: #4a4a4a;
    --lf-muted: #8a8a8a;
    --lf-card: #ffffff;
    --lf-radius: 14px;
    --lf-shadow: 0 2px 10px rgba(14, 59, 115, 0.06);
    --lf-gap: 16px;

    display: flex;
    flex-direction: column;
    gap: var(--lf-gap);
    font-family: inherit;
    color: var(--lf-text);
}

.illusion-lf__panel {
    background: var(--lf-card);
    border-radius: var(--lf-radius);
    box-shadow: var(--lf-shadow);
    padding: 18px 20px;
}

.illusion-lf__title {
    color: var(--lf-primary);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.04em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.illusion-lf__header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--lf-muted);
    font-size: 15px;
}

.illusion-lf__count { font-weight: 500; }

.illusion-lf__clear {
    background: none;
    border: none;
    color: var(--lf-muted);
    cursor: pointer;
    font-size: 15px;
    padding: 0;
}
.illusion-lf__clear:hover { color: var(--lf-primary); }

/* ACCORDION */
.illusion-lf__accordion-head {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--lf-primary);
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.04em;
    cursor: pointer;
    padding: 0;
    text-transform: uppercase;
}

.illusion-lf__caret {
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--lf-primary);
    transition: transform 0.2s;
}
.illusion-lf__accordion.is-open .illusion-lf__caret { transform: rotate(180deg); }

.illusion-lf__accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.illusion-lf__accordion.is-open .illusion-lf__accordion-body {
    max-height: 1200px;
    margin-top: 18px;
    overflow-y: auto;
}

/* PRICE SLIDER — forced styles to override theme CSS */
.illusion-lf__price { margin-bottom: 20px; }

.illusion-lf .illusion-lf__slider {
    position: relative !important;
    height: 24px !important;
    margin: 8px 12px !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
}
/* The faded outer track */
.illusion-lf .illusion-lf__slider-track {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 50% !important;
    height: 6px !important;
    transform: translateY(-50%) !important;
    background: #b9d8ec !important;
    border-radius: 999px !important;
    border: none !important;
    box-shadow: none !important;
}
/* The filled section between the two thumbs */
.illusion-lf .illusion-lf__slider-range {
    position: absolute !important;
    height: 6px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: #0e3b73 !important;
    border-radius: 999px !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 1 !important;
}
/* Hide the native range input visual; keep it interactive */
.illusion-lf .illusion-lf__slider-input {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    pointer-events: none !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 2 !important;
    outline: none !important;
}
.illusion-lf .illusion-lf__slider-input:focus {
    outline: none !important;
}
/* Kill the native track on the input itself */
.illusion-lf .illusion-lf__slider-input::-webkit-slider-runnable-track {
    background: transparent !important;
    border: none !important;
    height: 24px !important;
}
.illusion-lf .illusion-lf__slider-input::-moz-range-track {
    background: transparent !important;
    border: none !important;
    height: 24px !important;
}
/* The thumbs — round, deep blue, matching reference image */
.illusion-lf .illusion-lf__slider-input::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    background: #0e3b73 !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    box-shadow: 0 2px 4px rgba(14, 59, 115, 0.3) !important;
    margin-top: 0 !important;
    transform: none !important;
}
.illusion-lf .illusion-lf__slider-input::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    background: #0e3b73 !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    box-shadow: 0 2px 4px rgba(14, 59, 115, 0.3) !important;
    transform: none !important;
}
.illusion-lf .illusion-lf__slider-input::-ms-thumb {
    width: 20px !important;
    height: 20px !important;
    background: #0e3b73 !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.illusion-lf__price-labels {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #222;
    margin-top: 8px;
    padding: 0 6px;
}

/* OPTION LISTS */
.illusion-lf__options {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 320px;
    overflow-y: auto;
}
.illusion-lf__options label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--lf-text);
    font-size: 15px;
    user-select: none;
}
.illusion-lf__options input[type="radio"],
.illusion-lf__options input[type="checkbox"] {
    display: none;
}

.illusion-lf__radio,
.illusion-lf__check {
    width: 26px;
    height: 24px;
    position: relative;
    flex-shrink: 0;
    display: inline-block;
}
.illusion-lf__radio::before,
.illusion-lf__check::before {
    content: "";
    position: absolute;
    inset: 0;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 24'><path d='M13 2 C14 2 14.8 2.5 15.4 3.4 L23.7 17.6 C24.3 18.7 24.4 19.9 23.8 20.9 C23.2 21.9 22.2 22.4 21 22.4 L5 22.4 C3.8 22.4 2.8 21.9 2.2 20.9 C1.6 19.9 1.7 18.7 2.3 17.6 L10.6 3.4 C11.2 2.5 12 2 13 2 Z M13 5 L4.9 19 C4.7 19.4 4.8 19.6 5.2 19.6 L20.8 19.6 C21.2 19.6 21.3 19.4 21.1 19 Z'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 24'><path d='M13 2 C14 2 14.8 2.5 15.4 3.4 L23.7 17.6 C24.3 18.7 24.4 19.9 23.8 20.9 C23.2 21.9 22.2 22.4 21 22.4 L5 22.4 C3.8 22.4 2.8 21.9 2.2 20.9 C1.6 19.9 1.7 18.7 2.3 17.6 L10.6 3.4 C11.2 2.5 12 2 13 2 Z M13 5 L4.9 19 C4.7 19.4 4.8 19.6 5.2 19.6 L20.8 19.6 C21.2 19.6 21.3 19.4 21.1 19 Z'/></svg>") center/contain no-repeat;
    background-color: var(--lf-primary-soft);
}
.illusion-lf__options input:checked + .illusion-lf__radio::before,
.illusion-lf__options input:checked + .illusion-lf__check::before {
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 24'><path d='M13 2 C14 2 14.8 2.5 15.4 3.4 L23.7 17.6 C24.3 18.7 24.4 19.9 23.8 20.9 C23.2 21.9 22.2 22.4 21 22.4 L5 22.4 C3.8 22.4 2.8 21.9 2.2 20.9 C1.6 19.9 1.7 18.7 2.3 17.6 L10.6 3.4 C11.2 2.5 12 2 13 2 Z'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 24'><path d='M13 2 C14 2 14.8 2.5 15.4 3.4 L23.7 17.6 C24.3 18.7 24.4 19.9 23.8 20.9 C23.2 21.9 22.2 22.4 21 22.4 L5 22.4 C3.8 22.4 2.8 21.9 2.2 20.9 C1.6 19.9 1.7 18.7 2.3 17.6 L10.6 3.4 C11.2 2.5 12 2 13 2 Z'/></svg>") center/contain no-repeat;
    background-color: var(--lf-primary);
}

.illusion-lf__term-count {
    color: var(--lf-muted);
    font-size: 13px;
    margin-left: auto;
}

/* Loading state on target loop */
.illusion-lf-loading {
    position: relative;
    pointer-events: none;
}
.illusion-lf-loading::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.6);
    z-index: 5;
}
.illusion-lf-loading::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 44px; height: 44px;
    border: 3px solid var(--lf-primary-light, #b9d8ec);
    border-top-color: var(--lf-primary, #0e3b73);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: illusion-lf-spin 0.8s linear infinite;
    z-index: 6;
}
@keyframes illusion-lf-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* RTL */
[dir="rtl"] .illusion-lf__term-count { margin-left: 0; margin-right: auto; }
