/**
 * Product Filters Sidebar Styles
 * Roxy&Rich Theme
 */

/* Shop Layout with Sidebar */
.roxyrich-shop-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.shop-breadcrumb {
    margin-bottom: 30px;
}

.shop-container {
    display: flex;
    gap: 40px;
}

.shop-sidebar {
    flex: 0 0 280px;
    width: 280px;
}

.shop-content {
    flex: 1;
    min-width: 0;
}

.products-grid-wrapper {
    width: 100%;
}

/* Filter Sidebar */
.roxyrich-filters-sidebar {
    background: #fff;
    padding-right: 25px;
    border-right: 1px solid #979797;
    position: sticky;
    top: 20px;
}

/* Filter Section */
.filter-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-title {
    font-size: 17px;
    font-weight: 500;
    color: #000;
    margin: 0 0 25px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 25px;
    position: relative;
}

/* Pink underline for section titles */
.filter-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 4px;
    background-color: #EA148C;
}

/* Filter List */
.filter-list {
    list-style: none;
    margin: 0;
    padding: 0; /* Add left padding for dot indicator */
}

.filter-list li {
    height: 45px;
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.filter-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-list label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: color 0.3s ease;
}

.filter-label {
    line-height: normal;
}

.filter-list label:hover {
    color: #EA148C;
}

/* Checkboxes */
.filter-checkbox {
    display: none; /* Hide checkboxes */
}

/* Category Images */
.filter-category-image {
    width: 25px;
    height: 25px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
    vertical-align: middle;
}

/* Active state - Add dot indicator */
.filter-list li {
    position: relative;
}

.filter-list li::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

.filter-checkbox:checked ~ label::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #EA148C;
}

.filter-list label {
    position: relative;
}

.filter-checkbox:checked ~ .filter-label {
    color: #EA148C;
    font-weight: 600;
}

.star-icon {
    color: #ffd700;
    font-size: 18px;
    margin-right: 8px;
}

/* Range Slider */
.range-slider-container {
    padding: 20px 0;
}

.range-values {
    margin-bottom: 15px;
    text-align: left;
    font-size: 14px;
    font-weight: 400;
    color: #333;
}

.dual-range-wrapper {
    position: relative;
    height: 2px;
    display: flex;
    align-items: center;
    background: linear-gradient(to right, #ddd 0%, #ddd 0%, #000 0%, #000 100%, #ddd 100%, #ddd 100%);
    background-size: 100% 2px;
    background-repeat: no-repeat;
    background-position: center;
}

.weight-range {
    position: absolute;
    width: 100%;
    height: 2px;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    top: -8px;
}

.weight-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #EA148C;
    cursor: pointer;
    pointer-events: all;
    border: 3px solid #000000;
    box-shadow: none;
    margin-top: 0;
}

.weight-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #EA148C;
    cursor: pointer;
    pointer-events: all;
    border: 3px solid #000000;
    box-shadow: none;
}

.weight-range::-webkit-slider-runnable-track {
    width: 100%;
    height: 2px;
    background: transparent;
    border-radius: 0;
}

.weight-range::-moz-range-track {
    width: 100%;
    height: 2px;
    background: transparent;
    border-radius: 0;
}

/* Sale Checkbox */
.sale-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.sale-checkbox-label:hover {
    color: #EA148C;
}

/* Clear Filters Button */
.filter-actions {
    margin-top: 20px;
}

.clear-filters-btn {
    width: 100%;
    padding: 12px 20px;
    background: #f5f5f5;
    border: 1px solid #EA148C;
    border-radius: 5px;
    color: #EA148C;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clear-filters-btn:hover {
    background: #EA148C;
    color: #fff;
}

/* Loading State */
ul.products.loading {
    position: relative;
    pointer-events: none;
}

ul.products.loading::after {
    content: "Loading...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 600;
    color: #EA148C;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Hide default WooCommerce pagination completely */
.woocommerce-pagination {
    display: none !important;
}

/* Load More Button */
.roxyrich-load-more-wrapper {
    text-align: center;
    margin: 30px 0 20px;
    padding: 0;
}

.roxyrich-load-more-btn {
    display: inline-block;
        padding: 10px 24px !important;
        background: transparent;
        color: #000;
        font-size: 12px !important;
        font-weight: 500 !important;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border: 1px solid #000;
        border-radius: 3px;
        cursor: pointer;
        transition: all 0.25s ease;
}

.roxyrich-load-more-btn:hover {
    background: #000;
    color: #fff;
}

.roxyrich-load-more-btn:disabled {
    border-color: #ddd;
    color: #999;
    cursor: not-allowed;
    opacity: 0.5;
}

.roxyrich-load-more-btn.loading {
    position: relative;
    color: transparent;
    border-color: #000;
}

.roxyrich-load-more-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border: 2px solid #000;
    border-top-color: transparent;
    border-radius: 50%;
    animation: roxyrich-spin 0.6s linear infinite;
}

@keyframes roxyrich-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Hide Load More button when no more products */
.roxyrich-load-more-wrapper.hidden {
    display: none;
}

/* Mobile Filter Toggle Button */
.roxyrich-filter-toggle {
    display: none !important;
    position: fixed !important;
    bottom: 20px !important;
    left: 20px !important;
    z-index: 999 !important;
    padding: 12px 20px !important;
    background: #000 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 25px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.3s ease !important;
    line-height: 1 !important;
}

.roxyrich-filter-toggle:hover {
    background: #EA148C !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

.roxyrich-filter-toggle svg {
    width: 16px !important;
    height: 16px !important;
    margin-right: 8px !important;
    vertical-align: middle !important;
    display: inline-block !important;
}

/* Mobile Filters Overlay */
.roxyrich-filters-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Don't intercept clicks when not active */
}

.roxyrich-filters-overlay.active {
    opacity: 1;
    pointer-events: auto; /* Allow clicks when active */
}

/* Mobile Filters Close Button */
.roxyrich-filters-close {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #000;
    cursor: pointer;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    padding: 0;
    transition: color 0.2s ease;
}

.roxyrich-filters-close:hover {
    color: #EA148C;
}

/* Responsive */
@media (max-width: 1024px) {
    .shop-container {
        flex-direction: column;
    }

    .shop-sidebar {
        flex: 1;
        width: 100%;
    }

    .roxyrich-filters-sidebar {
        position: static;
        margin-bottom: 30px;
    }
}

@media (max-width: 1024px) {
    .roxyrich-shop-wrapper {
        padding: 20px 15px;
    }

    .shop-container {
        gap: 20px;
    }

    .filter-title {
        font-size: 13px;
    }

    .filter-list label {
        font-size: 13px;
    }

    /* Show toggle button on tablet and mobile */
    .roxyrich-filter-toggle {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Show close button on tablet and mobile */
    .roxyrich-filters-close {
        display: block;
    }

    /* Show overlay on mobile only when active */
    .roxyrich-filters-overlay.active {
        display: block;
    }

    /* Hide sidebar by default on mobile */
    .shop-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100%;
        background: #fff;
        z-index: 9999;
        overflow-y: auto;
        transition: left 0.3s ease;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
    }

    .shop-sidebar.active {
        left: 0;
    }

    .roxyrich-filters-sidebar {
        position: relative;
        margin-bottom: 0;
        padding: 60px 25px 25px 25px;
        border-right: none;
        height: 100%;
    }

    /* Prevent body scroll when filters are open */
    body.filters-open {
        overflow: hidden;
    }
}
