/* SKAD Wheels Filter Styles - Стилизация в стиле skad.ru */

/* Верхние фильтры */
.skad-top-filters {
    background: #ffffff;
    padding: 25px 30px;
    margin-bottom: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 25px;
    border: 1px solid #e8e8e8;
}

.skad-per-page-selector {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skad-per-page-selector label {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 15px;
}

.skad-per-page-selector select {
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
    cursor: pointer;
    min-width: 90px;
    font-weight: 500;
    transition: all 0.25s ease;
}

.skad-per-page-selector select:hover {
    border-color: #0066cc;
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.15);
}

.skad-per-page-selector select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.skad-filter-title {
    font-weight: 700;
    margin-bottom: 0;
    font-size: 18px;
    color: #1a1a1a;
    letter-spacing: -0.3px;
}

.skad-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skad-filter-btn {
    padding: 12px 24px;
    border: 2px solid #e0e0e0;
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1a1a1a;
    position: relative;
    overflow: hidden;
}

.skad-filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.skad-filter-btn:hover:not(:disabled)::before {
    left: 100%;
}

.skad-filter-btn:hover:not(:disabled) {
    border-color: #0066cc;
    background: #0066cc;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.25);
}

.skad-filter-btn.active {
    background: #0066cc;
    border-color: #0066cc;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.skad-filter-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.skad-filter-btn .count {
    font-size: 13px;
    opacity: 0.85;
    margin-left: 6px;
    font-weight: 500;
}

.skad-filter-btn.active .count {
    opacity: 0.95;
}

.skad-clear-filter {
    background: #ff4444 !important;
    border-color: #ff4444 !important;
    color: #fff !important;
}

.skad-clear-filter:hover {
    background: #e63939 !important;
    border-color: #e63939 !important;
    box-shadow: 0 4px 8px rgba(255, 68, 68, 0.25) !important;
}

/* Боковые фильтры */
.skad-sidebar-filters {
    background: #ffffff;
    padding: 18px;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.skad-sidebar-filters-wrapper {
    position: sticky;
    top: 20px;
    align-self: flex-start;
    width: 10%;
    flex: 0 0 10%;
    min-width: 200px;
    max-width: 250px;
}

.skad-sidebar-filters-container {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.skad-sidebar-filters-container > .skad-sidebar-filters-wrapper {
    width: 10%;
    flex: 0 0 10%;
}

.skad-sidebar-filters-container > .products,
.skad-sidebar-filters-container > .woocommerce-products-header,
.skad-sidebar-filters-container > div:not(.skad-sidebar-filters-wrapper) {
    flex: 1;
    width: auto;
}

.skad-filter-section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1a1a1a;
    border-bottom: 2px solid #0066cc;
    padding-bottom: 8px;
    letter-spacing: -0.3px;
}

.skad-filter-group {
    margin-bottom: 18px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e8e8e8;
}

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

.skad-filter-group-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1a1a1a;
    letter-spacing: -0.2px;
}

.skad-filter-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.skad-filter-scrollable {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

.skad-filter-scrollable::-webkit-scrollbar {
    width: 6px;
}

.skad-filter-scrollable::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.skad-filter-scrollable::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.skad-filter-scrollable::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.skad-filter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.skad-filter-item:hover {
    background: #f8f9fa;
    border-color: #e0e0e0;
    transform: translateX(1px);
}

.skad-filter-item.active {
    background: #e8f4fd;
    border-color: #0066cc;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 102, 204, 0.1);
}

.skad-filter-item input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.skad-filter-item .filter-label {
    flex: 1;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.3;
}

.skad-filter-item .filter-count {
    color: #666;
    font-size: 11px;
    margin-left: 8px;
    font-weight: 500;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
}

.skad-filter-item.active .filter-count {
    background: #0066cc;
    color: #fff;
}

/* Фильтр цены */
.skad-price-filter {
    margin-top: 10px;
}

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

.skad-price-inputs input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.25s ease;
}

.skad-price-inputs input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.skad-price-inputs input:hover {
    border-color: #b0b0b0;
}

.price-separator {
    color: #888;
    font-weight: 500;
}

/* Кнопки действий */
.skad-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.skad-filter-actions .button {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.skad-apply-filter {
    background: #0066cc;
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.25);
}

.skad-apply-filter:hover {
    background: #0052a3;
    box-shadow: 0 6px 12px rgba(0, 102, 204, 0.35);
    transform: translateY(-1px);
}

.skad-reset-filter {
    background: #6c757d;
    color: #fff;
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.25);
}

.skad-reset-filter:hover {
    background: #5a6268;
    box-shadow: 0 6px 12px rgba(108, 117, 125, 0.35);
    transform: translateY(-1px);
}

.skad-filter-help {
    margin-top: 12px;
    text-align: center;
}

.skad-help-link {
    color: #0066cc;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.skad-help-link:hover {
    color: #0052a3;
    text-decoration: underline;
}

/* Мобильная версия боковых фильтров */
.skad-sidebar-filters-mobile {
    margin-bottom: 30px;
}

.skad-sidebar-filters-mobile .skad-sidebar-filters {
    border: 1px solid #ddd;
}

/* Дополнительные улучшения в стиле skad.ru */
.skad-filter-buttons {
    gap: 12px;
}

.skad-filter-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

.skad-filter-item input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #0066cc;
}

.skad-filter-item input[type="radio"]:checked {
    accent-color: #0066cc;
}

.price-separator {
    color: #666;
    font-weight: 600;
    font-size: 16px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .skad-top-filters {
        padding: 20px;
        gap: 15px;
    }
    
    .skad-filter-buttons {
        justify-content: center;
        gap: 8px;
    }
    
    .skad-filter-btn {
        flex: 1;
        min-width: 70px;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .skad-per-page-selector {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }
    
    .skad-sidebar-filters {
        margin-top: 20px;
        padding: 20px;
    }
    
    .skad-sidebar-filters-mobile {
        display: block !important;
    }
    
    /* Скрываем сайдбар на мобильных, если есть мобильная версия */
    body:not(.has-sidebar) .skad-sidebar-filters {
        display: none;
    }
    
    .skad-filter-section-title {
        font-size: 20px;
    }
    
    .skad-filter-group-title {
        font-size: 16px;
    }
}

/* Состояние загрузки */
.skad-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

/* Скрытые товары */
.skad-filtered-out {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Показанные товары */
.skad-filtered-in {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.skad-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #0073aa;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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