/* ════════════════════════════════════════
   SHOP PAGE
   ════════════════════════════════════════ */

/* ── Page header ── */
.shop-page-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}
.shop-page-head__icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #9F7AEA, #38B2AC);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    flex-shrink: 0;
}
.shop-page-head__title {
    font-size: 28px;
    font-weight: 800;
    color: #322659;
    line-height: 1;
    margin: 0;
}
.shop-page-head__sub {
    font-size: 14px;
    color: #aaa;
    margin-top: 4px;
}

/* ── Two-column layout ── */
.shop-layout {
    display: flex;
    gap: 24px;
    align-items: stretch;
}
.shop-left  { flex: 0 0 62%; min-width: 0; }
.shop-right { flex: 0 0 calc(38% - 24px); min-width: 0; position: relative; }

/* Sticky right column */
.shop-right-sticky {
    position: sticky;
    top: 76px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Generic shop card ── */
.shop-card {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 2px 16px rgba(50,38,89,.07);
    border: 1px solid #f0ebff;
}
.shop-card__head {
    margin-bottom: 20px;
}
.shop-card__title {
    font-size: 18px;
    font-weight: 700;
    color: #322659;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
}
.shop-card__title i { color: #9F7AEA; font-size: 20px; }
.shop-card__sub {
    font-size: 13px;
    color: #aaa;
    margin: 0;
    line-height: 1.5;
}

/* ── Balance card ── */
.balance-card {
    background: linear-gradient(135deg, #322659 0%, #553c9a 60%, #38B2AC 140%);
    border-radius: 20px;
    padding: 24px;
    color: #fff;
    text-align: center;
    box-shadow: 0 8px 28px rgba(50,38,89,.25);
}
.balance-card__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .8px;
    opacity: .7;
    margin-bottom: 8px;
}
.balance-card__amount {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 48px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 6px;
}
.balance-card__amount i { font-size: 36px; color: #fcd34d; }
.balance-card__num { color: #fff; }
.balance-card__sub {
    font-size: 13px;
    opacity: .6;
}
.balance-card--guest {
    background: linear-gradient(135deg, #f5f0ff, #e6faf8);
    color: #322659;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 14px;
    text-align: center;
}
.balance-card--guest p { color: #888; line-height: 1.5; }

/* ── Topup list (sidebar) ── */
.topup-section { }
.topup-empty { color: #aaa; text-align: center; padding: 20px 0; font-size: 14px; }
.topup-list { display: flex; flex-direction: column; gap: 10px; }

.topup-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #faf5ff;
    border: 1.5px solid #ede9f8;
    border-radius: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.topup-row:hover {
    border-color: #c4b5fd;
    box-shadow: 0 4px 14px rgba(159,122,234,.12);
}
.topup-row__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #9F7AEA22, #38B2AC22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #9F7AEA;
    flex-shrink: 0;
}
.topup-row__info { flex: 1; min-width: 0; }
.topup-row__name { font-size: 13px; font-weight: 700; color: #322659; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topup-row__desc { font-size: 11px; color: #aaa; margin-top: 1px; }
.topup-row__right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.topup-row__price { font-size: 14px; font-weight: 800; color: #322659; }

.topup-btn-sm {
    padding: 6px 14px;
    background: linear-gradient(135deg, #9F7AEA, #38B2AC);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.topup-btn-sm:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(56,178,172,.4); }
.topup-btn-sm:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* For guest balance card login button */
.topup-btn {
    padding: 11px 20px;
    background: linear-gradient(135deg, #9F7AEA, #38B2AC);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    width: 100%;
}
.topup-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(56,178,172,.4); }
.topup-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── Hint box ── */
.shop-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.5;
}
.shop-hint i { font-size: 16px; color: #f59e0b; flex-shrink: 0; margin-top: 1px; }

/* ── Category tabs ── */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.cat-tab {
    padding: 7px 16px;
    border-radius: 20px;
    border: 1.5px solid #ede9f8;
    background: #faf5ff;
    color: #9b8ec4;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.cat-tab:hover  { background: #f0ebff; color: #322659; border-color: #c4b5fd; }
.cat-tab.active { background: #9F7AEA; color: #fff; border-color: #9F7AEA; }

/* ── Items grid ── */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}
.items-empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 48px 0;
    color: #ccc;
    font-size: 14px;
}
.items-empty i { font-size: 40px; display: block; margin-bottom: 10px; }

/* ── Item card ── */
.item-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    border: 1.5px solid #ede9f8;
    display: flex;
    flex-direction: column;
    transition: transform .2s, box-shadow .2s;
}
.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,.1);
}

/* Rarity strip */
.item-rarity-strip { height: 4px; }
.rarity-common    .item-rarity-strip { background: #d1d5db; }
.rarity-rare      .item-rarity-strip { background: linear-gradient(90deg,#3b82f6,#60a5fa); }
.rarity-epic      .item-rarity-strip { background: linear-gradient(90deg,#7c3aed,#a78bfa); }
.rarity-legendary .item-rarity-strip { background: linear-gradient(90deg,#d97706,#fcd34d,#f59e0b); }

/* Preview */
.item-preview {
    height: 120px;
    background: #f5f0ff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.item-preview .bg-prev { position: absolute; inset: 0; }
.item-preview .bg-prev video { width: 100%; height: 100%; object-fit: cover; }
.item-preview .av-prev .gt-avatar-wrap { width: 64px; height: 64px; }
.item-preview .av-prev .gt-avatar-initial { font-size: 24px; }

/* Body */
.item-body {
    padding: 12px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.item-rarity-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.rarity-common    .item-rarity-label { color: #6b7280; }
.rarity-rare      .item-rarity-label { color: #3b82f6; }
.rarity-epic      .item-rarity-label { color: #8b5cf6; }
.rarity-legendary .item-rarity-label { color: #f59e0b; }
.item-name  { font-size: 14px; font-weight: 700; color: #322659; line-height: 1.2; }
.item-desc  { font-size: 12px; color: #888; line-height: 1.3; flex: 1; }
.item-price { font-size: 14px; font-weight: 800; color: #9F7AEA; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.item-price i { font-size: 13px; }

/* Actions */
.item-actions {
    padding: 10px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.item-hint { font-size: 11px; color: #aaa; text-align: center; line-height: 1.4; }

.item-btn {
    width: 100%;
    padding: 9px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.item-btn:hover:not(:disabled) { transform: translateY(-1px); }
.item-btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-buy     { background: linear-gradient(135deg,#9F7AEA,#38B2AC); color: #fff; }
.btn-equip   { background: #ede9f8; color: #7c3aed; }
.btn-unequip { background: #fef3c7; color: #92400e; }

.badge-equipped {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}
.badge-not-logged { font-size: 12px; color: #aaa; text-align: center; padding: 6px 0; }

/* ════════════════════════════════════════
   MOBILE
   ════════════════════════════════════════ */
@media (max-width: 900px) {
    .shop-layout {
        flex-direction: column-reverse; /* баланс идёт сверху */
    }
    .shop-left,
    .shop-right { flex: none; width: 100%; }

    .shop-right-sticky { position: static; }

    /* На мобильных топап в строку */
    .topup-list { flex-direction: row; flex-wrap: wrap; }
    .topup-row  { flex: 1 1 calc(50% - 5px); min-width: 200px; }
    .topup-row__right { flex-direction: row; align-items: center; gap: 8px; }
}

@media (max-width: 560px) {
    .shop-page-head__title { font-size: 22px; }
    .shop-page-head__icon  { width: 42px; height: 42px; font-size: 20px; border-radius: 12px; }
    .items-grid { grid-template-columns: repeat(2, 1fr); }
    .topup-row  { flex: 1 1 100%; }
    .balance-card__amount { font-size: 38px; }
    .shop-card { padding: 18px; }
}
