/* Games catalogue layout — sidebar + grid (TZ §6.2). */

[data-page="games"] main { padding-bottom: var(--space-64); }

.games-filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
}
@media (min-width: 1024px) {
  .games-filters-toggle { display: none; }
}

.games-layout {
  display: grid;
  gap: var(--space-32);
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 1024px) {
  .games-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}
@media (min-width: 1440px) {
  .games-layout {
    grid-template-columns: 320px minmax(0, 1fr);
  }
}

/* ---------------- Sidebar (mobile = drawer) ---------------- */

.games-layout__sidebar {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(360px, 92vw);
  z-index: 200;
  transform: translateX(100%);
  transition: transform var(--transition-base);
  background: var(--color-bg-primary);
  padding: var(--space-16);
  overflow-y: auto;
  height: 100vh;
  height: 100svh;
}

body.filters-open .games-layout__sidebar { transform: translateX(0); }

.games-layout__sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
body.filters-open .games-layout__sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.games-layout__sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  margin-bottom: var(--space-16);
}

@media (min-width: 1024px) {
  .games-layout__sidebar {
    position: sticky;
    inset: auto;
    top: calc(72px + var(--space-24));      /* sit just below the sticky header */
    width: auto;
    height: auto;
    transform: none;
    background: transparent;
    padding: 0;
    overflow: visible;
    z-index: 1;
  }
  .games-layout__sidebar-backdrop { display: none; }
  .games-layout__sidebar-header { display: none; }
}

/* ---------------- Content ---------------- */

.games-layout__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

[data-component="games-grid"]:empty + [data-component="load-more"] { display: none; }
