:root {
    --shop-bg: #eef3fb;
    --shop-surface: rgba(255, 255, 255, 0.84);
    --shop-surface-strong: #ffffff;
    --shop-border: rgba(15, 38, 95, 0.08);
    --shop-shadow: 0 18px 45px rgba(24, 43, 88, 0.08);
    --shop-text: #173057;
    --shop-muted: #667790;
    --shop-accent: #0b51ff;
    --shop-accent-soft: rgba(11, 81, 255, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body.catalog-page {
    margin: 0;
    min-height: 100svh;
    padding: calc(var(--header-height) + 24px) 16px 32px;
    background:
        radial-gradient(circle at top left, rgba(123, 174, 255, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(84, 195, 255, 0.12), transparent 24%),
        linear-gradient(180deg, #f5f8fc 0%, #edf3fb 44%, #f8fafc 100%);
    color: var(--shop-text);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.character-center-container,
.shop-page__container {
    width: 100%;
    margin: 0 auto;
    padding: 0 40px;
}

.header-row,
.shop-toolbar {
    display: none;
}

.character-center-title,
.shop-toolbar__title {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--shop-text);
}

.header-controls,
.shop-toolbar__controls {
    display: none;
}

.filters-container,
.shop-filters {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    position: relative;
    z-index: 50;
}

.filter-group,
.shop-filters__group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-wrapper,
.shop-filter {
    position: relative;
    z-index: 60;
}

.filter-button,
.search-input,
.reset-filters {
    min-height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(23, 48, 87, 0.1);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 22px rgba(12, 31, 71, 0.04);
}

.filter-button {
    min-width: 156px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--shop-text);
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.filter-button:hover {
    border-color: rgba(11, 81, 255, 0.22);
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(12, 31, 71, 0.08);
}

.filter-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    min-width: 196px;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid rgba(23, 48, 87, 0.08);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 22px 50px rgba(12, 31, 71, 0.12);
    z-index: 80;
    display: none;
}

.filter-dropdown.show {
    display: block;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--shop-text);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.filter-option:hover,
.filter-option.active {
    background: var(--shop-accent-soft);
    color: var(--shop-accent);
}

.option-check {
    display: none;
}

.reset-filters {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    color: var(--shop-muted);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.reset-filters:hover {
    border-color: rgba(11, 81, 255, 0.24);
    color: var(--shop-accent);
    transform: translateY(-1px);
}

.search-container,
.shop-filters__search {
    position: relative;
    width: min(100%, 320px);
}

.search-input {
    width: 100%;
    padding: 0 16px 0 44px;
    color: var(--shop-text);
    font-size: 0.94rem;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-input:focus {
    border-color: rgba(11, 81, 255, 0.24);
    box-shadow: 0 0 0 4px rgba(11, 81, 255, 0.08);
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: #7a8aa6;
}

.characters-grid,
.shop-character-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    position: relative;
    z-index: 1;
    gap: 22px;
    margin-bottom: 30px;
}

.character-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 0;
    background: #ffffff;
    cursor: pointer;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.character-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
}

.character-image-container {
    position: relative;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    background: linear-gradient(180deg, #e8eef8, #dfe9f8);
}

.character-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.character-card:hover .character-image {
    transform: scale(1.04);
}

.character-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    gap: 12px;
}

.character-info__name {
    font-family: 'Source Han Sans CN', 'Noto Sans SC', sans-serif;
    font-style: normal;
    font-weight: 900;
    font-size: 40px;
    line-height: 60px;
    letter-spacing: 0.05em;
    color: #0B51FF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.character-info__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.character-price {
    flex-shrink: 0;
    font-family: 'Source Han Sans CN', 'Noto Sans SC', sans-serif;
    font-style: normal;
    font-weight: 900;
    font-size: 24px;
    line-height: 36px;
    text-align: right;
    color: #222222;
}

.character-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.type-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-family: 'Source Han Sans CN', 'Noto Sans SC', sans-serif;
    font-style: normal;
    font-weight: 900;
    font-size: 16px;
    line-height: 24px;
    white-space: nowrap;
}

.type-drop {
    color: #1763c6;
    background: rgba(23, 99, 198, 0.1);
}

.type-adopt {
    color: #d97e00;
    background: rgba(255, 149, 0, 0.1);
}

.type-recruit {
    color: #0a9a67;
    background: rgba(10, 154, 103, 0.12);
}

.status-open {
    color: #0B51FF;
    background: rgba(11, 81, 255, 0.08);
}

.status-soon {
    color: #b87600;
    background: rgba(255, 184, 0, 0.12);
}

.status-adopted {
    color: #5f6e86;
    background: rgba(95, 110, 134, 0.1);
}

.character-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
}

.character-image-container {
    position: relative;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    background: linear-gradient(180deg, #e8eef8, #dfe9f8);
}

.character-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.character-card:hover .character-image {
    transform: scale(1.04);
}

.character-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.45) 100%);
    pointer-events: none;
}

.character-overlay__top {
    display: flex;
    align-items: flex-start;
}

.character-overlay__bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.character-name {
    font-family: 'Source Han Sans CN', 'Noto Sans SC', sans-serif;
    font-style: normal;
    font-weight: 900;
    font-size: 40px;
    line-height: 60px;
    letter-spacing: 0.05em;
    color: #0B51FF;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.character-type-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.character-price {
    flex-shrink: 0;
    font-family: 'Source Han Sans CN', 'Noto Sans SC', sans-serif;
    font-style: normal;
    font-weight: 900;
    font-size: 24px;
    line-height: 36px;
    text-align: right;
    color: #222222;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.type-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 999px;
    font-family: 'Source Han Sans CN', 'Noto Sans SC', sans-serif;
    font-style: normal;
    font-weight: 900;
    font-size: 16px;
    line-height: 24px;
    text-align: right;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.type-drop {
    color: #ffffff;
    background: rgba(23, 99, 198, 0.6);
}

.type-adopt {
    color: #ffffff;
    background: rgba(255, 149, 0, 0.6);
}

.type-recruit {
    color: #ffffff;
    background: rgba(10, 154, 103, 0.6);
}

.status-open {
    color: #0B51FF;
    background: rgba(255, 255, 255, 0.75);
}

.status-soon {
    color: #b87600;
    background: rgba(255, 255, 255, 0.75);
}

.status-adopted {
    color: #5f6e86;
    background: rgba(255, 255, 255, 0.75);
}

.loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--shop-muted);
    font-size: 1rem;
    font-weight: 600;
}

.loader {
    width: 38px;
    height: 38px;
    margin-right: 14px;
    border-radius: 50%;
    border: 4px solid rgba(11, 81, 255, 0.12);
    border-top-color: var(--shop-accent);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.pagination-container,
.shop-pagination {
    display: flex;
    justify-content: center;
    margin: 10px 0 26px;
}

.pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.page-item {
    list-style: none;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 0;
    border: 1px solid rgba(15, 38, 95, 0.12);
    background: #ffffff;
    color: var(--shop-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.page-link:hover {
    border-color: rgba(11, 81, 255, 0.3);
    color: var(--shop-accent);
}

.page-item.active .page-link {
    background: var(--shop-accent);
    border-color: var(--shop-accent);
    color: #ffffff;
}

.page-item.disabled .page-link {
    color: #b5bfd0;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 1100px) {
    .characters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-container {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    body.catalog-page {
        padding: calc(var(--header-height) + 16px) 10px 22px;
    }

    .header-row {
        padding: 18px;
        border-radius: 22px;
    }

    .filters-container,
    .filter-group {
        width: 100%;
    }

    .filter-group {
        flex-wrap: wrap;
    }

    .filter-wrapper,
    .search-container {
        width: 100%;
    }

    .filter-button {
        width: 100%;
    }

    .reset-filters {
        justify-content: center;
        width: 100%;
    }

    .characters-grid {
        grid-template-columns: 1fr;
    }

    .character-info {
        padding: 12px 14px;
        gap: 8px;
    }

    .character-info__name {
        font-size: 24px;
        line-height: 36px;
    }

    .character-price {
        font-size: 18px;
        line-height: 28px;
    }

    .type-badge,
    .status-badge {
        gap: 3px;
        padding: 3px 7px;
        font-size: 12px;
        line-height: 18px;
    }

    .pagination {
        border-radius: 24px;
    }
}
