.wishlist-btn {
    position: relative;
}

.wishlist-btn.is-active {
    color: #9f7547;
}

.wishlist-count {
    position: absolute;
    top: -2px;
    right: -2px;
    display: none;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #9f7547;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
}

.wishlist-count.is-visible {
    display: block;
}

.table-favorite {
    transition: color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.table-favorite:hover,
.table-favorite:focus-visible {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(48, 35, 24, .18);
}

.table-favorite.is-active {
    background: #9f7547;
    color: #fff;
}

.wishlist-panel {
    position: fixed;
    z-index: 1001;
    top: 78px;
    right: 76px;
    display: flex;
    flex-direction: column;
    width: min(390px, calc(100vw - 32px));
    max-height: min(650px, calc(100vh - 96px));
    overflow: hidden;
    border: 1px solid #e1d6ca;
    border-radius: 16px;
    background: #fffdf9;
    box-shadow: 0 24px 70px rgba(36, 29, 22, .24);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(.98);
    transform-origin: top right;
    transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}

.wishlist-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.wishlist-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 22px 18px;
    border-bottom: 1px solid #ece4db;
    background: #f5f0e9;
}

.wishlist-panel-header span {
    color: #9f7547;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
}

.wishlist-panel-header h2 {
    margin: 5px 0 0;
    font-family: Georgia, serif;
    font-size: 24px;
    font-weight: 400;
}

.wishlist-panel-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #ded3c7;
    border-radius: 50%;
    background: #fff;
    color: #5a5149;
    cursor: pointer;
}

.wishlist-panel-close:hover {
    background: #211d19;
    color: #fff;
}

.wishlist-items {
    overflow-y: auto;
    padding: 4px 20px;
}

.wishlist-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 8px;
    padding: 16px 0;
    border-bottom: 1px solid #eee7df;
}

.wishlist-item:last-child {
    border-bottom: 0;
}

.wishlist-item-link {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 14px;
    color: inherit;
    text-decoration: none;
}

.wishlist-item-image {
    width: 76px;
    height: 76px;
    border: 1px solid #e7ddd2;
    border-radius: 10px;
    background: #f1ebe4;
    object-fit: cover;
}

.wishlist-item-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wishlist-item-info strong {
    overflow: hidden;
    font-family: Georgia, serif;
    font-size: 17px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wishlist-item-info small {
    margin-top: 5px;
    color: #857a70;
    font-size: 12px;
}

.wishlist-item-info b {
    margin-top: 9px;
    color: #765330;
    font-size: 14px;
    font-weight: 700;
}

.wishlist-remove {
    align-self: start;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #a18f7d;
    cursor: pointer;
}

.wishlist-remove:hover {
    background: #f4ece5;
    color: #9b4135;
}

.wishlist-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 48px 25px;
    text-align: center;
}

.wishlist-empty.is-visible {
    display: flex;
}

.wishlist-empty i {
    margin-bottom: 15px;
    color: #b99774;
    font-size: 30px;
}

.wishlist-empty strong {
    font-family: Georgia, serif;
    font-size: 21px;
    font-weight: 400;
}

.wishlist-empty span {
    margin-top: 7px;
    color: #857a70;
    font-size: 13px;
}

.wishlist-panel-footer {
    padding: 16px 22px 18px;
    border-top: 1px solid #e8ded4;
    background: #f5f0e9;
}

.wishlist-panel-footer.is-hidden {
    display: none;
}

.wishlist-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid #d7c9bb;
    border-radius: 8px;
    background: #fff;
    color: #8d493e;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.wishlist-clear:hover {
    border-color: #9b4135;
    color: #9b4135;
}

@media (max-width: 700px) {
    .wishlist-panel {
        top: 70px;
        right: 10px;
        width: calc(100vw - 20px);
        max-height: calc(100vh - 82px);
    }

    .wishlist-panel-header {
        padding: 18px;
    }

    .wishlist-items {
        padding: 3px 16px;
    }

    .wishlist-panel-footer {
        padding: 14px 18px 16px;
    }
}
