/* =========================================
   ОБЩИЕ ЭЛЕМЕНТЫ (ХЛЕБНЫЕ КРОШКИ И ШАПКА)
========================================= */
.breadcrumbs {
    max-width: 1440px;
    margin: 20px auto 10px auto;
    padding: 0 20px;
    font-size: 13px;
    color: #888888;
}

.breadcrumbs a {
    color: #888888;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: #936098;
}

.breadcrumbs .separator {
    margin: 0 8px;
}

.breadcrumbs .current {
    color: #333333;
}

.category-header {
    max-width: 1440px;
    margin: 0 auto 30px auto;
    padding: 0 20px 30px 20px;
    display: flex;
    align-items: center;
    gap: 30px;
    border-bottom: 2px solid #fb5a6c; /* Коралловая линия */
}

.category-logo {
    width: 140px;
    height: 140px;
    background-color: #ffffff;
    border-radius: 50%;
    border: 6px solid #e5e5e5; 
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 10px;
}

.category-header-info h1 {
    font-size: 38px;
    color: #4a3c5a;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    margin: 0 0 15px 0;
}

.category-header-info p {
    font-size: 15px;
    color: #333333;
    line-height: 1.6;
    margin: 0;
    max-width: 1000px;
}

/* =========================================
   СЕТКА: САЙДБАР И КОНТЕНТ
========================================= */
.category-layout {
    max-width: 1440px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

/* Сайдбар */
.category-sidebar {
    width: 260px;
    flex-shrink: 0;
}

.btn-filter-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #ffffff;
    border: 1px solid #936098;
    color: #936098;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 30px;
    transition: background 0.2s, color 0.2s;
}

.btn-filter-toggle:hover {
    background: #936098;
    color: #ffffff;
}

.filter-group {
    margin-bottom: 25px;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 20px;
}

.filter-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin-bottom: 15px;
}

.filter-group-header h3 {
    font-family: 'Playfair Display', serif; /* Серифный шрифт как на прототипе */
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #111111;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #555555;
    position: relative;
    padding-left: 30px;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 3px;
    transition: background-color 0.2s, border-color 0.2s;
}

.custom-checkbox:hover input ~ .checkmark {
    border-color: #936098;
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: #936098;
    border-color: #936098;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.btn-see-less {
    background: none;
    border: none;
    color: #936098;
    font-size: 13px;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 5px;
}

/* =========================================
   ОСНОВНОЙ КОНТЕНТ (ГРИД ТОВАРОВ)
========================================= */
.category-main {
    flex-grow: 1;
}

.category-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eeeeee;
}

.items-count {
    font-size: 14px;
    color: #555555;
}

.sort-box {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333333;
}

.sort-box select {
    padding: 6px 30px 6px 12px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    background: #ffffff;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position-x: 95%;
    background-position-y: 50%;
}

.yarn-category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px 20px;
}

.yarn-catalog-card {
    display: flex;
    flex-direction: column;
}

.yarn-catalog-image-box {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #f5f5f5;
    overflow: hidden;
    margin-bottom: 15px;
}

.yarn-catalog-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.yarn-catalog-image-box:hover img {
    transform: scale(1.05);
}

/* Диагональные ленты статусов */
.yarn-catalog-ribbon {
    position: absolute;
    top: 15px;
    left: -40px;
    padding: 4px 45px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    transform: rotate(-45deg);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    text-align: center;
    white-space: nowrap;
}

.yarn-catalog-ribbon.ribbon-green { background-color: #10b981; color: #ffffff; }
.yarn-catalog-ribbon.ribbon-yellow { background-color: #ffc107; color: #000000; }
.yarn-catalog-ribbon.ribbon-red { background-color: #ef4444; color: #ffffff; }
.yarn-catalog-ribbon.ribbon-blue { background-color: #6366f1; color: #ffffff; }

.wishlist-btn-corner {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    z-index: 10;
    padding: 5px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
    transition: color 0.2s ease, transform 0.2s ease;
}

.wishlist-btn-corner:hover {
    color: #fb5a6c;
    transform: scale(1.15);
}

/* Плашка с количеством вариантов цвета */
.options-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    color: #333333;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    border-top-left-radius: 4px;
}

.yarn-catalog-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.yarn-catalog-title {
    font-family: 'Playfair Display', serif; /* Серифный шрифт как на прототипе */
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.yarn-catalog-title a {
    color: #111111;
    text-decoration: none;
    transition: color 0.2s ease;
}

.yarn-catalog-title a:hover {
    color: #936098;
}

.yarn-catalog-desc {
    font-size: 12px;
    color: #666666;
    line-height: 1.5;
    margin: 0;
}

/* =========================================
   АДАПТИВНОСТЬ
========================================= */
@media screen and (max-width: 1200px) {
    .yarn-category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 992px) {
    .category-layout {
        flex-direction: column;
    }
    .category-sidebar {
        width: 100%;
    }
    .yarn-category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .category-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
}

@media screen and (max-width: 576px) {
    .yarn-category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .category-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}