/* ============================================================
   Tebex live storefront — Goblins & Gunslingers Hytale server
   Renders packages from the Tebex Headless API on-brand.
   Inherits design tokens from styles/gng-2026.css.
   ============================================================ */

.tbx-store { margin: 0; }

/* ---- state messages (loading note / empty / error) ---- */
.tbx-state {
    margin: 0 0 1.25rem;
    padding: 1rem 1.2rem;
    border-radius: var(--gx-radius, 10px);
    border: 1px solid var(--gx-hairline, rgba(217, 172, 84, 0.16));
    background: var(--gx-glass, rgba(16, 12, 8, 0.72));
    color: var(--gx-ink-soft, #d9cbab);
    font-family: var(--font-body, 'Crimson Text', serif);
    line-height: 1.6;
    text-align: center;
}
.tbx-state a { color: var(--gx-gold, #d9ac54); }
.tbx-state.is-error {
    border-color: rgba(212, 84, 62, 0.4);
    background: linear-gradient(135deg, rgba(212, 84, 62, 0.12), rgba(212, 84, 62, 0.03));
}

/* ---- grid ---- */
.tbx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

/* ---- card ---- */
.tbx-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1.6rem 1.4rem;
    border-radius: 20px;
    background: linear-gradient(165deg, rgba(28, 22, 15, 0.9) 0%, rgba(13, 10, 7, 0.78) 100%);
    border: 1px solid var(--gx-hairline-strong, rgba(217, 172, 84, 0.34));
    transition: transform 0.3s var(--gx-ease, cubic-bezier(0.22, 1, 0.36, 1)), border-color 0.3s, box-shadow 0.3s;
}
.tbx-card:hover {
    transform: translateY(-6px);
    border-color: var(--gx-gold, #d9ac54);
    box-shadow: var(--gx-shadow, 0 18px 50px rgba(0, 0, 0, 0.45)), var(--gx-glow-gold, 0 0 28px rgba(217, 172, 84, 0.22));
}
.tbx-card.is-featured {
    border-color: rgba(217, 172, 84, 0.55);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4), 0 0 36px rgba(217, 172, 84, 0.16);
}

/* ---- flag pill (subscription / sale) ---- */
.tbx-flag {
    position: absolute;
    top: -0.7rem;
    left: 1.4rem;
    font-family: var(--font-ui, 'Inter', sans-serif);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gx-gold, #d9ac54), var(--gx-gold-hi, #f3cf75));
    color: #1a0f04;
    box-shadow: 0 6px 14px rgba(217, 172, 84, 0.4);
}
.tbx-flag.is-sub {
    background: linear-gradient(135deg, var(--gx-teal, #58c9cf), #8fe3e7);
    box-shadow: 0 6px 14px rgba(88, 201, 207, 0.35);
}

/* ---- thumbnail ---- */
.tbx-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--gx-radius, 10px);
    margin: 0 0 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--gx-hairline, rgba(217, 172, 84, 0.16));
}

.tbx-name {
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: 1.15rem;
    color: var(--gx-ink, #f4e9d3);
    margin: 0 0 0.3rem;
}
.tbx-price {
    font-family: var(--font-ui, 'Inter', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--gx-gold, #d9ac54);
    margin: 0 0 0.9rem;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tbx-interval {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gx-faint, #9a8b6e);
    text-transform: lowercase;
}
.tbx-was {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gx-faint, #9a8b6e);
    text-decoration: line-through;
}
.tbx-desc {
    font-family: var(--font-body, 'Crimson Text', serif);
    font-size: 0.95rem;
    color: var(--gx-ink-soft, #d9cbab);
    line-height: 1.6;
    margin: 0 0 1.2rem;
    flex: 1;
}
.tbx-desc p { margin: 0 0 0.5rem; }
.tbx-desc ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.tbx-desc li { margin: 0.15rem 0; }

/* ---- buy button ---- */
.tbx-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gx-gold, #d9ac54), var(--gx-gold-hi, #f3cf75));
    color: #1a0f04;
    font-family: var(--font-ui, 'Inter', sans-serif);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s, opacity 0.18s;
    box-shadow: 0 6px 16px rgba(217, 172, 84, 0.4);
}
.tbx-buy:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 28px rgba(217, 172, 84, 0.55);
}
.tbx-buy:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
.tbx-buy:disabled,
.tbx-buy.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

/* spinner shown while a checkout basket is being created */
.tbx-spin {
    width: 0.9em;
    height: 0.9em;
    border-radius: 50%;
    border: 2px solid rgba(26, 15, 4, 0.35);
    border-top-color: #1a0f04;
    animation: tbx-spin 0.6s linear infinite;
}
@keyframes tbx-spin { to { transform: rotate(360deg); } }

/* ---- loading skeletons ---- */
.tbx-skel {
    border-radius: 20px;
    min-height: 280px;
    background: linear-gradient(110deg, rgba(28, 22, 15, 0.7) 30%, rgba(60, 48, 30, 0.5) 50%, rgba(28, 22, 15, 0.7) 70%);
    background-size: 200% 100%;
    animation: tbx-shimmer 1.3s ease-in-out infinite;
    border: 1px solid var(--gx-hairline, rgba(217, 172, 84, 0.12));
}
@keyframes tbx-shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    .tbx-card, .tbx-buy { transition: none; }
    .tbx-skel, .tbx-spin { animation: none; }
}
