/* =========================================================
   MOSTVIDEO — карточки товаров в категории
   Чистая версия без конфликтующих дублей
   ========================================================= */

/* ---------- Сетка 3 / 2 / 1 ---------- */


.category-products-responsive {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;

    -ms-flex-wrap: wrap;
    flex-wrap: wrap;

    width: 100%;
    max-width: 100%;
    margin: 0 -6px;
    box-sizing: border-box;
}

.category-product-responsive-item {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;

    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;

    width: calc(33.333333% - 12px);
    max-width: calc(33.333333% - 12px);
    min-width: 0;

    margin: 0 6px 14px;
    padding: 0;
    box-sizing: border-box;

    background: #ffffff;
    border: 1px solid #e3e3e3;
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* ---------- Заголовок ---------- */

.category-product-responsive-item .hd_brief {
    min-height: 40px;
    padding: 10px 12px 8px;

    color: #006699;
    background: #ffffff;
    border-bottom: 1px solid #ededed;

    font-size: 15px;
    line-height: 1.25;
    font-weight: bold;
    word-wrap: break-word;
}

.category-product-responsive-item .hd_brief a {
    color: #006699;
    text-decoration: none;
}

.category-product-responsive-item .hd_brief a:hover {
    color: #f06b00;
    text-decoration: none;
}

/* ---------- Верх карточки: цена и две кнопки ---------- */

.category-product-responsive-item table.category-product-topbar {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto;
}

.category-product-responsive-item table.category-product-topbar > tbody > tr > td.hdbtop {
    padding: 8px 10px !important;
}

.category-product-responsive-item .category-price-cell {
    width: 1%;
    padding: 0 10px 0 0;
    white-space: nowrap;
    vertical-align: middle;
}

.category-product-responsive-item .category-price-table {
    margin: 0 !important;
}

.category-product-responsive-item .price {
    padding: 0;
    color: #e36f0b;
    font-family: Arial, Verdana, sans-serif !important;
    font-size: 22px;
    line-height: 28px;
    font-weight: bold !important;
    white-space: nowrap;
}

.category-product-responsive-item .market-price {
    font-size: 13px;
    line-height: 18px;
}

.category-product-responsive-item .category-top-actions-cell {
    width: 100% !important;
    padding: 0 !important;
    white-space: nowrap;
    vertical-align: middle;
    text-align: right !important;
}

.category-product-responsive-item .category-top-actions-cell > table {
    width: auto !important;
    margin: 0 0 0 auto !important;
}

.category-product-responsive-item .category-buy-cell {
    padding: 0 !important;
    border-left: 0 !important;
}

.category-product-responsive-item .category-buy-actions {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;

    -ms-flex-wrap: nowrap;
    flex-wrap: nowrap;

    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;

    -webkit-box-pack: end;
    -ms-flex-pack: end;
    justify-content: flex-end;

    width: auto;
    min-width: 0;
    gap: 7px;
    white-space: nowrap;
}

/* В корзину */

.category-product-responsive-item .category-add-cart-button {
    display: -webkit-inline-box !important;
    display: -ms-inline-flexbox !important;
    display: inline-flex !important;

    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;

    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;

    -webkit-box-flex: 0;
    -ms-flex: 0 1 128px;
    flex: 0 1 128px;

    width: 110px !important;
    min-width: 108px !important;
    max-width: 128px !important;
    height: 25px !important;
    padding: 0 9px !important;
    box-sizing: border-box;

    color: #ffffff !important;
    background: linear-gradient(180deg, #f58b14 0%, #df6900 100%);
    border: 1px solid #c95e00;
    border-radius: 7px;

    font-size: 13px !important;
    line-height: 36px !important;
    font-weight: 500;
    text-align: center;
    text-decoration: none !important;
    white-space: nowrap;

    box-shadow: 0 2px 5px rgba(0,0,0,0.20);
}

.category-product-responsive-item .category-add-cart-button:hover {
    color: #ffffff !important;
    background: linear-gradient(180deg, #ffa22f 0%, #eb7600 100%);
    text-decoration: none !important;
}

.category-product-responsive-item .category-cart-icon {
    display: inline-block;
    margin-right: 6px;
    font-family: "Segoe UI Symbol", Arial, sans-serif;
    font-size: 17px;
    line-height: 1;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

/* В избранное — компактное квадратное сердце */

.category-product-responsive-item .category-favorite-button {
    display: -webkit-inline-box !important;
    display: -ms-inline-flexbox !important;
    display: inline-flex !important;

    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;

    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;

    -webkit-box-flex: 0;
    -ms-flex: 0 0 40px;
    flex: 0 0 40px;

    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    height: 25px !important;

    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;

    color: #ffffff !important;
    background: linear-gradient(180deg, #f58b14 0%, #df6900 100%);
    border: 1px solid #c95e00;
    border-radius: 7px;

    text-align: center;
    text-decoration: none !important;
    white-space: nowrap;

    box-shadow: 0 2px 5px rgba(0,0,0,0.16);
}

.category-product-responsive-item .category-favorite-button:hover {
    color: #ffffff !important;
    background: linear-gradient(180deg, #ffa22f 0%, #eb7600 100%);
    text-decoration: none !important;
}

/* Добавлено в избранное: белая кнопка и красное заполненное сердце */
.category-product-responsive-item .category-favorite-button_active {
    color: #d92525 !important;
    background: #ffffff;
    border-color: #d92525;
}

.category-product-responsive-item .category-favorite-button_active:hover {
    color: #c71919 !important;
    background: #fff3f3;
}

/* Само сердце */
.category-product-responsive-item .category-favorite-icon {
    display: block;
    margin: 0 !important;
    color: inherit;
    font-family: "Segoe UI Symbol", Arial, sans-serif;
    font-size: 25px !important;
    line-height: 1 !important;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

/* Текст остаётся в HTML для JavaScript, но визуально скрыт */
.category-product-responsive-item .category-favorite-text {
    position: absolute !important;
    overflow: hidden !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    clip: rect(0, 0, 0, 0) !important;
}

/* ---------- Разделитель под ценой ---------- */

.category-product-responsive-item td[style*="background-color: #CCCCCC"] {
    background-color: #eeeeee !important;
}

/* ---------- Основная часть карточки ---------- */

.category-product-responsive-item .hdbtop {
    background: #ffffff;
}

.category-product-responsive-item .imboxl,
.category-product-responsive-item .imboxr {
    width: 150px;
    min-width: 150px;
    padding-right: 12px;
    text-align: center;
    vertical-align: top;
}

.category-product-responsive-item .imboxl img.imboxl-podr,
.category-product-responsive-item .imboxr img.imboxl-podr {
    display: block;
    width: auto !important;
    max-width: 140px !important;
    min-width: 0 !important;
    max-height: 205px;
    height: auto !important;

    margin: 0 auto !important;
    padding: 3px;

    background: #ffffff;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

.category-product-responsive-item strong {
    display: inline;
    color: #222222;
    font-size: 12px;
    line-height: 1.45;
}

.category-product-responsive-item form {
    margin: 0;
}

.category-product-responsive-item .WCHhider {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 32px;

    margin: 4px 0 8px;
    padding: 3px 28px 3px 7px;
    box-sizing: border-box;

    background: #f7f8fa;
    border: 1px solid #bfc4ca;
    border-radius: 5px;

    font-size: 12px;
}

/* ---------- Нижние кнопки ---------- */

.category-product-footer-actions {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;

    -ms-flex-wrap: nowrap;
    flex-wrap: nowrap;

    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;

    -webkit-box-pack: start;
    -ms-flex-pack: start;
    justify-content: flex-start;

    width: 100%;
    margin-top: auto;
    padding: 7px 10px 9px;
    gap: 8px;
    box-sizing: border-box;

    background: #ffffff;
    border-top: 1px solid #ededed;
}

.category-product-footer-actions .category-quick-view-button,
.category-product-footer-actions .category-more-button {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;

    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;

    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;

    min-width: 0 !important;
    height: 23px !important;
    padding: 0 9px !important;
    box-sizing: border-box;

    border-radius: 6px;

    font-size: 11px !important;
    line-height: 21px !important;
    font-weight: bold;
    white-space: nowrap;
    text-align: center;
    text-decoration: none !important;
}

.category-product-footer-actions .category-quick-view-button {
    -webkit-box-flex: 0;
    -ms-flex: 0 1 165px;
    flex: 0 1 165px;

    width: 165px !important;

    color: #006699 !important;
    background: #f2f8fc;
    border: 1px solid #9cc7df;
}

.category-product-footer-actions .category-quick-view-button:hover {
    color: #00527d !important;
    background: #e4f3fb;
    text-decoration: none !important;
}

.category-product-footer-actions .category-quick-view-button i {
    margin-right: 5px;
}

.category-product-footer-actions .category-more-button {
    -webkit-box-flex: 0;
    -ms-flex: 0 1 120px;
    flex: 0 1 120px;

    width: 120px !important;

    color: #df6900 !important;
    background: #ffffff;
    border: 1px solid #ed8c38;
}

.category-product-footer-actions .category-more-button:hover {
    color: #ce5e00 !important;
    background: #fff6ed;
    text-decoration: none !important;
}

/* ---------- Среднее окно: две карточки ---------- */

@media screen and (max-width: 1350px) {
    .category-product-responsive-item,
    .category-product-responsive-item:nth-child(2n),
    .category-product-responsive-item:nth-child(3n) {
        width: calc(50% - 12px) !important;
        max-width: calc(50% - 12px) !important;
        min-width: 0 !important;
        margin: 0 6px 14px !important;
        padding-right: 0 !important;
    }
}

/* ---------- Узкий экран: одна карточка ---------- */

@media screen and (max-width: 850px) {
    .category-products-responsive {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .category-product-responsive-item,
    .category-product-responsive-item:nth-child(2n),
    .category-product-responsive-item:nth-child(3n) {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 12px !important;
    }
}

/* ---------- Совсем узкий телефон ---------- */

@media screen and (max-width: 560px) {
    .category-product-responsive-item .hd_brief {
        min-height: 0;
        font-size: 14px;
    }

    .category-product-responsive-item .category-price-cell {
        padding-right: 6px;
    }

    .category-product-responsive-item .price {
        font-size: 19px;
    }

    .category-product-responsive-item .category-buy-actions {
        gap: 5px;
    }

    .category-product-responsive-item .category-add-cart-button {
        width: 116px !important;
        min-width: 100px !important;
        max-width: 116px !important;
        padding: 0 6px !important;
        font-size: 12px !important;
    }

    .category-product-responsive-item .category-favorite-button {
        width: 30px !important;
        min-width: 30px !important;
        max-width: 30px !important;
        padding: 0 !important;
    }

    .category-product-responsive-item .imboxl,
    .category-product-responsive-item .imboxr {
        width: 110px;
        min-width: 110px;
        padding-right: 8px;
    }

    .category-product-responsive-item .imboxl img.imboxl-podr,
    .category-product-responsive-item .imboxr img.imboxl-podr {
        max-width: 102px !important;
        max-height: 155px;
    }

    .category-product-footer-actions .category-quick-view-button {
        width: auto !important;
        -webkit-box-flex: 1;
        -ms-flex: 1 1 58%;
        flex: 1 1 58%;
    }

    .category-product-footer-actions .category-more-button {
        width: auto !important;
        -webkit-box-flex: 1;
        -ms-flex: 1 1 42%;
        flex: 1 1 42%;
    }
}
