/**
 * Store page
 *
 * Reuses .board-tab from profile.css for the category filter.
 */

/* The hero and the section below it each carry generous padding, which on
   this page stacks into a large empty band above the storefront buttons.
   Pulled in here rather than changing the shared rules, which other pages
   rely on. */
.store-page .page-hero {
    min-height: auto;
    padding-bottom: 2rem;
}

.store-page .content-section {
    padding-top: 2.5rem;
}

/* Links out to the two storefronts */
.store-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.store-link {
    text-decoration: none;
}

/* The secondary button inherits Discord blurple from main.css; the token
   shop is not Discord, so it takes the site's own accent instead. */
.store-link.btn-secondary {
    background: rgba(255, 107, 53, 0.08);
    border-color: rgba(255, 107, 53, 0.5);
    color: var(--primary);
}

.store-link.btn-secondary:hover {
    background: rgba(255, 107, 53, 0.16);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.25);
}

.store-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 3rem;
}

/* ------------------------------------------------------------ categories */

.store-category {
    margin-bottom: 3.5rem;
}

.store-category-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.store-category-header h2 {
    font-size: 1.5rem;
    color: var(--primary);
}

.store-category-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Tebex category descriptions are long rich-text blocks. Clamped to a
   couple of lines so they introduce the section without burying the
   packages; the full text lives on the Tebex page. */
.store-category-desc {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* -------------------------------------------------------------- packages */

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

/* The whole card is the buy link */
.store-package {
    display: flex;
    flex-direction: column;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.store-package:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 107, 53, 0.5);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.store-package:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.store-package-image {
    position: relative;
    aspect-ratio: 16 / 10;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.store-package:hover .store-package-image img {
    transform: scale(1.05);
}

.store-package-placeholder {
    font-size: 2.5rem;
    opacity: 0.4;
}

/* Marks recurring packages so they are not mistaken for one-off buys */
.store-badge {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 107, 53, 0.9);
    color: #fff;
    border-radius: 6px;
}

.store-package-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem;
    gap: 0.5rem;
}

.store-package-name {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.store-package-desc {
    flex: 1;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-muted);
    /* Descriptions vary wildly in length; clamp keeps the grid even. */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.store-package-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.store-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.store-buy {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255, 107, 53, 0.12);
    border: 1px solid rgba(255, 107, 53, 0.35);
    border-radius: 8px;
    color: var(--primary);
    transition: all 0.2s ease;
}

.store-package:hover .store-buy {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
}

@media (max-width: 640px) {
    .store-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.85rem;
    }

    .store-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}
