/* ============================================================
   term24hr — Stylesheet
   ธีม: Dark (ม่วงดำ) เป็นค่าเริ่มต้น · Light (ม่วงขาว)
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --font-head: 'Kanit', 'Prompt', system-ui, sans-serif;
  --font-body: 'Prompt', system-ui, sans-serif;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --nav-h: 68px;
  --announce-h: 34px;
  --container: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* ---------- DARK (default) : ม่วงดำ ---------- */
html[data-theme='dark'] {
  --bg: #0a0614;
  --bg-2: #10091d;
  --bg-3: #171028;
  --surface: #1b1233;
  --surface-2: #22163f;
  --surface-glass: rgba(27, 18, 51, 0.6);
  --border: rgba(168, 85, 247, 0.14);
  --border-strong: rgba(168, 85, 247, 0.3);
  --text: #f2eeff;
  --text-2: #c7b9ea;
  --text-3: #9483bd;
  --primary: #a855f7;
  --primary-2: #8b5cf6;
  --primary-3: #7c3aed;
  --accent: #d946ef;
  --accent-2: #ec4899;
  --on-primary: #ffffff;
  --grad: linear-gradient(135deg, #c084fc 0%, #8b5cf6 45%, #7c3aed 100%);
  --grad-2: linear-gradient(135deg, #e879f9 0%, #a855f7 50%, #6d28d9 100%);
  --grad-text: linear-gradient(120deg, #e9d5ff, #c084fc 40%, #a855f7 70%, #f0abfc);
  --ring: rgba(168, 85, 247, 0.45);
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.14);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.14);
  --danger: #fb7185;
  --danger-bg: rgba(251, 113, 133, 0.14);
  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.14);
  --glow: 0 20px 60px -12px rgba(139, 92, 246, 0.55);
  --card-glow: 0 8px 30px -12px rgba(0, 0, 0, 0.6);
  --header-bg: rgba(10, 6, 20, 0.72);
  --orb-a: rgba(124, 58, 237, 0.55);
  --orb-b: rgba(217, 70, 239, 0.4);
  --orb-c: rgba(139, 92, 246, 0.4);
  color-scheme: dark;
}

/* ---------- LIGHT : ม่วงขาว ---------- */
html[data-theme='light'] {
  --bg: #faf7ff;
  --bg-2: #f4eeff;
  --bg-3: #ece2ff;
  --surface: #ffffff;
  --surface-2: #f6f1ff;
  --surface-glass: rgba(255, 255, 255, 0.75);
  --border: rgba(124, 58, 237, 0.14);
  --border-strong: rgba(124, 58, 237, 0.28);
  --text: #231244;
  --text-2: #564078;
  --text-3: #83709f;
  --primary: #7c3aed;
  --primary-2: #8b5cf6;
  --primary-3: #6d28d9;
  --accent: #c026d3;
  --accent-2: #db2777;
  --on-primary: #ffffff;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  --grad-2: linear-gradient(135deg, #c026d3 0%, #7c3aed 100%);
  --grad-text: linear-gradient(120deg, #6d28d9, #a855f7 60%, #c026d3);
  --ring: rgba(124, 58, 237, 0.4);
  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.1);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.1);
  --danger: #e11d48;
  --danger-bg: rgba(225, 29, 72, 0.08);
  --info: #2563eb;
  --info-bg: rgba(37, 99, 235, 0.08);
  --glow: 0 20px 50px -18px rgba(124, 58, 237, 0.45);
  --card-glow: 0 10px 30px -16px rgba(124, 58, 237, 0.35);
  --header-bg: rgba(250, 247, 255, 0.8);
  --orb-a: rgba(139, 92, 246, 0.28);
  --orb-b: rgba(192, 38, 211, 0.22);
  --orb-c: rgba(124, 58, 237, 0.2);
  color-scheme: light;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ============================================================
   Announce bar
   ============================================================ */
.announce {
  background: linear-gradient(90deg, #6d28d9, #a855f7, #c026d3);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  position: relative;
  z-index: 60;
}
.announce__track {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.announce__inner {
  display: flex; width: max-content; padding: 7px 0;
  white-space: nowrap;
  animation: announceScroll 26s linear infinite;
}
.announce__inner:hover { animation-play-state: paused; }
.announce__item { display: inline-flex; align-items: center; margin-right: 44px; }
@keyframes announceScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   Navbar
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.nav__inner { display: flex; align-items: center; gap: 20px; height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__logo { display: grid; place-items: center; filter: drop-shadow(0 4px 12px rgba(139, 92, 246, 0.5)); }
.brand__logo img { width: 36px; height: 36px; object-fit: contain; display: block; }
.brand__name {
  font-family: var(--font-head); font-weight: 700; font-size: 22px; letter-spacing: -0.02em;
}
.brand__name span {
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav__links { display: flex; gap: 4px; margin-left: auto; }
.nav__link {
  padding: 9px 16px; border-radius: 999px; font-weight: 500; font-size: 15px;
  color: var(--text-2); transition: all 0.2s var(--ease);
}
.nav__link:hover { color: var(--text); background: var(--surface-2); }
.nav__link.is-active { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-strong); }
.nav__actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn .ico-moon { display: none; }
html[data-theme='dark'] .icon-btn .ico-moon { display: block; }
html[data-theme='dark'] .icon-btn .ico-sun { display: none; }
.nav__burger { display: none; flex-direction: column; gap: 4px; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.nav__burger span { width: 18px; height: 2px; background: var(--text-2); border-radius: 2px; transition: 0.25s var(--ease); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 14px; font-weight: 600; font-size: 15px;
  transition: all 0.22s var(--ease); white-space: nowrap; line-height: 1;
}
.btn--primary { background: var(--grad); color: var(--on-primary); box-shadow: var(--glow); }
.btn--primary:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 24px 60px -12px rgba(139, 92, 246, 0.7); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--primary); background: var(--surface-2); }
.btn--outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
.btn--outline:hover { background: var(--surface); }
.btn--block { width: 100%; }
.btn--lg { padding: 15px 28px; font-size: 16px; border-radius: 16px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ============================================================
   App / Views
   ============================================================ */
.app { min-height: 60vh; }
.view { animation: viewIn 0.4s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(48px, 8vw, 100px) 0 clamp(40px, 7vw, 80px);
}
.hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.7; }
.orb--a { width: 480px; height: 480px; background: var(--orb-a); top: -160px; right: -80px; animation: float 11s ease-in-out infinite; }
.orb--b { width: 380px; height: 380px; background: var(--orb-b); bottom: -140px; left: -120px; animation: float 13s ease-in-out infinite reverse; }
.orb--c { width: 260px; height: 260px; background: var(--orb-c); top: 30%; left: 40%; animation: float 9s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-30px) scale(1.06); } }

.hero__grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 20px;
}
.hero__eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); } 70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.hero h1 {
  font-family: var(--font-head); font-weight: 700; font-size: clamp(34px, 5.5vw, 60px);
  line-height: 1.12; letter-spacing: -0.02em; margin-bottom: 18px;
}
.hero h1 .grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__sub { font-size: clamp(15px, 2vw, 18px); color: var(--text-2); max-width: 520px; margin-bottom: 28px; }

.hero__search { display: flex; gap: 10px; max-width: 540px; margin-bottom: 18px; }
.hero__search .search-box { flex: 1; }
.quick-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.quick-tag {
  padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  transition: all 0.2s var(--ease);
}
.quick-tag:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }

.hero__stats { display: flex; gap: 28px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat__num { font-family: var(--font-head); font-weight: 700; font-size: 26px; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat__label { font-size: 13px; color: var(--text-3); }

/* Hero visual / phone */
.hero__visual { position: relative; display: flex; justify-content: center; }
.phone {
  width: min(300px, 78vw); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 34px; padding: 16px; box-shadow: var(--glow); position: relative;
}
.phone__notch { width: 110px; height: 22px; background: var(--bg-3); border-radius: 999px; margin: 0 auto 14px; }
.phone__screen { border-radius: 22px; overflow: hidden; background: var(--bg-2); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.phone__title { font-size: 12px; color: var(--text-3); font-weight: 500; }
.phone__card { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 9px; }
.phone__thumb { width: 40px; height: 40px; border-radius: 10px; background: var(--bg-3); flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 6px; }
.phone__thumb img { width: 100%; height: 100%; object-fit: contain; border-radius: 4px; display: block; }
.phone__meta { flex: 1; min-width: 0; }
.phone__name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone__price { font-size: 12px; color: var(--primary); font-weight: 600; }
.phone__btn { padding: 8px 12px; font-size: 11.5px; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 600; flex-shrink: 0; }
.float-chip {
  position: absolute; background: var(--surface-glass); backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong); border-radius: 16px; padding: 10px 14px;
  font-size: 12.5px; font-weight: 600; box-shadow: var(--card-glow); display: flex; align-items: center; gap: 8px;
}
.float-chip--a { top: 6%; left: -6%; animation: float 6s ease-in-out infinite; }
.float-chip--b { bottom: 12%; right: -4%; animation: float 7s ease-in-out infinite reverse; }
.float-chip .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 16px; }

/* ============================================================
   Live orders (แถบออเดอร์ล่าสุด)
   ============================================================ */
.live {
  background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 12px 0; overflow: hidden; position: relative;
}
.live__inner { display: flex; align-items: center; gap: 16px; }
.live__label {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 6px 14px;
  background: var(--danger-bg); color: var(--danger); border-radius: 999px; font-size: 13px; font-weight: 700;
}
.live__label .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: blink 1.2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.live__track { flex: 1; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.live__marquee { display: flex; gap: 14px; width: max-content; animation: marquee 30s linear infinite; }
.live__marquee:hover { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.live-item {
  display: inline-flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; padding: 8px 14px; white-space: nowrap;
}
.live-item__icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; background: var(--surface-2); }
.live-item__text { font-size: 13px; color: var(--text-2); }
.live-item__text b { color: var(--text); font-weight: 600; }
.live-item__time { font-size: 12px; color: var(--text-3); }

/* ============================================================
   Sections
   ============================================================ */
.section { padding: clamp(44px, 7vw, 80px) 0; }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.section__title { font-family: var(--font-head); font-weight: 700; font-size: clamp(24px, 3.6vw, 34px); letter-spacing: -0.01em; }
.section__title .grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section__sub { color: var(--text-2); margin-top: 6px; font-size: 15px; }

/* ============================================================
   Game cards
   ============================================================ */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.game-card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; cursor: pointer; overflow: hidden;
  transition: all 0.25s var(--ease); display: flex; flex-direction: column; gap: 12px;
}
.game-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--card-glow); }
.game-card__badge {
  position: absolute; top: 12px; left: 12px; z-index: 2; padding: 4px 10px; border-radius: 999px;
  background: var(--grad); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.game-card__thumb { position: relative; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--bg-3); display: flex; align-items: center; justify-content: center; padding: 16px; }
.game-card__thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.4s var(--ease); }
.game-card:hover .game-card__thumb img { transform: scale(1.05); }
.game-card__body { display: flex; flex-direction: column; gap: 4px; }
.game-card__name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-card__price { font-size: 13px; color: var(--primary); font-weight: 600; }
.game-card__price span { font-size: 11px; color: var(--text-3); font-weight: 400; }

/* ============================================================
   Search box
   ============================================================ */
.search-box { position: relative; }
.search-box input {
  width: 100%; height: 52px; padding: 0 18px 0 48px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  font-size: 15px; outline: none; transition: all 0.2s var(--ease);
}
.search-box input::placeholder { color: var(--text-3); }
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.search-box .ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }

/* ============================================================
   Feature cards (Why us)
   ============================================================ */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; transition: all 0.25s var(--ease); position: relative; overflow: hidden;
}
.feature-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--card-glow); }
.feature-card__icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-size: 26px; margin-bottom: 16px; background: var(--surface-2); border: 1px solid var(--border);
}
.feature-card h3 { font-family: var(--font-head); font-size: 18px; margin-bottom: 8px; }
.feature-card p { color: var(--text-2); font-size: 14.5px; }

/* ============================================================
   Reviews
   ============================================================ */
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.review-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; display: flex; flex-direction: column; gap: 14px; transition: all 0.25s var(--ease);
}
.review-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--card-glow); }
.review-card__head { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 16px; color: #fff; background: var(--grad); flex-shrink: 0; }
.review-card__meta { flex: 1; min-width: 0; }
.review-card__name { font-weight: 600; font-size: 15px; }
.review-card__game { font-size: 12.5px; color: var(--text-3); }
.stars { color: #fbbf24; font-size: 14px; letter-spacing: 1px; }
.review-card__text { color: var(--text-2); font-size: 14.5px; }
.review-card__foot { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--text-3); }
.badge-verified { display: inline-flex; align-items: center; gap: 4px; color: var(--success); font-weight: 600; }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-q { width: 100%; text-align: left; padding: 18px 20px; font-weight: 600; font-size: 15.5px; display: flex; justify-content: space-between; align-items: center; gap: 14px; color: var(--text); }
.faq-q .chev { transition: transform 0.3s var(--ease); color: var(--primary); flex-shrink: 0; }
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease); }
.faq-a p { padding: 0 20px 18px; color: var(--text-2); font-size: 14.5px; }

/* ============================================================
   Game detail
   ============================================================ */
.detail-head { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.back-btn {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); transition: all 0.2s var(--ease);
}
.back-btn:hover { color: var(--text); border-color: var(--border-strong); }
.detail-hero {
  display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; margin-bottom: 26px;
}
.detail-hero__img { width: 260px; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; background: var(--bg-3); box-shadow: var(--card-glow); display: flex; align-items: center; justify-content: center; padding: 22px; }
.detail-hero__img img { width: 100%; height: 100%; object-fit: contain; }
.detail-hero h1 { font-family: var(--font-head); font-size: clamp(24px, 3.4vw, 34px); margin-bottom: 8px; }
.detail-hero .desc { color: var(--text-2); font-size: 14.5px; max-width: 640px; white-space: pre-line; line-height: 1.7; }
.detail-hero .desc a { color: var(--primary); }

.detail-layout { display: grid; grid-template-columns: 1fr 360px; gap: 26px; align-items: start; }
@media (max-width: 920px) { .detail-layout { grid-template-columns: 1fr; } }

.pkg-section h2 { font-family: var(--font-head); font-size: 20px; margin-bottom: 6px; }
.pkg-section .hint { color: var(--text-3); font-size: 13.5px; margin-bottom: 18px; }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.pkg-item {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px; cursor: pointer; text-align: left; transition: all 0.2s var(--ease); overflow: hidden;
}
.pkg-item:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.pkg-item.is-active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--ring); background: var(--surface-2); }
.pkg-item__name { font-weight: 600; font-size: 14px; line-height: 1.3; margin-bottom: 8px; }
.pkg-item__price { font-weight: 700; font-size: 17px; color: var(--primary); }
.pkg-item__price small { font-size: 12px; color: var(--text-3); font-weight: 400; }
.pkg-item__old { font-size: 12px; color: var(--text-3); text-decoration: line-through; }
.pkg-item__tag { position: absolute; top: 10px; right: 10px; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--danger-bg); color: var(--danger); }

/* Order summary panel */
.order-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; position: sticky; top: calc(var(--nav-h) + 20px);
}
.order-panel h3 { font-family: var(--font-head); font-size: 18px; margin-bottom: 18px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 7px; color: var(--text-2); }
.field input {
  width: 100%; height: 48px; padding: 0 16px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text);
  font-size: 15px; outline: none; transition: all 0.2s var(--ease);
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.field input::placeholder { color: var(--text-3); }
.field .help { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.field .help.err { color: var(--danger); }
.field input.invalid { border-color: var(--danger); }

.summary { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 6px; display: flex; flex-direction: column; gap: 10px; }
.summary__row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); }
.summary__row.total { font-size: 18px; font-weight: 700; color: var(--text); padding-top: 10px; border-top: 1px dashed var(--border-strong); }
.summary__row.total .val { color: var(--primary); font-size: 22px; }
.summary__warn { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--warning-bg); color: var(--warning); font-size: 13px; font-weight: 500; }

/* Order status result */
.order-result { text-align: center; padding: 20px 0; }
.order-result__icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; font-size: 30px; }
.order-result__icon.pending { background: var(--warning-bg); color: var(--warning); animation: spin 1.4s linear infinite; }
.order-result__icon.success { background: var(--success-bg); color: var(--success); }
.order-result__icon.canceled { background: var(--danger-bg); color: var(--danger); }
.order-result__icon.paid { background: var(--info-bg); color: var(--info); }
@keyframes spin { to { transform: rotate(360deg); } }
.order-result h3 { font-family: var(--font-head); font-size: 20px; margin-bottom: 6px; }
.order-result p { color: var(--text-2); font-size: 14.5px; }
.order-meta { margin: 18px auto 0; max-width: 340px; text-align: left; background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.order-meta .r { display: flex; justify-content: space-between; gap: 12px; }
.order-meta .r span:first-child { color: var(--text-3); }
.order-meta .r span:last-child { color: var(--text); font-weight: 500; text-align: right; word-break: break-all; }

/* ============================================================
   State: empty / loading / error
   ============================================================ */
.state { text-align: center; padding: 60px 20px; color: var(--text-2); }
.state__icon { font-size: 42px; margin-bottom: 14px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 14px; animation: spin 0.9s linear infinite; }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============================================================
   Toast
   ============================================================ */
.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 14px; padding: 14px 16px; box-shadow: var(--card-glow); animation: toastIn 0.3s var(--ease);
}
.toast.out { animation: toastOut 0.3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
.toast__ic { font-size: 20px; line-height: 1; }
.toast__body { flex: 1; }
.toast__title { font-weight: 600; font-size: 14px; }
.toast__msg { font-size: 13px; color: var(--text-2); }
.toast--success { border-left: 3px solid var(--success); }
.toast--error { border-left: 3px solid var(--danger); }
.toast--info { border-left: 3px solid var(--info); }

/* ============================================================
   Modal
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150; background: rgba(8, 4, 16, 0.7);
  backdrop-filter: blur(6px); display: flex; padding: 20px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: fadeIn 0.2s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  padding: 24px; max-width: 420px; width: 100%; text-align: center; margin: auto;
  animation: popIn 0.3s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.modal__icon { font-size: 44px; margin-bottom: 12px; }
.modal h3 { font-family: var(--font-head); font-size: 20px; margin-bottom: 8px; }
.modal p { color: var(--text-2); font-size: 14.5px; margin-bottom: 22px; }

/* Modal ชำระเงิน */
.modal--pay { max-width: 400px; display: flex; flex-direction: column; max-height: 88vh; }
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; flex-shrink: 0; }
.modal__head h3 { margin: 0; }
.modal__x { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 16px; line-height: 1; flex-shrink: 0; cursor: pointer; transition: all 0.2s var(--ease); }
.modal__x:hover { color: var(--text); border-color: var(--border-strong); }
.modal__body { overflow-y: auto; flex: 1 1 auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.modal__foot { flex-shrink: 0; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.pay-amount { font-family: var(--font-head); font-size: 34px; font-weight: 700; color: var(--primary); margin: 4px 0 16px; }
.pay-qr-frame { width: 260px; height: 260px; margin: 0 auto 12px; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.35); }
.pay-qr-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.pay-status { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: var(--text-2); margin-bottom: 14px; min-height: 24px; }
.pay-status .spinner { width: 18px; height: 18px; border-width: 2px; margin: 0; }
.pay-note { color: var(--text-2); font-size: 13.5px; margin-bottom: 16px; }
.pay-note small { color: var(--warning); font-weight: 500; }
.pay-summary { text-align: left; background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.pay-summary .r { display: flex; justify-content: space-between; gap: 12px; }
.pay-summary .r span:first-child { color: var(--text-3); flex-shrink: 0; }
.pay-summary .r span:last-child { color: var(--text); font-weight: 500; text-align: right; word-break: break-all; }

/* ============================================================
   Footer
   ============================================================ */
.footer { background: var(--bg-2); border-top: 1px solid var(--border); padding: 56px 0 30px; margin-top: 20px; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer__brand { display: flex; flex-direction: column; gap: 14px; }
.footer__desc { color: var(--text-2); font-size: 14px; max-width: 320px; }
.footer__pay { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-badge { padding: 6px 12px; font-size: 12px; font-weight: 600; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.footer__col { display: flex; flex-direction: column; gap: 10px; }
.footer__col h4 { font-family: var(--font-head); font-size: 15px; margin-bottom: 4px; }
.footer__col a { color: var(--text-2); font-size: 14px; transition: color 0.2s; }
.footer__col a:hover { color: var(--primary); }
.footer__bottom { border-top: 1px solid var(--border); padding-top: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--text-3); font-size: 13px; }
.footer__disclaimer { font-size: 12px; opacity: 0.85; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { order: -1; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .detail-hero { grid-template-columns: 120px 1fr; }
  .detail-hero__img { width: 120px; }
}
@media (max-width: 720px) {
  :root { --nav-h: 62px; }
  .nav__links {
    position: fixed; top: calc(var(--nav-h) + var(--announce-h)); left: 0; right: 0;
    flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: 12px 16px; gap: 6px; display: none; z-index: 49;
  }
  .nav__links.open { display: flex; }
  .nav__burger { display: flex; }
  .nav__login { display: none; }
  .hero__stats { gap: 18px; }
  .live__label { font-size: 12px; padding: 5px 10px; }
  .detail-hero { grid-template-columns: 1fr; text-align: center; }
  .detail-hero__img { width: 120px; margin: 0 auto; }
  .order-panel { position: static; }
  .footer__grid { grid-template-columns: 1fr; }
  .section__head { flex-direction: column; align-items: flex-start; }

  /* Modal ชำระเงินบนมือถือ — ย่อให้พอดีจอ */
  .modal-backdrop { padding: 14px; }
  .modal { padding: 18px 16px; }
  .modal--pay .pay-amount { font-size: 26px; margin: 2px 0 10px; }
  .modal--pay .pay-qr-frame { width: 190px; height: 190px; }
}
