/* ===== Кнопка «в избранное» на карточках ===== */

.js-zhk-fav.is-active {
    color: var(--color-gold-500);
    border-color: var(--color-gold-500);
}
.js-zhk-fav.is-active svg {
    fill: currentColor;
}

/* ===== Иконка избранного в хедере ===== */

.site-header__fav-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: #fff;
    cursor: pointer;
}
.site-header__fav-toggle svg { width: 20px; height: 20px; }

.site-header__fav-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--color-gold-500);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

/* ===== Панель избранного (off-canvas) ===== */

.zhk-fav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 15, 23, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1000;
}
.zhk-fav-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.zhk-fav-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 92vw;
    background: #fff;
    box-shadow: -20px 0 50px rgba(17, 22, 34, 0.15);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}
.zhk-fav-panel.is-open {
    transform: translateX(0);
}

.zhk-fav-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
    border-bottom: 1px solid #eceef1;
}
.zhk-fav-panel__title {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 20px;
    color: var(--color-dark-950);
    margin: 0;
}
.zhk-fav-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: #8a90a0;
    cursor: pointer;
}
.zhk-fav-panel__close svg { width: 18px; height: 18px; }

.zhk-fav-panel__list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zhk-fav-panel__empty,
.zhk-fav-panel__loading {
    font-family: var(--font-sans);
    font-size: 14px;
    color: #8a90a0;
    text-align: center;
    padding: 40px 12px;
}

.zhk-fav-item {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 10px;
    border: 1px solid #eceef1;
    border-radius: 14px;
}
.zhk-fav-item__media {
    display: block;
    width: 76px;
    height: 76px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--color-dark-900);
}
.zhk-fav-item__media img { width: 100%; height: 100%; object-fit: cover; }

.zhk-fav-item__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 20px;
}
.zhk-fav-item__title {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 15px;
    color: var(--color-dark-950);
    text-decoration: none;
}
.zhk-fav-item__price {
    font-family: var(--font-sans);
    font-size: 13px;
    color: #5b6270;
}
.zhk-fav-item__link {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-gold-600);
    text-decoration: none;
    margin-top: 2px;
}

.zhk-fav-item__remove {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: #f4f5f6;
    color: #8a90a0;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}
.zhk-fav-item__remove:hover { background: #eceef1; color: var(--color-dark-950); }

body.zhk-fav-open {
    overflow: hidden;
}

/* ===== Раскрывающийся поиск в хедере ===== */

.site-header__search {
    position: relative;
    display: flex;
    align-items: center;
}
.site-header__search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: #fff;
    cursor: pointer;
}
.site-header__search-form {
    position: absolute;
    top: 100%;
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 0;
    padding: 0;
    background: #fff;
    border: 1px solid #eceef1;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(17, 22, 34, 0.12);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: width 0.25s ease, opacity 0.2s ease, visibility 0.25s ease, padding 0.25s ease;
    margin-top: 10px;
}
.site-header__search.is-open .site-header__search-form {
    width: 300px;
    padding: 6px 6px 6px 16px;
    opacity: 1;
    visibility: visible;
}
.site-header__search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-family: var(--font-sans);
    font-size: 14px;
    background: none;
}
.site-header__search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: none;
    border-radius: 8px;
    background: var(--color-gold-500);
    color: #fff;
    cursor: pointer;
}
.site-header__search-submit svg { width: 14px; height: 14px; }

@media (max-width: 480px) {
    .site-header__search.is-open .site-header__search-form {
        width: 240px;
    }
}
