/**
 * Shop Filters Styles
 * Styles for sidebar filters, price slider, and infinite scroll
 * 
 * @package twind-xic
 */

/* Price Slider Styles */
.price-slider-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid theme('colors.primary-one.500');
    border-radius: 50%;
    cursor: grab;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.price-slider-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.price-slider-handle:active {
    cursor: grabbing;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Dark mode slider handle */
.dark .price-slider-handle {
    background: theme('colors.gray.700');
    border-color: theme('colors.primary-one.400');
}

/* Sidebar filters scrollbar */
.shop-filters-sidebar::-webkit-scrollbar {
    width: 6px;
}

.shop-filters-sidebar::-webkit-scrollbar-track {
    background: theme('colors.gray.100');
    border-radius: 3px;
}

.dark .shop-filters-sidebar::-webkit-scrollbar-track {
    background: theme('colors.gray.700');
}

.shop-filters-sidebar::-webkit-scrollbar-thumb {
    background: theme('colors.gray.400');
    border-radius: 3px;
}

.dark .shop-filters-sidebar::-webkit-scrollbar-thumb {
    background: theme('colors.gray.600');
}

.shop-filters-sidebar::-webkit-scrollbar-thumb:hover {
    background: theme('colors.gray.500');
}

.dark .shop-filters-sidebar::-webkit-scrollbar-thumb:hover {
    background: theme('colors.gray.500');
}

/* Mobile drawer animation */
#mobile-filters-content {
    box-shadow: -4px 0 6px -1px rgba(0, 0, 0, 0.1), -2px 0 4px -1px rgba(0, 0, 0, 0.06);
}

/* Loading indicator animation */
#loading-indicator svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Active filter tags animation */
.remove-filter-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 18px;
    line-height: 1;
    font-weight: bold;
}

/* Smooth transitions for products */
#products-container {
    transition: opacity 0.3s ease;
}

/* Mobile filters button pulse animation */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-one-rgb), 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(var(--primary-one-rgb), 0);
    }
}

#mobile-filters-toggle {
    animation: pulse 2s infinite;
}

#mobile-filters-toggle:hover {
    animation: none;
}

/* Checkbox custom styling */
.filter-checkbox {
    cursor: pointer;
}

.filter-checkbox:checked {
    background-color: theme('colors.primary-one.600');
    border-color: theme('colors.primary-one.600');
}

.dark .filter-checkbox:checked {
    background-color: theme('colors.primary-one.500');
    border-color: theme('colors.primary-one.500');
}

/* Select dropdown styling */
select#filter-orderby {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.dark select#filter-orderby {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%9ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

/* No products animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.no-products-found {
    animation: fadeIn 0.5s ease;
}
