/* ============================================
   v2/css/shop.css
   استایل صفحه فروشگاه
   سایت اخبار استقلال — نسخه ۲
   نسخه: 2.1 — اصلاح z-index قاب
   ============================================ */

.shop-page {
  padding: 12px 12px 30px;
}

/* ============================================
   Hero
   ============================================ */
.shop-hero {
  text-align: center;
  padding: 24px 16px 20px;
  background: linear-gradient(145deg, rgba(21, 96, 189, .06), rgba(245, 200, 66, .12));
  border-radius: 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.shop-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -40%;
  width: 180%;
  height: 180%;
  background: radial-gradient(circle, rgba(245, 200, 66, .15) 0%, transparent 60%);
  pointer-events: none;
}

.shop-hero-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.9rem;
  box-shadow: 0 8px 24px rgba(21, 96, 189, .3);
  position: relative;
  z-index: 2;
}

.shop-hero h1 {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 6px;
  font-weight: 800;
  position: relative;
  z-index: 2;
}

.shop-hero p {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  position: relative;
  z-index: 2;
}

.shop-wallet {
  display: inline-flex;
  gap: 8px;
  background: #fff;
  padding: 8px 14px;
  border-radius: 30px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
  position: relative;
  z-index: 2;
}

.shop-wallet-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--primary);
}

.shop-wallet-item i {
  color: var(--gold);
  font-size: .9rem;
}

.shop-wallet-item small {
  font-size: .65rem;
  color: var(--text-muted);
  font-weight: 500;
}

.shop-wallet-item.vip {
  color: #d4a017;
  background: linear-gradient(145deg, #fff8e1, #fffdf5);
  padding: 2px 10px;
  border-radius: 20px;
  border: 1px solid rgba(245, 200, 66, .35);
}

.shop-wallet-item.vip i {
  color: #d4a017;
}

/* ============================================
   Tabs
   ============================================ */
.shop-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg);
  padding: 5px;
  border-radius: 30px;
  margin-bottom: 16px;
}

.shop-tab {
  flex: 1;
  padding: 10px;
  border-radius: 25px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .3s;
}

.shop-tab i {
  font-size: .9rem;
}

.shop-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

.shop-tab.active i {
  color: var(--gold);
}

.shop-tab-content {
  display: none;
}

.shop-tab-content.active {
  display: block;
  animation: shopFade .3s ease;
}

@keyframes shopFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Hint
   ============================================ */
.shop-section-hint {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.6;
}

.shop-section-hint i {
  color: var(--gold);
  flex-shrink: 0;
  font-size: .9rem;
}

.shop-section-hint.vip-hint {
  background: linear-gradient(145deg, #fff8e1, #fffdf5);
  border-color: rgba(245, 200, 66, .35);
  color: #8a6d1a;
}

.shop-section-hint.vip-hint i {
  color: #d4a017;
}

/* ============================================
   Loading / Empty
   ============================================ */
.shop-loading {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: .82rem;
  grid-column: 1 / -1;
}

.shop-loading i {
  animation: shopSpin 1s linear infinite;
  display: inline-block;
  margin-left: 6px;
}

@keyframes shopSpin {
  to { transform: rotate(360deg); }
}

.shop-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-light);
  font-size: .82rem;
  grid-column: 1 / -1;
}

.shop-empty i {
  display: block;
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: .5;
}

/* ============================================
   Frames Grid
   ============================================ */
.shop-frames-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.shop-frame-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  border: 2px solid var(--border);
  text-align: center;
  transition: all .25s;
  position: relative;
  display: flex;
  flex-direction: column;
}

.shop-frame-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
}

.shop-frame-card.owned {
  border-color: var(--success);
  background: linear-gradient(145deg, #f0fff4, #f8fff9);
}

.shop-frame-card.equipped {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 96, 189, .15);
}

.shop-frame-card.locked {
  opacity: .85;
}

.shop-frame-card.vip-only::before {
  content: '👑 VIP';
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(145deg, var(--gold), var(--gold-dark));
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .55rem;
  font-weight: 900;
  z-index: 5;
}

.shop-frame-avatar-wrapper {
  width: 90px;
  height: 90px;
  margin: 6px auto 10px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-frame-avatar-inner {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 1.6rem;
  overflow: hidden;
  border: 2px solid #fff;
  position: relative;
  z-index: 2;
}

.shop-frame-avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 🎯 قاب — بالاتر از آواتار و بدون override z-index */
.shop-frame-avatar-wrapper .frame-preview {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
  box-sizing: border-box;
}

.shop-frame-name {
  font-size: .8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.shop-frame-desc {
  font-size: .65rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
  min-height: 28px;
}

.shop-frame-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  font-weight: 900;
  color: var(--primary);
  background: var(--bg);
  padding: 4px 12px;
  border-radius: 20px;
  margin: 0 auto 10px;
}

.shop-frame-price i {
  color: var(--gold);
  font-size: .75rem;
}

.shop-frame-btn {
  width: 100%;
  padding: 9px;
  border-radius: 10px;
  border: none;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all .2s;
  touch-action: manipulation;
  margin-top: auto;
}

.shop-frame-btn.buy {
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(21, 96, 189, .25);
}

.shop-frame-btn.equip {
  background: var(--bg);
  color: var(--primary);
}

.shop-frame-btn.equipped {
  background: linear-gradient(145deg, var(--success), #27ae60);
  color: #fff;
  cursor: default;
}

.shop-frame-btn.unequip {
  background: #fff;
  color: var(--danger);
  border: 2px solid var(--danger);
}

.shop-frame-btn.locked {
  background: var(--bg);
  color: var(--text-light);
  cursor: not-allowed;
}

.shop-frame-btn:active:not(.locked):not(.equipped) {
  transform: scale(.97);
}

/* ============================================
   Coin Packages Grid
   ============================================ */
.shop-coins-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.shop-coin-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
  position: relative;
  transition: all .25s;
  display: flex;
  flex-direction: column;
}

.shop-coin-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.shop-coin-card.popular {
  border-color: var(--gold);
  background: linear-gradient(145deg, #fff, #fffdf5);
}

.shop-coin-card.popular::before {
  content: '⭐ پرفروش';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(145deg, var(--gold), var(--gold-dark));
  color: var(--primary);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: .6rem;
  font-weight: 900;
  white-space: nowrap;
}

.shop-coin-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--gold), var(--gold-dark));
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(245, 200, 66, .35);
}

.shop-coin-coins {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 4px;
}

.shop-coin-coins small {
  font-size: .65rem;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.shop-coin-name {
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.shop-coin-price {
  font-size: .9rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 10px;
}

.shop-coin-price small {
  font-size: .62rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 3px;
}

.shop-coin-discount {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--danger);
  color: #fff;
  padding: 2px 7px;
  border-radius: 8px;
  font-size: .6rem;
  font-weight: 900;
}

.shop-coin-btn {
  width: 100%;
  padding: 9px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 4px 12px rgba(21, 96, 189, .25);
  transition: transform .2s;
  touch-action: manipulation;
  margin-top: auto;
}

.shop-coin-btn:active {
  transform: scale(.97);
}

/* ============================================
   VIP Packages Grid
   ============================================ */
.shop-vip-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-vip-card {
  background: linear-gradient(145deg, #fff, #fffdf5);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  position: relative;
  transition: all .25s;
  display: flex;
  flex-direction: column;
}

.shop-vip-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 200, 66, .15);
}

.shop-vip-card.popular {
  border-color: var(--gold);
  background: linear-gradient(145deg, #fff8e1, #fffdf5);
  box-shadow: 0 8px 24px rgba(245, 200, 66, .25);
}

.shop-vip-card.popular::before {
  content: '⭐ پرطرفدار';
  position: absolute;
  top: -10px;
  right: 20px;
  background: linear-gradient(145deg, var(--gold), var(--gold-dark));
  color: var(--primary);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: .6rem;
  font-weight: 900;
}

.shop-vip-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.shop-vip-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--gold), var(--gold-dark));
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(245, 200, 66, .4);
}

.shop-vip-info {
  flex: 1;
  min-width: 0;
}

.shop-vip-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 3px;
}

.shop-vip-days {
  font-size: .72rem;
  color: var(--text-muted);
}

.shop-vip-days i {
  color: var(--gold);
  margin-left: 4px;
}

.shop-vip-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.shop-vip-price {
  display: flex;
  flex-direction: column;
}

.shop-vip-price-old {
  font-size: .72rem;
  color: var(--text-light);
  text-decoration: line-through;
  margin-bottom: 2px;
}

.shop-vip-price-now {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--primary);
}

.shop-vip-price-now small {
  font-size: .65rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 3px;
}

.shop-vip-discount {
  background: var(--danger);
  color: #fff;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: .68rem;
  font-weight: 900;
}

.shop-vip-btn {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(21, 96, 189, .25);
  transition: transform .2s;
  touch-action: manipulation;
  margin-top: 12px;
}

.shop-vip-btn:active {
  transform: scale(.97);
}

/* ============================================
   Popup
   ============================================ */
#shopBuyFramePopup .popup-content,
#shopBuyPackagePopup .popup-content {
  max-width: 400px;
  margin: auto;
  border-radius: 20px;
  max-height: 90vh;
}

.shop-popup-title {
  color: var(--primary);
  font-size: 1rem;
  text-align: center;
  margin-bottom: 16px;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.shop-popup-title i {
  color: var(--gold);
}

.shop-popup-frame-preview {
  width: 110px;
  height: 110px;
  margin: 0 auto 16px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-popup-frame-preview .shop-frame-avatar-inner {
  width: 94px;
  height: 94px;
  font-size: 2.2rem;
  z-index: 2;
}

.shop-popup-frame-preview .frame-preview {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
  box-sizing: border-box;
}

.shop-popup-package-preview {
  text-align: center;
  margin-bottom: 16px;
}

.shop-popup-package-preview .shop-vip-icon,
.shop-popup-package-preview .shop-coin-icon {
  width: 70px;
  height: 70px;
  font-size: 1.8rem;
  margin: 0 auto;
}

.shop-popup-info {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.shop-popup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: .82rem;
  color: var(--text-muted);
}

.shop-popup-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.shop-popup-row strong {
  color: var(--primary);
  font-weight: 700;
}

.shop-popup-row strong.gold {
  color: #d4a017;
}

.shop-popup-payment-note {
  background: #e8f4fd;
  border: 1px solid #b8d9ff;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: .75rem;
  color: #0d5aa0;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.5;
}

.shop-popup-payment-note i {
  color: #1560bd;
  font-size: .9rem;
  flex-shrink: 0;
}

.shop-popup-actions {
  display: flex;
  gap: 8px;
}

.shop-popup-btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform .2s;
  touch-action: manipulation;
}

.shop-popup-btn.cancel {
  background: var(--bg);
  color: var(--text-muted);
}

.shop-popup-btn.confirm {
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(21, 96, 189, .25);
}

.shop-popup-btn.confirm:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.shop-popup-btn:active:not(:disabled) {
  transform: scale(.97);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 380px) {
  .shop-hero h1 { font-size: 1.1rem; }
  .shop-hero-icon { width: 60px; height: 60px; font-size: 1.6rem; }
  .shop-tab { font-size: .75rem; padding: 8px; }
  .shop-tab i { font-size: .85rem; }
  .shop-frame-avatar-wrapper { width: 82px; height: 82px; }
  .shop-frame-avatar-inner { width: 68px; height: 68px; font-size: 1.4rem; }
  .shop-frame-name { font-size: .75rem; }
  .shop-coin-coins { font-size: 1rem; }
  .shop-vip-title { font-size: .9rem; }
  .shop-vip-price-now { font-size: .95rem; }
}