/* Catalog Page Styles */

.catalog-page--all-mode .catalog-title {
    display: none;
}

.account-content .catalog-page {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Для страницы без ЛК (старая версия) */
.catalog-page {
    width: 100%;
    margin: 0;
    padding: 40px 0;
}

/* Header */
.account-content .catalog-header {
    margin-bottom: 40px;
    padding: 0;
}

.account-content .catalog-title {
    font-family: 'AGOpt Cyrillic', 'Sansation', sans-serif;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.catalog-header {
    margin-bottom: 40px;
    padding: 0 40px;
}

.catalog-title {
    font-family: 'AGOpt Cyrillic', 'Sansation', sans-serif;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Category Switcher */
.category-switcher {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.category-btn {
    padding: 8px 16px;
    background-color: #f5f5f5;
    /* border: 1px solid #e0e0e0; */
    border-radius: 50px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    transition: all 0.2s;
    cursor: pointer;
}

.category-btn:hover {
    background-color: #fff;
    /* border-color: #333; */
}

.category-btn.active {
    background-color: #555555;
    color: #fff;
    /* border-color: #000; */
}

/* Filters Toggle */
.filters-toggle-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    padding: 0 40px;
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.active-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background-color: var(--mm-color-surface-muted);
    border-radius: 50px;
}

.active-filter-name {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--mm-color-text-muted);
    pointer-events: none;
}

.active-filter-name.no-uppercase {
    text-transform: none;
}

.remove-filter-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-filter-btn svg {
    display: block;
    stroke: var(--mm-color-blue);
}

.filters-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--mm-color-surface-muted);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filters-toggle-btn:hover {
    background-color: var(--mm-color-bg);
    /* border-color: #333; */
}

.filters-toggle-btn--active {
    background-color: var(--mm-color-blue);
    color: #fff;
}

/* Filters Panel (выдвижная панель справа) */
.filters-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 10;
}

.filters-panel-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.filters-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filters-close:hover {
    color: #000;
}

.filters-panel-content {
    padding: 20px;
    padding-bottom: 100px;
}

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

.filter-title {
    font-size: 1rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.filter-option:hover {
    background-color: #f8f8f8;
}

.filter-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.filter-sizes {
    flex-direction: row;
    flex-wrap: wrap;
}

.filter-sizes .filter-option {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.filter-sizes .filter-option:hover {
    border-color: #333;
}

.filter-sizes .filter-option input[type="radio"]:checked+span {
    font-weight: 600;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Products Grid */
.account-content .products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    /* background-color: #e0e0e0; */
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    /* background-color: #e0e0e0; */
}

/* Центрирование карточек, если их меньше 4 на десктопе */
@media (min-width: 1025px) {

    /* Если карточек 1-3, центрируем их */
    /* .products-grid:has(.product-card:nth-child(1):last-child),
    .products-grid:has(.product-card:nth-child(2):last-child),
    .products-grid:has(.product-card:nth-child(3):last-child) {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        justify-content: center;
        max-width: calc(100% - 40px);
        margin: 0 auto;
    } */
}

/* Product Card styles moved to product-card.css */

/* Empty State */
.products-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* Overlay для мобильных фильтров */
.filters-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.filters-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 1024px) {

    .account-content .products-grid,
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .catalog-page {
        padding: 20px 0;
    }

    .catalog-header {
        padding: 0 15px;
    }

    .filters-toggle-container {
        padding: 0 15px;
    }

    .catalog-title {
        font-size: 1.5rem;
    }

    .category-switcher {
        gap: 8px;
    }

    .category-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .account-content .products-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-panel {
        width: 100%;
        right: -100%;
    }

    .image-nav-btn {
        display: none;
    }

    .product-hover-info {
        display: none;
    }

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

    .product-wishlist {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .catalog-title {
        font-size: 1.25rem;
    }

    .category-switcher {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
    }

    .category-btn {
        white-space: nowrap;
    }

    /* На очень маленьких экранах тоже оставляем 2 колонки */
    .account-content .products-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}