/* Palette taken from the tour banner: sky blue, navy lettering,
   gold "มูเตลู" script, sunny-yellow price swoosh, white polaroid paper. */
:root {
  --bg: #f2f8fe;
  --surface: #ffffff;
  --surface-2: #f0f6fd;
  --line: #d6e4f3;
  --text: #13294b;
  --navy: #0f2a5c;
  --muted: #5d6f8c;
  --sky: #3d8ee0;
  --sky-deep: #1d5fae;
  --gold: #e0a82e;
  --gold-hi: #ffd65a;
  --gold-lo: #c08a1c;
  --coral: #e0654a;
  --jade: #23936a;
  --shadow: 0 18px 40px -22px #1d5fae55;
  --radius: 18px;
  --head: "Mitr", "IBM Plex Sans Thai", sans-serif;
  --sans: "IBM Plex Sans Thai", system-ui, sans-serif;
  --hand: "Mali", "IBM Plex Sans Thai", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: linear-gradient(180deg, #cfe5fb 0, #e8f3fd 520px, var(--bg) 900px, #fff8ec 100%);
  color: var(--text);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--sky-deep); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- buttons (yellow like the price swoosh) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .75em 1.5em;
  border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #ffe27e, var(--gold-hi) 45%, var(--gold));
  color: var(--navy); font: 500 1rem var(--head);
  text-decoration: none; cursor: pointer;
  box-shadow: 0 8px 20px -8px #e0a82ecc, inset 0 1px 0 #fff9;
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -8px #e0a82ecc, inset 0 1px 0 #fff9; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sm { padding: .45em 1.1em; font-size: .92rem; }
.btn-lg { padding: .85em 2.2em; font-size: 1.15rem; }
.btn-ghost { background: var(--surface); color: var(--navy); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--sky); }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .65rem clamp(16px, 4vw, 40px);
  background: #ffffffd9; backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { font: 600 1.15rem var(--head); color: var(--gold); text-decoration: none; }
.brand span { color: var(--navy); font-weight: 500; }
.topbar nav { display: flex; align-items: center; gap: 1.2rem; }
.topbar nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: .95rem; }
.topbar nav a:not(.btn):hover { color: var(--navy); }
@media (max-width: 640px) { .topbar nav a:not(.btn) { display: none; } }

/* ---------- hero ---------- */
.hero { padding: clamp(0px, 3vw, 32px) 0 clamp(40px, 6vw, 64px); text-align: center; }
.banner { margin: 0 auto; max-width: 1180px; }
.banner img { width: 100%; height: auto; }
@media (min-width: 720px) {
  .banner { padding: 0 24px; }
  .banner img { border-radius: 24px; box-shadow: 0 30px 60px -30px #1d5fae99; }
}

.hero-inner { max-width: 820px; margin: 0 auto; padding: 0 16px; }
.tagline { margin: 1.6rem 0 0; font: 600 clamp(1.05rem, 3.4vw, 1.4rem) var(--hand); color: var(--sky-deep); }

.facts {
  list-style: none; padding: 0; margin: 1.4rem auto 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.facts li { padding: .9rem .6rem; }
.facts li + li { border-left: 1px solid var(--line); }
.facts small { display: block; color: var(--muted); font-size: .78rem; }
.facts strong { display: block; font: 500 1rem var(--head); color: var(--navy); }
@media (max-width: 600px) {
  .facts { grid-template-columns: 1fr; }
  .facts li + li { border-left: 0; border-top: 1px solid var(--line); }
}

.price-row { display: flex; align-items: center; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.8rem; }
.price { font: 600 3rem/1 var(--head); color: var(--navy); }
.price .currency { font-size: .55em; vertical-align: .6em; margin-right: .1em; color: var(--gold); }
.price small { font: 400 1rem var(--sans); color: var(--muted); margin-left: .3em; }

/* ---------- seat meter (bus) ---------- */
.seatmeter { max-width: 520px; margin: 2rem auto 0; }
.seatmeter-head { display: flex; justify-content: space-between; font-size: .9rem; color: var(--muted); margin-bottom: .5rem; }
.seatmeter-head strong { color: var(--sky-deep); font-weight: 600; }
.bus {
  display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px;
  padding: 10px 14px 10px 22px;
  border-radius: 12px 28px 28px 12px;
  background: var(--surface); box-shadow: var(--shadow), inset 0 -4px 0 var(--sky);
  position: relative;
}
.bus::before { /* windshield */
  content: ""; position: absolute; right: 7px; top: 8px; bottom: 12px; width: 5px;
  border-radius: 4px; background: #bcd8f4;
}
.seat { aspect-ratio: 1; border-radius: 3px; background: var(--gold-hi); box-shadow: inset 0 -2px 0 var(--gold); transition: background .4s; }
.seat.taken { background: #dbe6f2; box-shadow: none; }

/* ---------- sections ---------- */
.section { max-width: 980px; margin: 0 auto; padding: clamp(48px, 7vw, 80px) 16px 0; }
.section-title {
  display: flex; align-items: center; gap: 1rem;
  margin: 0 0 2rem; font: 600 clamp(1.5rem, 4vw, 2rem) var(--head); color: var(--navy);
}
.section-title::before, .section-title::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--gold-hi)); }
.section-title::after { background: linear-gradient(90deg, var(--gold-hi), transparent); }
.note-center { text-align: center; color: var(--muted); font-size: .92rem; margin: -1rem 0 2rem; }

.tbc {
  font-style: normal; font-size: .72em; font-weight: 500;
  padding: .1em .55em; border-radius: 999px; margin-left: .3em; vertical-align: .1em;
  color: var(--coral); background: #e0654a14; border: 1px solid #e0654a55; white-space: nowrap;
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { padding: 1.5rem 1.4rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border-top: 4px solid var(--sky); }
.card:nth-child(2) { border-top-color: var(--gold-hi); }
.card:nth-child(3) { border-top-color: var(--coral); }
.card-num { font: 600 1.8rem/1 var(--head); color: var(--gold); }
.card h3 { margin: .5rem 0 .3rem; font: 600 1.2rem var(--head); color: var(--navy); }
.card p { margin: 0; color: var(--muted); }
.card b { color: var(--navy); font-weight: 600; }

.include {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px;
  margin-top: 24px; padding: 1.4rem 1.6rem;
  background: #ffffffa6; border: 1.5px dashed #b9d3ee; border-radius: var(--radius);
}
@media (max-width: 640px) { .include { grid-template-columns: 1fr; } }
.include h3 { margin: 0 0 .5rem; font: 500 1.05rem var(--head); color: var(--sky-deep); }
.include ul { list-style: none; padding: 0; margin: 0; }
.include li { padding: .25rem 0 .25rem 1.6rem; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--jade); font-weight: 700; }
.crosses li { color: var(--muted); }
.crosses li::before { content: "–"; position: absolute; left: .2rem; }

/* ---------- schedule ---------- */
.days { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .days { grid-template-columns: 1fr; } }
.day { background: var(--surface); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.day-head { display: flex; align-items: baseline; gap: .7rem; margin-bottom: 1rem; }
.day-head strong { font: 500 1.05rem var(--head); color: var(--navy); }
.day-no { font: 600 .8rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #fff; background: var(--sky); padding: .15em .6em; border-radius: 6px; }
.day:nth-child(2) .day-no { background: var(--gold); }
.timeline { list-style: none; margin: 0 0 0 3.2rem; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: .35rem 0 .35rem 1.1rem; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: .95rem;
  width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--sky);
}
.timeline li.hl::before { background: var(--gold-hi); border-color: var(--gold); box-shadow: 0 0 0 4px #ffd65a55; }
.timeline li.hl { color: var(--navy); font-weight: 600; }
.timeline time { position: absolute; left: -3.5rem; width: 2.8rem; text-align: right; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; top: .45rem; }

/* ---------- booking panel ---------- */
.panel {
  max-width: 680px; margin: 0 auto;
  padding: clamp(1.2rem, 4vw, 2rem);
  background: var(--surface); border-radius: 24px;
  box-shadow: 0 30px 70px -35px #1d5fae80;
}
.steps { list-style: none; padding: 0; margin: 0 0 1.6rem; display: flex; counter-reset: s; }
.steps li { flex: 1; counter-increment: s; font-size: .85rem; color: var(--muted); text-align: center; position: relative; }
.steps li::before {
  content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; margin: 0 auto .3rem;
  border-radius: 50%; border: 1.5px solid var(--line); font-weight: 600; background: var(--surface);
  position: relative; z-index: 1;
}
.steps li + li::after { content: ""; position: absolute; top: 15px; right: calc(50% + 22px); width: calc(100% - 44px); height: 2px; background: var(--line); }
.steps li.active, .steps li.done { color: var(--navy); }
.steps li.active::before { background: var(--sky); color: #fff; border-color: var(--sky); }
.steps li.done::before { content: "✓"; background: var(--jade); color: #fff; border-color: var(--jade); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.field { display: block; }
.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
input, textarea {
  width: 100%; padding: .75em .9em;
  background: var(--surface-2); color: var(--text);
  border: 1.5px solid transparent; border-radius: 12px;
  font: 400 1rem var(--sans);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: #93a3bb; }
input:focus, textarea:focus { outline: none; background: var(--surface); border-color: var(--sky); box-shadow: 0 0 0 4px #3d8ee026; }
input.invalid { border-color: var(--coral); background: #fff5f2; }
textarea { resize: vertical; }

.qty-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin: 1.4rem 0 1rem; padding: 1rem 1.1rem;
  border-radius: 14px; background: #fff8e1; border: 1px solid #ffe7a3;
}
.qty-row strong { font: 500 1rem var(--head); color: var(--navy); }
.qty-row small { display: block; color: var(--muted); font-size: .8rem; }
.stepper { display: flex; align-items: center; gap: .3rem; }
.stepper button {
  width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: var(--surface); color: var(--navy); box-shadow: 0 2px 8px -2px #c08a1c66;
  font-size: 1.3rem; cursor: pointer;
}
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper output { min-width: 2.2em; text-align: center; font: 600 1.5rem var(--head); color: var(--navy); }

.passengers { display: grid; gap: 10px; margin-bottom: 1rem; }
.passenger { display: grid; grid-template-columns: 1.8rem 1fr 9.5em; align-items: center; gap: .6rem; }
.passenger b { width: 1.8rem; height: 1.8rem; display: grid; place-items: center; border-radius: 50%; background: var(--sky); color: #fff; font-size: .8rem; }
@media (max-width: 480px) {
  .passenger { grid-template-columns: 1.8rem 1fr; row-gap: .4rem; }
  .passenger [data-pphone] { grid-column: 2; }
}
.emergency { margin: 0 0 1rem; padding: .9rem 1rem 1rem; border: 1px solid var(--line); border-radius: 14px; }
.emergency legend { padding: 0 .4rem; font-size: .85rem; color: var(--muted); }
.field small, .emergency small { color: #93a3bb; }
.close-note { margin: .9rem 0 0; color: var(--muted); font-size: .9rem; }

.form-error { min-height: 1.2em; margin: .8rem 0 0; color: #c9432a; font-size: .92rem; }
.step-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.step-foot.center { justify-content: center; }
.total { color: var(--muted); }
.total strong { color: var(--navy); font: 600 1.5rem var(--head); margin-left: .3rem; }

/* payment */
.pay { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px; }
@media (max-width: 560px) { .pay { grid-template-columns: 1fr; } }
.pay-amount, .bank { padding: 1.1rem 1.2rem; border-radius: 16px; }
.pay-amount { text-align: center; background: linear-gradient(135deg, #fff3c4, var(--gold-hi)); }
.pay-amount strong { display: block; font: 600 2.4rem/1.25 var(--head); color: var(--navy); }
.pay-amount small { color: #6b5a2a; font-size: .85rem; }
.pay-amount b { color: #b3401f; }
.bank { background: var(--surface-2); }
.bank small { color: var(--muted); font-size: .85rem; }
.acc { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: .2rem 0; }
.acc strong { font: 600 1.35rem var(--sans); letter-spacing: .06em; font-variant-numeric: tabular-nums; color: var(--navy); }
.copy { flex: none; padding: .35em .9em; border-radius: 999px; border: 0; background: var(--sky); color: #fff; font: 500 .85rem var(--sans); cursor: pointer; }

.drop {
  display: grid; place-items: center; gap: .6rem;
  margin-top: 14px; min-height: 150px; padding: 1rem;
  border: 2px dashed #a9c9ec; border-radius: 16px;
  text-align: center; cursor: pointer; background: var(--surface-2); color: var(--sky-deep);
  transition: background .15s, border-color .15s;
}
.drop:hover { background: #e6f1fc; border-color: var(--sky); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop img { max-height: 280px; border-radius: 10px; box-shadow: var(--shadow); }
.drop small { color: var(--muted); }
.consent { display: flex; gap: .6rem; align-items: flex-start; margin-top: 1rem; font-size: .95rem; cursor: pointer; }
.consent + .consent { margin-top: .6rem; }
.consent input { flex: none; width: 20px; height: 20px; margin-top: .2em; accent-color: var(--sky); }
.policy p { margin: 0 0 .7rem; }
.policy b { color: var(--navy); font-weight: 600; }

/* ticket */
.ticket { border-radius: 20px; overflow: hidden; background: var(--surface); box-shadow: 0 20px 50px -25px #1d5fae99; border: 1px solid var(--line); }
.ticket-top { padding: 1.4rem; text-align: center; color: #fff; background: linear-gradient(135deg, var(--sky), var(--sky-deep)); border-bottom: 2px dashed #ffffff99; }
.ticket-top h3 { margin: 0; font: 600 1.4rem var(--head); color: var(--gold-hi); }
.ticket-top p { margin: .2rem 0 0; }
.ticket-top .eyebrow { margin: 0 0 .3rem; font: 600 .85rem var(--sans); letter-spacing: .2em; color: #fff; }
.ticket-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1.3rem 1.4rem .6rem; }
.ticket-body > div:first-child { grid-column: 1 / -1; }
.ticket-body small { display: block; color: var(--muted); font-size: .8rem; }
.ticket-body strong { color: var(--navy); }
.ticket-body .code { font: 600 1.9rem var(--head); color: var(--sky-deep); letter-spacing: .05em; white-space: nowrap; }
.qr-note { margin: .6rem 1.4rem 0; padding: .5rem .8rem; border-radius: 10px; background: #fff8e1; color: #6b5a2a; font-size: .88rem; text-align: center; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; padding: 1rem 1.4rem 1.4rem; width: 100%; }
.lookup-item .qr-grid { padding: .6rem 0 0; }
.qr-card { display: grid; justify-items: center; gap: .2rem; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: center; }
.qr-card .qr { padding: 6px; background: #fff; }
.qr-card .qr img, .qr-card .qr canvas { width: 148px; height: 148px; }
.qr-card small { color: var(--muted); font-size: .78rem; }
.qr-card strong { color: var(--navy); font-size: .95rem; word-break: break-word; }
.ticket + .note-center { margin: 1.2rem 0 0; }

/* lookup */
.lookup { display: flex; gap: 10px; }
.lookup input { flex: 1; }
.lookup-result { max-width: 680px; margin: 1rem auto 0; display: grid; gap: 10px; }
.lookup-item { padding: 1rem 1.2rem; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.lookup-item strong { font: 600 1.1rem var(--head); color: var(--sky-deep); }
.lookup-item small { color: var(--muted); }
.badge { font-size: .8rem; padding: .2em .7em; border-radius: 999px; align-self: start; }
.badge.ok { background: #23936a1a; color: var(--jade); }
.badge.warn { background: #e0654a1a; color: #c9432a; }
.lookup-empty { text-align: center; color: var(--muted); }

/* faq */
.faq { max-width: 760px; margin: 0 auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .3rem 1.4rem; }
.faq details + details { border-top: 1px solid var(--line); }
.faq summary { padding: 1rem 2rem 1rem 0; cursor: pointer; font-weight: 500; color: var(--navy); list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .3rem; color: var(--sky); font-size: 1.4rem; top: .7rem; transition: rotate .2s; }
.faq details[open] summary::after { rotate: 45deg; }
.faq p { margin: 0 0 1rem; color: var(--muted); }

/* footer */
.footer { margin-top: 90px; padding: 2.4rem 16px 3rem; text-align: center; color: #d6e6f8; background: var(--navy); }
.footer .brand span { color: #fff; }
.footer b { color: var(--gold-hi); }
.footer p { margin: .3rem 0; }
.footer .fb-link {
  display: inline-block; margin: .4rem 0; padding: .55em 1.3em; border-radius: 999px;
  background: #1877f2; color: #fff; font-weight: 500; text-decoration: none;
}
.footer .fb-link:hover { background: #0f65d6; }

/* overlay */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 1rem; background: #f2f8feeb; backdrop-filter: blur(4px); color: var(--navy); font-family: var(--head); }
.overlay p { margin: 0; max-width: 22em; padding: 0 16px; text-align: center; font-size: 1.1rem; }
.overlay small { color: var(--muted); font-family: var(--sans); }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--sky); animation: spin .9s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

/* live test mode banner (?test=...) */
.test-banner { position: sticky; top: 0; z-index: 20; padding: .55rem 16px; text-align: center; font: 500 .9rem var(--sans); background: #7c3aed; color: #fff; }
.test-banner.bad { background: #c9432a; }
