/* components — banner carousel, flash deal, pills, game grid, order flow, faq */

/* ── hero banner carousel ────────────────────────── */
.hero-wrap {
  margin-top: var(--sp-4);
  position: relative;
}

.hero {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(700px 320px at 85% 0%, oklch(48% 0.14 265 / 0.45), transparent 60%),
    radial-gradient(500px 260px at 5% 100%, oklch(52% 0.12 220 / 0.35), transparent 60%),
    linear-gradient(120deg, var(--surface-2), var(--bg-deep));
  padding: clamp(1.75rem, 4.5vw, 3rem) clamp(1.25rem, 4vw, 2.75rem);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero img.banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero h1 {
  font-size: var(--text-hero);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  max-width: 24ch;
}

.hero h1 em {
  font-style: normal;
  color: var(--gold);
}

.hero p {
  margin-top: var(--sp-2);
  color: var(--text-dim);
  max-width: 48ch;
}

.hero-badges {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-3);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--r-pill);
  background: oklch(30% 0.06 252 / 0.85);
  border: 1px solid var(--line);
  font-size: var(--text-xs);
  color: var(--text-dim);
}

.hero-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: var(--sp-3);
}

.hero-dots button {
  width: 22px;
  height: 5px;
  border-radius: 3px;
  background: var(--surface-3);
  transition: background var(--dur-fast) var(--ease);
}

.hero-dots button.on {
  background: var(--gold);
}

/* ── flash deal band ─────────────────────────────── */
.flash-band {
  margin-top: var(--sp-6);
  border-radius: var(--r-lg);
  border: 1px solid oklch(60% 0.19 32 / 0.55);
  background:
    radial-gradient(420px 200px at 95% 0%, oklch(50% 0.19 32 / 0.4), transparent 60%),
    var(--surface);
  padding: var(--sp-4);
}

.flash-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.flash-head h2 {
  font-size: var(--text-xl);
  font-weight: 800;
  background: linear-gradient(90deg, var(--hot), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.countdown {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.countdown span {
  background: linear-gradient(180deg, var(--hot), oklch(52% 0.2 30));
  color: white;
  border-radius: var(--r-sm);
  padding: 0.25rem 0.5rem;
  font-size: var(--text-sm);
  min-width: 2.1em;
  text-align: center;
}

.deal-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: var(--sp-3);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  scrollbar-width: thin;
}

.deal-card {
  position: relative;
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: var(--sp-3);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease);
}

.deal-card:hover {
  border-color: var(--gold);
}

.deal-card img,
.deal-card .ph {
  width: 54px;
  height: 54px;
  border-radius: var(--r-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.deal-card .ph {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--text-mute);
  background: var(--surface-3);
}

.deal-card .t {
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.25;
}

.deal-card .p {
  font-size: var(--text-xs);
  color: var(--text-dim);
  margin-top: 2px;
}

.deal-card .p .now {
  color: var(--gold);
  font-weight: 800;
  font-size: var(--text-sm);
}

.deal-card .p .was {
  text-decoration: line-through;
  color: var(--text-mute);
  margin-left: 5px;
}

.ribbon {
  position: absolute;
  top: 9px;
  right: -27px;
  rotate: 45deg;
  background: linear-gradient(90deg, var(--hot), oklch(55% 0.2 25));
  color: white;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 28px;
  letter-spacing: 0.02em;
}

/* ── promo strip ─────────────────────────────────── */
.promo-strip {
  margin-top: var(--sp-6);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface));
  padding: var(--sp-3) var(--sp-4);
}

.promo-strip b {
  letter-spacing: 0.04em;
}

.promo-strip span {
  display: block;
  color: var(--text-dim);
  font-size: var(--text-sm);
}

/* ── category pills (มีไอคอนวงกลมสี) ─────────────── */
.pills {
  position: sticky;
  top: var(--nav-h);
  z-index: 40;
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-block: var(--sp-3);
  background: linear-gradient(var(--bg) 82%, transparent);
  scrollbar-width: none;
}

.pills::-webkit-scrollbar {
  display: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  padding: 0.45rem 1rem 0.45rem 0.5rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-dim);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: all var(--dur-fast) var(--ease);
}

.pill .dot {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.8rem;
  background: var(--surface-3);
}

.pill:hover {
  border-color: var(--gold);
  color: var(--text);
}

.pill.on {
  background: var(--surface-2);
  border-color: var(--gold);
  color: var(--text);
  box-shadow: var(--glow-gold);
}

.pill.search {
  padding: 0.45rem 1rem;
}

/* ── section band (หัวข้อแบบแถบเฉียง) ────────────── */
.section {
  margin-top: var(--sp-section);
}

.section-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--surface-2), var(--surface) 55%, transparent);
  border: 1px solid var(--line);
  padding: 0.45rem 1.1rem 0.45rem 0.45rem;
  overflow: hidden;
}

.section-head::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 26%;
  background: linear-gradient(105deg, transparent 0 40%, oklch(60% 0.12 240 / 0.35) 40% 55%, transparent 55% 65%, oklch(60% 0.12 240 / 0.25) 65% 78%, transparent 78%);
  pointer-events: none;
}

.section-head .icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  font-size: 1rem;
}

.section-head h2 {
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-head .more {
  margin-left: auto;
  color: var(--gold);
  font-size: var(--text-sm);
  font-weight: 700;
  white-space: nowrap;
  z-index: 1;
}

.section-head .more:hover {
  text-decoration: underline;
}

/* ── game grid + card (6 คอลัมน์แบบแน่น) ─────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: var(--sp-3);
}

@media (min-width: 1100px) {
  .game-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.game-card {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
}

.game-card .art {
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
  background: var(--surface-2);
}

.game-card .ph {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-mute);
  background:
    radial-gradient(120px 120px at 30% 20%, oklch(44% 0.11 260 / 0.6), transparent 70%),
    var(--surface-2);
}

.game-card .label {
  padding: var(--sp-2) var(--sp-2) var(--sp-3);
  background: var(--surface);
}

.game-card .name {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.3em;
}

.game-card .pub {
  margin-top: 2px;
  font-size: var(--text-xs);
  color: var(--text-mute);
  text-align: center;
}

/* ── trust strip ─────────────────────────────────── */
.trust {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-3);
}

.trust-item {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: var(--sp-4);
}

.trust-item .em {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  font-size: 1.25rem;
}

.trust-item b {
  display: block;
  margin-bottom: 2px;
}

.trust-item span {
  color: var(--text-dim);
  font-size: var(--text-sm);
}

/* ── faq ─────────────────────────────────────────── */
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  margin-bottom: var(--sp-2);
  overflow: hidden;
}

.faq summary {
  padding: var(--sp-4);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
}

.faq summary::after {
  content: "+";
  color: var(--gold);
  font-size: 1.2rem;
  transition: rotate var(--dur-fast) var(--ease);
}

.faq details[open] summary::after {
  rotate: 45deg;
}

.faq .body {
  padding: 0 var(--sp-4) var(--sp-4);
  color: var(--text-dim);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* ── payment strip ───────────────────────────────── */
.pay-strip {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.pay-chip {
  padding: 0.45rem 1rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: white;
  color: oklch(30% 0.05 255);
  font-size: var(--text-xs);
  font-weight: 700;
}

/* ── order page (game detail) ────────────────────── */
.order-layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: var(--sp-6);
  margin-top: var(--sp-6);
}

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

.game-side {
  position: sticky;
  top: calc(var(--nav-h) + var(--sp-4));
  align-self: start;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: var(--sp-4);
}

@media (max-width: 900px) {
  .game-side {
    position: static;
  }
}

.game-side .cover {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
}

.game-side .cover img,
.game-side .cover .ph {
  width: 86px;
  height: 86px;
  border-radius: var(--r-md);
  object-fit: cover;
  border: 2px solid var(--gold);
  box-shadow: var(--glow-gold);
}

.game-side .cover .ph {
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text-mute);
  background: var(--surface-2);
}

.game-side h1 {
  font-size: var(--text-lg);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.game-side .pub {
  color: var(--text-mute);
  font-size: var(--text-xs);
}

.game-side .stats {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
  font-size: var(--text-xs);
  color: var(--text-dim);
  text-align: center;
}

.game-side .stats b {
  display: block;
  color: var(--gold);
  font-size: var(--text-base);
}

.game-side .rating-bars {
  margin-top: var(--sp-4);
  display: grid;
  gap: 6px;
}

.game-side .rating-bars .row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--text-dim);
}

.game-side .rating-bars .bar {
  flex: 1;
  height: 7px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}

.game-side .rating-bars .fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
}

/* ── steps ───────────────────────────────────────── */
.social-proof {
  display: inline-block;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  color: oklch(24% 0.05 85);
  font-weight: 800;
  font-size: var(--text-sm);
  border-radius: var(--r-pill);
  padding: 0.4rem 1.1rem;
  margin-bottom: var(--sp-3);
}

.step {
  border-radius: var(--r-lg);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}

.step-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.step-num {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--gold);
  color: var(--gold);
  font-weight: 800;
  font-size: var(--text-sm);
}

.step-head h2 {
  font-size: var(--text-lg);
  font-weight: 800;
}

.sku-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-2);
}

@media (min-width: 1100px) {
  .sku-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.sku {
  position: relative;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: var(--sp-3);
  text-align: center;
  transition: all var(--dur-fast) var(--ease);
  overflow: hidden;
}

.sku:hover {
  border-color: var(--cyan);
}

.sku.on {
  border-color: var(--gold);
  background: oklch(34% 0.075 90 / 0.3);
  box-shadow: var(--glow-gold);
}

.sku .amt {
  font-weight: 700;
  font-size: var(--text-sm);
  line-height: 1.3;
}

.sku .price {
  margin-top: var(--sp-1);
  color: var(--gold);
  font-weight: 800;
  font-size: var(--text-sm);
}

.sku .was {
  color: var(--text-mute);
  text-decoration: line-through;
  font-size: var(--text-xs);
  font-weight: 400;
  margin-left: 4px;
}

.sku .cat {
  margin-top: 2px;
  font-size: 0.68rem;
  color: var(--text-mute);
}

.field {
  margin-bottom: var(--sp-3);
}

.field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--sp-1);
  color: var(--text-dim);
}

.field input {
  width: 100%;
  height: 44px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--text);
  padding: 0 1rem;
  transition: border-color var(--dur-fast) var(--ease);
}

.field input:focus {
  outline: none;
  border-color: var(--gold);
}

.field .hint {
  margin-top: var(--sp-1);
  font-size: var(--text-xs);
  color: var(--text-mute);
}

/* ── sticky order bar ────────────────────────────── */
.order-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 60;
  backdrop-filter: blur(14px);
  background: oklch(20% 0.05 255 / 0.94);
  border-top: 2px solid var(--gold);
}

.order-bar-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding-block: var(--sp-3);
}

.order-bar .what {
  font-size: var(--text-sm);
  color: var(--text-dim);
}

.order-bar .what b {
  display: block;
  color: var(--text);
  font-size: var(--text-base);
}

.order-bar .total {
  margin-left: auto;
  text-align: right;
  font-size: var(--text-sm);
  color: var(--text-dim);
}

.order-bar .total b {
  display: block;
  color: var(--gold);
  font-size: var(--text-xl);
  font-weight: 800;
}

.buy-btn {
  padding: 0.8rem 1.9rem;
  border-radius: var(--r-pill);
  background: linear-gradient(120deg, var(--gold), var(--gold-deep));
  color: oklch(24% 0.05 85);
  font-weight: 800;
  font-size: var(--text-base);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.buy-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--glow-gold);
}

.buy-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── auth / track / status ───────────────────────── */
.panel {
  max-width: 460px;
  margin: var(--sp-section) auto 0;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: var(--sp-6);
}

.panel h1 {
  font-size: var(--text-xl);
  font-weight: 800;
  margin-bottom: var(--sp-2);
}

.panel .sub {
  color: var(--text-dim);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-4);
}

.sso-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 46px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-weight: 600;
  margin-bottom: var(--sp-2);
  transition: border-color var(--dur-fast) var(--ease);
}

.sso-btn:hover {
  border-color: var(--gold);
}

.alert {
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  margin-top: var(--sp-3);
}

.alert.err {
  background: oklch(35% 0.12 25 / 0.3);
  border: 1px solid var(--hot);
}

.alert.ok {
  background: oklch(35% 0.1 155 / 0.25);
  border: 1px solid var(--ok);
}

.spin {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  to {
    rotate: 360deg;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}
