body[data-page="products"] .page-shell {
  max-width: none;
  padding-left: 0.25rem;
  padding-right: 0;
}

.products-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(480px, 580px);
  gap: 2rem;
  align-items: start;
}

.products-main {
  min-width: 0;
}

.products-point-line {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.products-point-line strong {
  color: var(--color-accent);
  font-size: 1rem;
}

.game-tab-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--theme-scrollbar, rgba(129, 140, 248, 0.35)) transparent;
}

.game-tab-bar::-webkit-scrollbar {
  height: 6px;
}

.game-tab-bar::-webkit-scrollbar-track {
  background: transparent;
}

.game-tab-bar::-webkit-scrollbar-thumb {
  background: var(--theme-scrollbar, rgba(129, 140, 248, 0.28));
  border-radius: 999px;
}

.game-tab-bar::-webkit-scrollbar-thumb:hover {
  background: var(--theme-scrollbar-hover, rgba(129, 140, 248, 0.45));
}

.game-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.76rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.game-tab-icon {
  width: 1.15rem;
  height: 1.15rem;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 2px;
}

.game-tab:hover {
  border-color: var(--color-border-accent);
  color: var(--color-text);
}

.game-tab.is-active {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-dim);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  overflow: visible;
  position: relative;
  z-index: 1;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.product-card:has(.custom-select.is-open) {
  z-index: 30;
}

.product-card:hover:not(.product-card--empty) {
  border-color: var(--color-border-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.product-card--empty {
  opacity: 0.55;
}

.product-card-image {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--color-accent-dim), var(--color-surface));
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.75rem;
  background: #000;
}

.product-card-image--empty {
  color: var(--color-text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.product-card-body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.65rem;
}

.product-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  min-height: 1.25rem;
}

.product-card-desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  min-height: 2.4rem;
  flex: 1;
}

.product-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.product-card-price {
  font-weight: 700;
  color: var(--color-accent);
  font-size: 0.85rem;
}

.product-card-stock {
  font-size: 0.72rem;
}

.product-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.product-card-actions .btn {
  flex: 1;
  min-height: 2.25rem;
}

.product-card-actions .btn-intro {
  flex: 0 0 auto;
}

.product-duration-select.custom-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.products-history-card {
  position: sticky;
  top: 5.5rem;
}

.products-history-card h2 {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.purchase-history-table {
  table-layout: auto;
  width: 100%;
}

.purchase-history-table th,
.purchase-history-table td {
  white-space: nowrap;
  font-size: 0.78rem;
  vertical-align: middle;
  padding: 0.55rem 0.45rem;
}

.purchase-history-table th:nth-child(1),
.purchase-history-table td:nth-child(1) { width: 2.75rem; }
.purchase-history-table th:nth-child(2),
.purchase-history-table td:nth-child(2) { min-width: 9.5rem; }
.purchase-history-table th:nth-child(4),
.purchase-history-table td:nth-child(4) { min-width: 5rem; }
.purchase-history-table th:nth-child(5),
.purchase-history-table td:nth-child(5) { min-width: 7.5rem; }

.purchase-history-table td {
  font-size: 0.78rem;
}

.purchase-code {
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  word-break: break-all;
}

.purchase-code--lg {
  display: block;
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.purchase-code-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.purchase-code-row .purchase-code--lg {
  flex: 1;
  margin: 0;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.purchase-code-row .purchase-code--lg:hover {
  border-color: var(--color-accent);
  background: var(--color-bg-card);
}

.purchase-code--copy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.45rem;
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.purchase-code--copy:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-copy-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  padding: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.btn-copy-code:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-copy-code svg {
  width: 1rem;
  height: 1rem;
}

.product-intro-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.product-intro-image {
  width: 140px;
  flex-shrink: 0;
}

.product-intro-image img {
  width: 100%;
  max-height: 140px;
  border-radius: var(--radius-sm);
  background: #000;
  object-fit: contain;
}

.product-intro-detail {
  min-width: 0;
}

.product-intro-detail p {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.6;
}

.product-feature-list {
  margin: 0.35rem 0 0.75rem 1.1rem;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}

.field-hint--error {
  color: var(--color-error);
}

.product-buy-summary {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.product-buy-section {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.product-buy-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-bottom: 0.35rem;
}

.product-buy-value {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--color-text);
}

.product-buy-price {
  color: var(--color-accent);
  font-weight: 700;
  font-size: 1rem;
}

.product-stock--out {
  color: var(--color-error) !important;
  font-weight: 700;
}

.product-card--empty select.product-duration-select {
  width: 100%;
  min-height: 2.55rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.product-card--empty .product-card-body {
  gap: 0.85rem;
}

.tier-step-num {
  margin-left: 0.35rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

@media (max-width: 960px) {
  body[data-page="products"] .page-shell {
    max-width: var(--max-width);
  }

  .products-layout {
    grid-template-columns: 1fr;
  }

  .products-history-card {
    position: static;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-intro-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 961px) and (max-width: 1100px) {
  .game-tab {
    font-size: 0.72rem;
    padding: 0.4rem 0.6rem;
  }
}
