/* Sticky sidebar container */
.sidebar-main .block.filter.mondor-layered-nav,
.mondor-layered-nav {
    position: sticky !important;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    background: #fff;
}

.mondor-layered-nav .filter-subtitle {
    display: none;
}

/* Filter section titles - Shopify style */
.mondor-layered-nav .filter-options-title {
    position: relative;
    cursor: pointer;
    padding: 16px 24px 16px 0;
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #1a1a1a;
    border-bottom: 1px solid #e5e5e5;
}

.mondor-layered-nav .filter-options-title:first-of-type {
    border-top: 1px solid #e5e5e5;
}

/* Chevron arrow - Shopify style */
.mondor-layered-nav .filter-options-title::after {
    content: "";
    position: absolute;
    right: 4px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid #1a1a1a;
    border-bottom: 1.5px solid #1a1a1a;
    transform: translateY(-65%) rotate(45deg);
    transition: transform 0.2s ease;
}

.mondor-layered-nav .filter-options-title.is-collapsed::after {
    transform: translateY(-35%) rotate(-135deg);
}

/* Filter content area */
.mondor-layered-nav .filter-options-content {
    padding: 12px 0 20px;
}

/* Filter list base styles */
.mondor-filter-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mondor-filter-list .item {
    margin-bottom: 2px;
}

.mondor-filter-list .item a,
.mondor-filter-list .item .disabled {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1a1a1a;
    text-decoration: none;
    padding: 6px 0;
    font-size: 14px;
    line-height: 1.4;
}

.mondor-filter-list .item .disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.mondor-filter-list .item .label {
    flex: 1;
}

.mondor-filter-list .item .count {
    color: #666;
    font-size: 13px;
}

/* Selected state */
.mondor-filter-list .item.is-selected a {
    font-weight: 600;
}

/* Checkbox style for SIZE filter */
.mondor-filter-list .mondor-check {
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 1px solid #999;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.mondor-filter-list .item.is-selected .mondor-check {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.mondor-filter-list .item.is-selected .mondor-check::after {
    content: "";
    width: 10px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
}

/* COLOR swatch styles - Shopify style */
.mondor-swatch-list .item a {
    gap: 10px;
}

.mondor-color-chip {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background-size: cover;
    background-position: center;
    box-sizing: border-box;
}

.mondor-color-chip.mondor-color-fallback {
    background: linear-gradient(135deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
}

/* Selected color swatch - ring effect */
.mondor-swatch-list .item.is-selected .mondor-color-chip {
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #1a1a1a;
}

/* Active filter chips at top */
.mondor-filter-current {
    margin-bottom: 16px;
}

.mondor-filter-current .items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mondor-filter-current .item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    margin: 0 8px 8px 0;
    padding: 6px 10px;
    font-size: 12px;
    letter-spacing: 0.05em;
    border-radius: 2px;
}

.mondor-filter-current .filter-label {
    display: none;
}

.mondor-filter-current .filter-value {
    text-transform: uppercase;
    font-weight: 500;
}

.mondor-filter-current .action.remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.mondor-filter-current .action.remove:hover {
    opacity: 1;
}

.mondor-filter-current .action.remove span {
    display: none;
}

.mondor-filter-current .action.remove::before {
    content: "\00D7";
    font-size: 18px;
    line-height: 1;
    color: #333;
}

/* Clear All link */
.mondor-layered-nav .filter-actions {
    margin-bottom: 16px;
}

.mondor-layered-nav .filter-actions .action.clear {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    text-decoration: underline;
}

.mondor-layered-nav .filter-actions .action.clear:hover {
    color: #1a1a1a;
}

/* Mobile styles */
.mondor-filter-mobile-head,
.mondor-filter-toggle-mobile,
.mondor-filter-overlay {
    display: none;
}

@media (max-width: 992px) {
    .sidebar-main .block.filter.mondor-layered-nav,
    .mondor-layered-nav {
        position: static !important;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .mondor-filter-toggle-mobile {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        border: 1px solid #1a1a1a;
        background: #fff;
        padding: 10px 20px;
        margin-top: 10px;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        font-size: 12px;
        cursor: pointer;
    }

    .mondor-filter-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 998;
    }

    .mondor-layered-nav .filter-content {
        position: fixed;
        left: -110%;
        top: 0;
        width: min(90vw, 360px);
        height: 100vh;
        background: #fff;
        z-index: 999;
        overflow-y: auto;
        padding: 20px;
        transition: left 0.25s ease;
    }

    .mondor-filter-mobile-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20px;
        padding-bottom: 16px;
        border-bottom: 1px solid #e5e5e5;
    }

    .mondor-filter-mobile-head strong {
        font-size: 14px;
        text-transform: uppercase;
        letter-spacing: 0.1em;
    }

    .mondor-filter-mobile-head .action {
        border: 0;
        background: transparent;
        font-size: 12px;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        cursor: pointer;
    }

    .mondor-layerednav-open .mondor-layered-nav .filter-content {
        left: 0;
    }

    .mondor-layerednav-open .mondor-filter-overlay {
        display: block;
    }
}

/* Scrollbar styling for sticky sidebar */
.mondor-layered-nav::-webkit-scrollbar {
    width: 4px;
}

.mondor-layered-nav::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.mondor-layered-nav::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.mondor-layered-nav::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Filter Loading Overlay */
.mondor-filter-loader {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}

.mondor-filter-loader.is-active {
    display: block;
    pointer-events: auto;
}

.mondor-loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(1px);
}

.mondor-loader-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
}

.mondor-loader-spinner svg {
    width: 100%;
    height: 100%;
    animation: mondor-spin 1s linear infinite;
}

.mondor-loader-spinner circle {
    stroke: #1a1a1a;
    stroke-linecap: round;
    stroke-dasharray: 90, 150;
    stroke-dashoffset: 0;
    animation: mondor-dash 1.5s ease-in-out infinite;
}

@keyframes mondor-spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes mondor-dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Loading state on filter items */
.mondor-filter-list .item.is-loading a,
.mondor-swatch-list .item.is-loading a {
    opacity: 0.5;
    pointer-events: none;
}

/* Prevent interactions while filtering */
body.mondor-filtering .products.wrapper,
body.mondor-filtering .sidebar-main {
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}