/* ============================================================
   Final Space Store — style.css v12.0 (FULL GALLERY VERSION)
   ------------------------------------------------------------
   ✓ Supports new gallery system (big image + arrows + zoom)
   ✓ Supports video preview under big image
   ✓ Supports thumbnails with active border
   ✓ Supports NEW / HOT / BESTSELLER badge
   ✓ Supports description modal & toast
   ✓ Wallet header unchanged
   ============================================================ */

:root {
  --bg-main: #0b0f19;
  --bg-header: #0e1624;
  --bg-card: #101622;
  --accent: #007bff;
  --accent-hover: #1990ff;
  --success: #16a34a;
  --danger: #dc2626;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --font: 'Inter', system-ui, sans-serif;
}

/* ---------- BASE ---------- */
body {
  margin: 0;
  background: var(--bg-main);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  overflow-x: hidden;
}

/* ============================================================
   HEADER
   ============================================================ */
.fs-header {
  background: var(--bg-header);
  border-bottom: 1px solid #1f2937;
  position: sticky;
  top: 0;
  z-index: 50;
}

.fs-header-wrap {
  max-width: 1250px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.fs-brand {
  font-weight: 700;
  font-size: 20px;
  color: #fff;
}

.fs-center {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #93c5fd;
  font-size: 14px;
  flex: 1;
  justify-content: center;
}

.fs-tag { opacity: 0.8; }
.fs-addr { color: #4ff7ff; font-weight: 600; }
.fs-bal { color: #ffc96b; font-weight: 600; }

.fs-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.fs-btn {
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 15px;
  transition: background .25s, transform .25s, box-shadow .25s;
}

.fs-btn-blue {
  background: var(--accent);
  color: #fff;
}
.fs-btn-blue:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
  box-shadow: 0 0 15px var(--accent);
}

.fs-btn-ghost {
  background: #334155;
  color: #e5e7eb;
}
.fs-btn-ghost:hover {
  background: #475569;
  transform: scale(1.05);
}

/* ============================================================
   STORE GRID
   ============================================================ */
.container {
  max-width: 1250px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.fs-store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 30px;
  justify-content: center;
  align-items: stretch;
}

/* ============================================================
   PRODUCT CARD
   ============================================================ */
.product-card {
  background: var(--bg-card);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
  transition: transform .25s ease, box-shadow .25s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

/* ============================================================
   MAIN IMAGE + ARROWS + BADGE
   ============================================================ */
.product-gallery {
  padding: 14px 14px 10px;
}

.pg-main {
  position: relative;
  border-radius: 18px;
  border: 1px solid #1f2937;
  overflow: hidden;
  background: #020617;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pg-main img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}

/* Arrows */
.pg-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.75);
  background: rgba(15,23,42,.9);
  color: #e5e7eb;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pg-arrow.left { left: 10px; }
.pg-arrow.right { right: 10px; }
.pg-arrow.disabled { opacity: .22; cursor: default; }

/* Badge */
.pg-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: rgba(15,23,42,.92);
  border: 1px solid rgba(148,163,184,.8);
  color: #e5e7eb;
}
.pg-badge-new  { border-color:#22c55e; color:#bbf7d0; }
.pg-badge-hot  { border-color:#f97316; color:#fed7aa; }
.pg-badge-best { border-color:#eab308; color:#fef9c3; }

/* ============================================================
   VIDEO PREVIEW
   ============================================================ */
.pg-video {
  margin-top: 10px;
  border-radius: 14px;
  border: 1px solid #1f2937;
  background: #020617;
  padding: 8px 10px 10px;
}

.pg-video-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: #9ca3af;
  margin-bottom: 4px;
}

.pg-video-frame iframe,
.pg-video-frame video {
  width: 100%;
  border-radius: 12px;
  border: none;
  max-height: 280px;
  display: block;
}

/* ============================================================
   THUMBNAILS
   ============================================================ */
.pg-thumbs {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pg-thumb {
  flex: 0 0 auto;
  width: 55px;
  height: 55px;
  border-radius: 12px;
  border: 1px solid #1f2937;
  background: #020617;
  overflow: hidden;
  cursor: pointer;
  opacity: .65;
}

.pg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pg-thumb.active {
  opacity: 1;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,.7);
}

.pg-thumb-video {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pg-thumb-video-inner {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 30%, #1f2937, #020617 60%, #020617 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pg-play-icon {
  font-size: 20px;
  color: #e5e7eb;
  text-shadow: 0 0 8px rgba(15,23,42,.9);
}

/* Fullscreen video popup (Style B) */
#fs-video-popup {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(10px);
  transition: opacity .18s ease;
}

.fs-video-inner {
  position: relative;
  width: min(96vw, 960px);
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  border: 1px solid #1f2937;
  background: #020617;
  box-shadow: 0 32px 80px rgba(0,0,0,.85);
  overflow: hidden;
}

.fs-video-frame {
  width: 100%;
  height: 100%;
}

.fs-video-frame iframe,
.fs-video-frame video {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 18px;
  display: block;
}

.fs-video-close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgba(15,23,42,.9);
  color: #e5e7eb;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ============================================================
   PRODUCT INFO
   ============================================================ */
.product-info {
  padding: 16px 18px 20px;
  text-align: center;
}

.product-name {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fff;
}

.product-desc-text {
  font-size: 14px;
  line-height: 1.55;
  color: #9ca3af;
  margin-bottom: 12px;
}

.product-desc-text .desc-more {
  color: #93c5fd;
  font-weight: 600;
  cursor: pointer;
}

/* Price row */
.product-meta {
  font-size: 15px;
  color: #bfdbfe;
  font-weight: 600;
  margin-bottom: 15px;
}

/* ============================================================
   BUY BUTTON
   ============================================================ */
.buy-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  transition: all .25s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}

.buy-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
  box-shadow: 0 0 15px var(--accent);
}

/* Download state */
.buy-btn.download-btn {
  background: var(--success);
  box-shadow: 0 8px 24px rgba(22,163,74,.4);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#fs_toasts {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

#fs_toasts div {
  min-width: 220px;
  max-width: 320px;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  color: #fff;
  font-size: 15px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  opacity: 0;
  transform: translateY(10px);
  animation: toastIn .25s ease forwards, toastOut .35s ease 3.5s forwards;
}

#fs_toasts .ok { background: var(--success); }
#fs_toasts .error { background: var(--danger); }

@keyframes toastIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-15px); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .fs-store-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 640px) {
  .fs-header-wrap { flex-direction: column; align-items: flex-start; }
  .fs-center { justify-content: flex-start; flex-wrap: wrap; }
  .container { padding: 25px 10px 60px; }
  .product-name { font-size: 17px; }
}


/* Debug banner hidden by default (can be shown by setting localStorage fs_debug_banner='1' and overriding CSS) */
#fsDebugBanner{display:none!important;}


/* FS v4.32 wrong chain subtle disable */
body.fs-wrong-chain button, body.fs-wrong-chain a{ }



/* === FinalSpace v4.34 UI/UX pack === */
#fs-trustbar{
  width:100%;
  padding:10px 14px;
  background:rgba(255,255,255,0.03);
  border-bottom:1px solid rgba(255,255,255,0.08);
}
.fs-trustbar-inner{
  max-width:1200px;
  margin:0 auto;
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
}
.fs-badges{ display:flex; gap:8px; flex-wrap:wrap; }
.fs-badge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(0,170,255,0.12);
  border:1px solid rgba(0,170,255,0.22);
  color:#d7f3ff;
  font-weight:700;
  font-size:12px;
}
.fs-badge-muted{
  background:rgba(255,255,255,0.06);
  border-color:rgba(255,255,255,0.10);
  color:rgba(255,255,255,0.85);
}
.fs-wallet-logos{ display:flex; gap:8px; align-items:center; }
.fs-wlogo{
  width:28px;height:28px;
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:10px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.10);
  font-size:16px;
}

.fs-cta{
  width:100%;
  padding:12px 14px;
  background:rgba(0,0,0,0.25);
  border-bottom:1px solid rgba(255,255,255,0.08);
}
.fs-cta-inner{
  max-width:1200px;
  margin:0 auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.fs-cta-title{ color:#fff; font-weight:800; font-size:14px; }
.fs-cta-sub{ color:rgba(255,255,255,0.7); font-size:12px; margin-top:2px; }
.fs-cta-btn{
  padding:8px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(0,170,255,0.18);
  color:#fff;
  font-weight:800;
  cursor:pointer;
}
.fs-cta-muted{ background:rgba(255,255,255,0.06); }

.fs-disconnect-hint{ padding:14px; }
.fs-disconnect-card{
  max-width:1200px;
  margin:0 auto;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.10);
  border-radius:18px;
  padding:14px 16px;
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}
.fs-disconnect-title{ color:#fff; font-weight:900; font-size:14px; }
.fs-disconnect-sub{ color:rgba(255,255,255,0.75); font-size:12px; margin-top:4px; }

.fs-card{
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  border-color:rgba(255,255,255,0.12)!important;
}
.fs-card:hover{ transform:translateY(-2px); box-shadow:0 18px 45px rgba(0,0,0,0.35); border-color:rgba(0,170,255,0.28)!important; }
.fs-title{ font-size:18px!important; font-weight:900!important; letter-spacing:0.2px; }
.fs-highlights{
  display:flex; gap:10px; flex-wrap:wrap;
  font-size:12px; color:rgba(255,255,255,0.8);
  margin:10px 0 8px;
}
.fs-highlights span{ background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.10); padding:4px 8px; border-radius:999px; }

.fs-owned{
  position:absolute;
  top:14px; right:14px;
  background:rgba(0,255,140,0.14);
  border:1px solid rgba(0,255,140,0.22);
  color:#c8ffe7;
  padding:6px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:12px;
  display:none;
}

.fs-action-btn{
  font-weight:900!important;
  letter-spacing:0.2px;
  border-radius:16px!important;
  transform:translateZ(0);
}

.fs-purchase-overlay{
  position:fixed; inset:0;
  background:rgba(0,0,0,0.55);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:999997;
}
.fs-purchase-box{
  width:min(520px, 92vw);
  background:rgba(15,20,30,0.92);
  border:1px solid rgba(255,255,255,0.10);
  border-radius:20px;
  padding:18px 18px 14px;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  box-shadow:0 24px 60px rgba(0,0,0,0.45);
  text-align:center;
}
.fs-purchase-title{ color:#fff; font-weight:900; font-size:16px; }
.fs-purchase-sub{ color:rgba(255,255,255,0.72); font-size:12px; margin-top:6px; }
.fs-purchase-spinner{
  width:40px;height:40px;margin:14px auto 10px;
  border-radius:50%;
  border:3px solid rgba(255,255,255,0.18);
  border-top-color:rgba(0,170,255,0.95);
  animation:fsSpin 1s linear infinite;
}
@keyframes fsSpin{ to{ transform:rotate(360deg); } }
.fs-purchase-cancel{
  margin-top:6px;
  padding:8px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.06);
  color:#fff;
  font-weight:800;
  cursor:pointer;
}

.fs-skeleton-wrap{
  max-width:1200px;
  margin:10px auto 0;
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:18px;
  padding:0 14px;
}
@media (max-width: 980px){ .fs-skeleton-wrap{ grid-template-columns:repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px){ .fs-skeleton-wrap{ grid-template-columns:1fr; } }
.fs-skel-card{
  border-radius:22px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.03);
  padding:14px;
  overflow:hidden;
}
.fs-skel-media{ height:190px; border-radius:16px; background:rgba(255,255,255,0.06); }
.fs-skel-line{ height:14px; margin-top:12px; border-radius:10px; background:rgba(255,255,255,0.06); }
.fs-skel-line2{ width:70%; }
.fs-skel-btn{ height:44px; margin-top:14px; border-radius:16px; background:rgba(0,170,255,0.14); border:1px solid rgba(0,170,255,0.18); }

.fs-stickybar{
  position:fixed;
  left:0; right:0;
  bottom:0;
  padding:10px 12px;
  background:rgba(10,14,22,0.85);
  border-top:1px solid rgba(255,255,255,0.10);
  z-index:999996;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.fs-stickybar-inner{
  max-width:1200px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.fs-stickybar-text{ color:rgba(255,255,255,0.82); font-weight:800; font-size:13px; }
.fs-stickybar-btn{
  padding:10px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(0,170,255,0.18);
  color:#fff;
  font-weight:900;
  cursor:pointer;
}

