/* Favorites slide-out drawer — matches favorites page aesthetic */

.favorites-drawer {
    position: fixed;
    inset: 0;
    z-index: 100001;
    pointer-events: none;
}

.favorites-drawer.is-open {
    pointer-events: auto;
}

.favorites-drawer__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.favorites-drawer.is-open .favorites-drawer__overlay {
    opacity: 1;
}

.favorites-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    width: min(100%, 400px);
    height: 100%;
    max-height: 100vh;
    background: #f5f6f7;
    border-left: 1px solid #e8ecea;
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.1);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

body.admin-bar .favorites-drawer__panel {
    top: 32px;
    height: calc(100% - 32px);
    max-height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar .favorites-drawer__panel {
        top: 46px;
        height: calc(100% - 46px);
        max-height: calc(100vh - 46px);
    }
}

.favorites-drawer.is-open .favorites-drawer__panel {
    transform: translateX(0);
}

.favorites-drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.15rem 1.1rem;
    background: #f5f6f7;
    border-bottom: 1px solid #e8ecea;
}

.favorites-drawer__heading {
    min-width: 0;
}

.favorites-drawer__title {
    margin: 0 0 0.35rem;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111827;
}

.favorites-drawer__subtitle {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--color-muted);
}

.favorites-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #6b7280;
    font-size: 1.65rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.favorites-drawer__close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #111827;
}

.favorites-drawer__body {
    flex: 1 1 auto;
    overflow: auto;
    padding: 0.85rem 1rem 1rem;
}

.favorites-drawer__loading,
.favorites-drawer__empty {
    margin: 2.5rem 0;
    text-align: center;
    color: var(--color-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.favorites-drawer__empty-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    min-height: 44px;
    padding: 0.75rem 1.2rem;
    border-radius: 12px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.favorites-drawer__empty-cta:hover {
    opacity: 0.92;
    color: #fff;
}

.favorites-drawer__list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

/* Card — mirrors .favorites-card from favorites page */
.favorites-drawer-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: #fff;
}

.favorites-drawer-card__remove {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #9ca3af;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.favorites-drawer-card:hover .favorites-drawer-card__remove,
.favorites-drawer-card__remove:focus-visible {
    opacity: 1;
}

.favorites-drawer-card__remove:hover {
    background: #fff;
    color: #e11d48;
}

.favorites-drawer-card__remove svg {
    width: 14px;
    height: 14px;
}

.favorites-drawer-card__image {
    display: block;
    aspect-ratio: 1;
    background: #f8faf9;
}

.favorites-drawer-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.75rem;
}

.favorites-drawer-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.9rem 1rem 1rem;
}

.favorites-drawer-card__topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.favorites-drawer-card__name {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: #111827;
    text-decoration: none;
}

.favorites-drawer-card__name:hover {
    color: var(--color-primary);
}

.favorites-drawer-card__price {
    flex-shrink: 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-primary);
    text-align: right;
    white-space: nowrap;
}

.favorites-drawer-card__price del {
    display: block;
    color: #9ca3af;
    font-weight: 500;
    font-size: 0.78rem;
}

.favorites-drawer-card__price ins {
    text-decoration: none;
    color: #dc2626;
}

.favorites-drawer-card__attrs {
    list-style: none;
    margin: 0;
    padding: 0;
}

.favorites-drawer-card__attrs li {
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--color-muted);
}

.favorites-drawer-card__attrs span {
    color: #4b5563;
    font-weight: 500;
}

.favorites-drawer-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-top: 0.15rem;
}

.favorites-drawer-card__stock {
    font-size: 0.76rem;
    font-weight: 600;
}

.favorites-drawer-card__stock--in {
    color: #047857;
}

.favorites-drawer-card__stock--out {
    color: #b91c1c;
}

.favorites-drawer-card__actions {
    display: flex;
    justify-content: flex-end;
    flex: 1;
}

.favorites-drawer-card__add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.4rem 0.85rem;
    border: 0;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.favorites-drawer-card__add:hover {
    background: var(--color-primary);
}

.favorites-drawer-card__add.is-added {
    background: var(--color-primary);
}

.favorites-drawer-card__add:disabled {
    opacity: 0.65;
    cursor: wait;
}

.favorites-drawer-card__notify {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: transparent;
    color: #b91c1c;
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
}

.favorites-drawer-card__notify:hover {
    background: #fef2f2;
    color: #991b1b;
}

.favorites-drawer__footer {
    flex-shrink: 0;
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
    border-top: 1px solid #e8ecea;
    background: #fff;
}

.favorites-drawer__view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.favorites-drawer__view-all:hover {
    opacity: 0.92;
    color: #fff;
}

body.favorites-drawer-open {
    overflow: hidden;
}

@media (max-width: 480px) {
    .favorites-drawer__panel {
        width: 100%;
    }

    .favorites-drawer-card__remove {
        opacity: 1;
    }
}
