/* BOX 5 - Account product grid inspired by compact game-account marketplaces. */
.apb5-shell {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto 2.75rem;
    padding-inline: 4px;
}

.apb5-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: clamp(20px, 1.45vw, 26px);
    row-gap: 22px;
    align-items: stretch;
}

.apb5-card {
    --apb5-accent: #5f73f2;
    --apb5-accent-hover: #4d61e6;
    --apb5-soft: #eef1ff;
    --apb5-border: #e5e7eb;
    --apb5-muted: #6b7280;
    background: #fff;
    border: 1px solid var(--apb5-border);
    border-radius: 8px;
    overflow: hidden;
    min-width: 0;
    min-height: 300px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    /* Skip most layout/paint work for cards far outside the viewport when supported. */
    content-visibility: auto;
    contain-intrinsic-size: 300px;
}

.apb5-card:hover {
    transform: translateY(-2px);
    border-color: #d9ddf2;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
}

.apb5-image-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.apb5-image-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    background: #f3f4f6;
}

.apb5-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.apb5-info {
    padding: 12px 14px 11px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.apb5-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.apb5-code {
    flex: 0 0 auto;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--apb5-soft);
    color: var(--apb5-accent);
    font-size: 11px;
    line-height: 1.4;
    font-weight: 700;
}

.apb5-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #111827;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
    text-decoration: none;
}

.apb5-name:hover {
    color: var(--apb5-accent);
}

.apb5-description {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--apb5-muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.apb5-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.apb5-stat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.35;
}

.apb5-stat i {
    font-size: 13px;
}

.apb5-stat strong {
    color: #111827;
    font-weight: 700;
}

.apb5-sold {
    padding: 3px 7px;
    border-radius: 5px;
    color: var(--apb5-accent);
    background: var(--apb5-soft);
}

.apb5-sold strong {
    color: var(--apb5-accent);
}

.apb5-footer {
    min-height: 55px;
    margin-top: auto;
    padding: 10px 14px;
    border-top: 1px solid #edf0f3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px auto;
    align-items: center;
    gap: 8px;
}

.apb5-price {
    min-width: 0;
    color: var(--apb5-accent);
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
    white-space: nowrap;
}

.apb5-detail {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    text-decoration: none;
    transition: color .15s ease, background .15s ease;
}

.apb5-detail:hover {
    color: var(--apb5-accent);
    background: var(--apb5-soft);
}

.apb5-detail i {
    font-size: 16px;
}

.apb5-buy {
    min-height: 34px;
    padding: 7px 13px;
    border: 0;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--apb5-accent);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(95, 115, 242, .22);
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.apb5-buy:hover:not(:disabled) {
    background: var(--apb5-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(95, 115, 242, .28);
}

.apb5-buy i {
    font-size: 15px;
}

.apb5-buy-disabled,
.apb5-buy:disabled {
    cursor: not-allowed;
    background: #eef0f4;
    color: #8b93a1;
    box-shadow: none;
}

/* When the global image setting is OFF the image node is not rendered at all.
   The card naturally starts at .apb5-info and shrinks without blank space. */
.apb5-card.apb5-no-image {
    min-height: 185px;
}

@media (max-width: 991.98px) {
    .apb5-shell {
        padding-inline: 2px;
    }

    .apb5-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 18px;
        row-gap: 18px;
    }
}

@media (max-width: 767.98px) {
    .apb5-shell {
        margin-bottom: 1.75rem;
    }

    .apb5-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .apb5-card {
        min-height: 0;
    }

    .apb5-info {
        padding: 12px;
    }

    .apb5-footer {
        padding: 10px 12px;
    }
}

@media (max-width: 380px) {
    .apb5-footer {
        grid-template-columns: minmax(0, 1fr) 24px auto;
        gap: 5px;
    }

    .apb5-detail {
        width: 24px;
        height: 24px;
    }

    .apb5-buy {
        padding-left: 10px;
        padding-right: 10px;
        font-size: 12px;
    }
}
