/* ============================================================
   store.css — AstroVault
   Full game catalog page. Requires base.css loaded first.
   ============================================================ */

/* ── PAGE WRAPPER ── */
.store-page {
  position: relative;
  z-index: 1;
  padding-top: 64px; /* height of fixed nav */
  min-height: 100vh;
}

/* ── STORE HEADER ── */
.store-header {
  padding: 4rem 5vw 2rem;
  border-bottom: 1px solid var(--border);
}

.store-header .section-label {
  margin-bottom: 0.5rem;
}

.store-header .section-heading {
  margin-bottom: 0.5rem;
}

.store-header .section-intro {
  margin-bottom: 0;
}

/* ── FILTER BAR ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 5vw;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.filter-genres {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 0.25rem;
}

.filter-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.35rem 0.9rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.filter-btn:hover {
  border-color: var(--violet-soft);
  color: var(--violet-soft);
}
.filter-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.filter-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 0.25rem;
}

.sort-select {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  margin-left: auto;
  outline: none;
  transition: border-color 0.2s;
}
.sort-select:hover,
.sort-select:focus {
  border-color: var(--violet-soft);
  color: var(--text);
}

/* ── RESULTS COUNT ── */
.results-count {
  position: relative;
  z-index: 1;
  padding: 1rem 5vw 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.results-count span {
  color: var(--violet-soft);
  font-weight: 600;
}

/* ── CATALOG GRID ── */
.catalog-section {
  padding: 1.5rem 5vw 6rem;
  position: relative;
  z-index: 1;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* ── GAME CARD (same as index but lives here for store page) ── */
.game-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.2);
}

.game-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface2);
  position: relative;
  overflow: hidden;
}

.game-thumb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

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

.game-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--gold);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.game-badge.new  { background: #10b981; color: #fff; }
.game-badge.sale { background: #ef4444; color: #fff; }

.game-info {
  padding: 1.1rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.game-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.game-genre {
  font-size: 0.72rem;
  color: var(--violet-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.game-dot  { color: var(--border); font-size: 0.6rem; }
.game-size { font-size: 0.72rem; color: var(--text-muted); }

.game-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.game-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  /* Clamp long descriptions so every card in the grid stays the same
     height — full text is still available on the checkout page. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.game-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.game-price small {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
  display: block;
  margin-top: -2px;
}

.btn-buy {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.2s, transform 0.15s;
}
.btn-buy:hover {
  background: var(--brand-light);
  transform: scale(1.04);
}

/* ── SKELETON LOADING ── */
.skeleton {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: shimmer 1.6s infinite;
}

.skeleton-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface);
}

.skeleton-body {
  padding: 1.1rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--surface);
}
.skeleton-line.short { width: 40%; }
.skeleton-line.med   { width: 70%; }
.skeleton-line.full  { width: 100%; }
.skeleton-line.title { height: 18px; width: 80%; }

@keyframes shimmer {
  0%   { opacity: 1; }
  50%  { opacity: 0.5; }
  100% { opacity: 1; }
}

/* ── EMPTY STATE ── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.empty-state h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.empty-state p {
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ── ERROR STATE ── */
.error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.error-state p {
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .filter-bar    { padding: 1rem; gap: 0.5rem; }
  .catalog-section { padding: 1rem 1rem 4rem; }
  .store-header  { padding: 3rem 1rem 1.5rem; }
  .results-count { padding: 1rem 1rem 0; }
  .sort-select   { margin-left: 0; }
}