/* =========================================
   МОДУЛЬ "ВИДЫ ПРЯЖИ" (3 КОЛОНКИ)
========================================= */

.yarn-columns-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
    align-items: stretch; /* Заставляет колонки быть одинаковой высоты */
}

.yarn-column {
    background: #ffffff;
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    overflow: hidden; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid #f0f0f0;
    height: 100%; 
}

/* =========================================
   ЗАГОЛОВОК КОЛОНКИ С ФОНОВЫМ ИЗОБРАЖЕНИЕМ
========================================= */
.yarn-col-header {
    background-color: #8c7e91; 
    background-size: cover;    
    background-position: center; 
    background-repeat: no-repeat;
    color: #ffffff;
    padding: 18px 25px 18px 20px; 
    display: flex;
    flex-direction: column;
    position: relative;
    border-left: 6px solid #fb5a6c; /* Стилизованная левая плашка кораллового цвета */
}

.yarn-col-subtitle {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 2px;
    font-weight: 500;
}

.yarn-col-title {
    font-size: 26px;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    margin: 0;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Овальная кнопка "Смотреть" */
.yarn-btn-more {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    color: #8c7e91;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    font-weight: 700;
    transition: background-color 0.2s, color 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.yarn-btn-more:hover {
    background: #fb5a6c;
    color: #ffffff;
}

/* =========================================
   СЕТКА ТОВАРОВ ВНУТРИ КОЛОНКИ (2x2)
========================================= */
.yarn-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
    flex-grow: 1; 
}

.yarn-item-card {
    display: flex;
    flex-direction: column;
}

/* Квадратная фотография */
.yarn-item-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #f5f5f5;
    overflow: hidden;
    margin-bottom: 12px;
}

.yarn-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.yarn-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.yarn-image-link:hover img {
    transform: scale(1.06);
}

/* Диагональная лента (Базовая структура) */
.yarn-ribbon {
    position: absolute;
    top: 15px;
    left: -40px;
    background-color: #ffc107; /* Желтый цвет по умолчанию */
    color: #000000;
    padding: 4px 45px;
    font-size: 9px; 
    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;
    pointer-events: none;
    white-space: nowrap;
}

/* Цветовые вариации бейджей в зависимости от статуса */
.yarn-ribbon.ribbon-green { background-color: #10b981; color: #ffffff; }
.yarn-ribbon.ribbon-yellow { background-color: #f59e0b; color: #ffffff; }
.yarn-ribbon.ribbon-red { background-color: #ef4444; color: #ffffff; }
.yarn-ribbon.ribbon-blue { background-color: #6366f1; color: #ffffff; }

/* Сердечко В избранное */
.yarn-wishlist-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    z-index: 10;
    padding: 5px;
    transition: color 0.2s ease, transform 0.2s ease;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

.yarn-wishlist-btn:hover {
    color: #fb5a6c;
    transform: scale(1.15);
}

/* Текстовая информация под пряжей */
.yarn-item-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.yarn-item-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
    color: #333333;
}

.yarn-item-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.yarn-item-title a:hover {
    color: #936098;
}

/* =========================================
   АДАПТИВНОСТЬ
========================================= */
@media screen and (max-width: 1024px) {
    .yarn-columns-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .yarn-columns-wrapper {
        grid-template-columns: 1fr;
    }
}