.frames-shop-page {
    padding: 22px;
    max-width: 1200px;
    margin: 0 auto;
}

.frames-shop-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 22px;
}

.frames-shop-title h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.frames-shop-title p {
    margin-top: 4px;
    color: var(--color-text-muted);
    font-size: 13px;
}

.frames-shop-balance {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 10px 16px;

    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);

    font-size: 14px;
    font-weight: 600;

    white-space: nowrap;
}

.frames-shop-balance i {
    color: #7dd3fc;
    font-size: 13px;
}

.frames-shop-balance small {
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 500;
}

.frames-shop-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;

    margin-bottom: 18px;
}

.frames-filter {
    padding: 7px 14px;

    color: var(--color-text-secondary);
    background: var(--color-surface);

    border: 1px solid var(--color-border);
    border-radius: var(--radius);

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition:
        color var(--transition-fast),
        background-color var(--transition-fast),
        border-color var(--transition-fast);
}

.frames-filter:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

.frames-filter.active {
    color: var(--color-primary-text);
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.frames-shop-meta {
    margin-left: auto;

    color: var(--color-text-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.frames-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.frame-card {
    display: flex;
    flex-direction: column;

    background: var(--color-surface);

    border: 1px solid var(--color-border);
    border-radius: var(--radius-large);

    overflow: hidden;

    transition:
        transform var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
}

.frame-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-border-light);
    box-shadow: var(--shadow);
}

.frame-card.owned {
    border-color: rgba(76, 175, 114, 0.35);
}

.frame-card-preview {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background: var(--color-bg-tertiary);
    border-bottom: 1px solid var(--color-border);
}

.frame-card-skeleton .frame-card-preview {
    height: 142px;
}

.frame-preview {
    position: relative;

    width: 96px;
    height: 96px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    overflow: visible;
}

.frame-preview-avatar {
    width: 96px;
    height: 96px;

    display: block;

    object-fit: cover;
    border-radius: 50%;

    border: 3px solid var(--color-surface);

    background: var(--color-bg-tertiary);

    position: relative;
    z-index: 1;
}

.frame-preview-image {
    overflow: visible;
}

.frame-preview-overlay-wrap {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 100px;
    height: 100px;

    transform: translate(-50%, -50%);

    overflow: hidden;

    pointer-events: none;
    user-select: none;

    z-index: 2;
}

.frame-preview-overlay {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

.frame-preview-css {
    overflow: visible;
}

.frame-card-info {
    flex: 1;

    display: flex;
    flex-direction: column;
    gap: 10px;

    padding: 14px;
}

.frame-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    min-width: 0;
}

.frame-card-name {
    font-size: 13px;
    font-weight: 700;

    color: var(--color-text);

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.frame-sales {
    flex-shrink: 0;

    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.frame-sales-low { color: #e0a03f; }

.frame-sales-out {
    color: #e86b6b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 10px;
}

.frame-card.sold-out { opacity: 0.72; }

.frame-card.sold-out:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--color-border);
}

.frame-card-description {
    margin: 0;

    color: var(--color-text-muted);
    font-size: 11px;
    line-height: 1.45;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;

    word-break: break-word;
}

.frame-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    margin-top: auto;
    padding-top: 10px;

    border-top: 1px solid var(--color-border);
}

.frame-price {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    color: var(--color-text);
    font-size: 13px;
    font-weight: 700;

    white-space: nowrap;
}

.frame-price i {
    color: #7dd3fc;
    font-size: 11px;
}

.frame-price-free {
    color: var(--color-text-muted);
    font-weight: 600;
}

.frame-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 32px;
    padding: 0 14px;

    border-radius: var(--radius-small);

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    white-space: nowrap;

    transition:
        background-color var(--transition-fast),
        color var(--transition-fast),
        border-color var(--transition-fast),
        opacity var(--transition-fast);
}

.frame-action-login,
.frame-action-buy {
    color: var(--color-primary-text);
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.frame-action-login:hover,
.frame-action-buy:hover {
    opacity: 0.9;
}

.frame-action-equip {
    color: var(--color-text);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
}

.frame-action-equip:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
    border-color: var(--color-border-light);
}

.frame-action-active {
    color: var(--color-success);
    background: rgba(76, 175, 114, 0.08);
    border: 1px solid rgba(76, 175, 114, 0.3);

    cursor: default;
}

.frame-action-disabled {
    color: var(--color-text-muted);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);

    opacity: 0.6;
    cursor: not-allowed;
}

.frame-action:disabled {
    cursor: default;
}

.frame-card-skeleton {
    pointer-events: none;
}

.frame-card-skeleton .frame-card-preview {
    background: var(--color-bg-tertiary);
    border-bottom: 1px solid var(--color-border);

    position: relative;
    overflow: hidden;
}

.frame-skeleton-line {
    height: 12px;

    background: var(--color-bg-tertiary);
    border-radius: 4px;

    position: relative;
    overflow: hidden;
}

.frame-skeleton-line-short {
    width: 60%;
    height: 10px;
}

.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: "";

    position: absolute;
    inset: 0;

    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.06) 50%,
        transparent 100%);

    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

.frames-shop-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;

    margin-top: 20px;
}

.frames-shop-pager:empty {
    display: none;
}

.pager-btn {
    min-width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 9px;

    color: var(--color-text-secondary);
    background: var(--color-surface);

    border: 1px solid var(--color-border);
    border-radius: var(--radius);

    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;

    cursor: pointer;

    transition:
        color var(--transition-fast),
        background-color var(--transition-fast),
        border-color var(--transition-fast);
}

.pager-btn:hover:not(:disabled) {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

.pager-btn.active {
    color: var(--color-primary-text);
    background: var(--color-primary);
    border-color: var(--color-primary);

    cursor: default;
}

.pager-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.pager-arrow {
    font-size: 10px;
}

.pager-gap {
    padding: 0 2px;

    color: var(--color-text-muted);
    font-size: 12px;
}

.frames-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 60px 20px;

    color: var(--color-text-muted);
    font-size: 13px;

    background: var(--color-surface);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-large);
}

.frames-empty i {
    font-size: 16px;
}

.toast-container {
    position: fixed;
    z-index: 1000;

    right: 20px;
    bottom: 20px;

    display: flex;
    flex-direction: column;
    gap: 8px;

    pointer-events: none;
}

.toast {
    padding: 12px 16px;

    background: var(--color-surface);
    color: var(--color-text);

    border: 1px solid var(--color-border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);

    font-size: 12px;
    font-weight: 500;

    max-width: 320px;

    opacity: 0;
    transform: translateY(8px);

    transition:
        opacity var(--transition-fast),
        transform var(--transition-fast);
}

.toast.toast-show {
    opacity: 1;
    transform: translateY(0);
}

.toast-error {
    color: var(--color-danger);
    border-color: rgba(220, 85, 85, 0.35);
    background: rgba(220, 85, 85, 0.08);
}

.toast-success {
    color: var(--color-success);
    border-color: rgba(76, 175, 114, 0.35);
    background: rgba(76, 175, 114, 0.08);
}

@keyframes ringPulse {
    0%, 100% { box-shadow: 0 0 0 2px var(--pulse-color, #ffffff); }
    50%      { box-shadow: 0 0 0 2px var(--pulse-color, #ffffff), 0 0 14px var(--pulse-color, #ffffff); }
}

@keyframes ringGlow {
    0%, 100% { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--glow-color, #ffffff); }
    50%      { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--glow-color, #ffffff), 0 0 22px var(--glow-color, #ffffff); }
}

@keyframes ringSparkle {
    0%, 100% { box-shadow: 0 0 0 2px var(--sparkle-color, #ffffff); }
    50%      { box-shadow: 0 0 0 2px var(--sparkle-color, #ffffff), 0 0 14px var(--sparkle-color, #ffffff); }
}

.frame-card.not-purchasable {
    opacity: 0.7;
}

.frame-card.not-purchasable:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--color-border);
}

.frame-card.not-purchasable .frame-card-preview {
    position: relative;
}

.frame-card.not-purchasable .frame-card-preview::after {
    content: "\f023";

    position: absolute;
    top: 8px;
    right: 8px;

    width: 26px;
    height: 26px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--color-text-muted);
    background: rgba(20, 24, 30, 0.75);
    backdrop-filter: blur(4px);

    border: 1px solid var(--color-border);
    border-radius: 50%;

    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 11px;
}

.frame-action-locked {
    color: var(--color-text-muted);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);

    opacity: 0.7;
    cursor: not-allowed;
}

.frame-card-badge-locked {
    display: inline-flex;
    align-items: center;
    gap: 4px;

    padding: 2px 8px;

    color: var(--color-text-muted);
    background: var(--color-bg-tertiary);

    border: 1px solid var(--color-border);
    border-radius: 10px;

    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.frame-card-badge-locked i {
    font-size: 9px;
}

.frame-price-locked {
    color: var(--color-text-muted);
    font-weight: 600;
}

.frame-price-locked i {
    color: var(--color-text-muted);
}

.cosmetic-author {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cosmetic-author-verified {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .frames-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 700px) {
    .frames-shop-page {
        padding: 14px;
    }

    .frames-shop-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .frames-shop-balance {
        align-self: flex-start;
    }

    .frames-shop-title h1 {
        font-size: 19px;
    }

    .frames-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }

    .frame-card-preview {
        padding: 18px;
    }

    .frame-preview,
    .frame-preview-avatar {
        width: 76px;
        height: 76px;
    }

    .frame-preview-overlay-wrap {
        width: 80px;
        height: 80px;
    }

    .frame-card-info {
        padding: 12px;
    }

    .frame-card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .frame-action {
        width: 100%;
    }

    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .toast {
        max-width: 100%;
    }
}

@media (max-width: 420px) {
    .frames-grid {
        grid-template-columns: 1fr 1fr;
    }

    .frame-card-name {
        font-size: 12px;
    }

    .frame-card-description {
        -webkit-line-clamp: 1;
    }
}