.market-header__search-preview[hidden] {
    display: none !important;
}

.market-header__search-preview {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 18;
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(252, 228, 77, 0.08), transparent 32%),
        linear-gradient(180deg, rgba(19, 31, 49, 0.98), rgba(14, 24, 38, 0.98));
    box-shadow: var(--shadow-lg);
}

.market-header__search-preview.is-loading {
    pointer-events: none;
}

.market-header__search-preview-empty {
    padding: 10px 12px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

.market-header__search-preview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 132px;
    padding: 20px 16px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
}

.market-header__search-preview-loader {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    background: rgba(11, 19, 32, 0.72);
    backdrop-filter: blur(6px);
}

.market-header__search-preview-spinner {
    display: inline-flex;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.14);
    border-top-color: var(--yellow);
    border-radius: 50%;
    animation: market-header-search-spin 0.75s linear infinite;
}

@keyframes market-header-search-spin {
    to {
        transform: rotate(360deg);
    }
}

.market-header__search-preview-list {
    display: grid;
    gap: 8px;
}

.market-header__search-preview-item {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.market-header__search-preview-item:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.06);
}

.market-header__search-preview-media {
    display: block;
    width: 128px;
    aspect-ratio: 460 / 215;
    overflow: hidden;
}

.market-header__search-preview-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.market-header__search-preview-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px 10px 0;
}

.market-header__search-preview-copy strong {
    display: block;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-header__search-preview-meta {
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.market-header__search-preview-price {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 800;
}

.market-header__search-preview-more {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    align-self: flex-start;
    justify-self: flex-start;
    width: fit-content;
    max-width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 800;
}

.market-header__search-preview-more:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.06);
}

.market-header[data-desktop-search-expanded="true"] .market-header__main {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.market-header[data-desktop-search-expanded="true"] .market-header__search-form--desktop {
    max-width: none;
}

.market-header[data-desktop-search-expanded="true"] .market-header__nav {
    display: none;
}

.market-header__account-menu[hidden] {
    display: none;
}

.market-header__account-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 236px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(252, 228, 77, 0.1), transparent 38%),
        linear-gradient(180deg, rgba(19, 31, 49, 0.98), rgba(14, 24, 38, 0.98));
    box-shadow: var(--shadow-lg);
}

.market-header__account-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: flex-start;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 800;
    text-decoration: none;
}

.market-header__account-menu-item:hover {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.05);
}

.market-header__account-menu-item:disabled {
    opacity: 0.65;
    cursor: wait;
}

.market-header__mobile-shell[hidden] {
    display: none !important;
}

.market-header__mobile-shell {
    position: fixed;
    inset: 0;
    z-index: 65;
}

.market-header__mobile-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    border-radius: 0;
    background: rgba(5, 10, 18, 0.7);
    backdrop-filter: blur(8px);
}

.market-header__mobile-panel {
    position: absolute;
    border: 1px solid var(--border);
    border-radius: 28px;
    background:
        radial-gradient(circle at top left, rgba(252, 228, 77, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(19, 31, 49, 0.98), rgba(14, 24, 38, 0.98));
    box-shadow: var(--shadow-lg);
}

.market-header__mobile-panel--menu {
    top: 14px;
    right: 14px;
    bottom: 14px;
    width: min(380px, calc(100vw - 28px));
    display: grid;
    align-content: start;
    gap: 18px;
    padding: 20px;
    overflow-y: auto;
}

.market-header__mobile-panel--search {
    top: 14px;
    left: 50%;
    width: min(560px, calc(100vw - 28px));
    display: grid;
    gap: 18px;
    padding: 20px;
    transform: translateX(-50%);
}

.market-header__mobile-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 32px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 800;
}

.market-header__mobile-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 1.6rem;
    line-height: 1;
}

.market-header__mobile-search-form,
.market-header__mobile-nav,
.market-header__mobile-section {
    display: grid;
    gap: 14px;
}

.market-header__search-form--mobile {
    max-width: none;
}

.market-header__search-input--mobile {
    height: 54px;
    background: rgba(255, 255, 255, 0.04);
}

.market-header__search-submit--mobile {
    right: 9px;
}

.market-header__mobile-section-title {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.market-header__mobile-search-hint {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
}

.market-header__mobile-link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 800;
    text-align: left;
    text-decoration: none;
}

.market-header__mobile-link:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.06);
}

.market-header__mobile-section--legal {
    gap: 10px;
}

.market-header__mobile-legal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.market-header__mobile-legal a {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.market-header__mobile-legal a:hover {
    color: var(--text-primary);
}

body.site-auth-open {
    overflow: hidden;
}

body.site-header-open {
    overflow: hidden;
}

.site-auth[hidden] {
    display: none;
}

.site-auth {
    position: fixed;
    inset: 0;
    z-index: 120;
    overflow-y: auto;
}

.site-auth__backdrop {
    display: none;
}

.site-auth__dialog {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100%;
    padding: 28px 24px;
    background: rgba(4, 10, 18, 0.78);
    backdrop-filter: blur(18px);
}

.site-auth__shell {
    position: relative;
    width: min(460px, 100%);
    margin: max(12px, 4vh) 0;
    padding: 32px;
    border: 1px solid rgba(252, 228, 77, 0.16);
    border-radius: 30px;
    background:
        radial-gradient(circle at top right, rgba(252, 228, 77, 0.12), transparent 32%),
        linear-gradient(180deg, rgba(19, 31, 49, 0.98), rgba(14, 24, 38, 0.98));
    box-shadow: var(--shadow-lg);
}

.site-auth__close {
    position: absolute;
    top: 18px;
    right: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.7rem;
    line-height: 1;
}

.site-auth__close:hover {
    border-color: var(--border-strong);
}

.site-auth__eyebrow {
    color: var(--yellow);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.site-auth__subtitle {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.65;
}

.site-auth__status {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    line-height: 1.55;
}

.site-auth__status--error {
    border-color: rgba(255, 107, 107, 0.26);
    background: rgba(255, 107, 107, 0.09);
}

.site-auth__status--success {
    border-color: rgba(39, 198, 123, 0.24);
    background: rgba(39, 198, 123, 0.1);
}

.site-auth__forms {
    margin-top: 24px;
    width: 100%;
}

.site-auth__form {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 14px;
}

.site-auth__form.is-active {
    display: flex;
}

.site-auth__field {
    display: block;
}

.site-auth__field[hidden] {
    display: none !important;
}

.site-auth__meta-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.site-auth__meta-row[hidden] {
    display: none !important;
}

.site-auth__helper {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.65;
}

.site-auth__helper--inline {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 0 6px;
    white-space: nowrap;
}

.site-auth__helper--legal {
    min-width: 0;
    font-size: 0.76rem;
    line-height: 1.55;
}

.site-auth__helper--legal a {
    color: var(--yellow);
}

.site-auth__helper--legal a:hover {
    color: var(--yellow-soft);
}

.site-auth__unavailable {
    padding: 28px 24px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.04);
    text-align: center;
}

.site-auth__unavailable-title {
    color: var(--text-primary);
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.5;
}

.site-auth__form .site-auth__text-button {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--yellow);
    box-shadow: none;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 800;
    justify-content: flex-start;
    min-height: auto;
}

.site-auth__form .site-auth__text-button:hover {
    color: var(--yellow-soft);
}

.site-auth__form .site-auth__text-button--inline {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
}

.site-auth__form button[type="submit"]:disabled {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.site-auth__oauth[hidden] {
    display: none;
}

.site-auth__oauth {
    display: grid;
    gap: 12px;
    margin-bottom: 8px;
}

.site-auth__oauth-buttons {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    justify-items: center;
    gap: 14px;
}

.site-auth__oauth-slot {
    display: flex;
    width: 100%;
    max-width: 228px;
    min-width: 0;
    justify-self: center;
}

.site-auth__oauth-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-height: 58px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 18px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
}

.site-auth__oauth-button:hover {
    transform: translateY(-1px);
}

.site-auth__oauth-button-title {
    font-size: 0.98rem;
    font-weight: 900;
    line-height: 1.1;
    white-space: nowrap;
}

.site-auth__oauth-badge {
    display: block;
    width: 228px;
    height: auto;
}

.site-auth__oauth-button--vk,
.site-auth__oauth-button--yandex {
    width: 100%;
    padding: 0;
    border: none;
    min-height: auto;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.site-auth__oauth-button--vk {
    border-radius: 12px;
    background: #0077ff;
    color: #ffffff;
    overflow: hidden;
}

.site-auth__oauth-vk-content {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 44px;
    padding: 4px 12px;
}

.site-auth__oauth-vk-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 36px;
}

.site-auth__oauth-vk-mark svg {
    display: block;
    width: 22px;
    height: 22px;
}

.site-auth__oauth-vk-text {
    color: #ffffff;
    font-size: 0.96rem;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
}

.site-auth__oauth-button--vk:hover {
    background: #0077ff;
    color: #ffffff;
    transform: none;
    box-shadow: none;
    filter: none;
}

.site-auth__oauth-button--yandex:hover {
    transform: none;
    box-shadow: none;
    filter: none;
}

@media (max-width: 760px) {
    .market-header__search-preview {
        top: calc(100% + 8px);
    }

    .market-header__account-menu {
        right: 0;
        min-width: 160px;
    }

    .market-header__mobile-panel--menu {
        top: 12px;
        right: 12px;
        bottom: 12px;
        width: min(360px, calc(100vw - 24px));
        padding: 18px;
        border-radius: 24px;
    }

    .market-header__mobile-panel--search {
        top: 12px;
        width: calc(100vw - 24px);
        padding: 18px;
        border-radius: 24px;
    }

    .market-header__mobile-legal {
        grid-template-columns: 1fr;
    }

    .site-auth__dialog {
        padding: 16px;
    }

    .site-auth__shell {
        margin: 0;
        padding: 24px 20px 20px;
        border-radius: 24px;
    }

    .site-auth__forms {
        max-width: 100%;
    }

    .site-auth__close {
        top: 14px;
        right: 14px;
    }
}

@media (hover: none), (pointer: coarse) {
    .market-header__search-preview-item:hover {
        border-color: rgba(255, 255, 255, 0.08);
        background: rgba(255, 255, 255, 0.04);
    }

    .market-header__search-preview-more:hover {
        border-color: rgba(255, 255, 255, 0.08);
        background: rgba(255, 255, 255, 0.04);
    }

    .market-header__account-menu-item:hover {
        border-color: transparent;
        background: transparent;
    }

    .market-header__mobile-link:hover {
        border-color: rgba(255, 255, 255, 0.08);
        background: rgba(255, 255, 255, 0.04);
    }

    .market-header__mobile-legal a:hover {
        color: var(--text-secondary);
    }

    .site-auth__close:hover {
        border-color: var(--border);
    }

    .site-auth__helper--legal a:hover,
    .site-auth__form .site-auth__text-button:hover {
        color: var(--yellow);
    }

    .site-auth__oauth-button:hover {
        transform: none;
    }
}
