.cf-fav-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease;
    z-index: 99;
}

.cf-fav-btn:hover {
    transform: scale(1.15);
}

.cf-fav-btn:active {
    transform: scale(0.9);
}

/* Ascunde butoanele DOAR pentru guests până când JS actualizează starea - previne flash-ul la refresh */
body.cf-guest:not(.cf-initialized) .cf-fav-btn {
    opacity: 0;
}

body.cf-guest.cf-initialized .cf-fav-btn {
    opacity: 1;
    transition: opacity 0.15s ease;
}

.cf-fav-icon {
    position: relative;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cf-icon-empty,
.cf-icon-filled {
    width: 20px;
    height: 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cf-icon-empty {
    color: #888;
    opacity: 1;
}

.cf-icon-filled {
    color: #386356;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
}

/* Hover pe buton - inima devine verde */
.cf-fav-btn:hover .cf-icon-empty {
    color: #386356;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Stare activă - inima plină */
.cf-fav-btn.cf-fav-active .cf-icon-empty {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
}

.cf-fav-btn.cf-fav-active .cf-icon-filled {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Hover pe buton activ */
.cf-fav-btn.cf-fav-active:hover .cf-icon-filled {
    transform: translate(-50%, -50%) scale(1.15);
}

.cf-fav-btn .cf-fav-label {
    display: none;
}

.cf-favorites-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.cf-favorites-grid .product_img img {
    width: 100%;
    max-width: 180px;
    height: 180px;
    object-fit: contain;
    aspect-ratio: 1 / 1;
    transition: transform 0.3s ease;
}

.cf-favorites-grid .product_content{
    display: flex;
    width: 100%;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    }

.cf-favorites-grid .product_content h3{
    margin-block: 24px;
    font-size: 1.6rem;
    font-weight: 500;
    color: #000;
}

.cf-favorites-grid .product_card{
    border: 1px solid #F4F4F6;
    padding: 30px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cf-favorites-grid .product_card .product_img {
    position: relative !important;
}

.cf-favorites-grid .favorite_btn{
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    left: auto !important;
    z-index: 90;
}

/* Badge discount pe imagine */
.cf-favorites-grid .product_img {
    position: relative;
}

.cf-favorites-grid .product_img .price_discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e53935;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 80;
}

.cf-fav-product {
    border-radius: 16px;
    border: 1px solid #eee;
    padding: 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cf-fav-thumb img {
    border-radius: 12px;
    width: 100%;
    height: auto;
    display: block;
}

.cf-fav-title {
    font-size: 15px;
    margin: 0;
}

.cf-fav-title a {
    text-decoration: none;
    color: #111;
}

.cf-fav-price {
    font-weight: 600;
    font-size: 15px;
}

.cf-fav-actions {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Badge count pentru header */
.cf-fav-count {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: #386356;
    border-radius: 50%;
}

/* Badge-ul și favorite_item - ascunse pentru guests până JS inițializează */
body.cf-guest:not(.cf-initialized) .cf-fav-count,
body.cf-guest:not(.cf-initialized) .favorite_item.active {
    visibility: hidden;
}

/* Responsive grid */
@media (max-width: 1200px) {
    .cf-favorites-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .cf-favorites-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (max-width: 640px) {
    .cf-favorites-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .cf-favorites-grid .product_img img {
        height: 120px;
    }
    .cf-favorites-grid .product_card{
        padding: 10px;
    }
}