/* ========== catalog.css (исправленная версия) ========== */

/* Переменные */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --text-light: #666;
    --text-dark: #333;
    --shadow: 0 2px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* Основные стили страницы */
.catalog-page {
    padding: 30px 0 60px;
    background-color: #f8f9fa;
}

.page-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.page-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* Хлебные крошки */
.breadcrumbs {
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-light);
}
.breadcrumbs a {
    color: var(--secondary-color);
    text-decoration: none;
}
.breadcrumbs a:hover {
    color: var(--accent-color);
}
.breadcrumbs span {
    color: var(--text-dark);
    font-weight: 500;
}

/* Контейнер каталога */
.catalog-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    margin-top: 30px;
}

/* Боковая панель фильтров */
.catalog-sidebar {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 20px;
}
.filter-section h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
}

/* Категории */
.category-list {
    list-style: none;
    padding: 0;
}
.category-item {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}
.category-item:last-child {
    border-bottom: none;
}
.category-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition);
    box-sizing: border-box;
}
.category-item a:hover {
    background-color: #f0f7ff;
    color: var(--secondary-color);
    padding-left: 20px;
}
.category-item a .category-count {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
    color: #888;
    margin-left: auto;
    white-space: nowrap;
}
.category-item.active a {
    background-color: var(--secondary-color);
    color: white;
    font-weight: 600;
}
.category-item.active a .category-count {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Фильтр по цене */
.price-range {
    margin-top: 20px;
}
.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.price-inputs input {
    width: 100px;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
}
.price-inputs input:focus {
    border-color: var(--secondary-color);
    outline: none;
}
.price-inputs span {
    color: var(--text-light);
    font-weight: 600;
}
.price-slider-container {
    position: relative;
    height: 20px;
    margin: 20px 0;
}
.price-slider-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    width: 100%;
}
.price-slider-range {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}
.price-slider-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid var(--secondary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
    transition: var(--transition);
}
.price-slider-handle:hover {
    transform: translateY(-50%) scale(1.1);
}
.price-values {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
}

/* Бренды */
.brand-filter {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: thin;
}
.brand-filter::-webkit-scrollbar {
    width: 4px;
}
.brand-filter::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}
.brand-filter::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

/* Чекбоксы и радио */
.checkbox-label, .radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.3s;
}
.checkbox-label:hover, .radio-label:hover {
    background-color: #f8f9fa;
}
.checkbox-label input, .radio-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.checkbox-label span, .radio-label span {
    font-size: 15px;
    color: var(--text-dark);
}
.brand-count {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-left: auto;
}

/* Кнопки фильтров */
.apply-filters, .reset-filters {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 10px;
}
.apply-filters {
    background: var(--secondary-color);
    color: white;
}
.apply-filters:hover {
    background: #2980b9;
    transform: translateY(-2px);
}
.reset-filters {
    background: #f8f9fa;
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}
.reset-filters:hover {
    background: #e9ecef;
    border-color: var(--secondary-color);
}

/* Основное содержание каталога */
.catalog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}
.sort-control label {
    font-weight: 600;
    color: var(--primary-color);
}
.sort-control select {
    padding: 12px 25px;
    border-radius: 40px;
    background: #f8fafc;
    border: 2px solid #eef2f7;
    font-size: 1rem;
    cursor: pointer;
    min-width: 220px;
}
.products-count {
    background: #f0f7ff;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 600;
    color: var(--primary-color);
}

.view-control {
    display: flex;
    gap: 10px;
}
.view-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}
.view-btn:hover {
    border-color: var(--secondary-color);
}
.view-btn.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}
.view-btn.active img {
    filter: brightness(0) invert(1);
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
    
}
.products-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.products-grid.list-view .product-card {
    display: flex;
    flex-direction: row;
    height: auto;
    min-height: 200px;
}
.products-grid.list-view .product-image {
    width: 200px;
    height: auto;
    flex-shrink: 0;
}
.products-grid.list-view .product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.products-grid.list-view .product-title {
    height: auto;
    line-clamp: 3;
}
.products-grid.list-view .product-actions {
    margin-top: 15px;
}

/* Карточка товара */
.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 1;
    isolation: isolate;
    transform-style: flat;
    will-change: transform;
    margin: 10px 1px 0px 1px;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15), 0 0 0 1px var(--secondary-color);
    z-index: 100;
}
.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-image img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.product-image img.loaded {
    opacity: 1;
}

.status-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}
.status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: white;
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.status.discount {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
}
.status.new {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}
.status.hit {
    background: linear-gradient(135deg, #3498db, #2980b9);
}
.status.stock {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}
.status.out-of-stock {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.wishlist-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    color: #666;
    font-size: 18px;
}
.wishlist-btn:hover {
    background: white;
    color: var(--accent-color);
    transform: scale(1.1);
}
.wishlist-btn.active {
    color: var(--accent-color);
}

.product-info {
    padding: 20px 20px 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.product-category {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.product-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--primary-color);
    line-height: 1.4;
    height: 44px;
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}
.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    color: #666;
}
.brand {
    font-weight: 600;
    color: #444;
}
.price-container {
    margin: 18px 0 16px;
}
.price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.current-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-color);
}
.old-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}
.discount-percent {
    background: var(--accent-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1;
}
.savings-hint {
    font-size: 0.8rem;
    color: var(--success-color);
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 8px;
}
.add-to-cart, .quick-view {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    height: 50px;
    line-height: 1;
    box-sizing: border-box;
}
.add-to-cart {
    background: var(--secondary-color);
    color: white;
}
.add-to-cart:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
}
.add-to-cart:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}
.quick-view {
    background: #e9ecef;
    color: var(--primary-color);
}
.quick-view:hover {
    background: #dee2e6;
    transform: translateY(-2px);
}

/* Активные фильтры */
.selected-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    min-height: 20px;
}
.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--secondary-color);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}
.filter-tag .remove {
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
    opacity: 0.8;
    transition: var(--transition);
}
.filter-tag .remove:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Сообщения */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
}
.no-results h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}
.no-results p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}
.reset-filters-btn {
    display: inline-block;
    padding: 12px 25px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.reset-filters-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Загрузка */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    grid-column: 1 / -1;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* Скелетон */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}
.skeleton-image {
    height: 200px;
    width: 100%;
}
.skeleton-text {
    height: 20px;
    margin: 10px 0;
}
.product-card.skeleton-card .product-image {
    height: 200px;
    background: #f0f0f0;
}
.product-card.skeleton-card .product-title {
    height: 20px;
    width: 80%;
    margin: 10px 0;
}
.product-card.skeleton-card .price-container {
    height: 30px;
    width: 60%;
    margin: 10px 0;
}

/* Слайдер изображений */
.product-image-slider {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.slider-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    height: 100%;
    scrollbar-width: none;
    cursor: grab;
    cursor: -moz-grab;
    cursor: -webkit-grab;
}
.slider-track::-webkit-scrollbar {
    display: none;
}
.slider-track:active {
    cursor: grabbing;
    cursor: -moz-grabbing;
    cursor: -webkit-grabbing;
}
.slider-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    height: 100%;
}
.slider-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 2;
}
.dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.2);
}
.dot.active {
    background: white;
    transform: scale(1.2);
}

/* Быстрый просмотр */
.quick-view-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}
.quick-view-content {
    background: white;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow-y: hidden;
    position: relative;
    animation: modalZoomIn 0.25s ease-out;
}
@keyframes modalZoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.quick-view-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #eef2f7;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    color: #666;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}
.quick-view-close:hover {
    background: white;
    color: var(--accent-color);
    transform: rotate(90deg);
}
.quick-view-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}
.quick-view-gallery {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 8px;
    background: #f8fafc;
}
.quick-view-slider {
    width: 100%;
    height: 100%;
}
.quick-view-slider .slider-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    height: 100%;
}
.quick-view-slider .slider-slide img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #f5f5f5;
}
.quick-view-info h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}
.quick-view-meta {
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.quick-view-specs {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}
.quick-view-specs li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}
.quick-view-specs li:last-child {
    border-bottom: none;
}
.quick-view-specs strong {
    color: var(--primary-color);
}
.quick-view-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.quick-view-actions .btn-primary {
    flex: 1;
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    padding: 14px 24px;
    color: white;
    transition: all 0.2s;
    cursor: pointer;
}
.quick-view-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.4);
}
.quick-view-actions .wishlist-btn {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    top: 0;
    left: 0;
}
.quick-view-actions .wishlist-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Недавно просмотренные */
.recently-viewed-section {
    margin-top: 60px;
    padding: 20px 0;
    background: #f9f9f9;
    border-radius: 12px;
}
.recently-viewed-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    padding: 0 20px;
}

@media (max-width: 1200px) {
    .recently-viewed-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .recently-viewed-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .recently-viewed-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .recently-viewed-grid {
        grid-template-columns: 1fr;
    }
}
.recently-viewed-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}
.recently-viewed-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.recently-viewed-image {
    height: 150px;
    overflow: hidden;
    background: #f0f0f0;
}
.recently-viewed-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.recently-viewed-item:hover .recently-viewed-image img {
    transform: scale(1.05);
}
.recently-viewed-info {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.recently-viewed-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    line-height: 1.3;
    height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}
.recently-viewed-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 8px;
}
.recently-viewed-old-price {
    font-size: 0.8rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 5px;
}
.recently-viewed-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}
.recently-viewed-actions button {
    flex: 1;
    padding: 6px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}
.recently-viewed-add-to-cart {
    background: var(--secondary-color);
    color: white;
}
.recently-viewed-add-to-cart:hover {
    background: #2980b9;
}
.recently-viewed-wishlist {
    background: #f0f0f0;
    color: #666;
}
.recently-viewed-wishlist:hover {
    background: #e0e0e0;
    color: var(--accent-color);
}
.recently-viewed-title-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.recently-viewed-title-link:hover .recently-viewed-title {
    color: var(--secondary-color);
}
.recently-viewed-image a {
    display: block;
    line-height: 0;
}
.recently-viewed-image a:hover img {
    opacity: 0.9;
    transition: opacity 0.2s;
}

/* Мобильные фильтры */
.mobile-filters-btn {
    display: none;
    width: 100%;
    padding: 12px 20px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}
.mobile-filters-btn:hover {
    background: #2980b9;
}
.mobile-filters-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}
.mobile-filters-content {
    background: white;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}
.mobile-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-color);
}
.close-mobile-filters {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}
.close-mobile-filters:hover {
    background: #f1f1f1;
    color: var(--accent-color);
}
#mobileFiltersContent {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.mobile-filters-actions {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--light-color);
}
.mobile-filters-actions button {
    flex: 1;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
    flex-wrap: wrap;
}
.page-btn {
    min-width: 45px;
    height: 45px;
    padding: 0 18px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.page-btn:hover:not(.disabled):not(.active) {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}
.page-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}
.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.page-dots {
    padding: 0 10px;
    color: var(--text-light);
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: var(--success-color);
    color: white;
    border-radius: 8px;
    z-index: 9999;
    display: none;
    animation: slideIn 0.3s ease;
}
.notification.success { background: var(--success-color); }
.notification.error { background: var(--accent-color); }
.notification.info { background: var(--secondary-color); }
.notification.warning { background: var(--warning-color); }

/* Доступность */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
.price-slider-handle:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .product-card {
        animation: none;
        opacity: 1;
    }
}
@media (prefers-contrast: high) {
    .product-card,
    .filter-section,
    .stat-card {
        border: 2px solid currentColor;
    }
    .status {
        border: 1px solid #000;
    }
    .btn,
    .apply-filters,
    .reset-filters {
        border: 2px solid currentColor;
    }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Адаптивность */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
        gap: 20px;
    }
}
@media (max-width: 992px) {
    .catalog-container {
        grid-template-columns: 1fr;
    }
    .catalog-sidebar {
        display: none;
    }
    .mobile-filters-btn {
        display: flex;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}
@media (max-width: 768px) {
    .catalog-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px;
    }
    .sort-control {
        justify-content: space-between;
    }
    .sort-control select {
        min-width: 160px;
        padding: 10px 15px;
        font-size: 14px;
    }
    .products-count {
        text-align: center;
        font-size: 14px;
        padding: 8px 12px;
    }
    .view-control {
        justify-content: center;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .product-image {
        height: 170px;
    }
    .product-info {
        padding: 16px;
    }
    .product-title {
        font-size: 15px;
        height: auto;
        line-clamp: 2;
    }
    .current-price {
        font-size: 18px;
    }
    .old-price {
        font-size: 13px;
    }
    .product-actions {
        gap: 10px;
    }
    .add-to-cart, .quick-view {
        height: 50px;
        font-size: 14px;
        padding: 0 10px;
    }
    .pagination {
        gap: 8px;
        margin-top: 30px;
    }
    .page-btn {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 14px;
    }
    .quick-view-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    .quick-view-gallery {
        height: 250px;
    }
    .quick-view-content {
        width: 95%;
        max-height: 90vh;
    }
    .quick-view-info h2 {
        font-size: 1.5rem;
    }
}
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .product-image {
        height: 200px;
    }
    .recently-viewed-grid {
        grid-template-columns: 1fr;
    }
    .page-title {
        font-size: 1.8rem;
    }
    .page-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Стили для подкатегорий */
.category-list .parent-category a .sub-icon {
    margin-left: 8px;
    font-size: 12px;
    transition: transform 0.2s;
    cursor: pointer; 
}
.category-list .parent-category.open .sub-icon {
    transform: rotate(180deg);
}

.category-list .subcategory-list {
    display: none;
    list-style: none;
    padding-left: 12px;
    margin: 5px 0 10px 0;
    border-left: 2px solid var(--secondary-color);
}

.category-list .subcategory-list[style*="display: block"] {
    display: block; /* когда появляются */
}

.category-list .subcategory-item {
    margin-bottom: 8px;
}

.category-list .subcategory-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition);
    border-radius: 6px;
}

.category-list .subcategory-item a:hover {
    background-color: #f0f7ff;
    color: var(--secondary-color);
    padding-left: 20px;
}

.category-list .subcategory-item.active a {
    background-color: var(--secondary-color);
    color: white;
    font-weight: 600;
}
.category-list .parent-category a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-list .parent-category a .category-count {
    margin-left: auto;
    margin-right: 8px;          /* расстояние между цифрой и стрелкой */
}
.subcategory-list {
    transition: all 0.3s ease;
}

/* Улучшенный быстрый просмотр — прокрутка содержимого */
.quick-view-body {
    overflow-y: auto;
    max-height: calc(80vh - 80px); /* 80vh - высота модалки, минус отступы */
    padding: 0; /* чтобы внутренние отступы были у контента */
}

/* Если нужно, чтобы правая панель прокручивалась отдельно, а галерея оставалась видимой */
.quick-view-info {
    overflow-y: auto;
    max-height: 70vh; /* регулируйте по вкусу */
    padding-right: 10px; /* место для скроллбара */
}

/* Стилизация скроллбара для лучшего вида */
.quick-view-info::-webkit-scrollbar {
    width: 6px;
}
.quick-view-info::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}
.quick-view-info::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 3px;
}