/* Стили для модуля фильтров и категорий - Улучшенная версия */

.product-filter-block {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Панель фильтров сверху */
.filter-panel {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.filter-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #ee5a6f, #c44569, #a55eea);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.filter-group {
    flex: 1;
    min-width: 220px;
    position: relative;
}

.filter-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #2d3436;
    padding-bottom: 12px;
    border-bottom: 3px solid transparent;
    background: linear-gradient(90deg, #ff6b6b, #ee5a6f) no-repeat;
    background-size: 0% 3px;
    background-position: left bottom;
    transition: background-size 0.3s ease;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group:hover .filter-title {
    background-size: 100% 3px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 15px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.filter-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.1), rgba(238, 90, 111, 0.1));
    transition: width 0.3s ease;
}

.filter-option:hover::before {
    width: 100%;
}

.filter-option:hover {
    background: rgba(255, 107, 107, 0.08);
    border-color: rgba(255, 107, 107, 0.3);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
}

.filter-input {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #ff6b6b;
    position: relative;
    z-index: 1;
}

.filter-input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.filter-input[type="radio"]:checked {
    border-color: #ff6b6b;
    background: #fff;
}

.filter-input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 107, 107, 0);
    }
}

.filter-input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.filter-input[type="checkbox"]:checked {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
}

.filter-input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    font-size: 14px;
    font-weight: bold;
    animation: checkmark 0.3s ease forwards;
}

@keyframes checkmark {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-45deg);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2) rotate(5deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}

.filter-label {
    font-size: 15px;
    color: #2d3436;
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 1;
    font-weight: 500;
    transition: color 0.3s ease;
}

.filter-option:hover .filter-label {
    color: #ff6b6b;
}

.filter-reset-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    align-self: flex-end;
    margin-top: auto;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.filter-reset-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.filter-reset-btn:hover::before {
    width: 300px;
    height: 300px;
}

.filter-reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

.filter-reset-btn:active {
    transform: translateY(0);
}

/* Обертка контента */
.content-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Боковая панель категорий */
.categories-sidebar {
    width: 280px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.categories-sidebar::-webkit-scrollbar {
    width: 6px;
}

.categories-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.categories-sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    border-radius: 10px;
}

.categories-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 25px 0;
    color: #2d3436;
    padding-bottom: 15px;
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, #ff6b6b, #ee5a6f) 1;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.categories-title::after {
    content: '🌸';
    position: absolute;
    right: 0;
    font-size: 20px;
}

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 10px;
}

.category-link {
    display: block;
    padding: 14px 18px;
    color: #636e72;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.category-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    transform-origin: bottom;
}

.category-link:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(238, 90, 111, 0.1));
    color: #ff6b6b;
    padding-left: 25px;
    border-color: rgba(255, 107, 107, 0.2);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
}

.category-link:hover::before {
    transform: scaleY(1);
}

.category-link.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    transform: scale(1.02);
    border-color: transparent;
}

.category-link.active::before {
    display: none;
}

/* Контейнер товаров */
.products-container {
    flex: 1;
    min-width: 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08), 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    animation: cardAppear 0.6s ease-out forwards;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.05), rgba(238, 90, 111, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.product-card:hover::before {
    opacity: 1;
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(255, 107, 107, 0.2), 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card:hover .product-image {
    transform: scale(1.05);
    transition: transform 0.4s ease;
}

.product-info {
    padding: 20px;
    position: relative;
}

.product-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #2d3436;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.product-card:hover .product-name {
    color: #ff6b6b;
}

.product-price {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    display: inline-block;
    position: relative;
}

.product-price::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff6b6b, #ee5a6f);
    transition: width 0.3s ease;
}

.product-card:hover .product-price::after {
    width: 100%;
}

.products-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #636e72;
    font-size: 18px;
    font-weight: 500;
}

.categories-loading {
    text-align: center;
    padding: 20px;
    color: #636e72;
    font-size: 14px;
    font-style: italic;
}

.products-loading::before {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
    vertical-align: middle;
}

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

.products-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #636e72;
    font-size: 20px;
    font-weight: 500;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(248, 249, 250, 0.8));
    border-radius: 20px;
    border: 2px dashed #ddd;
}

.products-empty::before {
    content: "🌺";
    display: block;
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Адаптивность */
@media (max-width: 1024px) {
    .content-wrapper {
        flex-direction: column;
    }

    .categories-sidebar {
        width: 100%;
        position: static;
        max-height: none;
    }

    .categories-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .category-item {
        margin-bottom: 0;
        flex: 1;
        min-width: 150px;
    }

    .category-link {
        padding: 12px 18px;
        white-space: nowrap;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .product-filter-block {
        padding: 20px 15px;
    }

    .filter-panel {
        flex-direction: column;
        gap: 25px;
        padding: 25px 20px;
        border-radius: 15px;
    }

    .filter-group {
        width: 100%;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }

    .categories-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .filter-options {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .filter-option {
        flex: 1;
        min-width: 140px;
        padding: 10px 12px;
    }

    .filter-label {
        font-size: 14px;
    }

    .product-card {
        border-radius: 15px;
    }

    .product-image {
        height: 220px;
    }

    .product-name {
        font-size: 16px;
    }

    .product-price {
        font-size: 20px;
    }
}

/* Дополнительные эффекты */
.filter-panel,
.categories-sidebar,
.product-card {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Улучшенная типографика */
.product-filter-block * {
    box-sizing: border-box;
}

/* Плавные переходы для всех интерактивных элементов */
.filter-option,
.category-link,
.filter-reset-btn,
.product-card {
    will-change: transform;
}
