/* Popup size — centered in viewport */
.ts-search-overlay h1,
.ts-search-overlay h2,
.ts-search-overlay h3,
.ts-search-overlay h4,
.ts-search-overlay h5,
.ts-search-overlay h6 {
    letter-spacing: inherit;
}

.ts-search-overlay {
    background: #1d2327b3;
    bottom: 0;
    box-sizing: border-box;
    color: #0a112d;
    font-size: 16px;
    left: 0;
    opacity: 1;
    overflow-x: hidden;
    overflow-y: auto;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 9998;
    /* z-index: 9999999999999; */
}

.ts-search-overlay.is-open {
    display: block !important;
}

.ts-filter-items {
    text-align: left;
}

/* Overlay starts below WP admin bar when logged in */
body.admin-bar .ts-search-overlay {
    top: 32px;
}

.ts-search-form-controls {
    align-items: center;
    display: flex;
    line-height: 1.3;
    margin-left: 56px;
    margin-right: 56px;
    margin-top: 16px;
    z-index: 1;
}

@media (max-width: 991.98px) {
    .ts-search-form-controls {
        flex-direction: row-reverse;
        justify-content: space-between;
        left: 0;
        margin-left: 40px;
        margin-right: 40px;
        position: relative;
        right: 0;
    }
}

@media screen and (max-width: 782px) {
    body.admin-bar .ts-search-overlay {
        top: 46px;
    }
}

.ts-search-modal {
    background: #fff;
    height: 100%;
    min-height: 100%;
    overflow-y: auto;
    position: relative;
    z-index: 10;
    border-radius: 4px;
}

body.admin-bar .ts-search-modal {
    max-height: min(92vh, calc(100vh - 32px - 48px));
}

@media screen and (max-width: 782px) {
    body.admin-bar .ts-search-modal {
        max-height: min(92vh, calc(100vh - 46px - 48px));
    }
}

@media (prefers-reduced-motion: no-preference) {
    .ts-search-overlay {
        transition: opacity .1s ease-in;
    }
}

@media (min-width: 992px) {
    .ts-search-modal {
        max-width: 95%;
    }

    .ts-search-meta {
        padding-right: 210px;
    }

    .ts-search-form-controls {
        position: absolute;
        right: 320px;
    }

    .ts-search-form-controls .ts-search-results-filter-button {
        display: none;
    }
}

@media (min-width: 768px) {
    .ts-search-overlay {
        padding: 3em;
    }
}

/* Brand colors */
.ts-search-modal {
    --ts-purple: #602d77;
    --ts-green: #8fa33d;
    --ts-text: #1a1a1a;
    --ts-muted: #888;
    --ts-border: #ddd;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--ts-text);
}

.ts-search-header {
    margin-bottom: 10px;
}

.ts-search-form {
    align-items: center;
    display: flex;
    flex: 0 0 100%;
    margin: 0;
} 

.ts-search-icon {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    height: 60px;
    justify-content: center;
    left: 0;
    position: relative;
    top: 0;
    width: 60px;
    z-index: 1;
}
.ts-search-overlay.is-open .ts-search-form input[type="search"]{
    margin-bottom: 0px !important;
}

.ts-search-input {
    flex: 1;
    border: 0;
    outline: 0;
    padding: 4px 0;
    font-size: 16px;
    color: var(--ts-text);
    background: transparent;
    min-width: 0;
}

.ts-search-input::placeholder {
    color: #aaa;
}

.ts-search-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ts-clear-search {
    border: 0;
    background: transparent;
    color: var(--ts-muted);
    font-size: 15px;
    cursor: pointer;
    padding: 0;
    text-transform: lowercase;
}

.ts-clear-search:hover {
    color: var(--ts-text);
}

.ts-close-search {
    border: 0;
    background: transparent;
    color: #555;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    line-height: 1;
}

.ts-close-search:hover {
    color: var(--ts-purple);
}

.ts-search-body {
    display: flex;
    position: relative;
}

.ts-search-results-wrap {
    margin: 0;
    max-width: calc(100% - 320px);
    width: 100%;
}

.ts-search-meta {
    color: #0a112d;
    font-size: 1em;
    font-weight: 700;
    line-height: 1.3;
    margin: 1em 56px 1.5em;
    overflow-wrap: break-word;
    padding: 0;
}

.ts-item {
    display: flex;
    flex-direction: column;
    margin: 0 16px 16px 0;
    position: relative;
    width: calc(50% - 16px);
}

.ts-search-results {
    display: flex;
    flex-wrap: wrap;
    margin-right: 40px;
    padding: 0 0 3em;
    color: #0a112d;
    list-style: none;
    margin-left: 56px;
}

.ts-item {
    border: 0;
    padding: 0;
    border-radius: 0;
}

.ts-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ts-item-link:hover .ts-item-title {
    color: var(--ts-purple);
}

.ts-item-image {
    position: relative;
    border-radius: 5px;
    color: #0000;
}

#top .ts-search-input {
    flex: 1;
    border: 0;
    outline: 0;
    padding: 4px 0;
    font-size: 16px;
    color: var(--ts-text);
    background: transparent;
    min-width: 0;
}

.ts-clear-search {
    color: #646970;
    cursor: pointer;
    font-size: 1em;
    font-weight: 400;
    height: 60px;
    line-height: 1;
    margin: 0 .25em 0 0;
    overflow-wrap: normal;
    width: 60px;
}

.ts-item-image:before {
    content: "";
    display: block;
    padding-top: 100%;
    width: 100%;
}

.ts-item-image img {
    border-radius: 5px;
    bottom: 0;
    height: 100%;
    left: 0;
    object-fit: cover;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
}

.ts-item-title {
    font-size: 15px;
    line-height: 1.35;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: inherit;
    text-decoration: none;
    color: inherit;
}

.ts-item-title .ts-highlight {
    background: var(--ts-purple);
    color: #fff;
    padding: 0 2px;
}

.ts-item-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--ts-text);
    margin: 0;
}

.ts-item-price del {
    color: #999;
    font-weight: 400;
    margin-right: 5px;
    text-decoration: line-through;
}

.ts-item-price ins {
    text-decoration: none;
    font-weight: 600;
}

.ts-meta {
    font-size: 14px;
    color: var(--ts-muted);
    margin-top: 4px;
}

.ts-search-sidebar {
    background: none;
    border-left: 1px solid #fbfcfe;
    border-radius: 0;
    bottom: 0;
    box-shadow: none;
    color: #0a112d;
    display: block;
    flex: none;
    padding: 0 32px;
    position: static;
    width: 320px;
    padding-top: 14px;
    margin-bottom: 2em;
}

.ts-filter-heading {
    position: relative;
    color: #0a112d;
    display: block;
    font-size: inherit;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    padding: 0;
}

.ts-filter-group {
    margin-top: 1em;
}

.ts-filter-title {
    color: #9db202 !important;
    font-size: inherit;
    margin: 0;
    padding: 0;
    font-weight: bold;
}

.ts-filter-items label {
    align-items: baseline;
    display: flex;
    margin-top: 8px;
}

.ts-filter-items input[type="checkbox"] {
    appearance: auto;
    background: none;
    border: none;
    cursor: pointer;
    height: auto;
    margin: 0;
    top: 1px;
    width: auto;
}

.ts-filter-items .ts-facet-label {
    color: purple !important;
    cursor: pointer;
    display: inline-block;
    font-weight: 400;
    font-weight: bold !important;
    font-size: 0.92em !important;
    margin: 0 0 0 8px;
    padding: 0;
    width: auto;
    font-family: verdana, Helvetica, Arial, sans-serif;
}

.ts-filter-items .ts-facet-count {
    color: var(--ts-purple);
    font-weight: 600;
    font-size: 15px;
}

.ts-search-results > p {
    grid-column: 1 / -1;
    font-size: 15px;
    color: var(--ts-muted);
}

.ts-pagination button {
    margin-right: 8px;
}

.ts-loading-indicator {
    grid-column: 1 / -1;
    padding: 12px 0;
    font-size: 15px;
    color: var(--ts-muted);
}

.ts-load-more-btn {
    margin: 12px auto;
    display: block;
    padding: 8px 14px;
    border: 1px solid var(--ts-border);
    background: #fff;
    cursor: pointer;
    font-size: 15px;
    color: var(--ts-text);
}

@media (max-width: 1100px) {
    .ts-search-results {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .ts-search-results {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .ts-search-results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .ts-search-results-wrap {
        max-width: 100%;
        margin-top: 14px;
    }
}

@media (min-width: 576px) {
    .ts-item {
        width: calc(33.33333% - 16px);
    }
}

@media (min-width: 768px) {
    .ts-item {
        width: calc(33.33333% - 16px);
    }
}

@media (min-width: 992px) {
    .ts-item {
        width: calc(33.33333% - 16px);
    }
}

@media (min-width: 1200px) {
    .ts-item {
        width: calc(25% - 16px);
    }
}

@media (min-width: 1400px) {
    .ts-item {
        width: calc(20% - 16px);
    }
}

/* ── Header launch search bar ── */
.ts-search-launch-wrap {
    --ts-purple: #602d77;
    width: 100%;
}

.ts-search-launch-form {
    display: flex;
    align-items: stretch;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 0 !important;
}

#top .ts-search-launch-wrap .ts-search-launch-form .ts-search-launch-input,
#top .main_color .ts-search-launch-wrap .ts-search-launch-form .ts-search-launch-input {
    flex: 1;
    align-self: stretch;
    border: 0 !important;
    outline: 0;
    padding: 10px 16px !important;
    font-size: 16px;
    color: #1a1a1a !important;
    background: #fff !important;
    background-color: #fff !important;
    min-width: 0;
    width: auto !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
    min-height: 43px;
    line-height: normal;
    display: block;
}

#top .ts-search-launch-wrap .ts-search-launch-form .ts-search-launch-input:focus,
#top .main_color .ts-search-launch-wrap .ts-search-launch-form .ts-search-launch-input:focus {
    background: #fff !important;
    background-color: #fff !important;
    box-shadow: none !important;
    color: #1a1a1a !important;
}

#top .ts-search-launch-wrap .ts-search-launch-form .ts-search-launch-input:-webkit-autofill,
#top .main_color .ts-search-launch-wrap .ts-search-launch-form .ts-search-launch-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    box-shadow: 0 0 0 1000px #fff inset !important;
    -webkit-text-fill-color: #1a1a1a !important;
}

.ts-search-launch-input::placeholder {
    color: #aaa;
}

.ts-search-launch-input::-webkit-search-decoration,
.ts-search-launch-input::-webkit-search-cancel-button,
.ts-search-launch-input::-webkit-search-results-button,
.ts-search-launch-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
}

#top .ts-search-launch-wrap .ts-search-launch-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-height: 43px;
    align-self: stretch;
    border: 0;
    background: var(--ts-purple);
    color: #fff;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0;
    box-shadow: none !important;
}

#top .ts-search-launch-wrap .ts-search-launch-btn:hover {
    background: #4e2461;
}

.ts-search-launch-btn svg {
    display: block;
}

/* ══════════════════════════════════════════════════════════
   MOBILE-ONLY REDESIGN  (max-width: 991.98px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    .ts-search-modal {
        --ts-purple-light: #f3eaf6;
        --ts-surface: #ffffff;
        --ts-radius: 12px;
        --ts-radius-sm: 8px;
        --ts-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
        --ts-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
        /* background: #f7f8fa; */
        border-radius: 0;
    }

    .ts-search-overlay {
        background: rgba(10, 17, 45, 0.55);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    @media (prefers-reduced-motion: no-preference) {
        .ts-search-overlay {
            transition: opacity 0.2s ease;
        }

        .ts-search-modal {
            animation: ts-modal-in 0.25s ease;
        }

        @keyframes ts-modal-in {
            from {
                opacity: 0;
                transform: translateY(12px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
    }

    .ts-search-body {
        display: block;
        position: relative;
    }
    /* Search header */
    .ts-search-header {
        margin-bottom: -16px;
        background: var(--ts-surface);
        border-bottom: 1px solid #e5e7eb;
        padding: 12px 16px 14px;
        position: sticky;
        top: 0;
        z-index: 2; 
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    }

    .ts-search-form-controls {
        margin-left: 16px;
        margin-right: 16px;
        margin-top: 12px;
        gap: 10px;
        position: relative;
        z-index: 110;
    }

    .ts-search-body {
        z-index: 1;
    }

    .ts-search-form {
        background: #f3f4f6;
        border: 2px solid transparent;
        border-radius: var(--ts-radius);
        padding: 0 12px 0 4px;
        transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    }

    /* .ts-search-form:focus-within {
        background: var(--ts-surface);
        border-color: var(--ts-purple);
        box-shadow: 0 0 0 3px rgba(96, 45, 119, 0.12);
    } */
    section.ts-search-results-wrap.kg-filter-open::before
    {
        content: "";
        width: 100%;
        display: block;
        position: absolute;
        height: 100%;
        background: #000000;
        z-index: 1;
        opacity: 0.5;
        top: -14px;
    }
    .ts-search-icon {
        height: 48px;
        width: 44px;
        color: #6b7280;
    }

    .ts-search-input,
    #top .ts-search-input {
        padding: 12px 0;
    }

    .ts-search-input::placeholder {
        color: #9ca3af;
    }

    .ts-search-actions {
        gap: 4px;
    }

    .ts-clear-search {
        color: #6b7280;
        font-size: 13px;
        height: auto;
        width: auto;
        padding: 6px 10px;
        text-transform: capitalize;
        border-radius: 20px;
        font-weight: 500;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .ts-clear-search:hover {
        color: var(--ts-purple);
        background: var(--ts-purple-light);
    }

    .ts-close-search {
        background: #f3f4f6;
        color: #374151;
        padding: 8px;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        justify-content: center;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .ts-close-search:hover {
        color: var(--ts-purple);
        background: var(--ts-purple-light);
    }

    /* Filter toggle button */
    .ts-search-results-filter-button {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        border: 1.5px solid var(--ts-purple);
        border-radius: 24px;
        background: var(--ts-surface);
        color: var(--ts-purple);
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        white-space: nowrap;
        transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
        line-height: 1.2;
    }

    .ts-search-results-filter-button:hover,
    .ts-search-results-filter-button:focus {
        background: var(--ts-purple);
        color: #fff;
        outline: none;
        box-shadow: 0 2px 8px rgba(96, 45, 119, 0.3);
    }

    .ts-search-results-filter-button svg {
        flex-shrink: 0;
        transition: transform 0.2s ease;
    }
    .ts-search-results-filter-button svg path{
        fill: var(--ts-purple);
    }
    .ts-search-results-filter-button:hover svg path,
    .ts-search-results-filter-button:focus svg path{
        fill: #fff;
    }
    .ts-search-results-filter-button[aria-expanded="true"] svg,
    .ts-search-results-filter-button.is-open svg {
        transform: rotate(180deg);
    }

    .ts-search-results-filter-button[aria-expanded="true"],
    .ts-search-results-filter-button.is-open {
        background: var(--ts-purple);
        color: #fff;
    }

    /* Results meta */
    .ts-search-meta {
        color: #1a1a2e;
        font-size: 0.95em;
        font-weight: 600;
        margin: 26px 16px 12px;
    }

    .ts-search-meta strong,
    .ts-search-meta b {
        color: var(--ts-purple);
        font-weight: 700;
    }

    /* Product grid */
    .ts-search-results {
        margin-left: 0;
        margin-right: 0;
        padding: 0 8px 3em;
    }

    .ts-item {
        margin: 0;
        padding: 8px;
        width: calc(33.33% - 0px);
        box-sizing: border-box;
    }

    .ts-item-link {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .ts-item-link:hover,
    .ts-item-link:focus {
        transform: translateY(-2px);
        box-shadow: var(--ts-shadow-lg);
        border-color: rgba(96, 45, 119, 0.25);
    }

    .ts-item-link:hover .ts-item-title,
    .ts-item-link:focus .ts-item-title {
        color: var(--ts-purple);
    }

    .ts-item-image {
        border-radius: 0;
        color: transparent;
        background: #f9fafb;
        overflow: hidden;
    }

    .ts-item-image img {
        border-radius: 0;
        transition: transform 0.25s ease;
    }

    .ts-item-link:hover .ts-item-image img {
        transform: scale(1.04);
    }

    .ts-item-title {
        font-size: 13px;
        line-height: 1.4;
        margin: 0;
        padding: 10px 10px 4px;
        -webkit-line-clamp: 2;
        font-weight: 500;
        transition: color 0.15s ease;
    }

    .ts-item-title .ts-highlight {
        padding: 0 3px;
        border-radius: 2px;
    }

    .ts-item-price {
        font-size: 15px;
        font-weight: 700;
        color: var(--ts-purple);
        padding: 0 10px 12px;
    }

    .ts-item-price del {
        color: #9ca3af;
        font-size: 13px;
    }

    .ts-meta {
        font-size: 12px;
        padding: 0 10px 10px;
        margin-top: 2px;
    }

    /* Filter bottom sheet — compact panel, scrolls inside itself */
    .ts-filter-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(10, 17, 45, 0.45);
        z-index: 190;
        border: 0;
        padding: 0;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .ts-filter-backdrop.is-visible {
        display: block;
        animation: ts-fade-in 0.2s ease;
    }

    .ts-search-sidebar {
        background: var(--ts-surface);
        border: 0;
        border-radius:  0;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
        display: none;
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        /* max-height: min(58vh, 460px); */
         max-height: min(73vh);
        min-width: 0;
        overflow: scroll;
        padding: 0 20px;
        position: sticky;
        width: 90%;
        margin: 0 auto;
        z-index: 200;
        flex-direction: column;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    .ts-search-sidebar.is-open,
    .ts-search-sidebar.is-visible,
    .ts-search-sidebar[aria-hidden="false"],
    .ts-search-sidebar[style*="display: block"],
    .ts-search-sidebar[style*="display:block"] {
        display: flex !important;
        animation: ts-filter-sheet-up 0.28s ease;
    }

    /* Stop page / modal scroll while sheet is open */
    .ts-search-overlay:has(.ts-search-sidebar.is-open),
    .ts-search-overlay:has(.ts-search-sidebar.is-visible),
    .ts-search-overlay:has(.ts-search-sidebar[aria-hidden="false"]),
    .ts-search-modal:has(.ts-search-sidebar.is-open),
    .ts-search-modal:has(.ts-search-sidebar.is-visible),
    .ts-search-modal:has(.ts-search-sidebar[aria-hidden="false"]),
    .ts-search-modal.filters-open,
    .ts-search-modal.is-filters-open,
    .ts-search-body:has(.ts-search-sidebar.is-open),
    .ts-search-body:has(.ts-search-sidebar.is-visible),
    .ts-search-body:has(.ts-search-sidebar[aria-hidden="false"]),
    .ts-search-body.filters-open,
    .ts-search-body.is-filters-open {
        overflow: hidden;
    }

    @keyframes ts-filter-sheet-up {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .ts-filter-heading {
        color: #1a1a2e;
        font-size: 1.05em;
        font-weight: 700;
        margin: 0;
        padding: 16px 48px 14px 16px;
        border-bottom: 1px solid #e5e7eb;
        background: var(--ts-surface);
        flex: 0 0 auto;
        position: relative;
        display: flex;
        align-items: center;
        min-height: 52px;
        box-sizing: border-box;
    }

    .ts-filter-heading::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        border-radius: 4px;
        background: #d1d5db;
    }

    .ts-filter-close {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        border: 0;
        border-radius: 50%;
        background: #f3f4f6;
        color: #374151;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .ts-filter-close:hover,
    .ts-filter-close:focus {
        background: var(--ts-purple-light);
        color: var(--ts-purple);
        outline: none;
    }

    .ts-filter-scroll {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        padding: 8px 16px 12px;
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        scrollbar-width: thin;
        scrollbar-color: #c4b5d0 transparent;
    }

    .ts-filter-scroll::-webkit-scrollbar {
        width: 6px;
    }

    .ts-filter-scroll::-webkit-scrollbar-thumb {
        background: #c4b5d0;
        border-radius: 6px;
    }

    /* No .ts-filter-scroll wrapper — scroll the whole sheet, sticky header/footer */
    .ts-search-sidebar.is-open:not(:has(.ts-filter-scroll)),
    .ts-search-sidebar.is-visible:not(:has(.ts-filter-scroll)),
    .ts-search-sidebar[aria-hidden="false"]:not(:has(.ts-filter-scroll)) {
        display: block !important;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        max-height: min(58vh, 460px);
        scrollbar-width: thin;
        scrollbar-color: #c4b5d0 transparent;
    }

    .ts-search-sidebar.is-open:not(:has(.ts-filter-scroll)) .ts-filter-heading,
    .ts-search-sidebar.is-visible:not(:has(.ts-filter-scroll)) .ts-filter-heading,
    .ts-search-sidebar[aria-hidden="false"]:not(:has(.ts-filter-scroll)) .ts-filter-heading {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .ts-search-sidebar.is-open:not(:has(.ts-filter-scroll)) .ts-filter-footer,
    .ts-search-sidebar.is-visible:not(:has(.ts-filter-scroll)) .ts-filter-footer,
    .ts-search-sidebar[aria-hidden="false"]:not(:has(.ts-filter-scroll)) .ts-filter-footer {
        position: sticky;
        bottom: 0;
        z-index: 2;
    }

    .ts-filter-footer {
        flex: 0 0 auto;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid #e5e7eb;
        background: var(--ts-surface);
    }

    .ts-filter-done {
        display: block;
        width: 100%;
        padding: 12px 20px;
        border: 0;
        border-radius: 24px;
        background: var(--ts-purple);
        color: #fff;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.15s ease;
    }

    .ts-filter-done:hover,
    .ts-filter-done:focus {
        background: #4e2461;
        outline: none;
    }

    .ts-filter-group {
        margin-top: 12px;
        background: var(--ts-surface);
        border: 1px solid #e5e7eb;
        border-radius: var(--ts-radius-sm);
        padding: 12px 14px;
    }
    .ts-filter-group:last-child {
        margin-bottom: 20px;
    }

    .ts-filter-title {
        color: var(--ts-green) !important;
        font-size: 0.8em !important;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin-bottom: 6px;
    }

    .ts-filter-items label {
        align-items: center;
        margin-top: 0;
        padding: 8px 6px;
        border-radius: 6px;
        gap: 10px;
        transition: background 0.12s ease;
    }

    .ts-filter-items label:hover {
        background: #f9fafb;
    }

    .ts-filter-items label + label {
        margin-top: 2px;
    }

    .ts-filter-items input[type="checkbox"] {
        appearance: none;
        -webkit-appearance: none;
        background: var(--ts-surface);
        border: 2px solid #d1d5db;
        border-radius: 4px;
        height: 18px;
        width: 18px;
        flex-shrink: 0;
        position: relative;
        top: 0;
        transition: background 0.15s ease, border-color 0.15s ease;
    }

    .ts-filter-items input[type="checkbox"]:checked {
        background: var(--ts-purple);
        border-color: var(--ts-purple);
    }

    .ts-filter-items input[type="checkbox"]:checked::after {
        content: "";
        position: absolute;
        left: 5px;
        top: 1px;
        width: 5px;
        height: 10px;
        border: solid #fff;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
    }

    .ts-filter-items .ts-facet-label {
        color: #1a1a2e !important;
        font-family: inherit;
        font-weight: 500 !important;
        font-size: 0.9em !important;
        margin: 0;
        flex: 1;
        line-height: 1.35;
    }

    .ts-filter-items .ts-facet-count {
        color: #6b7280;
        font-weight: 500;
        font-size: 0.85em;
    }

    /* Backdrop handled by .ts-filter-backdrop only — no extra dim layer */
    .ts-search-body.filters-open::before,
    .ts-search-body.is-filters-open::before,
    .ts-search-modal.filters-open::before,
    .ts-search-modal.is-filters-open::before {
        content: none;
    }

    @keyframes ts-fade-in {
        from { opacity: 0; }
        to   { opacity: 1; }
    }

    /* Empty / loading / load-more */
    .ts-search-results > p {
        padding: 24px 16px;
        text-align: center;
        width: 100%;
    }

    .ts-loading-indicator {
        padding: 24px 16px;
        text-align: center;
        width: 100%;
    }

    .ts-load-more-btn {
        margin: 16px auto;
        padding: 12px 24px;
        border: 1.5px solid var(--ts-purple);
        border-radius: 24px;
        font-weight: 600;
        color: var(--ts-purple);
        transition: background 0.15s ease, color 0.15s ease;
    }

    .ts-load-more-btn:hover {
        background: var(--ts-purple);
        color: #fff;
    }
}

@media (max-width: 576px) {
    .ts-item {
        width: calc(50% - 0px);
    }
}