/* TTPOWER TOTHO — ธีมสีแบรนด์ (แดง-เขียว-เหลือง จากโลโก้) ใช้ร่วมกันหน้าแรกและหน้าสาขา */
:root {
  --red: #d62828;
  --flame: #f3722c;
  --yellow: #ffba08;
  --green: #2b9348;
  --green-dk: #14532d;
  --green-ink: #0d2818;
  --ink: #1c1917;
  --muted: #6b6560;
  --line: #ece6dc;
  --bg: #fffaf2;
  --card: #ffffff;
  --radius: 20px;
  --shadow: 0 12px 32px rgba(60, 30, 10, .08);
  --shadow-lg: 0 24px 50px rgba(60, 30, 10, .14);
  --grad-fire: linear-gradient(135deg, var(--red) 0%, var(--flame) 55%, var(--yellow) 100%);
  --grad-leaf: linear-gradient(135deg, var(--green-dk) 0%, var(--green) 100%);
  --stripe: linear-gradient(90deg, var(--red) 0 33.3%, var(--yellow) 33.3% 66.6%, var(--green) 66.6% 100%);
  --font: 'Noto Sans Lao', 'Noto Sans Thai', 'Phetsarath OT', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.75; -webkit-font-smoothing: antialiased; }
body::before { content: ''; position: fixed; inset: 0 0 auto 0; height: 4px; background: var(--stripe); z-index: 60; }
img { max-width: 100%; display: block; }
a { color: var(--red); }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Nav ---------- */
.nav { position: fixed; inset: 4px 0 auto 0; z-index: 50; transition: background .25s, box-shadow .25s; }
.nav.scrolled, .nav.open { background: rgba(255, 255, 255, .97); backdrop-filter: blur(12px); box-shadow: 0 6px 24px rgba(60, 30, 10, .08); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-weight: 800; line-height: 1.15; letter-spacing: .2px; }
.brand img { height: 46px; width: auto; background: #fff; border-radius: 12px; padding: 3px 5px; box-shadow: 0 4px 12px rgba(0, 0, 0, .15); }
.brand small { display: block; font-weight: 500; opacity: .85; font-size: .78rem; letter-spacing: 0; }
.nav.scrolled .brand, .nav.open .brand { color: var(--green-ink); }
.menu { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.menu a { display: block; padding: 8px 14px; border-radius: 999px; color: #fff; text-decoration: none; font-weight: 600; font-size: .95rem; }
.menu a:hover, .menu a.active { background: rgba(255, 255, 255, .16); }
.nav.scrolled .menu a, .nav.open .menu a { color: var(--ink); }
.nav.scrolled .menu a:hover, .nav.open .menu a:hover, .nav.scrolled .menu a.active { background: #fff1de; color: var(--red); }
.menu .cta { background: var(--grad-fire); color: #fff !important; box-shadow: 0 8px 20px rgba(214, 40, 40, .3); }
.menu .cta:hover { filter: brightness(1.06); }
.tools { display: flex; align-items: center; gap: 8px; }
.lang { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .16); }
.lang button { border: 0; background: transparent; color: #fff; font: 700 .78rem/1 var(--font); padding: 7px 9px; border-radius: 999px; cursor: pointer; }
.lang button.on { background: var(--yellow); color: var(--green-ink); }
.nav.scrolled .lang, .nav.open .lang { background: #f6efe4; }
.nav.scrolled .lang button, .nav.open .lang button { color: var(--muted); }
.nav.scrolled .lang button.on, .nav.open .lang button.on { color: var(--green-ink); }
.burger { display: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .16); cursor: pointer; }
.burger span { display: block; width: 20px; height: 2px; margin: 4px auto; background: #fff; transition: .2s; }
.nav.scrolled .burger, .nav.open .burger { background: #f6efe4; }
.nav.scrolled .burger span, .nav.open .burger span { background: var(--green-ink); }
.nav.open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.open .burger span:nth-child(2) { opacity: 0; }
.nav.open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
  .burger { display: block; }
  .menu {
    position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: #fff; padding: 8px 16px 18px; box-shadow: 0 18px 30px rgba(60, 30, 10, .12); display: none;
  }
  .nav.open .menu { display: flex; }
  .menu a { color: var(--ink); padding: 12px 14px; border-radius: 12px; }
  .menu .cta { text-align: center; margin-top: 6px; }
}
@media (max-width: 420px) { .brand span { font-size: .92rem; } .brand small { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 94vh; display: grid; align-items: center; color: #fff; overflow: hidden;
  background: var(--green-ink) center / cover no-repeat;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(13, 40, 24, .35) 0%, transparent 22%),
    linear-gradient(100deg, rgba(13, 40, 24, .88) 0%, rgba(13, 40, 24, .62) 38%, rgba(13, 40, 24, .12) 68%, transparent 100%);
}
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--stripe); }
.hero .wrap { position: relative; padding: 130px 0 90px; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px; border-radius: 999px; background: rgba(255, 186, 8, .18); color: var(--yellow); border: 1px solid rgba(255, 186, 8, .4); font-size: .9rem; font-weight: 700; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.9rem); line-height: 1.18; margin: 18px 0 14px; letter-spacing: -.5px; }
.hero h1 .hl { background: linear-gradient(90deg, var(--yellow), var(--flame)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: clamp(1rem, 2.2vw, 1.22rem); opacity: .92; max-width: 36em; margin: 0 0 30px; }
.hero-logo { justify-self: center; }
.hero-logo img {
  width: min(280px, 60vw); height: auto;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, .9)) drop-shadow(0 0 18px rgba(255, 255, 255, .45)) drop-shadow(0 14px 28px rgba(0, 0, 0, .45));
}
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 26px; border-radius: 14px; border: 0;
  font: 700 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-fire { background: var(--grad-fire); color: #fff; box-shadow: 0 12px 26px rgba(214, 40, 40, .35); }
.btn-fire:hover { filter: brightness(1.06); }
.btn-leaf { background: var(--grad-leaf); color: #fff; box-shadow: 0 12px 26px rgba(43, 147, 72, .3); }
.btn-ghost { background: rgba(255, 255, 255, .1); color: #fff; border: 1.5px solid rgba(255, 255, 255, .5); }
.btn-dark { background: var(--green-ink); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 48px; max-width: 720px; }
.stats.s3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 560px; }
.stat { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); border-radius: 18px; padding: 14px 16px; backdrop-filter: blur(4px); }
.stat b { display: block; font-size: clamp(1.35rem, 3.6vw, 2rem); line-height: 1.2; color: var(--yellow); }
.stat span { font-size: .84rem; opacity: .88; }
.scroll-cue { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); color: rgba(255, 255, 255, .7); font-size: 1.3rem; animation: bob 1.8s infinite; }
@keyframes bob { 50% { transform: translate(-50%, 8px); } }

/* ---------- Sections ---------- */
section { padding: 90px 0; }
.alt { background: #fff; }
.warm { background: linear-gradient(180deg, #fff6e6, var(--bg)); }
.head { text-align: center; max-width: 740px; margin: 0 auto 46px; }
.head.left { text-align: left; margin: 0 0 22px; }
.tag { display: inline-flex; align-items: center; gap: 8px; color: var(--red); font-weight: 800; letter-spacing: .6px; font-size: .85rem; text-transform: uppercase; }
.tag::before { content: ''; width: 26px; height: 4px; border-radius: 4px; background: var(--stripe); }
.head h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.28; margin: 8px 0 10px; color: var(--green-ink); letter-spacing: -.3px; }
.head p { color: var(--muted); margin: 0; font-size: 1.05rem; }

/* about */
.about { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; }
.about p { margin: 0 0 14px; color: #3f3a36; }
.about .legal { font-size: .88rem; color: var(--muted); border-left: 4px solid var(--yellow); padding-left: 14px; }
.about-img { position: relative; }
.about-img img { border-radius: var(--radius); box-shadow: var(--shadow-lg); aspect-ratio: 16 / 10; object-fit: cover; object-position: 60% 50%; width: 100%; }
.about-img::before { content: ''; position: absolute; inset: 18px -18px -18px 18px; border-radius: var(--radius); background: var(--grad-fire); opacity: .9; z-index: -1; }
.about-img .badge {
  position: absolute; left: -16px; bottom: 22px; background: #fff; color: var(--green-ink); border-radius: 16px;
  padding: 12px 16px; font-weight: 800; box-shadow: var(--shadow-lg); line-height: 1.3; display: flex; gap: 10px; align-items: center;
}
.about-img .badge i { color: var(--green); font-size: 1.6rem; }
.info-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.info-list li { display: flex; gap: 12px; align-items: flex-start; }
.info-list .ic { flex: 0 0 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #fff1de; color: var(--red); }
.info-list a { color: inherit; }

/* cards */
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.card { background: var(--card); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; border: 1px solid var(--line); }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.card .ic { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-size: 1.6rem; color: #fff; margin-bottom: 16px; }
.card h3 { margin: 0 0 6px; font-size: 1.18rem; color: var(--green-ink); line-height: 1.4; }
.card p { margin: 0; color: var(--muted); }
.ic-fire { background: var(--grad-fire); }
.ic-leaf { background: var(--grad-leaf); }
.ic-sun { background: linear-gradient(135deg, var(--yellow), var(--flame)); }
.ic-red { background: linear-gradient(135deg, #9d0208, var(--red)); }

/* services (homepage) */
.svc { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.svc a { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); transition: .2s; }
.svc a:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--yellow); }
.svc .thumb { height: 130px; display: grid; place-items: center; background: #fff7ea; padding: 18px; }
.svc .thumb img { max-height: 92px; width: auto; object-fit: contain; }
.svc .body { padding: 16px 18px 20px; }
.svc b { display: block; color: var(--green-ink); font-size: 1.05rem; }
.svc small { color: var(--muted); font-size: .9rem; }
.svc .go { margin-top: 10px; color: var(--red); font-weight: 700; font-size: .88rem; }

/* systems (branch) */
.sys { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.sys a {
  display: flex; gap: 16px; align-items: center; padding: 20px 22px; border-radius: var(--radius); text-decoration: none;
  background: #fff; color: var(--ink); box-shadow: var(--shadow); border: 1px solid var(--line); transition: .2s;
}
.sys a:hover { border-color: var(--yellow); transform: translateY(-3px); }
.sys .ic { flex: 0 0 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem; color: #fff; }
.sys b { display: block; color: var(--green-ink); }
.sys small { color: var(--muted); }

/* branches (homepage) */
.branches { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 18px; }
.branch { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); display: flex; flex-direction: column; transition: .2s; }
.branch:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.branch .cover { height: 150px; background: var(--green-ink) center / cover; position: relative; }
.branch .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(13, 40, 24, .85)); }
.branch .cover span { position: absolute; left: 16px; bottom: 12px; z-index: 1; color: #fff; font-weight: 800; font-size: 1.15rem; }
.branch .cover em { position: absolute; right: 12px; top: 12px; z-index: 1; font-style: normal; background: var(--yellow); color: var(--green-ink); font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; letter-spacing: .5px; }
.branch .b-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.branch .b-body p { margin: 0; display: flex; gap: 10px; color: #3f3a36; font-size: .93rem; word-break: break-word; }
.branch .b-body i { color: var(--green); width: 16px; margin-top: 5px; }
.branch .b-body a.more { margin-top: auto; padding-top: 10px; font-weight: 700; text-decoration: none; }

/* team */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }
.member { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-align: center; border: 1px solid var(--line); }
.member img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #f1e9dc; }
.member div { padding: 14px 12px 18px; border-top: 4px solid; border-image: var(--stripe) 1; }
.member b { display: block; color: var(--green-ink); line-height: 1.4; }
.member span { font-size: .88rem; color: var(--muted); }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery a { display: block; border-radius: 16px; overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .4s; }
.gallery a:hover img { transform: scale(1.06); }
.lightbox { position: fixed; inset: 0; background: rgba(13, 10, 8, .92); display: none; place-items: center; z-index: 100; padding: 20px; }
.lightbox.show { display: grid; }
.lightbox img { max-height: 88vh; border-radius: 12px; }
.lightbox button { position: absolute; top: 16px; right: 16px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--yellow); font-size: 1.6rem; cursor: pointer; }

/* video */
.videos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.video { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); background: #000; }
.video .frame { aspect-ratio: 16 / 9; }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.video .cap { background: #fff; padding: 12px 18px; font-weight: 700; color: var(--green-ink); }

/* contact */
/* map */
.map-frame { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); background: #eef3ea; aspect-ratio: 16 / 8; }
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.map-link { text-align: center; margin: 16px 0 0; }
.map-link a { font-weight: 700; text-decoration: none; }
@media (max-width: 760px) { .map-frame { aspect-ratio: auto; height: 420px; } }

.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.contact .card:hover { transform: none; }
.contact h3 { margin-top: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: #fff1de; color: var(--ink); text-decoration: none; font-weight: 600; margin: 4px 6px 4px 0; font-size: .92rem; }
.chip:hover { background: #ffe2b8; }
.chip i { color: var(--red); }
.form { display: grid; gap: 12px; }
.form label { font-weight: 600; font-size: .92rem; }
.form input, .form textarea {
  width: 100%; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 14px; font: 1rem var(--font); background: #fffdf9; color: var(--ink);
}
.form input:focus, .form textarea:focus { outline: 0; border-color: var(--flame); box-shadow: 0 0 0 4px rgba(243, 114, 44, .15); }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .hint { font-size: .82rem; color: var(--muted); margin: 0; }

/* downloads */
.dl { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.dl figure { margin: 0; width: min(260px, 100%); background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.dl img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff7ea; padding: 14px; }
.dl figcaption { padding: 12px; text-align: center; }

/* footer */
footer { background: var(--green-ink); color: rgba(255, 255, 255, .78); padding: 56px 0 28px; font-size: .93rem; position: relative; }
footer::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--stripe); }
footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
footer .cols.c2 { grid-template-columns: 1.4fr 1fr; }
footer b, footer h4 { color: #fff; }
footer h4 { margin: 0 0 10px; font-size: 1rem; }
footer a { color: #fff; text-decoration: none; }
footer a:hover { color: var(--yellow); }
footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
footer .flogo { background: #fff; border-radius: 12px; padding: 4px 6px; display: inline-block; margin-bottom: 12px; }
footer .flogo img { height: 52px; width: auto; }
footer .bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 32px; padding-top: 18px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

.to-top { position: fixed; right: 18px; bottom: 18px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--grad-fire); color: #fff; font-size: 1.1rem; box-shadow: var(--shadow-lg); cursor: pointer; opacity: 0; pointer-events: none; transition: .25s; z-index: 40; }
.to-top.show { opacity: 1; pointer-events: auto; }

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

@media (max-width: 960px) {
  .hero::before { background: linear-gradient(180deg, rgba(13, 40, 24, .55) 0%, rgba(13, 40, 24, .78) 45%, rgba(13, 40, 24, .55) 100%); }
  section { padding: 66px 0; }
  .hero-grid, .about, .contact { grid-template-columns: 1fr; }
  .hero-logo { display: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .videos { grid-template-columns: 1fr; }
  footer .cols, footer .cols.c2 { grid-template-columns: 1fr; }
  .about-img { margin: 0 18px 18px 0; }
  .about-img .badge { left: 12px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stats.s3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat { padding: 10px 12px; }
  .stat span { font-size: .74rem; }
  .btn { width: 100%; }
  .grid-4 { grid-template-columns: 1fr; }
  .gallery, .team { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .form .row2 { grid-template-columns: 1fr; }
  .card { padding: 22px; }
}
