/* ── Heart button ────────────────────────────────────────────────────────── */

.fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    pointer-events: auto;
    transition: transform 0.15s ease, background 0.15s ease;
    padding: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.fav-btn:hover {
    transform: scale(1.12);
    background: #fff;
}

.fav-btn .fa-heart {
    font-size: 16px;
    color: #bbb;
    transition: color 0.15s ease;
}

.fav-btn.fav-btn--saved .fa-heart {
    color: #e53935;
}

/* Larger variant for object detail page */
.fav-btn--lg {
    position: static;
    width: auto;
    height: auto;
    border-radius: 8px;
    background: #f5f5f5;
    padding: 7px 14px;
    gap: 7px;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
}

.fav-btn--lg:hover {
    background: #efefef;
    transform: none;
}

.fav-btn--lg .fa-heart {
    font-size: 15px;
}

.fav-btn--lg.fav-btn--saved {
    background: #fff0f0;
    color: #e53935;
}

.fav-btn--lg.fav-btn--saved .fa-heart {
    color: #e53935;
}

/* ── Header trigger button (top menu) ────────────────────────────────────── */

#favTriggerBtn.fav-header-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #ddd;
    color: #222;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

#favTriggerBtn.fav-header-btn:hover {
    background: #f7f7f7;
}

#favTriggerBtn.fav-header-btn .fa-heart {
    font-size: 18px;
}

.fav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* ── Overlay ─────────────────────────────────────────────────────────────── */

.fav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1300;
}

#favPanel.fav-panel--open .fav-overlay {
    display: block;
}

/* ── Desktop slide-in panel ─────────────────────────────────────────────── */

.fav-panel__drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 100vw;
    height: 100%;
    background: #fff;
    z-index: 1400;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 20px rgba(0,0,0,0.12);
}

#favPanel.fav-panel--open .fav-panel__drawer {
    transform: translateX(0);
}

.fav-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.fav-panel__title {
    font-size: 17px;
    font-weight: 600;
    color: #222;
    margin: 0;
}

.fav-panel__close {
    width: 34px;
    height: 34px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #555;
    transition: background 0.15s;
}

.fav-panel__close:hover {
    background: #ebebeb;
}

.fav-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

/* ── Mobile bottom sheet ─────────────────────────────────────────────────── */

.fav-sheet {
    display: none;
}

/* ── Cards inside panel ──────────────────────────────────────────────────── */

.fav-empty {
    text-align: center;
    color: #999;
    padding: 32px 0;
    font-size: 14px;
}

.fav-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f2f2f2;
}

.fav-card:last-child {
    border-bottom: none;
}

.fav-card__link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.fav-card__link:hover .fav-card__name {
    color: #1976d2;
    text-decoration: underline;
}

.fav-card__img {
    width: 64px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f0f0f0;
}

.fav-card__name {
    font-size: 13px;
    font-weight: 500;
    color: #222;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.fav-card__remove {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
    color: #bbb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
    padding: 0;
}

.fav-card__remove:hover {
    color: #e53935;
    background: #fff0f0;
}

/* ── Body lock when panel open ───────────────────────────────────────────── */

body.fav-panel-body-lock {
    overflow: hidden;
}

/* ── Mobile overrides ────────────────────────────────────────────────────── */

@media (max-width: 767px) {
    /* Hide desktop drawer */
    .fav-panel__drawer {
        display: none;
    }

    /* Show bottom sheet instead */
    .fav-sheet {
        display: flex;
        flex-direction: column;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 75vh;
        background: #fff;
        border-radius: 18px 18px 0 0;
        z-index: 10002;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.14);
    }

    #favPanel.fav-panel--open .fav-overlay {
        z-index: 10001;
    }

    #favPanel.fav-panel--open .fav-sheet {
        transform: translateY(0);
    }

    .fav-sheet__handle {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 12px 0 6px;
        cursor: pointer;
        flex-shrink: 0;
    }

    .fav-sheet__grabber {
        width: 38px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        display: block;
    }

    .fav-sheet__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 4px 16px 12px;
        border-bottom: 1px solid #f0f0f0;
        flex-shrink: 0;
    }

    .fav-sheet__title {
        font-size: 16px;
        font-weight: 600;
        color: #222;
        margin: 0;
    }

    .fav-sheet__close {
        width: 34px;
        height: 34px;
        border: none;
        background: #f5f5f5;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        color: #555;
        transition: background 0.15s;
        flex-shrink: 0;
        padding: 0;
    }

    .fav-sheet__close:hover {
        background: #ebebeb;
    }

    .fav-sheet__body {
        flex: 1;
        overflow-y: auto;
        padding: 10px 16px 24px;
        -webkit-overflow-scrolling: touch;
    }

}
