/* Filter Toggle Button */
.filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid #ddd;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.filters-toggle:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

.filter-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.filters-toggle.active .filter-icon {
    transform: rotate(45deg);
}

/* Filter Drawer */
.filters-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.filters-drawer.active {
    visibility: visible;
    opacity: 1;
}

.filters-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.filters-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 400px;
    height: 100%;
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.filters-drawer.active .filters-content {
    transform: translateX(0);
}

/* Filter Header */
.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
}

.filters-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
}

.filters-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filters-close:hover {
    color: #000;
}

/* Filter Body */
.filters-body {
    flex: 1;
    padding: 0;
    overflow-y: auto;
}

.filter-section {
    border-bottom: 1px solid #eee;
    padding: 25px 30px;
}

.filter-section h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter Search */
.filter-search {
    margin-bottom: 15px;
}

.filter-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Filter Options */
.filter-options {
    max-height: 200px;
    overflow-y: auto;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s ease;
}

.filter-option:hover {
    color: #666;
}

.filter-option input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 1px solid #ddd;
    border-radius: 2px;
    position: relative;
    transition: all 0.2s ease;
}

.filter-option input[type="checkbox"]:checked + .checkmark {
    background: #000;
    border-color: #000;
}

.filter-option input[type="checkbox"]:checked + .checkmark:after {
    content: '✓';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 10px;
}

/* Color Options */
.color-option {
    align-items: center;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #ddd;
    margin-right: 8px;
}

.color-option input[type="checkbox"]:checked + .color-swatch {
    border: 2px solid #000;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000;
}

/* Size Options */
.size-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
}

.size-option {
    flex-direction: column;
    text-align: center;
}

.size-box {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.size-option input[type="checkbox"]:checked + .size-box {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* Price Range */
.price-range-container {
    padding: 10px 0;
}

.price-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.price-inputs input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.price-inputs span {
    font-weight: 500;
}

.price-slider {
    position: relative;
    height: 6px;
    background: #eee;
    border-radius: 3px;
}

.price-slider input[type="range"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
}

.price-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #000;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
}

/* Filter Footer */
.filters-footer {
    padding: 20px 30px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.apply-filters-btn,
.clear-filters-btn {
    width: 100%;
    padding: 12px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.apply-filters-btn {
    background: #000;
    color: #fff;
}

.apply-filters-btn:hover {
    background: #333;
}

.clear-filters-btn {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
}

.clear-filters-btn:hover {
    background: #f5f5f5;
}

/* Responsive */
@media (max-width: 768px) {
    .filters-content {
        width: 100%;
    }
}

/* Active Filters - Enhanced Styling */
.active-filters-container {
    width: 100% !important;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin: 15px 0 25px 0;
    padding: 20px;
    animation: fadeIn 0.3s ease-in;
}



.active-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row !important;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.active-filters-label {
    font-weight: 600;
    font-size: 14px;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.active-filter-item {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 25px;
    padding: 8px 15px;
    font-size: 13px;
    color: #495057;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    position: relative;
}

.active-filter-item:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.filter-type {
    font-weight: 600;
    margin-right: 4px;
    color: #6c757d;
}

.color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    margin-right: 6px;
    flex-shrink: 0;
}

.remove-filter {
    background: none;
    border: none;
    margin-left: 10px;
    cursor: pointer;
    font-size: 18px;
    color: #6c757d;
    padding: 0;
    line-height: 1;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.remove-filter:hover {
    background: #dc3545;
    color: #ffffff;
    transform: scale(1.1);
}

.clear-all-filters {
    background: #dc3545;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 12px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: 600;
    transition: all 0.2s ease;
}

.clear-all-filters:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220,53,69,0.3);
}

/* Special styling for different filter types */
.brand-filter {
    border-left: 4px solid #007bff;
}

.color-filter {
    border-left: 4px solid #28a745;
}

.size-filter {
    border-left: 4px solid #ffc107;
}

.price-filter {
    border-left: 4px solid #6f42c1;
}

/* Responsive */
@media (max-width: 768px) {
 
    
    .active-filters-list {
        gap: 8px;
    }
    
    .active-filter-item {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 365px) {
    .active-filters-header {
        flex-direction: column !important;
       
    }
    
}

/* Ensure filter button is always visible */
.filters-toggle {
    position: relative;
    z-index: 1;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Filter integration with breadcrumb */
.filters-breadcrumb-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
    padding: 15px 0;
}

.woocommerce-breadcrumb {
    flex: 1;
    min-width: 200px;
}

/* Loading state for filter changes */
.filters-loading {
    opacity: 0.6;
    pointer-events: none;
}

.filters-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Ensure remove buttons are clickable */
.remove-filter {
    background: none;
    border: none;
    margin-left: 10px;
    cursor: pointer !important;
    font-size: 18px;
    color: #6c757d;
    padding: 0;
    line-height: 1;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    pointer-events: auto !important;
    z-index: 10;
    position: relative;
}

.remove-filter:hover {
    background: #dc3545 !important;
    color: #ffffff !important;
    transform: scale(1.1);
}

.clear-all-filters {
    background: #dc3545 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 12px;
    cursor: pointer !important;
    text-transform: uppercase;
    font-weight: 600;
    transition: all 0.2s ease;
    pointer-events: auto !important;
}

.clear-all-filters:hover {
    background: #c82333 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220,53,69,0.3);
}

/* Make sure the filter items don't block clicks */
.active-filter-item {
    pointer-events: auto;
    position: relative;
}

/* No products found styling */
.active-filters-container.no-products-found {
    border-color: #ffc107;
    background: #fff8e1;
}

.no-products-message {
    font-size: 11px;
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 12px;
    padding: 4px 8px;
    font-weight: 500;
}

.no-products-suggestion {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.no-products-suggestion p {
    margin: 0;
    font-size: 12px;
    color: #6c757d;
}

.clear-all-filters-inline {
    background: none;
    border: none;
    color: #dc3545;
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    font-weight: 600;
}

.clear-all-filters-inline:hover {
    color: #c82333;
    text-decoration: none;
}

/* Remove filter buttons (small with minimal padding) */
.remove-filter {
    display: inline-block;
    padding: 2px 4px !important;
    margin-left: 5px;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    border-radius: 2px;
    font-size: 12px;
    line-height: 1;
    user-select: none;
    transition: all 0.2s ease;
}

.remove-filter:hover {
    background: #e74c3c;
    color: white;
}

/* Clear filters buttons */
.clear-filters-btn,
.clear-all-filters,
.clear-all-filters-inline {
    display: inline-block;
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    user-select: none;
    transition: all 0.2s ease;
}

.clear-filters-btn:hover,
.clear-all-filters:hover,
.clear-all-filters-inline:hover {
    background: #c0392b;
}

/* Inline clear button (smaller) */
.clear-all-filters-inline {
    padding: 4px 8px;
    font-size: 11px;
    text-transform: none;
}

/* Fix color option styling */
.color-options .filter-option {
    margin: 5px 8px 5px 0 !important; /* Reduce margins */
    padding: 0 !important;
}

.color-options .filter-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.color-options .color-swatch {
    display: inline-block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

/* Show border when selected */
.color-options .filter-option input[type="checkbox"]:checked + .color-swatch {
    border: 3px solid #000 !important;
    box-shadow: 0 0 0 1px white inset;
}

.color-options .filter-option input[type="checkbox"]:checked + .color-swatch::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

/* Hover effect */
.color-options .color-swatch:hover {
    border: 2px solid #666 !important;
    transform: scale(1.1);
}

/* Fix filter section spacing */
.filter-section {
    margin-bottom: 20px !important;
    padding: 15px 0 !important;
}

.filter-options {
    margin-top: 10px !important;
}

/* Reduce overall margins in drawer */
.filters-body {
    padding: 15px !important;
}

.filters-body .filter-section:last-child {
    margin-bottom: 0 !important;
}

/* Keep original button styling for drawer buttons */
.clear-filters-btn {
    /* Keep your existing button styles */
}

/* Style divs in active filters area only */
.active-filters-container .remove-filter {
    display: inline-block;
    padding: 2px 4px !important;
    margin-left: 5px;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    border-radius: 2px;
    font-size: 12px;
    line-height: 1;
    user-select: none;
    transition: all 0.2s ease;
}

.active-filters-container .remove-filter:hover {
    background: #e74c3c;
    color: white;
}

.active-filters-container .clear-all-filters,
.active-filters-container .clear-all-filters-inline {
    display: inline-block;
    padding: 6px 12px;
    background: #e74c3c;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    user-select: none;
    transition: all 0.2s ease;
}

.active-filters-container .clear-all-filters:hover,
.active-filters-container .clear-all-filters-inline:hover {
    background: #c0392b;
}

/* Product count styling */
.filter-option small {
    color: #999;
    font-size: 10px;
    margin-left: 4px;
    font-weight: normal;
}

.size-box {
    position: relative;
}

.size-box small {
    position: absolute;
    bottom: -2px;
    right: 2px;
    font-size: 8px;
    color: #666;
    background: rgba(255,255,255,0.8);
    padding: 1px 2px;
    border-radius: 2px;
}

/* Hide count when checked to avoid clutter */
.filter-option input[type="checkbox"]:checked + .checkmark + * small,
.filter-option input[type="checkbox"]:checked + .color-swatch + * small,
.filter-option input[type="checkbox"]:checked + .size-box small {
    display: none;
}