/* =====================================================================
   ESAForum — Points Shop CSS  v8
   Created by ESAGAMES HOSTING SHIELD SRL
   ===================================================================== */

/* Points balance badge (also used by market, streak) */
.points-badge {
    background: linear-gradient(135deg, rgba(245,179,1,.16), rgba(245,179,1,.06));
    border: 1px solid rgba(245,179,1,.3);
    color: var(--amber);
    padding: 9px 16px;
    border-radius: 12px;
    font-size: 15px;
    flex-shrink: 0;
}
.points-badge b { color: #fff; }

/* ---- Free coins banner ---- */
.shop-free-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 20px;
    margin-bottom: 22px;
    background: linear-gradient(135deg,
        rgba(var(--primary-rgb, 124,92,255),.12) 0%,
        rgba(var(--primary-rgb, 124,92,255),.04) 100%);
    border: 1px solid rgba(var(--primary-rgb, 124,92,255),.28);
    border-radius: var(--radius-lg, 14px);
    overflow: hidden;
}
.shop-free-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.shop-free-ico { font-size: 26px; flex-shrink: 0; }
.shop-free-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.shop-free-text strong { color: #fff; font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-free-text span { font-size: 12.5px; color: var(--text-mute); overflow-wrap: break-word; word-break: break-word; }
.shop-free-btn {
    flex-shrink: 0;
    background: var(--grad-primary, linear-gradient(135deg,var(--primary),rgba(var(--primary-rgb,124,92,255),.7)));
    color: var(--on-accent, #fff);
    border: none;
    min-width: 72px;
}
.shop-free-btn.shop-free-claimed {
    background: rgba(46,230,166,.15);
    color: var(--green, #2ee6a6);
    border: 1px solid rgba(46,230,166,.3);
    cursor: default;
}

/* ---- Section heading ---- */
.shop-section-title {
    font-size: 19px;
    font-weight: 700;
    margin: 32px 0 16px;
    color: #fff;
    letter-spacing: -.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.shop-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    border-radius: 1px;
}

/* ---- Shop grid ---- */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
}
/* Ensure forms inside cards don't add extra width */
.shop-card form { width: 100%; box-sizing: border-box; }

/* ---- Shop card ---- */
.shop-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 16px 16px;
    text-align: center;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    overflow: hidden;
    /* subtle top accent line for depth */
    position: relative;
}
.shop-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb,124,92,255),.4), transparent);
    border-radius: 14px 14px 0 0;
    opacity: 0;
    transition: opacity var(--transition);
}
.shop-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--primary-rgb,124,92,255),.35);
    box-shadow: 0 8px 28px rgba(0,0,0,.3);
}
.shop-card:hover::before { opacity: 1; }

.shop-card.equipped {
    border-color: var(--green);
    box-shadow: 0 0 0 1px rgba(46,230,166,.25), 0 4px 18px rgba(46,230,166,.1);
}
.shop-card.equipped::before {
    background: linear-gradient(90deg, transparent, rgba(46,230,166,.45), transparent);
    opacity: 1;
}

/* Cosmetic preview area */
.shop-preview {
    height: 64px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    background: var(--surface-2);
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    overflow: hidden;
}

/* Gradient name color preview (for "grad:#a:#b" encoded items) */
.nc-grad {
    font-weight: 800;
    font-size: 18px;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glow name color preview */
.nc-glow {
    font-weight: 800;
    font-size: 18px;
}

.shop-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.35;
    color: #fff;
    /* two-line clamp on desktop; hard ellipsis avoided to keep names legible */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em; /* reserve two lines so cards stay uniform height */
}

.shop-price {
    color: var(--amber);
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Rarity accent colours on the price line — FIXED (meaningful), never themed */
.shop-price--common  { color: var(--text-dim); }
.shop-price--uncommon{ color: var(--green); }
.shop-price--rare    { color: #4a9eff; }
.shop-price--epic    { color: #9d7bff; }
.shop-price--legend  { color: var(--amber); }

/* "Equipped" indicator chip */
.shop-equipped-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--green);
    background: rgba(46,230,166,.1);
    border: 1px solid rgba(46,230,166,.25);
    border-radius: 999px;
    padding: 3px 9px;
    margin-bottom: 8px;
    align-self: center;
}

/* Desktop: wider grid + richer card on large screens */
@media (min-width: 1024px) {
    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
        gap: 20px;
    }
    .shop-card { padding: 24px 20px 18px; }
    .shop-preview { height: 72px; margin-bottom: 14px; border-radius: 11px; }
    .shop-name   { font-size: 15px; margin-bottom: 5px; }
    .shop-price  { font-size: 14px; margin-bottom: 16px; }
    .shop-section-title { font-size: 21px; margin: 36px 0 18px; }
    .shop-free-banner { padding: 16px 24px; }
    .shop-free-ico { font-size: 30px; }
    .shop-free-text strong { font-size: 15px; }
    .shop-free-text span { font-size: 13px; }
    .shop-free-btn { min-width: 84px; font-size: 14px; }
}

/* =====================================================================
   SHOP — RESPONSIVE
   ===================================================================== */

@media (max-width: 768px) {
    .points-badge {
        font-size: 13px;
        padding: 7px 12px;
    }
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .shop-card { padding: 14px 12px; }
    .shop-preview { height: 52px; border-radius: 9px; }
    .shop-name  { font-size: 13px; min-height: 2.65em; }
    .shop-price { font-size: 12px; margin-bottom: 10px; }
    .shop-section-title { font-size: 16px; margin: 22px 0 12px; }
}

@media (max-width: 480px) {
    .points-badge {
        font-size: 12px;
        padding: 6px 10px;
        width: auto;
        max-width: 100%;
        white-space: nowrap;
    }
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .shop-card    { padding: 12px 10px; }
    .shop-preview { height: 48px; margin-bottom: 8px; border-radius: 8px; }
    .shop-name    { font-size: 12.5px; min-height: 2.6em; }
    .shop-price   { font-size: 12px; margin-bottom: 8px; }
    /* Clamp preview text sizes */
    .nc-grad, .nc-glow, .shop-preview span[style] { font-size: 15px !important; }
    /* Buy/equip buttons — full touch target */
    .shop-card .btn { min-height: 36px; font-size: 12px; }
}

/* 390px: maintain 2 cols, just tweak spacing */
@media (max-width: 390px) {
    .shop-grid { gap: 8px; }
    .shop-card  { padding: 10px 8px; }
    .shop-preview { height: 42px; }
    .shop-name  { font-size: 12px; min-height: 2.55em; }
    .shop-card .btn { font-size: 11px; }
}

@media (max-width: 360px) {
    /* At 360px keep 2 cols — items are small enough, 1-col wastes space */
    .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
    .shop-card  { padding: 10px 7px; }
}
