/* Hide any duplicate filters that might appear */
.wc-custom-filter-widget {
    display: none !important;
}

/* Horizontal Filter Bar - eBay Style */
.wc-horizontal-filters-container {
    margin: 20px 0;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 15px;
    background: white;
    position: relative;
    z-index: 10;
}

.wc-horizontal-filters-container {
    z-index: 9999;
}

.wc-horizontal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.wc-filter-toggle-btn,
.wc-filter-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.wc-filter-toggle-btn:hover,
.wc-filter-dropdown-btn:hover {
    border-color: #0073aa;
    color: #0073aa;
}

.wc-filter-dropdown-btn.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.wc-filter-toggle-btn svg,
.wc-filter-dropdown-btn svg {
    flex-shrink: 0;
}

/* Individual Filter Dropdowns */
.wc-filter-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.wc-filter-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    max-width: 280px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.15s ease;
    margin-top: 2px;
}

.wc-filter-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wc-filter-dropdown-content {
    padding: 8px 0;
    max-height: 300px;
    overflow-y: auto;
}

.wc-filter-dropdown-content h4 {
    display: none;
    /* Hide the title to match eBay style */
}

.wc-filter-dropdown-option {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    cursor: pointer;
    transition: background-color 0.1s ease;
    font-size: 13px;
    line-height: 1.4;
}

.wc-filter-dropdown-option:hover {
    background-color: #f7f7f7;
}

.wc-filter-dropdown-option input[type="checkbox"],
.wc-filter-dropdown-option input[type="radio"] {
    margin-right: 8px;
    margin-top: 0;
    width: 16px;
    height: 16px;
    accent-color: #0073aa;
}

.wc-filter-dropdown-option input[type="checkbox"]:checked {
    background-color: #0073aa;
    border-color: #0073aa;
}

.wc-filter-dropdown-option .wc-filter-label {
    flex: 1;
    font-size: 13px;
    color: #333;
    font-weight: normal;
}

.wc-filter-dropdown-option .wc-filter-count {
    color: #767676;
    font-size: 12px;
    margin-left: 8px;
    font-weight: normal;
}

.wc-filter-dropdown-select {
    width: 100%;
    padding: 8px 12px;
    border: none;
    font-size: 13px;
    background: white;
    color: #333;
}

.wc-filter-dropdown-select:focus {
    outline: none;
    background-color: #f7f7f7;
}

/* Scrollbar styling for dropdown */
.wc-filter-dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.wc-filter-dropdown-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.wc-filter-dropdown-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.wc-filter-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Active filter styling */
.wc-filter-dropdown-option input[type="checkbox"]:checked+.wc-filter-label,
.wc-filter-dropdown-option input[type="radio"]:checked+.wc-filter-label {
    font-weight: 500;
    color: #0073aa;
}

/* Dropdown arrow animation */
.wc-filter-dropdown-btn svg {
    transition: transform 0.2s ease;
}

.wc-filter-dropdown-wrapper .wc-filter-dropdown-menu.open+.wc-filter-dropdown-btn svg {
    transform: rotate(180deg);
}

/* Filter Sidebar Popup */
.wc-filter-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -400px;
    width: 400px;
    height: 100vh !important;
    background: white !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 2147483647 !important;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.wc-filter-sidebar.open {
    left: 0;
}

.wc-filter-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.wc-filter-sidebar-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.wc-filter-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-filter-close:hover {
    color: #333;
}

.wc-filter-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.wc-filter-group {
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.wc-filter-group:last-child {
    border-bottom: none;
}

.wc-filter-group h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.wc-filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wc-filter-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.wc-filter-option:last-child {
    border-bottom: none;
}

.wc-filter-option input[type="checkbox"],
.wc-filter-option input[type="radio"] {
    margin-right: 10px;
    margin-top: 0;
}

.wc-filter-label {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.wc-filter-count {
    color: #666;
    font-size: 12px;
    margin-left: 10px;
}

.wc-filter-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.wc-filter-sidebar-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    display: flex;
    gap: 10px;
}

.wc-filter-apply,
.wc-filter-clear {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.wc-filter-apply {
    background: #0073aa;
    color: white;
}

.wc-filter-apply:hover {
    background: #005a87;
}

.wc-filter-clear {
    background: #f1f1f1;
    color: #333;
}

.wc-filter-clear:hover {
    background: #e1e1e1;
}

/* Overlay */
.wc-filter-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 2147483646 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.wc-filter-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wc-filter-sidebar {
        width: 100%;
        right: -100%;
    }

    .wc-horizontal-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .wc-filter-toggle-btn,
    .wc-filter-dropdown-btn {
        justify-content: center;
        width: 100%;
    }
}

/* Legacy sidebar styles for fallback */
.wc-custom-filter-widget {
    margin-bottom: 30px;
}

.wc-custom-filter-widget .widgettitle {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.wc-custom-filter-widget .woocommerce-widget-layered-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wc-custom-filter-widget .woocommerce-widget-layered-nav-list__item {
    margin-bottom: 8px;
    padding: 0;
}

.wc-custom-filter-widget .woocommerce-widget-layered-nav-list__item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    padding: 4px 0;
}

.wc-custom-filter-widget input[type="checkbox"],
.wc-custom-filter-widget input[type="radio"] {
    margin-right: 8px;
    margin-top: 0;
}

.wc-custom-filter-widget .count {
    margin-left: auto;
    color: #666;
    font-size: 12px;
}

/* Fo
rce sidebar to appear on top of everything */
.wc-filter-sidebar {
    isolation: isolate !important;
    transform: translateZ(0) !important;
}

.wc-filter-sidebar.open {
    left: 0 !important;
    transform: translateZ(0) !important;
}

/* Ensure overlay covers everything */
.wc-filter-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateZ(0) !important;
}

/* Additional z-index overrides for common theme elements */
body.wc-filter-open {
    overflow: hidden !important;
}

/* Force positioning context */
.wc-filter-sidebar,
.wc-filter-overlay {
    will-change: transform !important;
    backface-visibility: hidden !important;
}

/* Clean sidebar styling */
.wc-filter-sidebar.open {
    left: 0 !important;
}