/* «Избранное» samokatbook.ru */

.fav-btn {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #231f20;
    font: inherit;
    line-height: 1;
    cursor: pointer;
}
.fav-btn[hidden] { display: none !important; }

.fav-btn::before,
.fav-head::before {
    content: '';
    display: block;
    flex: 0 0 auto;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.5s-7.3-4.4-9.3-8.8C1.3 8.6 3.2 4.8 6.9 4.8c2.1 0 3.5 1.2 5.1 3 1.6-1.8 3-3 5.1-3 3.7 0 5.6 3.8 4.2 6.9-2 4.4-9.3 8.8-9.3 8.8z' fill='none' stroke='%23231F20' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.fav-btn.is-active::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.5s-7.3-4.4-9.3-8.8C1.3 8.6 3.2 4.8 6.9 4.8c2.1 0 3.5 1.2 5.1 3 1.6-1.8 3-3 5.1-3 3.7 0 5.6 3.8 4.2 6.9-2 4.4-9.3 8.8-9.3 8.8z' fill='%23FFBD17' stroke='%23231F20' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.fav-btn.is-loading { opacity: .5; pointer-events: none; }
.fav-btn:focus-visible { outline: 2px solid #231f20; outline-offset: 2px; }

/* карточка в каталоге — кружок поверх обложки */
.main-goods_image { position: relative; }
.fav-btn--card {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    width: 36px;
    height: 36px;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}
.fav-btn--card::before { width: 22px; height: 22px; }
@media (hover: hover) {
    .fav-btn--card:hover { background: #fff; }
}

/* страница книги — сердечко с подписью под заголовком */
.fav-btn--detail { margin: 0 0 14px; font-size: 16px; }
.fav-btn--detail::before { width: 24px; height: 24px; }
.fav-btn--detail::after { content: 'В избранное'; text-decoration: underline; text-underline-offset: 3px; }
.fav-btn--detail.is-active::after { content: 'В избранном'; text-decoration: none; }

/* страница книги — квадратная кнопка справа от «Купить» */
.fav-btn--buy {
    flex: 0 0 auto;
    width: 49px;
    height: 49px;
    margin-left: 12px;
    justify-content: center;
    box-sizing: border-box;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
}
.fav-btn--buy::before { width: 24px; height: 24px; }
@media (hover: hover) {
    .fav-btn--buy:hover { border-color: #231f20; }
}
@media (max-width: 520px) {
    /* на телефоне .wrap-btns — блок; ставим «Купить» и сердечко в одну строку */
    .wrap-btns .btn-buy-product,
    .wrap-btns .fav-btn--buy { display: inline-flex; vertical-align: middle; }
    /* чтобы сердечко поместилось справа от кнопки рядом с ценой */
    .wrap-price .detail-price { margin-right: 12px; }
    .fav-btn--buy { width: 40px; height: 40px; margin-left: 4px; }
    .fav-btn--buy::before { width: 22px; height: 22px; }
}
@media (max-width: 400px) {
    /* узкие телефоны (360 px): кнопка «Купить»/«Предзаказ» чуть уже, чтобы сердечко осталось в строке */
    .wrap-btns .product-detail_basket { width: 112px !important; background-size: 100% 100% !important; }
}

/* шапка */
.fav-head {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    text-decoration: none;
    vertical-align: middle;
}
.fav-head::before { width: 26px; height: 26px; }
.fav-head__count {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    box-sizing: border-box;
    border-radius: 9px;
    background: #FFBD17;
    color: #231f20;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
.fav-head__count.is-empty { display: none; }

.bar-fav {
    float: right;
    height: 52px;
    margin: 10px 14px 10px 0;
    padding: 10px 0;
    display: flex;
    align-items: center;
}
.fav-head--mobile { margin-right: 10px; }

/* страница /personal/favorites/ */
.fav-page .main-goods_item-new-section { visibility: hidden; }   /* пока скрипт расставляет порядок */
.fav-page .main-goods_item-new-section.is-sorted { visibility: visible; }
.fav-page h1 { margin-bottom: 20px; }
.fav-empty { padding: 20px 0 40px; font-size: 18px; line-height: 1.5; }
.fav-empty a.fav-empty__btn {
    display: inline-block;
    margin-top: 16px;
    padding: 7px 18px;
    border-radius: 7px 8px 6px 13px;
    background: #ffcb05;
    color: #231f20;
    text-decoration: none;
}
