:root {
  --brand: #2478e8;
  --brand-dark: #1a5bb8;
  --brand-darker: #123f82;
  --brand-light: #eaf3ff;
  --brand-lighter: #f4f9ff;
  --accent: #17c3b2;
  --ink: #101c30;
  --muted: #5b6b82;
  --border: #e2e8f2;
  --bg: #f6f9fd;
  --white: #ffffff;
  --ok: #1e9e5a;
  --ok-bg: #e8f8ef;
  --warn: #b8860b;
  --warn-bg: #fff6e0;
  --danger: #d3392f;
  --danger-bg: #fdecea;
  --shadow-sm: 0 2px 8px rgba(16, 28, 48, 0.06);
  --shadow: 0 10px 28px rgba(16, 28, 48, 0.09);
  --shadow-lg: 0 20px 48px rgba(16, 28, 48, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Kanit', 'Segoe UI', 'Leelawadee UI', 'Tahoma', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.28; margin: 0 0 12px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Nav ---------- */
.site-nav {
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  position: sticky; top: 0; z-index: 50;
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
.site-nav.scrolled { border-bottom-color: var(--border); box-shadow: 0 4px 20px rgba(16,28,48,.06); background: rgba(255,255,255,.94); }
.site-nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; transition: height .25s var(--ease); }
.site-nav.scrolled .site-nav-inner { height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.brand img { width: 32px; height: 32px; border-radius: 9px; display: block; flex-shrink: 0; transition: transform .25s var(--ease); }
.brand:hover img { transform: rotate(-6deg) scale(1.06); }
.brand span { color: var(--brand); }
.nav-end { display: flex; align-items: center; gap: 16px; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  position: relative; color: var(--ink); font-weight: 500; padding: 9px 14px; border-radius: 999px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-links a:hover { background: var(--brand-light); color: var(--brand-dark); }
.nav-cta { flex-shrink: 0; white-space: nowrap; }
.nav-toggle {
  display: none; position: relative; width: 40px; height: 40px; flex-shrink: 0;
  background: none; border: none; cursor: pointer; color: var(--ink);
  align-items: center; justify-content: center; border-radius: 10px;
  transition: background .15s var(--ease);
}
.nav-toggle:hover { background: var(--brand-light); }
.nav-toggle-icon { position: absolute; display: flex; transition: opacity .18s var(--ease), transform .18s var(--ease); }
.nav-toggle .icon-close { opacity: 0; transform: rotate(-45deg) scale(.6); }
.nav-toggle.open .icon-menu { opacity: 0; transform: rotate(45deg) scale(.6); }
.nav-toggle.open .icon-close { opacity: 1; transform: rotate(0) scale(1); color: var(--brand); }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-end .nav-cta { display: none; }
  .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: var(--white);
    padding: 10px 20px 18px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .28s var(--ease), opacity .2s var(--ease);
  }
  .nav-links.open { max-height: 400px; opacity: 1; }
  .nav-links a { padding: 12px 10px; border-radius: 10px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff;
  box-shadow: 0 6px 16px rgba(36, 120, 232, .28);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(36, 120, 232, .34); color: #fff; }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.btn-outline { background: transparent; border-color: var(--border); color: var(--ink); box-shadow: none; }
.btn.btn-outline:hover { background: var(--brand-light); border-color: var(--brand); color: var(--brand-dark); box-shadow: none; }
.btn.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); box-shadow: none; }
.btn.btn-ghost:hover { background: var(--bg); box-shadow: none; }
.btn.btn-danger { background: linear-gradient(135deg, #e04b40, var(--danger)); box-shadow: 0 6px 16px rgba(211, 57, 47, .25); }
.btn.btn-danger:hover { box-shadow: 0 10px 22px rgba(211, 57, 47, .32); }
.btn.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; color: var(--ink); }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit; background: var(--white); color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-light);
}
.field { margin-bottom: 16px; }
.field-hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.form-row { display: flex; gap: 14px; }
.form-row > .field { flex: 1; }
@media (max-width: 600px) { .form-row { flex-direction: column; gap: 0; } }

.terms-box {
  max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 10px; font-size: 13.5px; background: var(--bg);
}
.terms-box h4 { margin-bottom: 4px; }

/* ---------- Cards / Layout ---------- */
.card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.card-narrow { max-width: 460px; margin: 40px auto; }
.section { padding-top: clamp(40px, 8vw, 64px); padding-bottom: clamp(40px, 8vw, 64px); }
.section.narrow { max-width: 720px; margin: 0 auto; }
.section-band { background: var(--brand-lighter); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; margin-bottom: clamp(26px, 5vw, 36px); }
.section-head h2 { font-size: clamp(24px, 4.2vw, 32px); }
.section-head p { color: var(--muted); font-size: 16px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  background: var(--brand-light); color: var(--brand-dark); font-size: 13px; font-weight: 700;
  margin-bottom: 14px; letter-spacing: .01em;
}

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Reveal-on-scroll ---------- */
/* ซ่อนไว้ก่อนเฉพาะตอนที่ JS รันได้จริง (ดู app.js: document.documentElement.classList.add('js-anim'))
   กันเนื้อหาค้างมองไม่เห็น/ค้างเหลื่อมซ้อนกับ section ถัดไปถ้า JS โหลดช้า/พัง/ถูกบล็อก */
.js-anim .reveal { opacity: 0; transform: translateY(14px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }
.stagger-1.reveal { transition-delay: .06s; }
.stagger-2.reveal { transition-delay: .14s; }
.stagger-3.reveal { transition-delay: .22s; }
.stagger-4.reveal { transition-delay: .3s; }

/* ---------- Notices / flash ---------- */
.notice { padding: 14px 18px; border-radius: var(--radius-sm); margin: 16px 0; font-size: 14.5px; border: 1px solid transparent; }
.notice-success, .notice-ok { background: var(--ok-bg); color: var(--ok); border-color: #cdeedb; }
.notice-warn { background: var(--warn-bg); color: var(--warn); border-color: #f3e3ad; }
.notice-error, .notice-danger { background: var(--danger-bg); color: var(--danger); border-color: #f7d3cf; }
.notice-info { background: var(--brand-light); color: var(--brand-dark); border-color: #cfe2fb; }

/* ---------- Badges / status pills ---------- */
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.badge-gray { background: #eef1f5; color: var(--muted); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-brand { background: var(--brand-light); color: var(--brand-dark); }

/* ---------- Toggle switch (เปิด/ปิดสถานะ เช่น ให้บริการจังหวัด) ---------- */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: relative; width: 42px; height: 24px; border-radius: 999px; background: #d5dbe4;
  transition: background .18s var(--ease); flex-shrink: 0;
}
.switch-track::before {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--white); box-shadow: 0 1px 3px rgba(16,28,48,.25); transition: transform .18s var(--ease);
}
.switch input:checked + .switch-track { background: var(--ok); }
.switch input:checked + .switch-track::before { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .5; cursor: not-allowed; }
.switch-label { font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.switch input:checked ~ .switch-label { color: var(--ok); }

/* ---------- Bank card ---------- */
.bank-card { background: var(--brand-lighter); border: 1px solid #cfe2fb; border-radius: var(--radius-sm); padding: 16px 18px; }
.bank-card-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #cfe2fb; font-size: 14.5px; }
.bank-card-row:last-child { border-bottom: none; }
.bank-card-row .bank-card-value { display: flex; align-items: center; gap: 8px; }
.bank-card-qr { text-align: center; margin-bottom: 12px; }
.bank-card-qr img { max-width: 180px; width: 100%; border-radius: var(--radius-sm); border: 1px solid #cfe2fb; background: var(--white); }

/* ---------- Copy button (คัดลอกเลขบัญชี ฯลฯ) ---------- */
.copy-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  background: var(--white); border: 1px solid var(--border); color: var(--brand-dark); font-size: 12.5px;
  font-weight: 600; cursor: pointer; transition: all .15s var(--ease); flex-shrink: 0; font-family: inherit;
}
.copy-btn:hover { border-color: var(--brand); background: var(--brand-light); }
.copy-btn.copied { background: var(--ok-bg); border-color: #cdeedb; color: var(--ok); }
.copy-btn svg { flex-shrink: 0; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--white); }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14.5px; }
th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; background: var(--bg); }
tbody tr { transition: background .12s var(--ease); }
tbody tr:hover { background: var(--brand-lighter); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; white-space: nowrap; padding-bottom: 4px; margin-bottom: 22px; }
.tabs a { padding: 9px 18px; border-radius: 999px; background: var(--white); border: 1px solid var(--border); color: var(--ink); font-weight: 600; font-size: 14px; transition: all .15s var(--ease); }
.tabs a:hover { border-color: var(--brand); color: var(--brand-dark); }
.tabs a.active { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; border-color: transparent; }

/* ---------- App shell (admin / dashboard / rider / customer) ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-side {
  width: 240px; background: linear-gradient(180deg, #101c30, #0a1424); color: #b8c6de;
  flex-shrink: 0; padding: 24px 16px;
}
.app-side .brand { color: #fff; font-size: 20px; margin-bottom: 26px; display: block; }
.app-side a {
  display: block; padding: 11px 14px; border-radius: 10px; color: #b8c6de; font-weight: 500;
  margin-bottom: 3px; transition: background .15s var(--ease), color .15s var(--ease);
}
.app-side a:hover, .app-side a.active { background: rgba(255,255,255,.09); color: #fff; text-decoration: none; }
.app-side a.active { background: linear-gradient(135deg, rgba(36,120,232,.35), rgba(36,120,232,.15)); box-shadow: inset 0 0 0 1px rgba(36,120,232,.4); }
.app-side .side-user { font-size: 12.5px; color: #7488a6; padding: 0 14px 16px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 16px; }
.app-main { flex: 1; padding: 30px; max-width: 100%; overflow-x: hidden; }
.app-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }

@media (max-width: 820px) {
  .app-shell { flex-direction: column; }
  .app-side { width: 100%; display: flex; align-items: center; gap: 4px; padding: 12px 16px; overflow-x: auto; }
  .app-side .brand { margin-bottom: 0; flex-shrink: 0; }
  .app-side .side-user { display: none; }
  .app-side a { white-space: nowrap; }
  .app-main { padding: 18px; }
}

/* ---------- Stat tiles ---------- */
.stat-tile {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 20px 22px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
}
.stat-tile::before {
  content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}
.stat-tile .stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-tile .stat-value { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }

/* ---------- Section titles (admin dashboard groupings) ---------- */
.section-title {
  display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700;
  color: var(--ink); margin: 30px 0 14px;
}
.section-title:first-child { margin-top: 0; }
.section-title svg { color: var(--brand); flex-shrink: 0; }

/* ---------- Charts (inline SVG, server-rendered) ---------- */
.chart { display: block; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.chart-axis-label { font-size: 11px; fill: var(--muted); font-family: inherit; }
.chart-line-path { stroke-width: 2.5px; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: var(--white); stroke: var(--brand); stroke-width: 2px; transition: r .12s var(--ease); }
.chart-dot:hover { r: 5; }
.chart-dot-last { fill: var(--brand); }
.chart-bar-track { fill: var(--bg); }
.chart-bar-label { font-size: 12.5px; fill: var(--ink); font-weight: 500; }
.chart-bar-value { font-size: 12.5px; fill: var(--muted); font-weight: 700; }
.chart-bar-value-inside { fill: #fff; }
.chart-bar-h rect[style*="fill"] { transition: opacity .12s var(--ease); }
.chart-bar-h rect[style*="fill"]:hover { opacity: .85; }

/* ---------- Store card (customer browse) ---------- */
.store-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .22s var(--ease), box-shadow .22s var(--ease);
  display: block;
}
.store-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.store-card .cover-wrap { position: relative; overflow: hidden; }
.store-card img.cover { width: 100%; height: 150px; object-fit: cover; background: var(--brand-light); transition: transform .35s var(--ease); }
.store-card:hover img.cover { transform: scale(1.06); }
.store-card .cover-badge { position: absolute; top: 10px; right: 10px; }
.store-card-body { padding: 16px 18px; }
.store-card-body h3 { margin-bottom: 4px; font-size: 17px; }
.store-meta { font-size: 13px; color: var(--muted); }

/* ---------- Menu item row ---------- */
.menu-item-row { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); align-items: center; }
.menu-item-row:last-child { border-bottom: none; }
.menu-item-row img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; flex-shrink: 0; background: var(--brand-light); }
.menu-item-info { flex: 1; }
.menu-item-info h4 { margin: 0 0 4px; font-size: 15.5px; font-weight: 600; }
.menu-item-price { font-weight: 700; color: var(--brand-dark); }

/* ---------- รูปยืนยันตัวตน/เอกสารไรเดอร์ (ใช้ในหน้าแอดมิน rider_detail) ---------- */
.doc-thumb { display: block; width: 120px; height: 120px; object-fit: cover; border-radius: 10px; background: var(--brand-light); border: 1px solid var(--border); }

/* ---------- Cart ---------- */
.cart-line { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14.5px; }
.cart-total-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 15px; }
.cart-total-row.grand { font-weight: 800; font-size: 19px; border-top: 2px solid var(--border); margin-top: 6px; padding-top: 12px; color: var(--brand-darker); }

/* ---------- Status timeline ---------- */
.status-track { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.status-step { flex: 1; min-width: 90px; text-align: center; padding: 11px 6px; border-radius: var(--radius-sm); background: #eef1f5; color: var(--muted); font-size: 12.5px; font-weight: 700; transition: all .2s var(--ease); }
.status-step.done { background: var(--ok-bg); color: var(--ok); }
.status-step.current { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; box-shadow: 0 6px 16px rgba(36,120,232,.3); }

/* ---------- Map ---------- */
.map-box { width: 100%; height: 280px; border-radius: var(--radius-sm); border: 1px solid var(--border); overflow: hidden; }
.map-hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(48px, 9vw, 88px) 0 clamp(48px, 9vw, 96px); overflow: hidden; isolation: isolate; }
.hero::before, .hero::after {
  content: ''; position: absolute; z-index: -1; border-radius: 50%; filter: blur(60px); opacity: .55;
  animation: auroraDrift 16s var(--ease) infinite alternate;
}
.hero::before { width: 480px; height: 480px; background: radial-gradient(circle, var(--brand-light), transparent 70%); top: -160px; right: -120px; }
.hero::after { width: 360px; height: 360px; background: radial-gradient(circle, #d6f5f0, transparent 70%); bottom: -140px; left: -100px; animation-delay: -7s; }
.hero-blob-3 {
  content: ''; position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: .4;
  width: 280px; height: 280px; background: radial-gradient(circle, rgba(23,195,178,.55), transparent 70%);
  top: 46%; left: 40%; animation: auroraDrift 20s var(--ease) infinite alternate-reverse;
}
@keyframes auroraDrift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-32px, 26px) scale(1.14); }
}
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 40px); align-items: center; }
.hero h1 { font-size: clamp(28px, 5.2vw, 44px); font-weight: 800; }
.hero h1 .text-gradient {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: clamp(15.5px, 2.4vw, 18px); color: var(--muted); max-width: 520px; }
.hero-actions { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.hero-trust { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 22px; }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.hero-trust span svg { color: var(--ok); flex-shrink: 0; }
.hero-art { position: relative; animation: heroFloat 5.5s ease-in-out infinite; }
.hero-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 22px; border: 1px solid var(--border); transition: transform .12s linear;
  transform-style: preserve-3d; will-change: transform;
}
@keyframes heroFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (max-width: 860px) { .hero-trust { justify-content: center; } }
.hero-card .hero-card-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.hero-card .hero-card-row:last-child { border-bottom: none; }
.hero-card .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(23,195,178,.18); flex-shrink: 0; }
.hero-stats { display: flex; gap: 22px; margin-top: 22px; }
.hero-stats div strong { display: block; font-size: 22px; color: var(--brand-darker); }
.hero-stats div span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-art { order: -1; max-width: 380px; margin: 0 auto clamp(28px, 6vw, 40px); }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
}

/* ---------- Feature icon badges ---------- */
.icon-badge {
  width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 16px; background: linear-gradient(135deg, var(--brand-light), #dcecff);
  color: var(--brand-dark);
}
.icon-badge.accent { background: linear-gradient(135deg, #d9f7f2, #c3f0e8); color: #0d8f7f; }
.icon-badge.warn { background: linear-gradient(135deg, var(--warn-bg), #ffe9b8); color: #a06a00; }
.icon-badge.ok { background: linear-gradient(135deg, var(--ok-bg), #c8f2d8); color: #147a45; }

.feature-card { transition: transform .22s var(--ease), box-shadow .22s var(--ease); }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-card .icon-badge svg { transition: transform .22s var(--ease); }
.feature-card:hover .icon-badge svg { transform: scale(1.12) rotate(-4deg); }

/* ---------- Spotlight hover glow (เอฟเฟกต์แสงตามเมาส์บนการ์ด, เปิดใช้ด้วย [data-spotlight]) ---------- */
[data-spotlight] { position: relative; overflow: hidden; }
/* ใช้ ::after ไม่ใช่ ::before เพราะ .audience-card.featured ใช้ ::before ไปแล้วสำหรับริบบิ้น "แนะนำ" —
   ถ้าใช้ ::before ซ้ำ คุณสมบัติจากทั้ง 2 กฎจะถูกรวมกันบน pseudo-element เดียวกัน (เช่น inset:0 ของ spotlight
   จะเติม bottom/left ให้ริบบิ้นที่ปกติตั้งใจให้เป็นแค่แถบเล็กๆ กลายเป็นสี่เหลี่ยมใหญ่คลุมทั้งการ์ด) */
[data-spotlight]::after {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .3s var(--ease);
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(36,120,232,.16), transparent 70%);
  pointer-events: none; z-index: 1;
}
[data-spotlight]:hover::after { opacity: 1; }

/* ---------- Bento grid (ส่วน "ทำไมต้อง WongWai") ---------- */
.bento-grid {
  display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: auto auto;
  grid-template-areas: "large small1" "large small2"; gap: 22px;
}
.bento-grid .bento-large { grid-area: large; display: flex; flex-direction: column; justify-content: center; }
.bento-grid .bento-large h3 { font-size: 23px; }
.bento-grid .bento-large p { font-size: 15.5px; max-width: 420px; }
.bento-grid .bento-small-1 { grid-area: small1; }
.bento-grid .bento-small-2 { grid-area: small2; }
@media (max-width: 760px) {
  .bento-grid { grid-template-columns: 1fr; grid-template-areas: "large" "small1" "small2"; }
}

/* ---------- Stat cards (quick facts strip) ---------- */
.stat-strip { position: relative; z-index: 2; margin-top: clamp(-56px, -6vw, -34px); margin-bottom: clamp(24px, 5vw, 40px); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 2vw, 20px); }
.stat-card {
  text-align: center; padding: clamp(22px, 3.5vw, 32px) 14px; display: flex; flex-direction: column; align-items: center;
  box-shadow: var(--shadow-lg);
}
.stat-card .icon-badge { margin: 0 0 16px; width: 60px; height: 60px; }
.stat-card strong { display: block; font-size: clamp(32px, 6vw, 44px); font-weight: 800; color: var(--brand-darker); line-height: 1.1; letter-spacing: -0.01em; white-space: nowrap; }
.stat-card > span { display: block; font-size: 14px; color: var(--muted); margin-top: 7px; font-weight: 600; }
@media (max-width: 700px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-strip { margin-top: clamp(16px, 4vw, 28px); }
}

/* ---------- How it works (steps) ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; counter-reset: step; position: relative; }
.step { position: relative; text-align: center; padding: 0 22px; }
.step::before {
  counter-increment: step; content: counter(step);
  width: 46px; height: 46px; margin: 0 auto 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px;
  box-shadow: 0 8px 18px rgba(36,120,232,.28); position: relative; z-index: 2;
}
.step-icon { width: 60px; height: 60px; margin: 18px auto 0; border-radius: 18px; background: var(--brand-light); color: var(--brand-dark); display: flex; align-items: center; justify-content: center; }
.step h3 { font-size: 17px; }
.step p { color: var(--muted); font-size: 14.5px; margin-bottom: 0; }
.steps::after {
  content: ''; position: absolute; top: 23px; left: 16.5%; right: 16.5%; height: 2px;
  background: repeating-linear-gradient(90deg, var(--border) 0 8px, transparent 8px 16px); z-index: 1;
}
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; gap: 36px; }
  .steps::after { display: none; }
}

/* ---------- Steps group heading (ใช้คั่นระหว่าง .steps หลายชุดในหน้าเดียว เช่น ขั้นตอนสมัครร้านค้า/ไรเดอร์) ---------- */
.steps-group-head {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 19px; font-weight: 700; margin: 48px 0 28px; color: var(--ink);
}
.steps-group-head svg { color: var(--brand); flex-shrink: 0; }

/* ---------- Audience cards ---------- */
.audience-card {
  display: flex; flex-direction: column; height: 100%; text-align: left; position: relative; overflow: hidden;
}
.audience-card .icon-badge { width: 56px; height: 56px; }
.audience-card ul { list-style: none; padding: 0; margin: 14px 0 22px; flex: 1; }
.audience-card ul li { display: flex; align-items: flex-start; gap: 9px; padding: 5px 0; font-size: 14.5px; color: var(--muted); }
.audience-card ul li svg { flex-shrink: 0; margin-top: 2px; color: var(--ok); }
.audience-card.featured { border: 1.5px solid var(--brand); box-shadow: var(--shadow); animation: featuredGlow 3.2s ease-in-out infinite; }
@keyframes featuredGlow {
  0%, 100% { box-shadow: var(--shadow), 0 0 0 0 rgba(36,120,232,.25); }
  50% { box-shadow: var(--shadow), 0 0 0 7px rgba(36,120,232,0); }
}
.audience-card.featured::before {
  content: 'แนะนำ'; position: absolute; top: 16px; right: -32px; transform: rotate(45deg);
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 36px;
}

/* ---------- FAQ accordion ---------- */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:first-child { border-top: 1px solid var(--border); }
.faq-q {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 4px; cursor: pointer; font-weight: 600; font-size: 15.5px; user-select: none;
}
.faq-q svg { flex-shrink: 0; color: var(--muted); transition: transform .25s var(--ease); }
.faq-item.open .faq-q svg { transform: rotate(180deg); color: var(--brand); }
.faq-item.open .faq-q { color: var(--brand-dark); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); }
.faq-item.open .faq-a { max-height: 240px; }
.faq-a-inner { padding: 0 4px 20px; color: var(--muted); font-size: 14.5px; line-height: 1.7; }

/* ---------- CTA banner ---------- */
.cta-banner {
  position: relative; overflow: hidden; border-radius: 28px; padding: clamp(36px, 7vw, 56px) clamp(20px, 5vw, 40px); text-align: center;
  background: linear-gradient(135deg, var(--brand-darker), var(--brand-dark) 55%, var(--accent));
  background-size: 200% 200%; animation: ctaGradientShift 9s ease infinite;
  color: #fff; isolation: isolate;
}
@keyframes ctaGradientShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.cta-banner::before, .cta-banner::after {
  content: ''; position: absolute; border-radius: 50%; z-index: -1; opacity: .35; filter: blur(50px);
}
.cta-banner::before { width: 340px; height: 340px; background: #fff; top: -140px; left: -80px; }
.cta-banner::after { width: 260px; height: 260px; background: var(--accent); bottom: -120px; right: -60px; }
.cta-banner h2 { color: #fff; font-size: clamp(22px, 4.5vw, 30px); }
.cta-banner p { color: rgba(255,255,255,.85); max-width: 520px; margin-left: auto; margin-right: auto; }
.cta-banner .btn { background: #fff; color: var(--brand-darker); box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.cta-banner .btn:hover { color: var(--brand-darker); transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,.22); }
.cta-banner .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.cta-banner .btn-outline:hover { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }

/* ---------- Live pulse dot ---------- */
.dot-pulse { position: relative; }
.dot-pulse::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor;
  opacity: 0; animation: dotPulse 1.8s var(--ease) infinite;
}
@keyframes dotPulse { 0% { opacity: .5; transform: scale(.6); } 100% { opacity: 0; transform: scale(2); } }

/* ---------- Footer ---------- */
.site-footer { background: linear-gradient(180deg, #101c30, #0a1424); color: #aebbd2; padding-top: 48px; margin-top: 70px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 26px; }
.footer-grid .brand { margin-bottom: 10px; color: #fff; }
.footer-grid h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.footer-grid a { display: block; color: #aebbd2; padding: 5px 0; font-size: 14px; transition: color .15s var(--ease); }
.footer-grid a:hover { color: #fff; }
.footer-bottom { padding: 22px; text-align: center; font-size: 13px; color: #6f81a0; margin-top: 34px; border-top: 1px solid rgba(255,255,255,.08); }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Ratings ---------- */
.stars { display: inline-flex; align-items: center; gap: 2px; color: #f0b429; vertical-align: middle; }
.stars .star-ico { display: block; }
.stars-meta { font-size: 13px; color: var(--muted); }
.stars-empty { font-size: 13px; color: var(--muted); font-style: normal; }
.review-row { padding: 14px 0; border-bottom: 1px solid var(--border); }
.review-row:last-child { border-bottom: none; }

/* ---------- Search / filter bar ---------- */
.search-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.search-bar input[type="search"] { flex: 1; min-width: 220px; }
.chip-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.chip-filters a { padding: 8px 16px; border-radius: 999px; background: var(--white); border: 1px solid var(--border); color: var(--ink); font-weight: 600; font-size: 13.5px; transition: all .15s var(--ease); }
.chip-filters a:hover { border-color: var(--brand); color: var(--brand-dark); }
.chip-filters a.active { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; border-color: transparent; }

/* ---------- Confirm modal (แทน browser confirm() เดิม ใช้กับฟอร์มที่มี data-confirm="ข้อความ") ---------- */
.confirm-modal-overlay {
  position: fixed; inset: 0; background: rgba(16, 28, 48, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity .2s var(--ease), visibility 0s linear .2s;
}
.confirm-modal-overlay.open { opacity: 1; visibility: visible; transition: opacity .2s var(--ease); }
.confirm-modal {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 30px 28px 26px; max-width: 380px; width: 100%; text-align: center;
  transform: scale(.92) translateY(10px); transition: transform .22s var(--ease);
}
.confirm-modal-overlay.open .confirm-modal { transform: scale(1) translateY(0); }
.confirm-modal-icon {
  width: 56px; height: 56px; border-radius: 50%; background: var(--danger-bg); color: var(--danger);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
}
.confirm-modal-icon.warn { background: var(--warn-bg); color: var(--warn); }
.confirm-modal-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.confirm-modal-msg { font-size: 14.5px; color: var(--muted); margin-bottom: 24px; line-height: 1.65; }
.confirm-modal-actions { display: flex; gap: 10px; }
.confirm-modal-actions .btn { flex: 1; margin: 0; }

/* ---------- Lightbox ป็อปอัพดูรูป (ลิงก์ที่มี data-lightbox) ---------- */
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(16, 28, 48, .7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity .2s var(--ease), visibility 0s linear .2s;
}
.lightbox-overlay.open { opacity: 1; visibility: visible; transition: opacity .2s var(--ease); }
.lightbox {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 760px; max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  transform: scale(.94); transition: transform .22s var(--ease);
}
.lightbox-overlay.open .lightbox { transform: scale(1); }
.lightbox-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.lightbox-close { border: 0; background: var(--brand-light); color: var(--ink); width: 34px; height: 34px; border-radius: 50%; font-size: 16px; cursor: pointer; flex-shrink: 0; }
.lightbox-close:hover { background: var(--border); }
.lightbox-body { padding: 14px; overflow: auto; display: flex; justify-content: center; background: #f4f6fa; }
.lightbox-body img { max-width: 100%; max-height: calc(100vh - 200px); object-fit: contain; border-radius: 8px; }
.lightbox-foot { padding: 12px 18px; text-align: right; border-top: 1px solid var(--border); }
.lightbox-foot .btn { margin: 0; }
a[data-lightbox] { cursor: zoom-in; }

.icon-text { font-size: 26px; color: var(--brand); }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }

/* =====================================================================
   UI refresh (ต.ค. 2026) — ปรับหน้าตาทั้งเว็บให้สะอาด อ่านง่าย กดง่ายบนมือถือ
   เขียนต่อท้ายไฟล์เพื่อทับค่าเดิม ไม่แตะโครงหน้า PHP — ลบบล็อกนี้ทิ้งได้ถ้าอยากย้อนกลับ
   ===================================================================== */
:root {
  --bg: #f3f6fb;
  --border: #e3e9f2;
  --ring: 0 0 0 4px rgba(36, 120, 232, .18);
}

body { font-size: 15.5px; }
::selection { background: var(--brand-light); color: var(--brand-darker); }

/* ---------- ปุ่ม: สูงพอให้นิ้วกดง่าย มีกรอบโฟกัสชัดสำหรับคีย์บอร์ด ---------- */
.btn { min-height: 46px; padding: 11px 22px; line-height: 1.2; }
.btn.btn-sm { min-height: 36px; padding: 7px 14px; }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 10px; }
.btn:focus-visible { border-radius: 999px; }

/* ---------- ฟอร์ม ---------- */
label { font-size: 14px; margin-bottom: 7px; }
input, select, textarea { min-height: 48px; border-radius: 12px; font-size: 15.5px; }
textarea { min-height: 96px; line-height: 1.6; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--brand); }
input:hover, select:hover, textarea:hover { border-color: #c9d6e8; }
input:focus, select:focus, textarea:focus { box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: #9aa8bc; }
input:disabled, select:disabled, textarea:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235b6b82' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
input[type="file"] { padding: 7px; min-height: 0; cursor: pointer; color: var(--muted); font-size: 14px; }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 8px 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--brand-light); color: var(--brand-dark); font-family: inherit; font-weight: 600; font-size: 13.5px;
  transition: background .15s var(--ease);
}
input[type="file"]::file-selector-button:hover { background: #d6e7fd; }
.field { margin-bottom: 18px; }
.field-hint { font-size: 13px; margin-top: 6px; line-height: 1.55; }

/* ---------- การ์ด ---------- */
.card { border-color: var(--border); box-shadow: 0 1px 2px rgba(16, 28, 48, .04), 0 4px 16px rgba(16, 28, 48, .04); }
.card > h3:first-child, .card > h2:first-child { margin-bottom: 16px; }
.card h3 { font-size: 18px; }

/* ---------- แจ้งเตือน: มีแถบสีด้านซ้าย อ่านแวบเดียวรู้ว่าดีหรือไม่ดี ---------- */
.notice { border-left-width: 4px; border-radius: 12px; line-height: 1.6; }
.notice-success, .notice-ok { border-left-color: var(--ok); }
.notice-warn { border-left-color: #e0a800; }
.notice-error, .notice-danger { border-left-color: var(--danger); }
.notice-info { border-left-color: var(--brand); }

/* ---------- ตาราง ---------- */
.table-wrap { border: 1px solid var(--border); border-radius: 14px; background: var(--white); -webkit-overflow-scrolling: touch; }
.table-wrap table { background: transparent; }
th { background: #f7f9fc; white-space: nowrap; }
.table-wrap tbody tr:last-child td { border-bottom: none; }

/* ---------- หลังบ้าน (ร้านค้า/ไรเดอร์/แอดมิน) ---------- */
.app-side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 22px 14px;
}
.app-side a { padding: 11px 14px; border-radius: 12px; }
.app-side .brand { display: flex; align-items: center; gap: 0; }
.app-side .brand img { margin-right: 9px; }
.app-side a:last-child { margin-top: auto; color: #8fa1bd; } /* ออกจากระบบ อยู่ล่างสุด แยกจากเมนูหลัก */
.app-side a:last-child:hover { color: #fff; background: rgba(211, 57, 47, .22); }
.app-main { padding: 32px clamp(18px, 3vw, 40px); }
.app-main > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.app-topbar h2 { font-size: clamp(22px, 3vw, 28px); letter-spacing: -.02em; }

.stat-tile { border-radius: 14px; transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

@media (max-width: 820px) {
  /* มือถือ: เมนูเป็นแถบด้านบนติดหน้าจอ เลื่อนซ้ายขวาได้ ไม่ต้องเลื่อนกลับขึ้นไปหาเมนู */
  .app-side {
    position: sticky; top: 0; z-index: 60; height: auto; flex-direction: row;
    padding: 10px 12px; gap: 6px; box-shadow: 0 4px 18px rgba(10, 20, 36, .25);
    scrollbar-width: none;
  }
  .app-side::-webkit-scrollbar { display: none; }
  .app-side .brand { font-size: 17px; margin-right: 4px; }
  .app-side .brand img { width: 26px; height: 26px; }
  .app-side a { padding: 9px 14px; border-radius: 999px; margin: 0; font-size: 14.5px; flex-shrink: 0; }
  .app-side a:last-child { margin-top: 0; }
  .app-main { padding: 18px 14px 32px; }
  .card { padding: 20px 18px; border-radius: 14px; }
  .app-topbar { margin-bottom: 16px; }
}
@media (max-width: 560px) {
  .grid > [style*="span 2"] { grid-column: auto !important; } /* การ์ดกว้าง 2 ช่องไม่ล้นจอมือถือ (เหลือคอลัมน์เดียว) */
}

/* ---------- ตัวเลือกแบบชิป/แท็บ ---------- */
.tabs a, .chip-filters a { min-height: 40px; display: inline-flex; align-items: center; }

/* ---------- แผนที่ ---------- */
.map-box { border-radius: 14px; }
.leaflet-control-zoom a { width: 36px !important; height: 36px !important; line-height: 36px !important; }

/* ผู้ใช้ที่ตั้งค่าลดการเคลื่อนไหว — ปิดแอนิเมชันทั้งหมด */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
