:root {
  --primary: #1E1A38;
  --primary-light: #2A1B4A;
  --accent: #F97316;
  --accent-hover: #EA580C;
  --cream: #F7F5FB;
  --white: #FFFFFF;
  --text-dark: #1F1B2E;
  --text-muted: #6B6580;
  --border: #E9E1F2;
  --footer-text: #C9BEDD;
  --footer-border: #34294F;
  --footer-muted: #9A8FB5;
  --grad: linear-gradient(135deg, #6D28D9 0%, #C026D3 45%, #F97316 100%);
  --radius: 12px;
  --max-width: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'IBM Plex Sans Thai', system-ui, sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  line-height: 1.6;
}

h1, h2, h3, .serif {
  font-family: 'Noto Serif Thai', serif;
  margin: 0;
}

p { margin: 0; }

.nowrap { white-space: nowrap; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.brand span {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-dark);
}

.nav-links a.active {
  color: var(--accent);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--primary);
}

.nav-toggle svg { width: 24px; height: 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #FFFFFF !important;
  padding: 11px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(249,115,22,0.35); }
.btn { transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease; }

.btn-lg { padding: 15px 28px; font-size: 16px; }

/* ---------- Page banner (inner pages) ---------- */
.page-banner {
  background: var(--grad);
  padding: 64px 24px;
  text-align: center;
  color: #FFFFFF;
}

.page-banner .eyebrow {
  display: inline-block;
  background: #FFFFFF;
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.page-banner h1 {
  font-size: 34px;
  font-weight: 600;
}

.page-banner p {
  margin-top: 12px;
  font-size: 16px;
  color: rgba(255,255,255,0.92);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Hero (home) ---------- */
.hero {
  background: var(--grad);
  padding: 88px 24px;
}

.hero .container {
  display: flex;
  align-items: center;
  gap: 56px;
}

.hero-copy {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.hero-copy .eyebrow {
  background: #FFFFFF;
  color: var(--primary);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.6);
}

.hero-copy h1 {
  font-size: 42px;
  line-height: 1.3;
  font-weight: 600;
  color: #FFFFFF;
}

.hero-copy p {
  font-size: 18px;
  line-height: 1.7;
  color: rgba(255,255,255,0.92);
  max-width: 460px;
}

.hero-image {
  flex: 1;
  min-width: 280px;
  aspect-ratio: 4/3;
  border-radius: 16px;
  border: 1.5px dashed rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #FFFFFF;
  text-align: center;
  padding: 16px;
}

.hero-image svg { width: 40px; height: 40px; }
.hero-image span { font-size: 14px; font-weight: 600; }

/* Hero dashboard mockup (ใช้แทนรูปจนกว่าจะมีรูปจริง) */
.hero-photo {
  flex: 1;
  min-width: 280px;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(30,26,56,0.35);
}

.hero-mock {
  flex: 1;
  min-width: 280px;
  max-width: 480px;
  background: #FFFFFF;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 24px 48px rgba(30,26,56,0.35);
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: rotate(1.5deg);
}

.mock-head { display: flex; align-items: center; gap: 6px; }
.mock-head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.mock-title { margin-left: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); }

.mock-total {
  background: var(--grad);
  border-radius: 12px;
  padding: 16px 18px;
  color: #FFFFFF;
}
.mock-label { font-size: 13px; opacity: 0.9; }
.mock-amount { font-size: 30px; font-weight: 700; line-height: 1.3; }
.mock-sync { font-size: 12px; opacity: 0.9; }

.mock-rows { display: flex; flex-direction: column; gap: 12px; }
.mock-row { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.mock-row b { color: var(--text-dark); font-weight: 600; }
.tag { font-size: 11px; font-weight: 700; padding: 3px 0; border-radius: 6px; text-align: center; color: #FFFFFF; }
.tag.shopee { background: #EE4D2D; }
.tag.lazada { background: #1A1AA6; }
.tag.tiktok { background: #111111; }
.bar { height: 8px; background: var(--cream); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: 999px; }

.mock-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mock-foot div { background: var(--cream); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.mock-foot small { font-size: 11px; color: var(--text-muted); }
.mock-foot strong { font-size: 15px; color: var(--text-dark); }
.mock-foot .ok { color: #16A34A; }

/* ---------- Stats ---------- */
.stats {
  background: var(--primary);
  padding: 44px 24px;
}

.stats .container {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}

.stat {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat .num {
  font-size: 30px;
  font-weight: 700;
  color: #FFFFFF;
}

.stat .label {
  font-size: 14px;
  color: var(--footer-text);
}

/* ---------- Client logo marquee ---------- */
section.clients {
  padding: 44px 0 48px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.clients-title {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}

.marquee-track {
  display: flex;
  gap: 20px;
  width: max-content;
  padding: 4px 0;
  animation: marquee-scroll 32s linear infinite;
}

.marquee:hover .marquee-track { animation-play-state: paused; }

.logo-item {
  flex: 0 0 auto;
  width: 180px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.logo-item img {
  max-width: 100%;
  max-height: 102px;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.logo-item:hover { border-color: #D8C8F0; box-shadow: 0 6px 16px rgba(109,40,217,0.10); }
.logo-item:hover img { transform: scale(1.06); }

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-50% - 10px)); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee-track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; padding: 0 20px; }
  .marquee-track [aria-hidden="true"] { display: none; }
}

/* ---------- Sections ---------- */
section { padding: 80px 24px; }
section.alt { background: var(--white); }

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.section-head .eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.section-head h2 {
  font-size: 28px;
  font-weight: 600;
}

/* ---------- Service cards ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--cream);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: #D8C8F0;
  box-shadow: 0 12px 28px rgba(109,40,217,0.12);
}

.service-card .icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7C3AED;
  box-shadow: 0 2px 6px rgba(30,26,56,0.06);
}

.service-card .icon svg { width: 22px; height: 22px; }

.service-card h3 { font-size: 16px; font-weight: 700; font-family: 'IBM Plex Sans Thai', sans-serif; }
.service-card p { font-size: 14px; color: var(--text-muted); }

/* ---------- Why us rows ---------- */
.whyus-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 880px;
  margin: 0 auto;
}

.whyus-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px 26px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.whyus-row:hover { border-color: #D8C8F0; box-shadow: 0 8px 20px rgba(109,40,217,0.08); }

.whyus-row .num {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 999px;
  background: var(--grad);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.whyus-row h3 { font-size: 15px; font-weight: 700; font-family: 'IBM Plex Sans Thai', sans-serif; }
.whyus-row p { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* ---------- CTA / footer ---------- */
.cta-footer {
  padding: 76px 24px 56px 24px;
  background: var(--primary);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.cta-footer h2 { font-size: 28px; font-weight: 600; color: #FFFFFF; }

.cta-footer > p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--footer-text);
  max-width: 520px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 48px;
  margin-top: 36px;
  flex-wrap: wrap;
  justify-content: center;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--footer-text);
  text-align: left;
}

.contact-list a { color: var(--footer-text); }
.contact-list a:hover { color: #FFFFFF; }

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  padding: 14px;
  border-radius: 12px;
}

.qr-box img { width: 96px; height: 96px; border-radius: 6px; }
.qr-box span { font-size: 12px; font-weight: 600; color: var(--primary); }

.copyright {
  width: 100%;
  max-width: 1140px;
  border-top: 1px solid var(--footer-border);
  margin-top: 36px;
  padding-top: 20px;
  font-size: 12px;
  color: var(--footer-muted);
}

/* ---------- About page content ---------- */
.about-content {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-content h2 { font-size: 26px; font-weight: 600; }
.about-content p { font-size: 17px; line-height: 1.8; color: var(--text-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .site-nav { position: relative; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    background: #FFFFFF;
    padding: 20px 24px 24px 24px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 16px rgba(20,20,19,0.08);
  }
  .nav-links.open { display: flex; }
  .site-nav { flex-wrap: nowrap; padding: 12px 16px; }
  .brand { order: 1; margin-right: auto; min-width: 0; }
  .brand span { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .site-nav > .btn { order: 2; padding: 8px 14px; font-size: 13px; white-space: nowrap; }
  .nav-toggle { order: 3; }
  .nav-links { order: 4; }
  .hero .container { flex-direction: column; }
  .hero-copy { align-items: center; text-align: center; }
  .hero-copy p { max-width: 100%; }
  .stats .container { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .page-banner h1 { font-size: 26px; }
  .hero-copy h1 { font-size: 30px; }
  .hero { padding: 56px 20px; }
  .hero-mock { transform: none; width: 100%; min-width: 0; }
  .hero-photo { width: 100%; min-width: 0; }
  section { padding: 56px 20px; }
}

@media (max-width: 480px) {
  .brand span { display: none; }
  .hero-copy h1 { font-size: 26px; }
  .hero-copy p { font-size: 16px; }
  .stat .num { font-size: 22px; }
  .whyus-row { padding: 18px; gap: 16px; }
  .logo-item { width: 140px; height: 100px; padding: 8px 12px; }
  .logo-item img { max-height: 84px; }
  .marquee-track { gap: 12px; animation-duration: 24s; }
  @keyframes marquee-scroll { to { transform: translateX(calc(-50% - 6px)); } }
}
