﻿/* ===================== ПРЕМИАЛЬНЫЙ КАТАЛОГ B2B ===================== */
/* Базовая сетка и контейнер */
.catalog-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 992px) {
    .catalog-container {
        padding: 0 1.5rem;
    }
}

@media (max-width: 576px) {
    .catalog-container {
        padding: 0 1rem;
    }
}

/* ===================== ЗАГОЛОВОК КАТАЛОГА ===================== */
.catalog-header {
    padding: 3rem 0 2rem;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 2rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

@media (max-width: 768px) {
    .catalog-header {
        padding: 2rem 0 1.5rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {
    .catalog-header {
        padding: 1.5rem 0 1rem;
        margin-bottom: 1rem;
    }
}

.catalog-header h1 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.03em;
}

@media (max-width: 768px) {
    .catalog-header h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .catalog-header h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
}

.catalog-header .lead {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 600px;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .catalog-header .lead {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .catalog-header .lead {
        font-size: 0.95rem;
        line-height: 1.4;
    }
}

/* ===================== ПОИСК ===================== */
.catalog-search {
    position: relative;
    max-width: 400px;
}

@media (max-width: 768px) {
    .catalog-search {
        max-width: 100%;
        width: 100%;
    }
}

.catalog-search .form-control {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.875rem 3rem 0.875rem 1.5rem;
    font-size: 0.875rem;
    transition: var(--transition);
    height: 48px;
    width: 100%;
}

@media (max-width: 576px) {
    .catalog-search .form-control {
        height: 44px;
        padding: 0.75rem 2.5rem 0.75rem 1.25rem;
        font-size: 0.85rem;
    }
}

/* Стили для текста-подсказки в поле поиска */
.catalog-search .form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
}

.catalog-search .form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    background-color: var(--bg-card);
}

.catalog-search .btn {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

@media (max-width: 576px) {
    .catalog-search .btn {
        width: 44px;
    }
}

.catalog-search .btn:hover {
    color: var(--accent-blue);
    background-color: transparent;
}

/* Для темной темы - дополнительное усиление контраста */
[data-theme="dark"] .catalog-search .form-control::placeholder {
    opacity: 0.9;
}

/* ===================== ЛЕЙАУТ КАТАЛОГА ===================== */
.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    min-height: calc(100vh - 200px);
}

@media (max-width: 1200px) {
    .catalog-layout {
        grid-template-columns: 240px 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 992px) {
    .catalog-layout {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .catalog-sidebar {
        order: -1;
        margin-bottom: 1.5rem;
    }

    .catalog-main {
        order: 1;
    }
}

/* ===================== КНОПКА ФИЛЬТРОВ ДЛЯ МОБИЛЬНЫХ ===================== */
.filter-mobile-toggle {
    display: none;
}

@media (max-width: 992px) {
    .filter-mobile-toggle {
        display: flex;
        width: 100%;
        margin-bottom: 1rem;
        padding: 0.875rem 1rem;
        background: var(--bg-card);
        border: 1px solid var(--border-medium);
        border-radius: 8px;
        justify-content: space-between;
        align-items: center;
        font-weight: 600;
        color: var(--text-primary);
        cursor: pointer;
        transition: var(--transition);
        font-size: 0.95rem;
        position: sticky;
        top: 80px;
        z-index: 100;
        box-shadow: var(--shadow-sm);
        -webkit-tap-highlight-color: rgba(0, 102, 204, 0.1);
    }

        .filter-mobile-toggle:hover {
            border-color: var(--accent-blue);
            background-color: rgba(0, 102, 204, 0.04);
        }

        .filter-mobile-toggle i {
            transition: transform 0.3s ease;
        }

        .filter-mobile-toggle.active i {
            transform: rotate(180deg);
        }
}

/* ===================== САЙДБАР ФИЛЬТРОВ ===================== */
.catalog-sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
}

@media (max-width: 992px) {
    .catalog-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1050;
        background: var(--bg-primary);
        padding: 1rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0;
        border-radius: 0;
        border: none;
        animation: slideIn 0.3s ease-out;
    }

        .catalog-sidebar.mobile-open {
            display: block;
        }

    /* Анимация появления */
    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateX(-20px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* Заголовок сайдбара на мобильных */
    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--border-light);
    }

    .sidebar-title {
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--text-primary);
        margin: 0;
    }

    .close-sidebar {
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.25rem;
        line-height: 1;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        transition: var(--transition);
    }

        .close-sidebar:hover {
            color: var(--text-primary);
            background-color: rgba(0, 0, 0, 0.05);
        }

    [data-theme="dark"] .close-sidebar:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

.filter-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

@media (max-width: 992px) {
    .filter-section {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
    }
}

@media (max-width: 576px) {
    .filter-section {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 10px;
    }
}

.filter-section h3 {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

@media (max-width: 576px) {
    .filter-section h3 {
        font-size: 0.95rem;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
}

/* ===================== COLLAPSIBLE FILTERS ===================== */
.filter-collapsible .filter-content {
    display: none;
    margin-top: 0.75rem;
}

.filter-toggle {
    width: 100%;
    background: none;
    border: none;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0;
    color: var(--text-primary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    -webkit-tap-highlight-color: rgba(0, 102, 204, 0.1);
}

@media (max-width: 576px) {
    .filter-toggle {
        font-size: 0.95rem;
    }
}

.filter-toggle i {
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.filter-collapsible.open .filter-content {
    display: block;
}

.filter-collapsible.open .filter-toggle i {
    transform: rotate(180deg);
}

/* ===================== КАТЕГОРИИ ===================== */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 0.25rem;
}

.category-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: var(--transition);
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 102, 204, 0.1);
}

@media (max-width: 576px) {
    .category-parent {
        padding: 0.625rem;
        min-height: 44px;
    }
}

.category-parent:hover,
.category-parent.active {
    background-color: rgba(0, 102, 204, 0.08);
    color: var(--accent-blue);
}

    .category-parent.active .category-toggle i {
        color: var(--accent-blue);
    }

.category-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.category-toggle {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    -webkit-tap-highlight-color: rgba(0, 102, 204, 0.1);
}

    .category-toggle:hover {
        color: var(--accent-blue);
        background-color: rgba(0, 0, 0, 0.05);
    }

    .category-toggle i {
        transition: transform 0.2s ease;
        font-size: 0.9rem;
    }

.category-item.open .category-toggle i {
    transform: rotate(45deg);
}

.category-children {
    display: none;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
    border-left: 1px solid var(--border-light);
    margin-left: 0.5rem;
}

.category-item.open .category-children {
    display: block;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 4px;
    transition: var(--transition);
    margin-bottom: 0.25rem;
    -webkit-tap-highlight-color: rgba(0, 102, 204, 0.1);
}

@media (max-width: 576px) {
    .category-link {
        padding: 0.5rem;
        min-height: 40px;
    }
}

.category-link:hover,
.category-link.active {
    background-color: rgba(0, 102, 204, 0.08);
    color: var(--accent-blue);
}

.category-count {
    background: var(--bg-secondary);
    color: var(--text-muted);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    min-width: 24px;
    text-align: center;
}

.category-link.active .category-count {
    background-color: var(--accent-blue);
    color: white;
}

/* ===================== ПРОИЗВОДИТЕЛИ ===================== */
.manufacturer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.manufacturer-item {
    margin-bottom: 0.25rem;
}

.manufacturer-checkbox {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
    -webkit-tap-highlight-color: rgba(0, 102, 204, 0.1);
}

@media (max-width: 576px) {
    .manufacturer-checkbox {
        padding: 0.5rem;
        min-height: 44px;
    }
}

.manufacturer-checkbox:hover {
    background-color: rgba(0, 102, 204, 0.04);
}

.manufacturer-checkbox input {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-blue);
    -webkit-tap-highlight-color: rgba(0, 102, 204, 0.1);
}

@media (max-width: 576px) {
    .manufacturer-checkbox input {
        width: 20px;
        height: 20px;
    }
}

.manufacturer-checkbox label {
    flex: 1;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 0.875rem;
}

@media (max-width: 576px) {
    .manufacturer-checkbox label {
        font-size: 0.9rem;
    }
}

.manufacturer-checkbox:hover label {
    color: var(--text-primary);
}

.manufacturer-count {
    background: var(--bg-secondary);
    color: var(--text-muted);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* ===================== ЦЕНОВОЙ ДИАПАЗОН ===================== */
.price-slider-container {
    padding: 1rem 0;
}

@media (max-width: 576px) {
    .price-slider-container {
        padding: 0.75rem 0;
    }
}

.price-slider {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--border-light);
    outline: none;
    -webkit-appearance: none;
    margin: 1rem 0;
}

    .price-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background: var(--accent-blue);
        cursor: pointer;
        border: 2px solid var(--bg-card);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        transition: var(--transition);
    }

        .price-slider::-webkit-slider-thumb:hover {
            transform: scale(1.1);
        }

    .price-slider::-moz-range-thumb {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background: var(--accent-blue);
        cursor: pointer;
        border: 2px solid var(--bg-card);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }

.price-values {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

@media (max-width: 576px) {
    .price-values {
        font-size: 0.85rem;
        margin-top: 0.75rem;
    }
}

.price-min,
.price-max {
    background: var(--bg-secondary);
    padding: 0.375rem 0.875rem;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    min-width: 80px;
    text-align: center;
}

/* ===================== КНОПКИ ФИЛЬТРОВ ===================== */
.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

@media (max-width: 576px) {
    .filter-actions {
        margin-top: 1.5rem;
        gap: 0.625rem;
    }
}

.filter-actions .btn {
    width: 100%;
    justify-content: center;
    font-weight: 500;
    height: 48px;
}

@media (max-width: 576px) {
    .filter-actions .btn {
        height: 44px;
        font-size: 0.9rem;
    }
}

.btn-apply {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

    .btn-apply:hover {
        background-color: var(--accent-dark);
        border-color: var(--accent-dark);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

.btn-reset {
    background-color: transparent;
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

    .btn-reset:hover {
        border-color: var(--text-secondary);
        color: var(--text-primary);
    }

/* ===================== ОСНОВНАЯ ОБЛАСТЬ ===================== */
.catalog-main {
    flex: 1;
}

/* Панель управления */
.catalog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

@media (max-width: 768px) {
    .catalog-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
}

.catalog-stats {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .catalog-stats {
        order: 2;
        text-align: center;
        font-size: 0.85rem;
    }
}

.catalog-sort {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .catalog-sort {
        width: 100%;
        justify-content: space-between;
        order: 1;
    }
}

@media (max-width: 576px) {
    .catalog-sort {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
}

.catalog-sort select {
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-card);
    cursor: pointer;
    min-width: 180px;
    transition: var(--transition);
    height: 40px;
}

@media (max-width: 768px) {
    .catalog-sort select {
        flex: 1;
        min-width: auto;
    }
}

@media (max-width: 576px) {
    .catalog-sort select {
        width: 100%;
        height: 44px;
        font-size: 0.9rem;
    }
}

.catalog-sort select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    outline: none;
}

/* ===================== СЕТКА ТОВАРОВ ===================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 1200px) {
    .products-grid {
        gap: 1.5rem;
    }
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }
}

/* ===================== КАРТОЧКА ТОВАРА ===================== */
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    animation: fadeIn 0.4s ease-out;
    animation-fill-mode: both;
}

@media (max-width: 576px) {
    .product-card {
        border-radius: 10px;
    }
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-blue);
}

/* Задержка для анимации появления карточек */
.product-card:nth-child(1) {
    animation-delay: 0.1s;
}

.product-card:nth-child(2) {
    animation-delay: 0.2s;
}

.product-card:nth-child(3) {
    animation-delay: 0.3s;
}

.product-card:nth-child(4) {
    animation-delay: 0.4s;
}

.product-card:nth-child(5) {
    animation-delay: 0.5s;
}

.product-card:nth-child(6) {
    animation-delay: 0.6s;
}

/* Изображение товара */
.product-image {
    position: relative;
    padding-top: 75%; /* Соотношение 4:3 */
    background: var(--bg-secondary);
    overflow: hidden;
}

    .product-image img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 1.5rem;
        transition: transform 0.5s ease;
    }

@media (max-width: 576px) {
    .product-image {
        padding-top: 70%;
    }

        .product-image img {
            padding: 1rem;
        }
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* Бейджи */
.product-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1;
}

@media (max-width: 576px) {
    .product-badges {
        top: 0.75rem;
        left: 0.75rem;
        gap: 0.375rem;
    }
}

.product-badge {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

@media (max-width: 576px) {
    .product-badge {
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
    }
}

.badge-new {
    background: var(--accent-blue);
    color: white;
}

.badge-stock {
    background: #28a745;
    color: white;
}

.badge-order {
    background: var(--text-secondary);
    color: white;
}

/* Контент карточки */
.product-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

@media (max-width: 576px) {
    .product-content {
        padding: 1.25rem;
    }
}

.product-sku {
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

@media (max-width: 576px) {
    .product-sku {
        font-size: 0.7rem;
        margin-bottom: 0.375rem;
    }
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    flex: 1;
}

@media (max-width: 576px) {
    .product-title {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
    }
}

.product-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

    .product-title a:hover {
        color: var(--accent-blue);
    }

.product-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    flex: 1;
}

@media (max-width: 576px) {
    .product-description {
        font-size: 0.85rem;
        margin-bottom: 1rem;
        line-height: 1.4;
    }
}

/* Информация о цене и наличии */
.product-meta {
    margin-bottom: 1.5rem;
}

@media (max-width: 576px) {
    .product-meta {
        margin-bottom: 1.25rem;
    }
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

@media (max-width: 576px) {
    .product-price {
        font-size: 1.1rem;
    }
}

.product-min-order {
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (max-width: 576px) {
    .product-min-order {
        font-size: 0.85rem;
    }
}

.product-stock {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

@media (max-width: 576px) {
    .product-stock {
        font-size: 0.85rem;
    }
}

.stock-available {
    color: #28a745;
}

.stock-unavailable {
    color: var(--text-muted);
}

/* Кнопки действий */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
}

@media (max-width: 576px) {
    .product-actions {
        gap: 0.625rem;
    }
}

.btn-details, .btn-cart, .btn-notify {
    width: 100%;
    justify-content: center;
    height: 44px;
    font-weight: 500;
}

@media (max-width: 576px) {
    .btn-details, .btn-cart, .btn-notify {
        height: 42px;
        font-size: 0.9rem;
    }
}

/* ===================== ПАГИНАЦИЯ ===================== */
.catalog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

@media (max-width: 768px) {
    .catalog-pagination {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
}

@media (max-width: 576px) {
    .catalog-pagination {
        margin-top: 1.5rem;
        padding-top: 1rem;
        flex-wrap: wrap;
        gap: 0.375rem;
    }
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    background-color: var(--bg-card);
    -webkit-tap-highlight-color: rgba(0, 102, 204, 0.1);
}

@media (max-width: 576px) {
    .page-link {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}

.page-link:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background-color: rgba(0, 102, 204, 0.04);
}

.page-link.active {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--bg-secondary);
}

/* Кнопки "Предыдущая" и "Следующая" */
.page-prev, .page-next {
    min-width: 80px;
    padding: 0 1rem;
}

@media (max-width: 576px) {
    .page-prev, .page-next {
        min-width: 70px;
        padding: 0 0.75rem;
        font-size: 0.85rem;
    }
}

/* ===================== ПУСТОЙ РЕЗУЛЬТАТ ===================== */
.catalog-empty {
    text-align: center;
    padding: 4rem 2rem;
}

@media (max-width: 768px) {
    .catalog-empty {
        padding: 3rem 1.5rem;
    }
}

@media (max-width: 576px) {
    .catalog-empty {
        padding: 2rem 1rem;
    }
}

.catalog-empty-icon {
    font-size: 3rem;
    color: var(--border-medium);
    margin-bottom: 1.5rem;
}

@media (max-width: 576px) {
    .catalog-empty-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
}

.catalog-empty h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

@media (max-width: 576px) {
    .catalog-empty h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
}

.catalog-empty p {
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-secondary);
}

@media (max-width: 576px) {
    .catalog-empty p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
}

.catalog-empty .btn {
    min-width: 200px;
}

@media (max-width: 576px) {
    .catalog-empty .btn {
        min-width: 180px;
        height: 44px;
    }
}

/* ===================== МОДАЛЬНЫЕ ОКНА ===================== */
.modal-content {
    background: var(--bg-card);
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
}

@media (max-width: 576px) {
    .modal-content {
        margin: 1rem;
        border-radius: 10px;
    }
}

.modal-header {
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem;
}

@media (max-width: 576px) {
    .modal-header {
        padding: 1.25rem;
    }
}

.modal-body {
    padding: 1.5rem;
}

@media (max-width: 576px) {
    .modal-body {
        padding: 1.25rem;
    }
}

.modal-footer {
    border-top: 1px solid var(--border-light);
    padding: 1.5rem;
}

@media (max-width: 576px) {
    .modal-footer {
        padding: 1.25rem;
    }
}

.form-control, .form-select {
    background-color: var(--bg-card);
    border-color: var(--border-medium);
    color: var(--text-primary);
    height: 48px;
}

@media (max-width: 576px) {
    .form-control, .form-select {
        height: 44px;
        font-size: 0.9rem;
    }
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-card);
    border-color: var(--accent-blue);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.25rem rgba(0, 102, 204, 0.25);
}

.form-label {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* ===================== АНИМАЦИИ ===================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================== ОСОБЕННОСТИ ДЛЯ iOS САФАРИ ===================== */
@supports (-webkit-touch-callout: none) {
    .filter-mobile-toggle,
    .category-parent,
    .category-toggle,
    .category-link,
    .manufacturer-checkbox,
    .page-link,
    .btn {
        -webkit-tap-highlight-color: rgba(0, 102, 204, 0.1);
    }

    .catalog-sidebar {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .product-card {
        -webkit-tap-highlight-color: rgba(0, 102, 204, 0.05);
    }
}

/* ===================== ВЫСОКОКОНТРАСТНЫЙ РЕЖИМ ===================== */
@media (prefers-contrast: high) {
    .product-card:hover {
        outline: 2px solid var(--accent-blue);
    }

    .category-parent.active,
    .category-link.active {
        outline: 2px solid var(--accent-blue);
    }
}

/* ===================== РЕЖИМ СНИЖЕННОЙ АНИМАЦИИ ===================== */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-card:hover,
    .product-image img,
    .filter-toggle i,
    .category-toggle i,
    .catalog-sidebar {
        transition: none !important;
        animation: none !important;
    }

        .product-card:hover {
            transform: none;
        }
}

/* ===================== ОВЕРЛЕЙ ПРИ ОТКРЫТОМ САЙДБАРЕ ===================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    animation: fadeIn 0.3s ease-out;
}

    .sidebar-overlay.active {
        display: block;
    }

/* ===================== ПРОКРУТКА ДЛЯ МОБИЛЬНЫХ ===================== */
@media (max-width: 576px) {
    .catalog-container {
        padding-bottom: 1rem;
    }

    .catalog-main {
        padding-bottom: env(safe-area-inset-bottom, 1rem);
    }
}

/* ===================== БЕЗОПАСНЫЕ ОБЛАСТИ ДЛЯ НОВЫХ iPhone ===================== */
@supports (padding: max(0px)) {
    .catalog-sidebar,
    .catalog-main {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .catalog-sidebar {
        padding-top: max(1rem, env(safe-area-inset-top));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* ===================== УЛУЧШЕНИЯ ДЛЯ ГОРИЗОНТАЛЬНОЙ ОРИЕНТАЦИИ ===================== */
@media (max-width: 992px) and (orientation: landscape) {
    .catalog-sidebar {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .filter-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* ===================== ДОПОЛНИТЕЛЬНЫЕ МЕДИА-ЗАПРОСЫ ДЛЯ ОЧЕНЬ МАЛЕНЬКИХ ЭКРАНОВ ===================== */
@media (max-width: 360px) {
    .catalog-container {
        padding: 0 0.75rem;
    }

    .product-content {
        padding: 1rem;
    }

    .product-badges {
        top: 0.5rem;
        left: 0.5rem;
    }

    .product-badge {
        padding: 0.15rem 0.5rem;
        font-size: 0.65rem;
    }

    .product-title {
        font-size: 0.9rem;
    }

    .product-description {
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 1rem;
    }

    .btn-details, .btn-cart, .btn-notify {
        height: 40px;
        font-size: 0.85rem;
    }
}
