/* tep-product-filters/assets/css/filters.css */

.tep-filters-wrapper {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: none;
    font-family: inherit;
}

.tep-filters-desktop-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 20px 0;
    text-transform: uppercase;
}

.tep-filters-header-mobile {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.tep-filters-header-mobile h3 {
    margin: 0;
    font-size: 18px;
}

.tep-filters-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

/* Active Filters Display */
.tep-filters-active {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tep-filters-active:empty {
    display: none;
    margin-bottom: 0;
}

.tep-active-filter-btn {
    display: inline-flex;
    align-items: center;
    background: #fff;
    color: #4b5563;
    border: 1px solid #d1d5db;
    padding: 6px 14px 6px 8px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.tep-active-filter-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #ef4444;
}

.tep-active-filter-btn span.tep-active-filter-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #f3f4f6;
    border-radius: 50%;
    margin-right: 6px;
    font-size: 14px;
    font-weight: bold;
    color: #9ca3af;
    transition: all 0.2s ease;
}

.tep-active-filter-btn:hover span.tep-active-filter-icon {
    background: #fee2e2;
    color: #ef4444;
}

/* Filter Groups */
.tep-filter-group {
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

.tep-filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.tep-filter-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tep-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.tep-filter-toggle::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 2px solid #111;
    border-bottom: 2px solid #111;
    transform: translateY(2px) rotate(225deg); /* Points UP */
    transition: transform 0.3s ease;
}

.tep-collapsed .tep-filter-toggle::after {
    transform: translateY(-2px) rotate(45deg); /* Points DOWN */
}

.tep-collapsed .tep-filter-options {
    display: none;
}

.tep-filter-options {
    margin-top: 15px;
}

/* Filter List */
.tep-filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.tep-filter-list li {
    margin-bottom: 8px;
}

.tep-filter-list label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #444;
}

.tep-filter-list input[type="checkbox"] {
    margin-right: 8px;
}

.tep-filter-count {
    color: #999;
    font-size: 12px;
    margin-left: 4px;
}

/* Swatches */
.tep-filter-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tep-swatch-label {
    cursor: pointer;
    position: relative;
    display: inline-block;
}

.tep-swatch-label input {
    display: none;
}

.tep-swatch-color {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1), inset 0 0 0 1px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

/* Hover Effect */
.tep-swatch-label:hover .tep-swatch-color {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15), inset 0 0 0 1px rgba(0,0,0,0.05);
}

/* Active/Checked Effect */
.tep-swatch-label input:checked + .tep-swatch-color {
    border-color: #333;
    padding: 2px;
    background-clip: content-box;
    transform: scale(1.1);
}

/* Custom CSS Tooltip */
.tep-swatch-label::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: #222;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.tep-swatch-label::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    border-width: 5px;
    border-style: solid;
    border-color: #222 transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10;
    pointer-events: none;
}

.tep-swatch-label:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

.tep-swatch-label:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Mobile Overlay */
.tep-filters-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* Mobile Slide-out */
@media (max-width: 768px) {
    .tep-filters-wrapper {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100vh;
        overflow-y: auto;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        background: #fff;
        padding: 20px;
        border-radius: 0;
    }

    .tep-filters-desktop-title {
        display: none;
    }

    .tep-filters-wrapper.tep-mobile-open {
        left: 0;
    }

    .tep-filters-header-mobile {
        display: flex;
    }

    .tep-filters-overlay.tep-active {
        display: block;
    }
}

/* Mobile Filter Button */
.tep-mobile-filter-btn {
    display: none;
}

@media (max-width: 768px) {
    .tep-mobile-filter-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: #fff;
        border: 1px solid #eee;
        color: #333;
        font-size: 13px;
        font-weight: 600;
        text-transform: uppercase;
        padding: 8px 16px;
        cursor: pointer;
        border-radius: 4px;
        
        
        position: relative;
        z-index: 10;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }
    
    .tep-mobile-filter-btn svg {
        width: 14px;
        height: 14px;
    }
}


/* Force hide WooCommerce category grids when a filter is active */
body.tep-filters-active-state li.product-category,
body.tep-filters-active-state .product-category {
    display: none !important;
}

/* Force hide the entire category wrapper section when a filter is active */
body.tep-filters-active-state .tepp-categories-section {
    display: none !important;
}
