.favorite-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    border-radius: 4px;
    background: rgba(50, 60, 76, 0.50);
    backdrop-filter: blur(3.5px);
    display: flex;
    padding: 5px 10px;
    justify-content: center;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

@media (max-width: 1000px) {
    .favorite-btn {
        top: 10px;
        right: 10px;
    }
}

.heart {
    width: 18px;
    height: 18px;
}

.heart-outline {
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
}

.heart-fill {
    fill: none;
    stroke: #FF0000;
    stroke-width: 2;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 1s ease, fill 0.3s ease;
}

.favorite-btn__label {
    display: flex;
    align-items: center;
    overflow: hidden;
}

.favorite-btn__text,
.favorite-btn__count {
    color: #FFF;
    text-align: center;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 14px;
    white-space: nowrap;
    max-width: 120px;
    opacity: 1;
    transition:
        max-width 0.55s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.favorite-btn__count {
    max-width: 0;
    opacity: 0;
}

.catalog-card-image-wrap:hover .favorite-btn__text,
.card-gallery:hover .favorite-btn__text,
.favorite-btn.active .favorite-btn__text {
    max-width: 0;
    opacity: 0;
}

.catalog-card-image-wrap:hover .favorite-btn__count,
.card-gallery:hover .favorite-btn__count,
.favorite-btn.active .favorite-btn__count {
    max-width: 120px;
    opacity: 1;
}

.favorite-btn:hover .heart-fill {
    stroke-dashoffset: 0;
    fill: rgba(255, 0, 0, 0.2);
}

.favorite-btn.active .heart-fill {
    fill: #FF0000;
    stroke-dashoffset: 0;
    stroke: #FF0000;
}
