/* =========================================================
   Mamong Academy — Design System
   ========================================================= */

:root {
  --navy-900: #072254;
  --navy-800: #0b3c8f;
  --navy-700: #0f49a8;
  --blue-600: #1257c9;
  --blue-500: #2071e6;
  --blue-400: #3e8df5;
  --sky-200: #bcdcff;
  --sky-100: #e3f0ff;
  --sky-50: #f2f8ff;

  --gold-600: #e08c00;
  --gold-500: #f7a81b;
  --gold-400: #ffc02e;
  --gold-100: #fff3d6;

  --ink: #10233f;
  --ink-soft: #33456a;
  --muted: #61759a;
  --line: #dde8f7;
  --white: #fff;
  --bg: #f6faff;

  --green-500: #06c755;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 34px;
  --r-pill: 999px;

  --sh-sm: 0 2px 8px rgba(11, 60, 143, .07);
  --sh-md: 0 10px 30px rgba(11, 60, 143, .10);
  --sh-lg: 0 22px 60px rgba(11, 60, 143, .16);
  --sh-gold: 0 10px 26px rgba(247, 168, 27, .34);

  --ff-head: 'Kanit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ff-body: 'Sarabun', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --wrap: 1180px;
  --header-h: 76px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-soft);
  background: var(--bg);
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; display: block; }
img { height: auto; }
a { color: var(--blue-600); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--gold-600); }
h1, h2, h3, h4, h5 { font-family: var(--ff-head); color: var(--ink); line-height: 1.28; margin: 0 0 .6em; font-weight: 600; letter-spacing: -.2px; overflow-wrap: break-word; }

/* grid/flex children default to min-width:auto, which lets long content push
   the layout wider than the viewport — reset it so everything stays contained */
.hero-inner > *, .split > *, .detail-grid > *, .grid > *,
.footer-grid > *, .header-inner > *, .stats-row > * { min-width: 0; }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.35rem); font-weight: 700; }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
p { margin: 0 0 1.05em; }
ul, ol { margin: 0 0 1em; padding-left: 1.15em; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue-400); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--navy-800); color: #fff; padding: 12px 20px; border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s ease;
}
.site-header.scrolled { box-shadow: var(--sh-md); }
.header-inner { display: flex; align-items: center; gap: 18px; min-height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark, .brand img { border-radius: 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--ff-head); font-size: 1.16rem; font-weight: 700; color: var(--navy-800); letter-spacing: -.3px; }
.brand-text small { font-size: .74rem; color: var(--muted); font-weight: 500; }

.main-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.main-nav a {
  font-family: var(--ff-head); font-size: .935rem; font-weight: 500;
  color: var(--ink-soft); padding: 9px 13px; border-radius: var(--r-pill);
  white-space: nowrap; transition: all .18s ease;
}
.main-nav a:hover { background: var(--sky-100); color: var(--navy-800); }
.main-nav a.is-active { background: var(--navy-800); color: #fff; }

.header-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: none; border: 1px solid var(--line); background: #fff;
  width: 44px; height: 44px; border-radius: 13px; color: var(--navy-800);
  align-items: center; justify-content: center;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--ff-head); font-weight: 600; font-size: 1.02rem;
  padding: 14px 28px; border-radius: var(--r-pill); border: 2px solid transparent;
  cursor: pointer; transition: transform .16s ease, box-shadow .2s ease, background .2s ease;
  text-align: center; line-height: 1.35;
}
.btn:hover { transform: translateY(-2px); }
.btn-sm { padding: 9px 17px; font-size: .9rem; border-radius: var(--r-pill); }
.btn-lg { padding: 17px 38px; font-size: 1.1rem; }
.btn-block { width: 100%; }

.btn-primary { background: linear-gradient(135deg, var(--blue-600), var(--navy-800)); color: #fff; box-shadow: var(--sh-md); }
.btn-primary:hover { color: #fff; box-shadow: var(--sh-lg); }
.btn-gold { background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); color: #4a2c00; box-shadow: var(--sh-gold); }
.btn-gold:hover { color: #3d2400; }
.btn-ghost { background: #fff; color: var(--navy-800); border-color: var(--sky-200); box-shadow: var(--sh-sm); }
.btn-ghost:hover { color: var(--navy-800); border-color: var(--blue-400); }
.btn-outline-white { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.55); backdrop-filter: blur(6px); }
.btn-outline-white:hover { background: rgba(255,255,255,.22); color: #fff; }
.btn-line { background: var(--green-500); color: #fff; box-shadow: 0 6px 16px rgba(6,199,85,.3); }
.btn-line:hover { color: #fff; }

/* =========================================================
   Announcement bar / promo
   ========================================================= */
.promo-bar {
  background: linear-gradient(100deg, var(--gold-400), var(--gold-500) 60%, #ff9a2b);
  color: #4a2c00; font-family: var(--ff-head); font-weight: 500;
}
.promo-bar .wrap { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding-block: 11px; text-align: center; }
.promo-bar .badge {
  background: #4a2c00; color: var(--gold-400); font-size: .78rem; font-weight: 600;
  padding: 3px 12px; border-radius: var(--r-pill); white-space: nowrap;
}
.promo-bar strong { font-weight: 600; }
.promo-bar .promo-body { font-size: .93rem; opacity: .92; }
.promo-bar a { color: #4a2c00; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; white-space: nowrap; }
.promo-bar a:hover { color: #1b1000; }

/* =========================================================
   Hero + slider
   ========================================================= */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(150deg, #0a3379 0%, var(--navy-800) 42%, var(--blue-600) 100%);
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.14), transparent 46%),
    radial-gradient(circle at 88% 78%, rgba(247,168,27,.20), transparent 45%);
}
.hero::after {
  content: ''; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.13) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 72%);
          mask-image: linear-gradient(to bottom, #000, transparent 72%);
}
.hero-inner {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 46px; align-items: center;
  padding-block: 62px 74px;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
  padding: 7px 17px; border-radius: var(--r-pill);
  font-family: var(--ff-head); font-size: .87rem; font-weight: 500; margin-bottom: 20px;
  backdrop-filter: blur(6px);
}
.hero-eyebrow svg { color: var(--gold-400); }
.hero h1 { color: #fff; margin-bottom: .45em; }
.hero h1 .hl { color: var(--gold-400); }
.hero-sub { font-size: 1.09rem; color: rgba(255,255,255,.9); max-width: 34em; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 13px; margin-bottom: 30px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0; margin: 0; list-style: none; }
.hero-points li { display: flex; align-items: center; gap: 8px; font-size: .95rem; color: rgba(255,255,255,.94); }
.hero-points svg { color: var(--gold-400); flex-shrink: 0; }

/* slider */
.slider { position: relative; border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--sh-lg); background: #06214f; max-width: 100%; }
.slider-track { display: flex; transition: transform .55s cubic-bezier(.4,.02,.2,1); }
.slide { min-width: 100%; position: relative; }
/* contain (ไม่ใช่ cover) เพื่อไม่ให้ภาพแนวตั้งโดนตัดหัว-ท้าย */
.slide img {
  width: 100%; aspect-ratio: 1/1; object-fit: contain;
  background: linear-gradient(150deg, #0a3379, #0b3c8f 55%, #1257c9);
}
.slide-cap {
  position: absolute; inset-inline: 0; bottom: 0; padding: 52px 22px 18px;
  background: linear-gradient(to top, rgba(4,20,52,.92), rgba(4,20,52,.5) 52%, transparent);
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.slide-cap .slide-title {
  color: #fff; font-family: var(--ff-head); font-weight: 600; font-size: 1.06rem;
  line-height: 1.3; margin: 0; flex: 1 1 auto; min-width: 0;
  text-shadow: 0 2px 10px rgba(4,20,52,.6);
}
.slide-cap .btn { padding: 9px 20px; font-size: .88rem; }
.slider-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.9); color: var(--navy-800);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-md);
  transition: background .18s ease;
}
.slider-btn:hover { background: #fff; }
.slider-btn.prev { left: 14px; }
.slider-btn.next { right: 14px; }
.slider-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.slider-dots button {
  width: 9px; height: 9px; border-radius: 50%; border: none; padding: 0;
  background: rgba(255,255,255,.45); transition: all .2s ease;
}
.slider-dots button.is-active { background: var(--gold-400); width: 26px; border-radius: var(--r-pill); }

/* wave divider */
.wave { display: block; width: 100%; height: 56px; }
.wave path { fill: var(--bg); }

/* =========================================================
   Sections
   ========================================================= */
.section { padding-block: 74px; }
.section-tight { padding-block: 52px; }
.section-alt { background: linear-gradient(180deg, var(--sky-50), #fff); }
.section-navy { background: linear-gradient(140deg, var(--navy-900), var(--navy-800)); color: rgba(255,255,255,.9); }
.section-navy h2, .section-navy h3 { color: #fff; }

.section-head { text-align: center; max-width: 700px; margin: 0 auto 46px; }
.section-head.left { text-align: left; margin-inline: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--sky-100); color: var(--navy-800);
  font-family: var(--ff-head); font-size: .82rem; font-weight: 600;
  padding: 6px 15px; border-radius: var(--r-pill); margin-bottom: 15px;
}
.eyebrow svg { color: var(--gold-500); }
.section-navy .eyebrow { background: rgba(255,255,255,.14); color: #fff; }
.section-head p { color: var(--muted); font-size: 1.03rem; margin-bottom: 0; }
.section-navy .section-head p { color: rgba(255,255,255,.8); }

/* =========================================================
   Cards / grids
   ========================================================= */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm); transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  overflow: hidden;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--sh-lg); border-color: var(--sky-200); }

/* feature card */
.feature { padding: 30px 26px; text-align: center; }
.feature .ic {
  width: 62px; height: 62px; border-radius: 20px; margin: 0 auto 17px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--sky-100), var(--sky-200));
  color: var(--navy-800);
}
.feature.gold .ic { background: linear-gradient(140deg, var(--gold-100), #ffdf9a); color: var(--gold-600); }
.feature h3 { margin-bottom: .4em; font-size: 1.13rem; }
.feature p { color: var(--muted); font-size: .95rem; margin-bottom: 0; }

/* course card */
.course-card { display: flex; flex-direction: column; height: 100%; }
.course-media { position: relative; background: var(--sky-100); }
.course-media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.course-badge {
  position: absolute; top: 13px; left: 13px; z-index: 2;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); color: #4a2c00;
  font-family: var(--ff-head); font-size: .78rem; font-weight: 600;
  padding: 5px 13px; border-radius: var(--r-pill); box-shadow: var(--sh-sm);
}
.course-cat {
  position: absolute; top: 13px; right: 13px; z-index: 2;
  background: rgba(7,34,84,.86); color: #fff; backdrop-filter: blur(6px);
  font-size: .74rem; font-weight: 500; padding: 5px 12px; border-radius: var(--r-pill);
}
.course-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.course-body h3 { font-size: 1.1rem; margin-bottom: .35em; }
.course-body h3 a { color: var(--ink); }
.course-body h3 a:hover { color: var(--blue-600); }
.course-desc { color: var(--muted); font-size: .93rem; margin-bottom: 14px; }
.course-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--sky-50); border: 1px solid var(--line); color: var(--ink-soft);
  font-size: .8rem; padding: 4px 11px; border-radius: var(--r-pill);
}
.chip svg { color: var(--blue-500); }
.course-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px dashed var(--line); }
.price { display: flex; flex-direction: column; line-height: 1.15; }
.price .amount { font-family: var(--ff-head); font-size: 1.65rem; font-weight: 700; color: var(--navy-800); }
.price .amount small { font-size: .95rem; font-weight: 500; }
.price .was { font-size: .84rem; color: var(--muted); text-decoration: line-through; }
.price .note { font-size: .78rem; color: var(--muted); }

/* stats */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat {
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--r-md); padding: 24px 18px; text-align: center; backdrop-filter: blur(6px);
}
.stat .ic { color: var(--gold-400); margin-bottom: 9px; display: flex; justify-content: center; }
.stat .val { font-family: var(--ff-head); font-size: 2rem; font-weight: 700; color: #fff; line-height: 1.1; }
.stat .val span { font-size: 1.05rem; font-weight: 500; color: var(--gold-400); }
.stat .lbl { font-size: .87rem; color: rgba(255,255,255,.78); margin-top: 5px; }

/* category card */
.cat-card { padding: 32px 28px; display: flex; flex-direction: column; height: 100%; position: relative; overflow: hidden; }
.cat-card::after {
  content: ''; position: absolute; right: -34px; top: -34px; width: 130px; height: 130px;
  border-radius: 50%; background: linear-gradient(140deg, var(--sky-100), transparent); z-index: 0;
}
.cat-card > * { position: relative; z-index: 1; }
.cat-card .ic {
  width: 58px; height: 58px; border-radius: 18px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--navy-800), var(--blue-600)); color: #fff;
  box-shadow: var(--sh-md);
}
.cat-card .tagline { color: var(--gold-600); font-family: var(--ff-head); font-weight: 500; font-size: .9rem; margin-bottom: 8px; }
.cat-card p { color: var(--muted); font-size: .94rem; }
.cat-card .link { margin-top: auto; display: inline-flex; align-items: center; gap: 7px; font-family: var(--ff-head); font-weight: 600; color: var(--blue-600); }
.cat-card .link svg { transition: transform .2s ease; }
.cat-card:hover .link svg { transform: translateX(4px); }

/* review card */
.review-card { display: flex; flex-direction: column; height: 100%; }
/* รีวิวเป็นภาพที่มีตัวหนังสือ ใช้ contain เพื่อไม่ให้ข้อความโดนตัด */
.review-card .rc-media img {
  width: 100%; aspect-ratio: 1/1; object-fit: contain;
  background: linear-gradient(160deg, var(--sky-50), var(--sky-100));
  border-bottom: 1px solid var(--line);
}
.review-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.stars { display: flex; gap: 2px; color: var(--gold-500); margin-bottom: 10px; }
.stars svg { fill: currentColor; }
.review-quote { position: relative; color: var(--ink-soft); font-size: .96rem; margin-bottom: 14px; }
.review-quote .qm { color: var(--sky-200); position: absolute; top: -6px; left: -4px; z-index: 0; }
.review-quote span { position: relative; z-index: 1; }
.review-meta { margin-top: auto; padding-top: 13px; border-top: 1px dashed var(--line); }
.review-meta strong { font-family: var(--ff-head); color: var(--ink); display: block; }
.review-meta .res { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--green-500); font-weight: 600; margin-top: 3px; }

/* gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gal-item { position: relative; border-radius: var(--r-md); overflow: hidden; cursor: zoom-in; box-shadow: var(--sh-sm); background: #fff; }
.gal-item img { width: 100%; aspect-ratio: 1/1; object-fit: cover; transition: transform .4s ease; }
.gal-item:hover img { transform: scale(1.05); }
.gal-cap {
  position: absolute; inset-inline: 0; bottom: 0; padding: 34px 16px 14px; color: #fff;
  background: linear-gradient(to top, rgba(4,20,52,.9), transparent);
  font-size: .87rem; opacity: 0; transition: opacity .25s ease;
}
.gal-item:hover .gal-cap { opacity: 1; }
.gal-tag {
  position: absolute; top: 11px; left: 11px; background: rgba(255,255,255,.92); color: var(--navy-800);
  font-size: .74rem; font-weight: 600; padding: 4px 11px; border-radius: var(--r-pill);
}

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(4,16,40,.93);
  display: none; align-items: center; justify-content: center; padding: 26px;
  backdrop-filter: blur(4px);
}
.lightbox.open { display: flex; }
.lightbox img { max-width: min(94vw, 900px); max-height: 88vh; border-radius: var(--r-md); object-fit: contain; }
.lightbox .lb-close {
  position: absolute; top: 20px; right: 20px; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: none; color: #fff; display: flex; align-items: center; justify-content: center;
}
.lightbox .lb-close:hover { background: rgba(255,255,255,.3); }

/* =========================================================
   Course detail
   ========================================================= */
.page-hero {
  background: linear-gradient(140deg, var(--navy-900), var(--navy-800) 55%, var(--blue-600));
  color: #fff; padding-block: 48px 56px; position: relative; overflow: hidden;
}
.page-hero::after {
  content: ''; position: absolute; inset: 0; opacity: .4;
  background-image: radial-gradient(rgba(255,255,255,.13) 1px, transparent 1px); background-size: 26px 26px;
}
.page-hero > .wrap { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; margin-bottom: .3em; }
.page-hero p { color: rgba(255,255,255,.86); max-width: 46em; margin-bottom: 0; }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .87rem; margin-bottom: 16px; color: rgba(255,255,255,.7); }
.crumbs a { color: rgba(255,255,255,.86); }
.crumbs a:hover { color: var(--gold-400); }
.crumbs svg { opacity: .5; }

.detail-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 36px; align-items: start; }
.detail-main { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px; box-shadow: var(--sh-sm); }
.detail-main img.cover { width: 100%; border-radius: var(--r-md); margin-bottom: 26px; }
.detail-main h2 { font-size: 1.42rem; margin-top: 1.5em; }
.detail-main h2:first-of-type { margin-top: 0; }

.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.check-list li { display: flex; align-items: flex-start; gap: 11px; }
.check-list li svg { color: var(--green-500); flex-shrink: 0; margin-top: 4px; }

.buy-box {
  position: sticky; top: calc(var(--header-h) + 18px);
  background: #fff; border: 2px solid var(--sky-200); border-radius: var(--r-lg);
  padding: 26px; box-shadow: var(--sh-md);
}
.buy-box .price-big { font-family: var(--ff-head); font-size: 2.6rem; font-weight: 700; color: var(--navy-800); line-height: 1.05; }
.buy-box .price-big small { font-size: 1.1rem; font-weight: 500; }
.buy-box .was-big { font-size: .98rem; color: var(--muted); text-decoration: line-through; }
.buy-box .save { display: inline-block; background: var(--gold-100); color: var(--gold-600); font-weight: 600; font-size: .84rem; padding: 3px 12px; border-radius: var(--r-pill); margin-left: 8px; }
.buy-meta { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; font-size: .93rem; }
.buy-meta li { display: flex; align-items: flex-start; gap: 10px; }
.buy-meta svg { color: var(--blue-500); flex-shrink: 0; margin-top: 3px; }
.buy-meta strong { color: var(--ink); font-weight: 600; }
.buy-box .btn + .btn { margin-top: 10px; }
.buy-note { font-size: .84rem; color: var(--muted); text-align: center; margin: 14px 0 0; }

/* =========================================================
   Forms
   ========================================================= */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px; box-shadow: var(--sh-md); }
.field { margin-bottom: 17px; }
.field label { display: block; font-family: var(--ff-head); font-weight: 500; font-size: .93rem; color: var(--ink); margin-bottom: 7px; }
.field label .req { color: #e0483a; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 16px; font-family: var(--ff-body); font-size: 1rem; color: var(--ink);
  background: var(--sky-50); border: 1.5px solid var(--line); border-radius: var(--r-sm);
  transition: border-color .18s ease, background .18s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue-400); background: #fff; box-shadow: 0 0 0 4px rgba(62,141,245,.13);
}
.field textarea { min-height: 128px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-msg { padding: 15px 18px; border-radius: var(--r-sm); margin-bottom: 18px; font-size: .95rem; display: none; }
.form-msg.ok { display: block; background: #e6f9ee; border: 1px solid #a8e6c3; color: #0a6b39; }
.form-msg.err { display: block; background: #fdecea; border: 1px solid #f5c2bd; color: #a32319; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; pointer-events: none; }

.contact-side { display: grid; gap: 16px; align-content: start; }
.contact-item {
  display: flex; gap: 15px; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px 22px; box-shadow: var(--sh-sm);
}
.contact-item .ic {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--sky-100); color: var(--navy-800);
}
.contact-item.line .ic { background: #e5faed; color: var(--green-500); }
.contact-item h3 { font-size: 1rem; margin-bottom: .15em; }
.contact-item p { margin: 0; font-size: .94rem; color: var(--muted); }
.contact-item a { font-weight: 600; }

/* =========================================================
   FAQ
   ========================================================= */
.faq-list { display: grid; gap: 13px; max-width: 860px; margin-inline: auto; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-sm); overflow: hidden; }
.faq-item summary {
  display: flex; align-items: center; gap: 14px; padding: 20px 24px; cursor: pointer;
  font-family: var(--ff-head); font-weight: 500; font-size: 1.03rem; color: var(--ink); list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .q-ic { color: var(--blue-500); flex-shrink: 0; }
.faq-item summary .chev { margin-left: auto; color: var(--muted); transition: transform .22s ease; flex-shrink: 0; }
.faq-item[open] summary .chev { transform: rotate(180deg); }
.faq-item[open] summary { color: var(--navy-800); background: var(--sky-50); }
.faq-answer { padding: 4px 24px 22px; color: var(--ink-soft); font-size: .97rem; }
.faq-answer p:last-child { margin-bottom: 0; }

/* =========================================================
   About / split
   ========================================================= */
.split { display: grid; grid-template-columns: .85fr 1.15fr; gap: 46px; align-items: center; }
.split.rev { grid-template-columns: 1.15fr .85fr; }
.split-media { position: relative; }
.split-media img { width: 100%; border-radius: var(--r-xl); box-shadow: var(--sh-lg); }
.split-media .float-badge {
  position: absolute; bottom: 22px; left: -18px;
  background: #fff; border-radius: var(--r-md); padding: 15px 20px; box-shadow: var(--sh-lg);
  display: flex; align-items: center; gap: 13px; max-width: 260px;
}
.split-media .float-badge .ic {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--gold-400), var(--gold-500)); color: #4a2c00;
}
.split-media .float-badge strong { font-family: var(--ff-head); color: var(--ink); font-size: .96rem; display: block; line-height: 1.3; }
.split-media .float-badge small { color: var(--muted); font-size: .82rem; }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.timeline li { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 20px; box-shadow: var(--sh-sm); }
.timeline li svg { color: var(--gold-500); flex-shrink: 0; margin-top: 3px; }
.timeline li span { color: var(--ink-soft); font-size: .97rem; }

/* =========================================================
   CTA band
   ========================================================= */
.cta-band {
  background: linear-gradient(130deg, var(--navy-900), var(--blue-600));
  color: #fff; border-radius: var(--r-xl); padding: 52px 44px; text-align: center;
  position: relative; overflow: hidden; box-shadow: var(--sh-lg);
}
.cta-band::after {
  content: ''; position: absolute; inset: 0; opacity: .45;
  background-image: radial-gradient(rgba(255,255,255,.16) 1px, transparent 1px); background-size: 24px 24px;
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { color: #fff; margin-bottom: .35em; }
.cta-band p { color: rgba(255,255,255,.87); max-width: 42em; margin-inline: auto; margin-bottom: 26px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 13px; justify-content: center; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer { background: linear-gradient(160deg, #061c45, var(--navy-900)); color: rgba(255,255,255,.72); padding-top: 58px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.35fr; gap: 36px; padding-bottom: 42px; }
.brand-footer .brand-text strong { color: #fff; }
.brand-footer .brand-text small { color: rgba(255,255,255,.6); }
.footer-desc { font-size: .92rem; color: rgba(255,255,255,.66); margin-top: 15px; margin-bottom: .6em; }
.footer-desc.small { font-size: .85rem; color: rgba(255,255,255,.5); }
.footer-col h3 { color: #fff; font-size: 1.02rem; margin-bottom: .9em; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.footer-col a { color: rgba(255,255,255,.72); font-size: .93rem; }
.footer-col a:hover { color: var(--gold-400); }
.footer-contact li { display: flex; align-items: flex-start; gap: 10px; font-size: .93rem; }
.footer-contact svg { color: var(--gold-400); flex-shrink: 0; margin-top: 4px; }
.social-row { display: flex; gap: 10px; margin-top: 16px; }
.social-row a {
  width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.09); color: #fff; transition: all .2s ease;
}
.social-row a:hover { background: var(--gold-500); color: #4a2c00; transform: translateY(-3px); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.11); padding-block: 20px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .87rem;
}
.footer-bottom p { margin: 0; color: rgba(255,255,255,.55); }
.footer-bottom a { color: rgba(255,255,255,.7); }

/* floating contact — ไอคอนล้วน ไม่มีตัวหนังสือ */
.float-contact { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 12px; }
.fc {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: var(--sh-lg); position: relative;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s ease;
  animation: fcFloat 3.4s ease-in-out infinite;
}
.fc:nth-child(2) { animation-delay: .6s; }
.fc:hover { transform: translateY(-5px) scale(1.08); color: #fff; }
.fc:active { transform: scale(.9); }
.fc-line { background: var(--green-500); }
.fc-tel { background: linear-gradient(135deg, var(--blue-600), var(--navy-800)); }
/* วงแหวนกระเพื่อมเบา ๆ ให้สะดุดตา */
.fc::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid currentColor; opacity: 0;
  animation: fcPing 2.8s ease-out infinite;
}
.fc-tel::after { animation-delay: 1.4s; }

/* utilities */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-3 { margin-top: 26px; } .mt-4 { margin-top: 38px; }
.lead { font-size: 1.08rem; color: var(--muted); }
.divider-note { text-align: center; color: var(--muted); font-size: .93rem; margin-top: 30px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 36px; padding-block: 48px 58px; }
  .slider { max-width: 520px; margin-inline: auto; }
  .detail-grid { grid-template-columns: 1fr; }
  .buy-box { position: static; }
  .split, .split.rev { grid-template-columns: 1fr; gap: 32px; }
  .split-media { max-width: 460px; margin-inline: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* keep the top bar from crowding on mid-size laptops */
@media (max-width: 1240px) and (min-width: 1025px) {
  .main-nav a { padding: 9px 9px; font-size: .88rem; }
  .brand-text small { display: none; }
}

@media (max-width: 1024px) {
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 10px 16px 20px; box-shadow: var(--sh-lg);
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 13px 16px; border-radius: var(--r-sm); font-size: 1rem; }
  .nav-toggle { display: flex; }
  .header-cta { margin-left: auto; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .section { padding-block: 54px; }
  .detail-main, .form-card { padding: 24px 20px; }
  .cta-band { padding: 40px 24px; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 1.02rem; }
  .header-inner { gap: 10px; }
  .grid-4, .stats-row { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .slider-btn { width: 38px; height: 38px; }
  .fc span { display: none; }
  .fc { padding: 14px; }
  .float-contact { right: 12px; bottom: 12px; }
  .course-foot { flex-direction: column; align-items: stretch; }
  .course-foot .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* =========================================================
   Micro-interactions — ให้กดแล้วรู้สึกเด้ง น่ารัก เข้ากับธีม
   ========================================================= */
@keyframes fcFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes fcPing {
  0%   { opacity: .55; transform: scale(1); }
  70%  { opacity: 0;   transform: scale(1.45); }
  100% { opacity: 0;   transform: scale(1.45); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-9deg) scale(1.06); }
  75% { transform: rotate(9deg) scale(1.06); }
}
@keyframes popIn {
  0% { transform: scale(1); } 45% { transform: scale(.93); } 100% { transform: scale(1); }
}
@keyframes rippleOut { to { transform: scale(2.6); opacity: 0; } }
@keyframes sparkleSpin { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(18deg) scale(1.18); } }
@keyframes bobIn { 0% { opacity: 0; transform: translateY(14px) scale(.97); } 100% { opacity: 1; transform: none; } }

/* ปุ่มทั้งหมด: กดแล้วยุบ แล้วเด้งกลับแบบสปริง */
.btn {
  position: relative; overflow: hidden;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.94); }
.btn.is-pressed { animation: popIn .34s cubic-bezier(.34,1.56,.64,1); }

/* คลื่นกระเพื่อมตอนกด */
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(255,255,255,.55); transform: scale(0); opacity: .85;
  animation: rippleOut .6s ease-out forwards;
}
.btn-gold .ripple, .btn-ghost .ripple { background: rgba(11,60,143,.22); }

/* ไอคอนในการ์ดขยับตอนชี้ */
.feature:hover .ic svg { animation: wiggle .55s ease-in-out; }
.cat-card:hover .ic { animation: popIn .45s cubic-bezier(.34,1.56,.64,1); }
.contact-item:hover .ic svg { animation: wiggle .55s ease-in-out; }
.stat:hover .ic svg { animation: popIn .45s cubic-bezier(.34,1.56,.64,1); }
.eyebrow svg { animation: sparkleSpin 3.2s ease-in-out infinite; }
.hero-eyebrow svg { animation: sparkleSpin 3.2s ease-in-out infinite; }

/* การ์ดกดแล้วยุบเล็กน้อย */
.card { -webkit-tap-highlight-color: transparent; }
.card:active { transform: translateY(-2px) scale(.99); }

/* เมนูและลิงก์ */
.main-nav a { transition: background .18s ease, color .18s ease, transform .18s cubic-bezier(.34,1.56,.64,1); }
.main-nav a:active { transform: scale(.94); }
.nav-toggle { transition: transform .2s cubic-bezier(.34,1.56,.64,1); }
.nav-toggle:active { transform: scale(.88); }
.social-row a:active { transform: scale(.9); }

/* FAQ เปิดแล้วค่อย ๆ ไหลลงมา */
.faq-item[open] .faq-answer { animation: bobIn .32s ease-out; }
.faq-item summary { transition: background .2s ease; -webkit-tap-highlight-color: transparent; }

/* ปุ่มสไลด์ */
.slider-btn { transition: background .18s ease, transform .2s cubic-bezier(.34,1.56,.64,1); }
.slider-btn:active { transform: translateY(-50%) scale(.85); }
.slider-dots button:active { transform: scale(.8); }

/* ข้อความสำเร็จหลังส่งฟอร์ม */
.form-msg.ok { animation: bobIn .4s ease-out; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
