/* Shop page styles */
.shop-hero {
  text-align: center;
  padding: 60px 20px 30px;
}
.shop-hero h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
  color: #e0e0e0;
}
.shop-hero p {
  color: #999; font-size: 1.05rem; max-width: 520px; margin: 0 auto;
}

/* Billing toggle */
.billing-toggle {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; margin: 28px auto 36px;
  font-size: 0.97rem; color: #ccc;
}
.billing-toggle span.active { color: #5b8dd9; font-weight: 700; }
.toggle-switch {
  position: relative; width: 48px; height: 26px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #444; border-radius: 26px; cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider:before {
  content: '';
  position: absolute; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: #5b8dd9; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(22px); }

/* Rank cards */
.shop-cards {
  display: flex; flex-wrap: wrap; gap: 28px;
  justify-content: center; padding: 0 20px 60px;
  max-width: 900px; margin: 0 auto;
}
.rank-card {
  background: #1a1a2e;
  border: 2px solid #333;
  border-radius: 16px;
  padding: 32px 28px 28px;
  width: 300px;
  display: flex; flex-direction: column;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.rank-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
}
.rank-card.owned {
  border-color: #5b8dd9;
}
.rank-card-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: #5b8dd9; color: #fff; font-size: 0.78rem; font-weight: 700;
  padding: 3px 14px; border-radius: 20px; white-space: nowrap;
  display: none;
}
.rank-card.owned .rank-card-badge { display: block; }
.rank-card-name {
  font-size: 1.5rem; font-weight: 800; margin-bottom: 6px;
}
.rank-card-price {
  font-size: 2rem; font-weight: 800; margin-bottom: 4px;
}
.rank-card-price-sub {
  font-size: 0.85rem; color: #888; margin-bottom: 20px;
}
.rank-card-features {
  list-style: none; padding: 0; margin: 0 0 24px;
  flex: 1; display: flex; flex-direction: column; gap: 8px;
}
.rank-card-features li {
  font-size: 0.92rem; color: #ccc; display: flex; align-items: flex-start; gap: 8px;
}
.rank-card-features li::before {
  content: '✓'; color: #5b8dd9; font-weight: 700; flex-shrink: 0; margin-top: 1px;
}
.rank-buy-btn {
  width: 100%; padding: 11px 0;
  background: #5b8dd9; color: #fff; border: none; border-radius: 9px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: background 0.2s;
}
.rank-buy-btn:hover { background: #4a7bc8; }
.rank-buy-btn:disabled { background: #444; cursor: not-allowed; }
.rank-buy-btn.upgrade-btn { background: #7c5be5; }
.rank-buy-btn.upgrade-btn:hover { background: #6b4ad4; }

/* Upgrade banner */
.upgrade-note {
  font-size: 0.8rem; color: #aaa; text-align: center; margin-top: 8px;
}

/* ── Payment Modal ── */
.shop-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  z-index: 10001;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.shop-modal-overlay.visible { opacity: 1; pointer-events: all; }
.shop-modal {
  background: #1a1a2e; border: 1px solid #444; border-radius: 14px;
  width: 420px; max-width: 95vw; padding: 28px 28px 24px;
  position: relative; transition: transform 0.2s;
  transform: translateY(-12px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
}
.shop-modal-overlay.visible .shop-modal { transform: translateY(0); }
.shop-modal-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; color: #888; font-size: 1.4rem; cursor: pointer;
}
.shop-modal-close:hover { color: #fff; }
.shop-modal h2 { margin: 0 0 6px; font-size: 1.3rem; }
.shop-modal-subtitle { color: #999; font-size: 0.9rem; margin-bottom: 20px; }
#payment-element { margin-bottom: 18px; }
.shop-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 0;
  color: #aaa;
  font-size: 0.95rem;
}
.shop-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18);
  border-top-color: #5b8dd9;
  animation: shop-spin 0.8s linear infinite;
}
@keyframes shop-spin {
  to { transform: rotate(360deg); }
}


/* Overlay that stays until Stripe Element is ready */
#payment-element { position: relative; min-height: 88px; }
#payment-element-inner { min-height: 88px; }
.shop-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.shop-loading-overlay.hidden { opacity: 0; }
.shop-pay-btn {
  width: 100%; padding: 11px 0;
  background: #5b8dd9; color: #fff; border: none; border-radius: 9px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: background 0.2s;
}
.shop-pay-btn:hover { background: #4a7bc8; }
.shop-pay-btn:disabled { background: #444; cursor: not-allowed; }
.shop-modal-error {
  color: #e05a5a; font-size: 0.88rem; background: #2a1010;
  border-radius: 6px; padding: 8px 12px; margin-top: 8px; display: none;
}
.shop-modal-error.visible { display: block; }
.shop-mc-warning {
  background: #2a1a0a; border: 1px solid #7c5a22;
  border-radius: 8px; padding: 14px 16px; margin-bottom: 16px;
  font-size: 0.9rem; color: #ffcd7a; line-height: 1.5;
}
.shop-mc-warning a { color: #5b8dd9; }
