.shop-page {
  --shop-frame-accent: transparent;
  --shop-frame-gradient: linear-gradient(135deg, transparent, transparent);
  --shop-frame-glow: transparent;
  --shop-frame-width: 0px;
  --shop-effect-glow: transparent;
  --shop-effect-blur: 0px;
  --shop-effect-animation: none;
  --shop-page-gradient:
    radial-gradient(circle at top left, rgba(251,191,36,0.14), transparent 24%),
    radial-gradient(circle at top right, rgba(59,130,246,0.1), transparent 22%),
    linear-gradient(180deg, #f7f8fb 0%, #eef2f7 100%);
  background: var(--shop-page-gradient);
  color: #111;
}

.shop-shell,
.shop-shell * { box-sizing: border-box; }

.shop-shell {
  max-width: 1200px;
  margin: 24px auto 48px;
  padding: 0 24px;
}

.hidden { display: none !important; }

/* ── Toolbar ── */
.shop-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 0 0 20px;
  border-bottom: 1px solid #e5e5e5;
}

.shop-eyebrow {
  margin: 0 0 6px;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
}

.shop-toolbar-info h1 {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.shop-toolbar-desc {
  margin: 0;
  font-size: 13px;
  color: #777;
  line-height: 1.5;
}

.shop-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.shop-stat-pills { display: flex; gap: 6px; }

.shop-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e5e5e5;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.shop-currency-icon {
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
}

.shop-currency-icon[hidden] {
  display: none !important;
}

.shop-currency-icon-sm {
  width: 24px;
  height: 24px;
}

.shop-currency-icon-md {
  width: 26px;
  height: 26px;
}

.shop-toolbar-buttons { display: flex; gap: 6px; }

/* ── Buttons ── */
.shop-primary-btn,
.shop-ghost-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  font: 600 12.5px/1 Inter, sans-serif;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.shop-primary-btn {
  background: #111;
  color: #fff;
  border-color: #111;
}

.shop-primary-btn:hover:not(:disabled) { opacity: 0.88; }
.shop-primary-btn:active:not(:disabled) { transform: scale(0.97); }

.shop-ghost-btn {
  background: #fff;
  color: #444;
  border-color: #ddd;
}

.shop-ghost-btn:hover { background: #f5f5f5; }
.shop-primary-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Button shimmer */
.shop-primary-btn::after,
.shop-item-btn.primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255,255,255,0.06) 40%,
    rgba(255,255,255,0.12) 50%,
    rgba(255,255,255,0.06) 60%,
    transparent 80%
  );
  animation: shopShimmer 3.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shopShimmer {
  0% { left: -100%; }
  45%, 100% { left: 150%; }
}

/* ── Tabs ── */
.shop-tabs-bar {
  display: flex;
  gap: 8px;
  padding: 16px 0 0;
  border-bottom: 1px solid #e5e5e5;
  position: relative;
}

.shop-tabs-bar::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  width: 0;
  background: #111;
  border-radius: 1px;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.shop-tab {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: #999;
  font: 600 13px/1 Inter, sans-serif;
  cursor: pointer;
  transition: color 0.2s;
  margin-bottom: -1px;
}

.shop-tab:hover { color: #555; }
.shop-tab.active { color: #111; border-bottom-color: transparent; }

/* ── Layout ── */
.shop-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
  padding-top: 24px;
  align-items: start;
}

.shop-main {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.shop-sidebar {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 20px;
}

/* ── Sections ── */
.shop-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.shop-section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.shop-section-head span {
  font-size: 12px;
  color: #999;
  font-weight: 500;
}

/* ── Owned Row ── */
.shop-items-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.shop-items-row::-webkit-scrollbar { height: 3px; }
.shop-items-row::-webkit-scrollbar-track { background: transparent; }
.shop-items-row::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 3px; }

.shop-items-row > .shop-item-card { flex: 0 0 152px; }
.shop-items-row .shop-item-preview { min-height: 100px; border-radius: 10px; }

.shop-items-row .shop-item-title {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-items-row .shop-item-meta { display: none; }
.shop-items-row .shop-item-actions { margin-top: 0; }
.shop-items-row .shop-item-btn { height: 30px; font-size: 11px; border-radius: 7px; }

/* ── Product Grid ── */
.shop-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

/* ── Product Card ── */
.shop-item-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #eee;
  background: #fff;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  animation: shopCardIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--card-delay, 0ms);
}

.shop-item-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.shop-item-card.is-equipped {
  border-color: rgba(34,197,94,0.3);
  background: #f0fdf4;
}

.shop-item-card.is-equipped::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: shopDotPulse 2s ease-in-out infinite;
  z-index: 2;
}

.shop-item-card.is-owned:not(.is-equipped) {
  border-color: rgba(99,102,241,0.2);
  background: #f5f3ff;
}

.shop-item-card { position: relative; }

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

@keyframes shopDotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ── Item Preview ── */
.shop-item-preview {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid #f0f0f0;
  background: #fafafa;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.shop-item-preview.avatar img,
.shop-item-preview.avatar video,
.shop-item-media-fill {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shop-item-preview .mini-avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  color: #111;
  box-shadow:
    0 0 0 var(--shop-frame-width, 0px) var(--shop-frame-accent, transparent),
    0 0 20px var(--shop-effect-glow, transparent),
    0 8px 20px rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.shop-item-preview .mini-avatar img,
.shop-item-preview .mini-avatar video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shop-item-preview .mini-avatar::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 24px;
  background: radial-gradient(circle at center, var(--shop-effect-glow, transparent) 0%, transparent 60%);
  filter: blur(var(--shop-effect-blur, 0px));
  animation: var(--shop-effect-animation, none);
}

.shop-item-preview.background { background: var(--shop-page-gradient); }

/* ── Item Info ── */
.shop-item-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.shop-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.item-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 5px;
  background: #f5f5f5;
  color: #555;
  font-size: 11px;
  font-weight: 600;
}

.item-pill.success { background: #dcfce7; color: #16a34a; }
.item-pill.warning { background: #fff7ed; color: #c2410c; }

.shop-item-actions { margin-top: 2px; }

.shop-item-btn {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #111;
  font: 600 12px/1 Inter, sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.shop-item-btn:hover:not(:disabled) { background: #f5f5f5; }
.shop-item-btn:active:not(:disabled) { transform: scale(0.97); }

.shop-item-btn.primary {
  background: #111;
  color: #fff;
  border-color: #111;
}

.shop-item-btn.primary:hover:not(:disabled) { background: #2a2a2a; border-color: #2a2a2a; }
.shop-item-btn:disabled { cursor: default; opacity: 0.45; }

/* ── Sidebar: Preview ── */
.shop-preview-card {
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  background: #fff;
  padding: 16px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: box-shadow 0.6s ease;
}

.shop-preview-card.has-effect {
  box-shadow: 0 0 0 0 transparent;
  animation: shopPreviewGlow 3s ease-in-out infinite;
}

@keyframes shopPreviewGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(99,102,241,0.0); }
  50% { box-shadow: 0 0 24px rgba(99,102,241,0.08); }
}

.shop-background-media-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.shop-preview-card > * { position: relative; z-index: 1; }

.shop-preview-label {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #aaa;
}

.shop-preview-banner { margin-bottom: 12px; }

.shop-preview-banner strong {
  font-size: 14px;
  font-weight: 700;
}

.shop-preview-avatar-stage {
  display: grid;
  place-items: center;
  padding: 4px 0 14px;
}

.shop-preview-avatar {
  width: 100px;
  height: 100px;
  border-radius: 24px;
  position: relative;
  display: grid;
  place-items: center;
  background: #fafafa;
  border: 1px solid #eee;
  box-shadow:
    0 0 0 var(--shop-frame-width) var(--shop-frame-accent),
    0 0 0 calc(var(--shop-frame-width) * 2 + 1px) rgba(255,255,255,0.8),
    0 0 28px var(--shop-effect-glow),
    0 8px 24px rgba(0,0,0,0.06);
  overflow: hidden;
  isolation: isolate;
}

.shop-frame-media-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 2;
}

.shop-preview-avatar::before {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: 34px;
  background: radial-gradient(circle at center, var(--shop-effect-glow) 0%, transparent 60%);
  filter: blur(var(--shop-effect-blur));
  opacity: 0.8;
  animation: var(--shop-effect-animation);
  z-index: -1;
}

.shop-preview-avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 var(--shop-frame-width) rgba(255,255,255,0.85),
    inset 0 0 0 calc(var(--shop-frame-width) * 2) rgba(0,0,0,0.03);
}

.shop-preview-avatar img,
.shop-preview-avatar video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shop-preview-avatar span {
  font-size: 1.5rem;
  font-weight: 800;
  color: #111;
  letter-spacing: 0.04em;
}

.shop-preview-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.preview-label {
  margin: 0 0 2px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bbb;
}

.shop-preview-meta strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #333;
  line-height: 1.35;
}

/* ── Sidebar: Wallet ── */
.shop-sidebar-card {
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  background: #fff;
  padding: 14px 16px;
}

.shop-wallet-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-wallet-right {
  margin-left: auto;
  text-align: right;
}

.shop-wallet-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 10px 0;
}

.wallet-label {
  font-size: 11px;
  font-weight: 600;
  color: #999;
}

.wallet-balance {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  transition: color 0.2s;
}

.wallet-unit {
  font-size: 12px;
  font-weight: 600;
  color: #999;
}

.wallet-balance-sm {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  display: block;
}

.wallet-copy {
  margin: 2px 0 0;
  font-size: 11px;
  color: #aaa;
  line-height: 1.4;
}

/* ── Streak bar ── */
.shop-streak-track {
  height: 3px;
  border-radius: 2px;
  background: #f0f0f0;
  margin-top: 10px;
  overflow: hidden;
}

.shop-streak-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: #111;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Sidebar: History ── */

/* ── Status ── */
.shop-status-line { padding: 8px 0; }

.status-copy {
  margin: 0;
  font-size: 11px;
  color: #ddd;
  text-align: center;
  transition: color 0.3s;
}

.status-copy.is-ok { color: #16a34a; }

/* ── Empty State ── */
.empty-state {
  display: grid;
  gap: 6px;
  place-items: center;
  padding: 24px 16px;
  color: #bbb;
  text-align: center;
  border: 1px dashed #e5e5e5;
  border-radius: 10px;
  font-size: 12px;
}

.empty-state i {
  animation: shopEmptyFloat 3s ease-in-out infinite;
}

@keyframes shopEmptyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ── Login Gate ── */
.login-gate {
  margin-top: 8px;
  min-height: 340px;
  display: grid;
  place-items: center;
}

.login-gate-card {
  max-width: 360px;
  width: min(100%, 360px);
  margin: 0 auto;
  padding: 32px 24px;
  border-radius: 14px;
  border: 1px solid #e5e5e5;
  background: #fff;
  text-align: center;
  color: #999;
}

.login-gate-card h2 {
  margin: 12px 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #111;
}

.login-gate-card p {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.6;
}

/* ── Footnote ── */
.shop-footnote {
  margin-top: 32px;
  text-align: center;
  font-size: 11px;
  color: #ccc;
}

/* ── Aura animations (kept for shop-rendering compat) ── */
@keyframes shopAuraPulse {
  0%, 100% { transform: scale(0.96); opacity: 0.7; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes shopAuraFloat {
  0%, 100% { transform: translateY(0); opacity: 0.75; }
  50% { transform: translateY(-4px); opacity: 1; }
}

/* ── Responsive ── */
@media (max-width: 920px) {
  .shop-layout { grid-template-columns: 1fr; }

  .shop-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .shop-sidebar-card:first-child,
  .shop-status-line { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .shop-shell { padding: 0 16px; margin-top: 16px; }

  .shop-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .shop-toolbar-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .shop-stat-pills { flex-wrap: wrap; }
  .shop-toolbar-buttons { flex-wrap: wrap; }

  .shop-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .shop-sidebar { grid-template-columns: 1fr; }

  .shop-preview-meta {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Shop layout refresh */
.shop-shell {
  max-width: 1240px;
}

.shop-toolbar {
  padding: 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(10px);
}

.shop-toolbar-info {
  max-width: 560px;
}

.shop-toolbar-desc {
  max-width: 46ch;
  color: #475569;
}

.shop-pill {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.9);
}

.shop-primary-btn,
.shop-ghost-btn {
  height: 40px;
  border-radius: 12px;
}

.shop-tabs-bar {
  margin-top: 16px;
  padding: 0 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
}

.shop-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
}

.shop-main,
.shop-sidebar {
  gap: 20px;
}

.shop-section {
  padding: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.04);
}

.shop-section-head {
  margin-bottom: 16px;
}

.shop-section-head h2 {
  font-size: 16px;
  color: #0f172a;
}

.shop-section-head span {
  color: #64748b;
}

.shop-item-card {
  border-color: rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.04);
}

.shop-item-card:hover {
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
}

.shop-preview-card,
.shop-sidebar-card {
  border-radius: 22px;
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.05);
}

.shop-preview-card {
  padding: 18px;
}

.shop-preview-banner strong {
  font-size: 16px;
  color: #0f172a;
}

.shop-preview-avatar {
  width: 112px;
  height: 112px;
}

.shop-preview-meta {
  gap: 10px;
}

.preview-label {
  color: #94a3b8;
}

.shop-preview-meta strong {
  color: #334155;
}

.shop-status-line {
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.9);
}

.status-copy {
  color: rgba(255, 255, 255, 0.74);
}

.empty-state {
  min-height: 132px;
  border-color: rgba(15, 23, 42, 0.1);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.85) 0%, rgba(241, 245, 249, 0.85) 100%);
  color: #64748b;
}

.shop-footnote {
  color: #64748b;
}

@media (max-width: 920px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shop-toolbar,
  .shop-section {
    padding: 16px;
    border-radius: 18px;
  }

  .shop-tabs-bar {
    padding: 0 4px;
  }
}
