/* Избранное: кнопка на карточке товара и счётчик в шапке */

.item-block {
    position: relative;
}

.fav-toggle {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #e3e8ef;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #9aa1ac;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.fav-toggle:hover {
    color: #d51932;
    border-color: #f3c2ca;
    transform: scale(1.06);
}

.fav-toggle__heart {
    display: block;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
}

.fav-toggle.is-active {
    color: #d51932;
    border-color: #f3c2ca;
    background: #fdecef;
}

.fav-toggle.is-active .fav-toggle__heart {
    fill: currentColor;
}

.fav-toggle.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Счётчик избранного в шапке */
.header--hoff .container .favorite .favorite-link {
    position: relative;
}

.header--hoff .container .favorite .fav-count {
    position: absolute;
    top: -6px;
    right: -10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #d51932;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
    pointer-events: none;
}

.header--hoff .container .favorite .fav-count[hidden] {
    display: none !important;
}

/* На мобильных иконка в шапке 24px — счётчик чуть компактнее */
@media (max-width: 767px) {
    .header--hoff .container .favorite .fav-count {
        top: -5px;
        right: -8px;
        min-width: 16px;
        height: 16px;
        font-size: 10px;
        line-height: 16px;
    }
}
