* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: #1a1a1a;
    color: #fff;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 2px;
}

.user-info {
    color: #aaa;
    font-size: 14px;
}

.main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* Catalog layout */
.catalog-layout {
    display: flex;
    gap: 24px;
}

/* Filters */
.filters {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 16px;
}

.filters h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #1a1a1a;
}

.filter-group {
    margin-bottom: 14px;
}

.filter-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.15s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #888;
}

.btn-apply {
    width: 100%;
    padding: 10px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.15s;
}

.btn-apply:hover {
    background: #333;
}

.btn-reset {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-size: 13px;
    color: #888;
    text-decoration: none;
}

.btn-reset:hover {
    color: #333;
}

/* Products */
.products {
    flex: 1;
    min-width: 0;
}

.products-header {
    margin-bottom: 16px;
    font-size: 14px;
    color: #888;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.product-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.product-image {
    width: 100%;
    height: 320px;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 48px;
    background: rgba(255,255,255,0.85);
    border: none;
    border-radius: 4px;
    font-size: 22px;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s;
    line-height: 1;
}

.product-card:hover .img-arrow {
    opacity: 1;
}

.img-arrow:hover {
    background: #fff;
    color: #000;
}

.img-prev {
    left: 6px;
}

.img-next {
    right: 6px;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #f5f5f5;
    transition: opacity 0.3s;
}

.product-card:hover .product-image img {
    opacity: 0.92;
}

.no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #bbb;
    font-size: 15px;
}

.product-info {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-article {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 8px;
}

.product-attrs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.product-attrs span {
    font-size: 11px;
    background: #f2f2f2;
    padding: 3px 9px;
    border-radius: 12px;
    color: #555;
    line-height: 1.3;
}

/* Кнопки размеров */
.product-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.size-btn {
    padding: 5px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    font-size: 12px;
    color: #555;
    transition: all 0.15s;
    font-family: inherit;
}

.size-btn:hover {
    border-color: #aaa;
    color: #333;
    background: #f0f0f0;
}

.size-btn.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.product-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    flex-wrap: wrap;
}

.btn-add-selection {
    display: block;
    width: 100%;
    padding: 10px 16px;
    margin-top: 12px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    letter-spacing: 0.3px;
}

.btn-add-selection:hover {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-add-selection:active {
    transform: translateY(0);
}

.admin-link {
    color: #e65100 !important;
    font-weight: 600;
}

.price-current {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

.price-old {
    font-size: 15px;
    font-weight: 500;
    color: #aaa;
    text-decoration: line-through;
}

.price-new {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

.price-discount {
    font-size: 14px;
    font-weight: 700;
    color: #e53935;
    background: #ffebee;
    padding: 2px 8px;
    border-radius: 6px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    font-size: 14px;
}

.pagination a {
    color: #1a1a1a;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: all 0.15s;
}

.pagination a:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.pagination span {
    color: #888;
}

/* Адаптивность */
@media (max-width: 900px) {
    .catalog-layout {
        flex-direction: column;
    }

    .filters {
        width: 100%;
        position: static;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* Стили для шапки с пользователем */
.btn-logout {
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
    margin-left: 16px;
    padding: 6px 12px;
    border: 1px solid #555;
    border-radius: 4px;
    transition: all 0.15s;
}

.btn-logout:hover {
    color: #fff;
    border-color: #888;
    background: #333;
}

.cabinet-link {
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
    margin-right: 16px;
    transition: color 0.15s;
}
.cabinet-link:hover {
    color: #fff;
}

/* Мульти-фильтр */
/* Мульти-фильтр */
.filter-label {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.filter-label .arrow {
    font-size: 10px;
    transition: transform 0.2s;
}
.filter-label.open .arrow {
    transform: rotate(180deg);
}
.filter-values {
    display: none;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 6px;
}
.filter-values.open {
    display: block;
}

/* Переопределение стилей для элементов фильтра */
.filter-values .filter-item {
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    font-size: 13px;
    cursor: pointer;
    font-weight: 400;
    color: #555;
    width: auto !important;
    margin-bottom: 0 !important;
}

.filter-values .filter-item input.filter-checkbox {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
    margin: 0 !important;
    padding: 0 !important;
    border: 2px solid #ccc;
    border-radius: 3px;
    appearance: none;
    cursor: pointer;
    position: relative;
}

.filter-checkbox[data-state="include"] {
    background: #4CAF50 !important;
    border-color: #4CAF50 !important;
}
.filter-checkbox[data-state="exclude"] {
    background: #e53935 !important;
    border-color: #e53935 !important;
}
.filter-checkbox[data-state="include"]::after {
    content: "✓";
    color: #fff;
    font-size: 11px;
    position: absolute;
    top: -1px;
    left: 2px;
}
.filter-checkbox[data-state="exclude"]::after {
    content: "✕";
    color: #fff;
    font-size: 10px;
    position: absolute;
    top: 0px;
    left: 3px;
}