
/* ===================== ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ ===================== */
:root {
    --silver-light: #f5f5f5;
    --silver-mid: #e0e0e0;
    --silver-dark: #b0b0b0;
    --silver-darker: #8a8a8a;
    --text-dark: #1b1b1b;
    --text-mid: #4b4b4b;
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.2);
    --shadow-lg: 0 25px 60px rgba(0,0,0,0.35);
    --transition-fast: 0.3s ease;
    --transition-mid: 0.5s ease;
}

/* ==================== ОСНОВНЫЕ СТИЛИ ==================== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%); /* светлый платиновый фон */
    background-attachment: fixed;
    color: #2b2b2b; /* контрастный тёмно-серый текст */
    overflow-x: hidden;
}

h2 {
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-align: center;
    background: linear-gradient(135deg, #4a4a4a 0%, #1a1a1a 100%); /* базовый темно-серебряный градиент */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.3), /* легкое сияние сверху */
                 0 4px 10px rgba(255, 255, 255, 0.2); /* более мягкое сияние вокруг */
    animation: fadeInDown 0.8s ease-out;
}
/* ==================== ОПТИМИЗИРОВАННЫЕ АНИМАЦИИ ==================== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==================== УТИЛИТЫ ==================== */
.hidden {
    display: none !important;
}

/* ==================== МОДАЛЬНОЕ ОКНО (СЕРЕБРЯНОЕ) ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* чуть мягче, чтобы светло смотрелось */
    z-index: 999;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #f9f9f9; /* светлое серебро */
    padding: 35px;
    border-radius: 24px;
    width: 500px;
    max-width: 92%;
    box-shadow: 0 20px 60px rgba(180, 185, 190, 0.4); /* мягкая платиновая тень */
    text-align: center;
    z-index: 1000;
    animation: scaleIn 0.3s ease-out;
    will-change: transform;
}

/* Заголовок */
.modal-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2b2b2b; /* контрастный темный текст */
    margin-bottom: 20px;
}

/* Изображение товара */
.modal-product-image-wrapper {
    width: 100%;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #e8ebee 0%, #cfd4d8 100%); /* платиновый градиент */
}

.modal-product-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.modal-product-image-wrapper img:hover {
    transform: scale(1.05);
}

/* Цена */
.modal-product-price {
    font-weight: 700;
    font-size: 1.3rem;
    color: #4a4a4a; /* темный серебряный текст */
    margin: 10px 0;
}

.modal-total-price {
    font-weight: 700;
    font-size: 1.5rem;
    /* background: linear-gradient(135deg, #d4af37 0%, #f0c674 100%); /* золотой для акцента */
    /* -webkit-text-fill-color: transparent;  */
    margin: 10px 0;
}

/* Количество */
.quantity-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 25px 0;
}

.quantity-btn {
    background: linear-gradient(135deg, #cfd4d8 0%, #aeb3b8 100%);
    color: #2b2b2b;
    border: 1px solid #bfc5ca;
    border-radius: 12px;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(180, 185, 190, 0.4);
}

.quantity-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(180, 185, 190, 0.6);
}

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

.quantity-controls input {
    width: 80px;
    height: 45px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
    border: 2px solid #cfd4d8;
    background: #f9f9f9;
    color: #2b2b2b;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quantity-controls input:focus {
    outline: none;
    border-color: #aeb3b8;
    box-shadow: 0 0 0 3px rgba(174, 179, 184, 0.3);
}

/* Кнопки модалки */
.modal-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 25px;
}

.modal-buttons button {
    flex: 1;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#confirmQuantity {
    background: linear-gradient(135deg, #d1d5db 0%, #a7b0ba 100%);
    color: #2b2b2b;
    border: 1px solid #bfc5ca;
    box-shadow: 0 4px 15px rgba(180, 185, 190, 0.4);
}

#confirmQuantity:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(180, 185, 190, 0.6);
    background: linear-gradient(135deg, #e2e6ea 0%, #c5ccd3 100%);
}

#cancelQuantity {
    background: #f0f3f6;
    color: #4a4a4a;
    border: 1px solid #d1d5db;
    box-shadow: 0 4px 15px rgba(180, 185, 190, 0.3);
}

#cancelQuantity:hover {
    transform: translateY(-2px);
    background: #d9dee3;
}

/* ==================== ПОИСК И ФИЛЬТРЫ ==================== */
.search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease-out;
}

.name-search-group {
    display: flex;
    width: 100%;
    max-width: 600px;
    gap: 12px;
}

/* ==================== ПОЛЯ ПОИСКА ==================== */
#searchInput,
#codeSearch {
    flex: 1;
    padding: 14px 20px;
    border-radius: 30px;
    border: 2px solid #c0c0c0; /* серебристый */
    outline: none;
    font-size: 15px;
    background: #f5f5f5; /* светло-серебристый фон */
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    color: #2f2f2f;
}

#searchInput:focus,
#codeSearch:focus {
    border: 2px solid #a8a8a8; /* тёмное серебро */
    box-shadow: 0 4px 15px rgba(160, 160, 160, 0.3);
    transform: translateY(-1px);
    background: #ffffff;
}
#codeSearch{
    width: 100%;
    max-width: 600px;
}

/* ==================== КНОПКИ ==================== */
#searchButton,
#resetFiltersButton {
    padding: 14px 28px;
    border-radius: 30px;
    border: 2px solid #bfbfbf;
    background: linear-gradient(135deg, #fafafa 0%, #dcdcdc 100%); /* серебристый градиент */
    color: #333;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
    box-shadow: 0 4px 15px rgba(150, 150, 150, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

#searchButton:hover,
#resetFiltersButton:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #ffffff 0%, #e6e6e6 100%);
    box-shadow: 0 6px 20px rgba(130, 130, 130, 0.5);
}

#searchButton:active,
#resetFiltersButton:active {
    transform: translateY(0);
}

/* ==================== ДРОПДАУНЫ ==================== */
.dropdown-section {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

.sort-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.custom-select {
    min-width: 220px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 30px;
    border: 2px solid #c0c0c0;
    appearance: none;
    background: #f5f5f5 
        url("data:image/svg+xml;utf8,<svg fill='%23333' height='20' viewBox='0 0 24 24' width='20'><path d='M7 10l5 5 5-5z'/></svg>") 
        no-repeat right 15px center;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    color: #333;
}

.custom-select:hover {
    border-color: #a8a8a8;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(160, 160, 160, 0.3);
}

.custom-select:focus {
    outline: none;
    border-color: #9b9b9b;
    box-shadow: 0 0 0 3px rgba(180, 180, 180, 0.3);
}

/* ===================== FOOTER ===================== */
footer.bg-dark {
    background: linear-gradient(135deg, var(--silver-dark) 0%, var(--text-dark) 100%) !important;
    color: var(--silver-light);
    margin-top: 5rem;
}

footer h3 {
    color: var(--silver-light);
    font-weight: 700;
}

footer a {
    color: var(--silver-mid);
    transition: all var(--transition-fast);
    position: relative;
    padding-left: 0;
}

footer a::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--silver-light);
    transition: width var(--transition-fast);
}

footer a:hover {
    color: var(--silver-light);
    padding-left: 8px;
}

footer a:hover::before {
    width: 100%;
}



/* ==================== КАРТОЧКИ ТОВАРОВ (ОПТИМИЗИРОВАНО) ==================== */
/* 🌤 Общий контейнер */
.product-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    padding: 20px;
    animation: fadeInUp 0.8s ease-out;
}

/* 💎 Карточка товара */
.product-card {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 1px solid #eceff3;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: scaleIn 0.5s ease-out backwards;
    will-change: transform, box-shadow;
}

/* ✨ Эффект подсветки при наведении */
.product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(240, 243, 248, 0.7), rgba(255, 255, 255, 0.5));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
    border-radius: 18px;
}

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

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(150, 160, 170, 0.25);
}

/* 🖼 Картинка */
.product-card img {
    width: 100%;
    height: 270px;
    object-fit: contain;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    transition: transform 0.4s ease;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%);
}

.product-card:hover img {
    transform: scale(1.05) rotate(-2deg); /* немного наклоняем влево */
}

/* 📦 Информация о товаре */
.product-info {
    padding: 5px 5px 18px;
    text-align: center;
    background: #fff;
    border-top: 1px solid #e2e5ea;
}

/* 🏷 Название */
.product-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: #1f1f1f; /* тёмно-графитовый, контрастный на белом */
    margin: 0 0 0px;
    /* line-height: 1.4; */
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 📖 Описание */
.product-info p {
    font-size: 12px;
    color: #5c6670; /* более глубокий серо-синий */
    margin: 0px 0;
    font-weight: 400;
}

/* 💰 Цена */
.product-info .price {
    font-weight: 700;
    font-size: 1rem;
    /* background: linear-gradient(135deg, #7a7f87 0%, #b0b5bb 100%); /* тёмное серебро к светлому */
    /* -webkit-text-fill-color: transparent;  */
    margin-top: 0px;
}

/* ==================== КНОПКА ДОБАВИТЬ В КОРЗИНУ ==================== */
.add-to-cart-btn {
    margin-top: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%); /* светлый серебряный */
    color: #2a2a2a;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.4s ease;
    box-shadow: 0 4px 12px rgba(200, 205, 210, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

/* 💎 Эффект свечения при наведении */
.add-to-cart-btn:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #ffffff 0%, #e9ecef 100%);
    box-shadow: 0 0 25px rgba(210, 220, 230, 0.9), 0 8px 25px rgba(180, 185, 190, 0.5);
}

/* ✨ Эффект “пробегающего блика” */
.add-to-cart-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 100%
    );
    transform: skewX(-25deg);
    transition: 0.7s;
}

.add-to-cart-btn:hover::after {
    left: 130%;
}


.add-to-cart-btn:active {
    transform: translateY(0);
}

.categories-section {
    margin-bottom: 40px;
}

.categories-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
}

.categories-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.categories-toggle {
    background: none;
    border: 2px solid #007bff;
    color: #007bff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.categories-toggle:hover {
    background: #007bff;
    color: white;
}

/* Контейнер категорий - GRID макет */
.categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    max-height: 600px;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.categories-container.hidden {
    display: none;
    opacity: 0;
}

/* Основные категории - блоки */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: white;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    justify-content: center;
    position: relative;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.category-card.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Стрелка для категорий с детьми */
.category-card.has-children::before {
    content: '▶';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.category-card.has-children.active::before {
    color: white;
}

.category-card.has-children.expanded::before {
    transform: rotate(90deg);
}

.category-icon {
    font-size: 40px;
    margin-bottom: 8px;
    display: block;
}

.category-name {
    font-size: 13px;
    font-weight: 600;
    word-break: break-word;
}

/* Контейнер подкатегорий - скрыт по умолчанию */
.subcategories-wrapper {
    display: none;
    grid-column: 1 / -1; /* Занимает всю ширину */
    padding: 10px 0;
}

.subcategories-wrapper.expanded {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    animation: slideDown 0.3s ease;
}

/* Подкатегории - МЕНЬШИЕ блоки с отступом */
.category-card.subcategory {
    padding: 10px;
    font-size: 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 2px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-left: 0; /* Убираем отступ, т.к. используем grid */
}

.category-card.subcategory .category-icon {
    font-size: 30px;
    margin-bottom: 6px;
}

.category-card.subcategory .category-name {
    font-size: 11px;
}

.category-card.subcategory:hover {
    border-color: #4a90e2;
    background: linear-gradient(135deg, #e0f7ff 0%, #b3e0ff 100%);
    transform: translateY(-3px);
}

.category-card.subcategory.active {
    background: #357abd;
    color: white;
    border-color: #357abd;
}

/* Подкатегории уровень 2 - ЕЩЕ меньше */
.category-card.subcategory.level-2 {
    padding: 8px;
    background: linear-gradient(135deg, #fff5e6 0%, #ffe0b3 100%);
}

.category-card.subcategory.level-2 .category-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.category-card.subcategory.level-2 .category-name {
    font-size: 10px;
}

/* Подкатегории уровень 3 - САМЫЕ маленькие */
.category-card.subcategory.level-3 {
    padding: 6px;
    background: linear-gradient(135deg, #f0f0f0 0%, #d9d9d9 100%);
}

.category-card.subcategory.level-3 .category-icon {
    font-size: 20px;
    margin-bottom: 3px;
}

.category-card.subcategory.level-3 .category-name {
    font-size: 9px;
}

/* Анимация появления */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Фильтры */
.filters-section {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    display: none;
}

.filters-section.active {
    display: block;
    animation: slideDown 0.3s ease;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

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

input[type="checkbox"] {
    display: none !important;
}

.filter-option {
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 13px;
}

.filter-option:hover {
    border-color: #007bff;
    background: #e7f1ff;
}

.filter-option.selected {
    background: #007bff;
    color: white;
    border-color: #007bff;
}
.breadcrumb-nav {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
}

.breadcrumb-nav a {
    color: #007bff;
    text-decoration: none;
    cursor: pointer;
    margin: 0 5px;
}

.breadcrumb-nav a:hover {
    text-decoration: underline;
}

.breadcrumb-nav span {
    color: #666;
    margin: 0 5px;
}

/* ==================== ПАГИНАЦИЯ ==================== */
.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 40px 0;
    animation: fadeInUp 0.8s ease-out;
}

.pagination-btn {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    color: #667eea;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: scale(1.05);
}

.pagination-btn:hover:not(.active) {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

/* ==================== АДАПТИВНОСТЬ ==================== */
@media (max-width: 1200px) {
    .product-section {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    h2 {
        font-size: 2rem;
    }

    .product-section {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
        padding: 0 10px;
    }

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

    .product-card img {
        height: 270px;
    }

    .name-search-group {
        flex-direction: column;
        width: 95%;
    }

    .search-container {
        gap: 10px;
    }

    #searchInput,
    #codeSearch {
        width: 100%;
        padding: 12px 18px;
    }

    .sort-container {
        flex-direction: column;
        gap: 10px;
    }

    .custom-select {
        width: 95%;
        min-width: unset;
    }

    .modal-content {
        width: 95%;
        padding: 25px 20px;
    }

    .modal-product-image-wrapper {
        height: 250px;
    }

    .quantity-controls {
        gap: 10px;
    }

    .quantity-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .quantity-controls input {
        width: 70px;
        height: 40px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    h2 {
        font-size: 1.5rem;
    }

    .categories-container{
        display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 5px;
    margin-bottom: 25px;
    }
    .category-card{
        padding: 5px;
    }
    .category-icon{
        font-size: 25px;
        margin-bottom: 4px;
    }
    .category-name{
        font-size: 11px;
    }

    .categories-header h3{
        font-size: 16px;
    }
    .categories-toggle{
        font-size: 12px;
    }

    .product-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-card {
        max-width: 100%;
    }

    .product-info h4 {
        font-size: 16px;
        min-height: 40px;
    }

    .product-info .price {
        font-size: 1rem;
    }

    .add-to-cart-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    #searchButton,
    #resetFiltersButton {
        padding: 12px 20px;
        font-size: 13px;
    }
}

/* Фильтр по цене */
.price-filter-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.price-filter-section h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.price-range-container {
    width: 100%;
}

/* Поля ввода */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.price-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.price-input-group label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.price-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    transition: border-color 0.3s;
}

.price-input:focus {
    outline: none;
    border-color: #007bff;
}

.price-separator {
    font-size: 20px;
    color: #999;
    margin-top: 20px;
}

/* Слайдер */
.price-slider {
    position: relative;
    height: 5px;
    background: #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
}

.price-progress {
    position: absolute;
    height: 100%;
    background: linear-gradient(to right, #007bff, #0056b3);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.range-input {
    position: relative;
    height: 35px;
    margin-top: -30px;
}

.range-input input {
    position: absolute;
    width: 100%;
    height: 5px;
    background: none;
    pointer-events: none;
    margin-top: 15px;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.range-input input::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #007bff;
    pointer-events: auto;
    -webkit-appearance: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.4);
    transition: all 0.3s ease;
}

.range-input input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.6);
}

.range-input input::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #007bff;
    pointer-events: auto;
    -moz-appearance: none;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.4);
    transition: all 0.3s ease;
}

.range-input input::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.6);
}

/* Адаптив */
@media (max-width: 576px) {
    .price-inputs {
        flex-direction: column;
        gap: 10px;
    }
    
    .price-separator {
        display: none;
    }
}

/* ==================== ОПТИМИЗАЦИЯ ПРОИЗВОДИТЕЛЬНОСТИ ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

::selection {
     background: rgba(180, 180, 180, 0.3); /* мягкий серебряный фон выделения */
    color: #2b2b2b; /* контрастный темный текст */
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #e8e8e8;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #b0b0b0 0%, #888888 100%); /* серебро / платина */
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #999999 0%, #b0b0b0 100%);
}

/* Оптимизация рендеринга */
.product-card,
.quantity-btn,
.add-to-cart-btn {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Отключаем сложные эффекты при прокрутке */
@media (hover: none) {
    .product-card:hover {
        transform: translateY(-4px);
    }
    
    .product-card:hover img {
        transform: scale(1.03);
    }
}