/* Карточки товаров в статьях блога (/blog/). Вид «плитка» и «строка». */

.blog-products{
    margin:35px auto;
    font-size:14px;
    line-height:1.5;
    color:#222;
    text-align:left;
}

.blog-products__card{
    display:flex;
    flex-direction:column;
    border:1px solid #ececec;
    background:#fafafa;
    padding:18px;
}

.blog-products__image{
    display:block;
    text-align:center;
    margin-bottom:10px;
}

.blog-products__image img{
    height:250px;
    width:auto;
    max-width:100%;
    object-fit:contain;
}

.blog-products__info{
    display:flex;
    flex-direction:column;
    flex:1;
}

/* Двойной класс — чтобы перебить цвет ссылок статьи (.blog-article a) */
.blog-products .blog-products__title{
    display:block;
    font-size:16px;
    line-height:1.35;
    font-weight:600;
    min-height:68px;
    margin-bottom:4px;
    color:#222;
    text-decoration:none;
}

.blog-products .blog-products__title:hover{
    color:#e0157e;
}

.blog-products__props{
    margin-bottom:8px;
}

.blog-products__prop{
    display:flex;
    align-items:baseline;
    margin-bottom:3px;
}

.blog-products__prop-name,
.blog-products__prop-value{
    white-space:nowrap;
}

.blog-products__prop-value{
    overflow:hidden;
    text-overflow:ellipsis;
}

.blog-products__prop-line{
    flex:1;
    min-width:12px;
    border-bottom:1px dotted #cfcfcf;
    margin:0 8px;
}

.blog-products__bottom{
    margin-top:auto;
}

.blog-products__prices{
    display:flex;
    flex-direction:column;
    align-items:center;
    margin-bottom:12px;
    line-height:1.2;
}

.blog-products__price{
    font-size:24px;
    font-weight:700;
    color:#e0157e;
    white-space:nowrap;
}

.blog-products__old-price{
    min-height:17px;
    margin-top:3px;
    font-size:14px;
    color:#666;
    text-decoration:line-through;
    white-space:nowrap;
}

.blog-products__actions{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

.blog-products__buy{
    flex:1;
    display:flex;
    align-items:center;
    justify-content:center;
    height:42px;
    padding:0 16px;
    border:none;
    background:#e0157e;
    color:#fff !important;
    font-size:14px;
    font-weight:600;
    text-decoration:none !important;
    cursor:pointer;
    white-space:nowrap;
}

.blog-products__buy:hover{
    background:#c41270;
}

/* Шаблон сайта задаёт .in-cart{display:block} и грузится позже — без усиления текст «В корзине» съезжает в угол */
.blog-products .blog-products__buy--in-cart{
    display:flex;
}

.blog-products__buy--unavailable{
    background:#e6e6e6;
    color:#666 !important;
}

.blog-products__buy--unavailable:hover{
    background:#dcdcdc;
}

.blog-products__qty{
    display:flex;
    align-items:center;
    height:42px;
    border:1px solid #ddd;
    background:#fff;
    flex-shrink:0;
}

/* Селекторы усилены: шаблон сайта сам задаёт размеры и отступы input[type=text] и кнопкам */
.blog-products .blog-products__qty button{
    width:30px;
    min-width:0;
    height:100%;
    padding:0;
    border:none;
    border-radius:0;
    background:#fff;
    color:#222;
    font-size:18px;
    line-height:1;
    cursor:pointer;
}

.blog-products .blog-products__qty input[type="text"]{
    width:36px;
    min-width:0;
    height:100%;
    padding:0;
    border:none;
    border-radius:0;
    background:#fff;
    box-shadow:none;
    text-align:center;
    font-size:15px;
}

.blog-products__note{
    margin-top:18px;
    font-size:12px;
    line-height:1.6;
    color:#555;
}

/* Плитка: число колонок = числу карточек, но не больше 4 */

.blog-products--grid{
    display:grid;
    gap:20px;
}

.blog-products--cols-1{ grid-template-columns:minmax(0, 260px); justify-content:center; }
.blog-products--cols-2{ grid-template-columns:repeat(2, minmax(0, 260px)); justify-content:center; }
.blog-products--cols-3{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
.blog-products--cols-4{ grid-template-columns:repeat(4, minmax(0, 1fr)); }

.blog-products--cols-4 .blog-products__card{
    padding:14px;
}

.blog-products--cols-4 .blog-products__image img{
    height:220px;
}

/* Строка: картинка слева, характеристики и покупка справа */

.blog-products--row .blog-products__card{
    flex-direction:row;
    align-items:flex-start;
    gap:56px;
    padding:26px;
    margin:40px 0;
}

.blog-products--row .blog-products__image{
    width:100px;
    flex-shrink:0;
    margin:0;
}

.blog-products--row .blog-products__image img{
    width:100%;
    height:auto;
}

.blog-products--row .blog-products__title{
    font-size:18px;
    line-height:1.45;
    min-height:0;
    margin-bottom:18px;
}

.blog-products--row .blog-products__props{
    line-height:1.9;
    color:#333;
    margin-bottom:18px;
}

.blog-products--row .blog-products__prop{
    margin-bottom:8px;
}

.blog-products--row .blog-products__bottom{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:16px;
    margin-top:0;
}

.blog-products--row .blog-products__prices{
    align-items:flex-start;
    margin:0;
}

.blog-products--row .blog-products__price{
    color:#111;
}

.blog-products--row .blog-products__price--sale{
    color:#e0157e;
}

.blog-products--row .blog-products__old-price:empty{
    display:none;
}

.blog-products--row .blog-products__buy{
    flex:none;
    padding:0 22px;
}

@media (max-width:1200px){
    .blog-products--cols-4{
        grid-template-columns:repeat(2, minmax(0, 260px));
        justify-content:center;
    }
}

@media (max-width:768px){
    .blog-products--grid,
    .blog-products--cols-4{
        grid-template-columns:repeat(2, minmax(0, 1fr));
        gap:12px;
    }

    /* Нечётная последняя карточка — по центру, шириной в одну колонку */
    .blog-products--grid .blog-products__card:last-child:nth-child(odd){
        grid-column:1 / -1;
        width:calc(50% - 6px);
        justify-self:center;
    }

    .blog-products--cols-1 .blog-products__card:last-child:nth-child(odd){
        width:100%;
        max-width:260px;
    }

    .blog-products__card,
    .blog-products--cols-4 .blog-products__card{
        padding:12px;
    }

    .blog-products__image img,
    .blog-products--cols-4 .blog-products__image img{
        height:180px;
    }

    .blog-products .blog-products__title{
        font-size:14px;
        min-height:56px;
    }

    .blog-products__props{
        font-size:13px;
    }

    .blog-products__price{
        font-size:20px;
    }

    .blog-products__buy{
        padding:0 8px;
    }

    .blog-products--row .blog-products__card{
        gap:20px;
        padding:16px;
    }

    .blog-products--row .blog-products__image{
        width:70px;
    }

    .blog-products--row .blog-products__title{
        font-size:16px;
        margin-bottom:12px;
    }
}
