/* ============================================
   ราวบันไดสแตนเลสโคราช — Main Stylesheet
   Theme: Orange / White
   ============================================ */

:root {
  --orange: #f97316;
  --orange-dark: #ea580c;
  --orange-light: #ffedd5;
  --orange-soft: #fff7ed;
  --white: #ffffff;
  --dark: #1f2937;
  --gray: #6b7280;
  --gray-light: #f3f4f6;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0, 0, 0, .08);
  --shadow-lg: 0 12px 40px rgba(249, 115, 22, .18);
  --font: 'Prompt', 'Sarabun', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--dark); background: var(--white); line-height: 1.7; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

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

/* ---------- Inline SVG icons ---------- */
.ico {
  width: 1.15em; height: 1.15em; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.18em; display: inline-block;
}
.feature-item .icon .ico { width: 26px; height: 26px; }
.contact-list .icon .ico { width: 22px; height: 22px; }
.footer-contact .ico { width: 18px; height: 18px; color: var(--orange); margin-top: 4px; }
.section { padding: 70px 0; }
.section-alt { background: var(--orange-soft); }

.section-head { text-align: center; max-width: 720px; margin: 0 auto 44px; }
.section-head .eyebrow {
  display: inline-block; background: var(--orange-light); color: var(--orange-dark);
  font-weight: 600; font-size: .85rem; padding: 6px 16px; border-radius: 999px; margin-bottom: 12px;
}
.section-head h1, .section-head h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 700; margin-bottom: 12px; }
.section-head p { color: var(--gray); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600;
  padding: 13px 28px; border-radius: 999px; transition: all .25s ease; cursor: pointer; border: none; font-size: 1rem;
}
.btn-primary { background: var(--orange); color: var(--white); box-shadow: var(--shadow-lg); }
.btn-primary:hover { background: var(--orange-dark); transform: translateY(-2px); }
.btn-outline { border: 2px solid var(--orange); color: var(--orange-dark); background: transparent; }
.btn-outline:hover { background: var(--orange); color: var(--white); }
.btn-white { background: var(--white); color: var(--orange-dark); }
.btn-white:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-line { background: #06c755; color: var(--white); }
.btn-line:hover { background: #05b34c; transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000; background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(10px); box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--dark); }
.logo-mark {
  width: 42px; height: 42px; border-radius: 10px; background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  display: grid; place-items: center; color: var(--white); font-size: 1.3rem; font-weight: 800;
}
.logo span em { font-style: normal; color: var(--orange-dark); }
.main-nav ul { display: flex; gap: 6px; }
.main-nav a {
  padding: 9px 16px; border-radius: 999px; font-weight: 500; color: var(--dark); transition: all .2s;
}
.main-nav a:hover { background: var(--orange-light); color: var(--orange-dark); }
.main-nav a.active { background: var(--orange); color: var(--white); }
.header-cta { display: flex; align-items: center; gap: 10px; }
.header-phone {
  display: inline-flex; align-items: center; gap: 8px; background: var(--orange); color: var(--white);
  font-weight: 600; padding: 10px 20px; border-radius: 999px; transition: all .25s;
}
.header-phone:hover { background: var(--orange-dark); }
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer; width: 44px; height: 44px;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span { width: 24px; height: 3px; background: var(--orange-dark); border-radius: 2px; transition: all .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(160deg, var(--orange-soft) 0%, var(--white) 60%); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding: 70px 0; }
.hero-text .eyebrow {
  display: inline-block; background: var(--orange-light); color: var(--orange-dark);
  font-weight: 600; font-size: .85rem; padding: 6px 16px; border-radius: 999px; margin-bottom: 16px;
}
.hero-text h1 { font-size: clamp(1.8rem, 4.5vw, 2.7rem); font-weight: 800; line-height: 1.3; margin-bottom: 16px; }
.hero-text h1 em { font-style: normal; color: var(--orange-dark); }
.hero-text p { color: var(--gray); font-size: 1.05rem; margin-bottom: 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 18px; }
.hero-badges li { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--dark); font-weight: 500; }
.hero-badges li::before {
  content: ""; width: 18px; height: 18px; flex-shrink: 0;
  background: var(--orange);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>') center/contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>') center/contain no-repeat;
}
.hero-img { position: relative; }
.hero-img img { border-radius: var(--radius); box-shadow: var(--shadow-lg); aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.hero-img .hero-card {
  position: absolute; bottom: -18px; left: -18px; background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 22px; display: flex; align-items: center; gap: 12px;
}
.hero-card strong { color: var(--orange-dark); font-size: 1.3rem; }
.hero-card small { color: var(--gray); }

/* ---------- Cards / Services ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.card {
  background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.card-body { padding: 22px; }
.card-body h3 { font-size: 1.15rem; margin-bottom: 8px; }
.card-body p { color: var(--gray); font-size: .95rem; margin-bottom: 14px; }
.card-link { color: var(--orange-dark); font-weight: 600; font-size: .95rem; }
.card-link:hover { text-decoration: underline; }

/* ---------- Feature / Why us ---------- */
.feature-item { text-align: center; padding: 28px 20px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.feature-item .icon {
  width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 16px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  display: grid; place-items: center; font-size: 1.6rem; color: var(--white);
}
.feature-item h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-item p { color: var(--gray); font-size: .92rem; }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.gallery-grid a { border-radius: var(--radius); overflow: hidden; display: block; position: relative; }
.gallery-grid img { aspect-ratio: 1/1; object-fit: cover; width: 100%; transition: transform .35s; }
.gallery-grid a:hover img { transform: scale(1.06); }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: step; }
.step { background: var(--white); border-radius: var(--radius); padding: 26px 20px; box-shadow: var(--shadow); position: relative; }
.step::before {
  counter-increment: step; content: counter(step);
  width: 42px; height: 42px; border-radius: 50%; background: var(--orange); color: var(--white);
  display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; margin-bottom: 14px;
}
.step h3 { font-size: 1.02rem; margin-bottom: 6px; }
.step p { color: var(--gray); font-size: .9rem; }

/* ---------- Reviews ---------- */
.review-card { background: var(--white); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.review-stars { color: #fbbf24; letter-spacing: 3px; margin-bottom: 10px; }
.review-card blockquote { color: var(--dark); margin-bottom: 16px; font-size: .97rem; }
.review-author { display: flex; align-items: center; gap: 12px; }
.review-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--orange-light);
  color: var(--orange-dark); display: grid; place-items: center; font-weight: 700;
}
.review-author strong { display: block; font-size: .95rem; }
.review-author small { color: var(--gray); }

/* ---------- FAQ ---------- */
.faq-item { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.faq-item summary {
  cursor: pointer; padding: 18px 22px; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--orange); font-size: 1.4rem; font-weight: 700; transition: transform .25s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 22px 18px; color: var(--gray); }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(135deg, var(--orange), var(--orange-dark)); color: var(--white); text-align: center; }
.cta-band h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin-bottom: 12px; }
.cta-band p { opacity: .92; margin-bottom: 24px; }
.cta-band .btn-outline { border-color: var(--white); color: var(--white); }
.cta-band .btn-outline:hover { background: var(--white); color: var(--orange-dark); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.contact-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; }
.contact-list li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--gray-light); }
.contact-list li:last-child { border-bottom: none; }
.contact-list .icon {
  flex: 0 0 46px; width: 46px; height: 46px; border-radius: 12px; background: var(--orange-light);
  color: var(--orange-dark); display: grid; place-items: center; font-size: 1.25rem;
}
.contact-list strong { display: block; }
.contact-list a { color: var(--orange-dark); font-weight: 600; }
.contact-list small { color: var(--gray); }
.contact-form label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.contact-form input, .contact-form textarea, .contact-form select {
  width: 100%; padding: 12px 16px; border: 1.5px solid #e5e7eb; border-radius: 10px;
  font-family: var(--font); font-size: 1rem; margin-bottom: 16px; transition: border .2s; background: var(--white);
}
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus { outline: none; border-color: var(--orange); }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: .88rem; color: var(--gray); padding: 18px 0 0; }
.breadcrumb a { color: var(--orange-dark); }
.breadcrumb span::before { content: "›"; margin: 0 8px; color: var(--gray); }

/* ---------- Footer ---------- */
.site-footer { background: #211a14; color: #e7e0da; margin-top: 70px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; padding: 56px 0 40px; }
.footer-grid h4 { color: var(--white); font-size: 1.05rem; margin-bottom: 16px; }
.footer-grid h4::after { content: ""; display: block; width: 34px; height: 3px; background: var(--orange); border-radius: 2px; margin-top: 8px; }
.footer-about p { font-size: .93rem; color: #bdb3aa; margin-top: 12px; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #bdb3aa; font-size: .95rem; transition: color .2s; }
.footer-links a:hover { color: var(--orange); }
.footer-contact li { display: flex; gap: 10px; margin-bottom: 12px; font-size: .95rem; color: #bdb3aa; }
.footer-contact a { color: var(--orange); font-weight: 600; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 18px 0; font-size: .85rem; color: #9b9089; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.footer-bottom a { color: #bdb3aa; }
.footer-bottom a:hover { color: var(--orange); }

/* ---------- Error pages ---------- */
.error-page { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 60px 20px; }
.error-page .code { font-size: clamp(4rem, 14vw, 8rem); font-weight: 800; color: var(--orange); line-height: 1; }
.error-page h1 { font-size: 1.6rem; margin: 10px 0 8px; }
.error-page p { color: var(--gray); margin-bottom: 24px; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-3, .steps { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-inner { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .main-nav {
    position: fixed; inset: 72px 0 auto 0; background: var(--white); box-shadow: var(--shadow);
    transform: translateY(-130%); transition: transform .3s ease; padding: 16px 20px 24px;
  }
  .main-nav.open { transform: none; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav a { display: block; }
  .nav-toggle { display: flex; }
  .header-phone .phone-text { display: none; }
  .header-phone { padding: 10px 14px; }
}
@media (max-width: 560px) {
  .grid-3, .grid-4, .steps { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 50px 0; }
}

/* ---------- Lightbox (popup รูปภาพ) ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(17, 24, 39, .92);
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease;
  padding: 24px;
}
.lightbox.open { opacity: 1; visibility: visible; }
body.lightbox-open { overflow: hidden; }
.lightbox-figure { margin: 0; max-width: 92vw; max-height: 86vh; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lightbox-img {
  max-width: 92vw; max-height: 78vh; width: auto; height: auto;
  border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  animation: lightboxZoom .25s ease;
}
@keyframes lightboxZoom { from { transform: scale(.96); opacity: .4; } to { transform: scale(1); opacity: 1; } }
.lightbox-caption { color: #e5e7eb; font-size: .9rem; text-align: center; max-width: 80vw; }
.lightbox-close {
  position: absolute; top: 18px; right: 18px; z-index: 2;
  width: 44px; height: 44px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease, transform .2s ease;
}
.lightbox-close:hover { background: var(--orange); transform: rotate(90deg); }
.lightbox-close svg { width: 22px; height: 22px; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 48px; height: 48px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease;
}
.lightbox-nav:hover { background: var(--orange); }
.lightbox-nav svg { width: 24px; height: 24px; }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-counter {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: #e5e7eb; font-size: .85rem; background: rgba(255, 255, 255, .1);
  padding: 4px 14px; border-radius: 999px;
}
@media (max-width: 560px) {
  .lightbox { padding: 12px; }
  .lightbox-nav { width: 40px; height: 40px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 10px; right: 10px; }
}

/* ---------- Logo / brand ---------- */
.logo { min-width: 0; }
.logo-mark {
  flex: 0 0 auto; width: 46px; height: 46px;
  background: none; border-radius: 0; box-shadow: none; display: block;
}
.logo-mark img, .logo-mark svg { width: 100%; height: 100%; display: block; }
.logo > span:last-child { white-space: nowrap; letter-spacing: -.01em; }
.footer-logo { display: inline-block; margin-bottom: 18px; }
.footer-logo img { width: 300px; max-width: 100%; height: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.footer-about .sr-only::after { display: none; }
@media (max-width: 640px) {
  .logo { gap: 9px; font-size: 1rem; }
  .logo-mark { width: 40px; height: 40px; }
}
@media (max-width: 400px) {
  .logo { gap: 8px; font-size: .9rem; }
  .logo-mark { width: 36px; height: 36px; }
}

/* ============================================================
   Responsive + Thai typography polish
   ============================================================ */

/* ---- การตัดคำภาษาไทย: ตัดเฉพาะจบคำ ห้ามตัดกลางคำ ---- */
body { word-break: normal; overflow-wrap: break-word; hyphens: none; -webkit-hyphens: none; }
p, li, dd, td, figcaption, blockquote { text-wrap: pretty; }
h1, h2, h3, h4, h5, .eyebrow, .btn, .section-head p, .hero-card { text-wrap: balance; }
.nb { white-space: nowrap; }

/* ---- กันเนื้อหาล้นขอบจอ ---- */
.grid-3 > *, .grid-4 > *, .steps > *, .footer-grid > *,
.contact-grid > *, .hero-inner > *, .gallery-grid > * { min-width: 0; }
.card, .contact-card, .feature-item, .step { overflow-wrap: break-word; }

/* ---- ระยะและขนาดแบบลื่นไหลตามจอ ---- */
.container { padding-left: clamp(16px, 4vw, 24px); padding-right: clamp(16px, 4vw, 24px); }
.section { padding: clamp(44px, 7vw, 70px) 0; }
.section-head { margin-bottom: clamp(28px, 5vw, 44px); }
.site-footer { margin-top: clamp(44px, 7vw, 70px); }
.footer-grid { gap: clamp(24px, 4vw, 36px); padding: clamp(38px, 6vw, 56px) 0 clamp(28px, 4vw, 40px); }

/* ---- หน้าติดต่อ: จัดการ์ดให้อยู่กึ่งกลาง ---- */
.contact-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  justify-content: center; max-width: 1000px; margin-left: auto; margin-right: auto;
}
.contact-grid > :only-child {
  grid-column: 1 / -1; max-width: 620px; width: 100%;
  margin-left: auto; margin-right: auto;
}
.contact-card { padding: clamp(20px, 4vw, 30px); }
.contact-list li { align-items: flex-start; }

/* ---- เบรกพอยต์เพิ่มเติม ---- */
@media (min-width: 961px) and (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .btn { padding: 12px 20px; font-size: .95rem; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .hero-img .hero-card { left: 0; bottom: -14px; padding: 12px 16px; }
  .hero-text p { font-size: 1rem; }
}
@media (max-width: 400px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hero-badges { gap: 10px 16px; }
  .footer-logo img { width: 250px; }
  .contact-list li { gap: 10px; }
}

/* ---- รายการที่มีไอคอน: ให้ข้อความเป็นก้อนเดียว ตัดบรรทัดได้ปกติ ---- */
.footer-contact li, .contact-list li, .hero-badges li { flex-wrap: wrap; }
.footer-contact li > .fc-body { flex: 1 1 0; min-width: 0; }
.footer-contact li > span:first-child,
.contact-list li > .icon { flex: 0 0 auto; }
.contact-list li > div:last-child { flex: 1 1 0; min-width: 0; }

/* ============================================================
   Motion / อนิเมชั่น
   ============================================================ */
:root { --ease: cubic-bezier(.22,.85,.32,1); --anim: .72s; }

/* ---- เอฟเฟกต์ตอนเลื่อนถึง ---- */
.js-anim [data-anim] {
  opacity: 0;
  transition: opacity var(--anim) var(--ease), transform var(--anim) var(--ease);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
.js-anim [data-anim="up"]    { transform: translate3d(0, 32px, 0); }
.js-anim [data-anim="down"]  { transform: translate3d(0, -26px, 0); }
.js-anim [data-anim="left"]  { transform: translate3d(-36px, 0, 0); }
.js-anim [data-anim="right"] { transform: translate3d(36px, 0, 0); }
.js-anim [data-anim="zoom"]  { transform: scale(.93); }
.js-anim [data-anim="fade"]  { transform: none; }
.js-anim [data-anim].is-in   { opacity: 1; transform: none; }

/* ---- หน้าแรก: ไล่ปรากฏตอนเปิดเว็บ ---- */
.js-anim .hero-text > *, .js-anim .hero-img { opacity: 0; animation: heroUp .85s var(--ease) forwards; }
.js-anim .hero-text > *:nth-child(1) { animation-delay: .06s; }
.js-anim .hero-text > *:nth-child(2) { animation-delay: .16s; }
.js-anim .hero-text > *:nth-child(3) { animation-delay: .26s; }
.js-anim .hero-text > *:nth-child(4) { animation-delay: .36s; }
.js-anim .hero-text > *:nth-child(5) { animation-delay: .46s; }
.js-anim .hero-img { animation-name: heroSide; animation-delay: .22s; }
.js-anim .hero-card { opacity: 0; animation: pop .55s var(--ease) .85s forwards; }
@keyframes heroUp   { from { opacity: 0; transform: translate3d(0,28px,0); } to { opacity: 1; transform: none; } }
@keyframes heroSide { from { opacity: 0; transform: translate3d(38px,0,0) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pop      { from { opacity: 0; transform: scale(.84) translateY(10px); } to { opacity: 1; transform: none; } }

/* ---- แถบหัวเว็บย่อตอนเลื่อนลง ---- */
.site-header { transition: box-shadow .35s var(--ease), background-color .35s var(--ease); }
.header-inner { transition: height .35s var(--ease); }
.logo-mark { transition: width .35s var(--ease), height .35s var(--ease); }
.site-header.is-stuck { box-shadow: 0 8px 28px rgba(15,23,42,.13); background: rgba(255,255,255,.98); }
.site-header.is-stuck .header-inner { height: 60px; }
.site-header.is-stuck .logo-mark { width: 38px; height: 38px; }
@media (max-width: 640px) {
  .site-header.is-stuck .header-inner { height: 58px; }
  .site-header.is-stuck .logo-mark { width: 34px; height: 34px; }
}

/* ---- เมนู: ขีดใต้วิ่งตอนชี้ ---- */
.main-nav a { position: relative; }
.main-nav a::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 5px; height: 2px;
  background: var(--orange); border-radius: 2px;
  transform: scaleX(0); transform-origin: left center;
  transition: transform .3s var(--ease);
}
.main-nav a:hover::after { transform: scaleX(1); }
.main-nav a.active::after { display: none; }

/* ---- การ์ดและรูป ---- */
.card, .feature-item, .step, .review-card, .contact-card, .faq-item {
  transition: transform .38s var(--ease), box-shadow .38s var(--ease);
}
.feature-item:hover, .step:hover, .review-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.card img { transition: transform .7s var(--ease); }
.card:hover img { transform: scale(1.07); }
.feature-item .icon { transition: transform .4s var(--ease); }
.feature-item:hover .icon { transform: translateY(-3px) scale(1.08) rotate(-5deg); }
.step::before { transition: transform .4s var(--ease); }
.step:hover::before { transform: scale(1.12) rotate(-6deg); }

.gallery-grid img { transition: transform .7s var(--ease); }
.gallery-grid a:hover img { transform: scale(1.08); }
.gallery-grid a::after {
  content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit;
  background: linear-gradient(180deg, rgba(234,88,12,0) 38%, rgba(154,52,18,.55));
  opacity: 0; transition: opacity .35s var(--ease);
}
.gallery-grid a::before {
  content: ""; position: absolute; z-index: 2; left: 50%; top: 50%; width: 44px; height: 44px;
  margin: -22px 0 0 -22px; border-radius: 50%;
  background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23ea580c" stroke-width="2.4" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="M20 20l-3.7-3.7"/></svg>') center/22px no-repeat;
  opacity: 0; transform: scale(.55);
  transition: opacity .3s var(--ease), transform .38s var(--ease);
}
.gallery-grid a:hover::after { opacity: 1; }
.gallery-grid a:hover::before { opacity: 1; transform: scale(1); }

/* ---- ปุ่ม: แสงวิ่งตอนชี้ ---- */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 28%, rgba(255,255,255,.30) 50%, transparent 72%);
  transform: translateX(-135%); transition: transform .75s var(--ease); pointer-events: none;
}
.btn:hover::after { transform: translateX(135%); }
.btn:active { transform: translateY(1px) scale(.99); }
.header-phone { transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.header-phone:hover { transform: translateY(-2px); }

/* ---- คำถามที่พบบ่อย ---- */
.faq-item summary { transition: background-color .25s var(--ease); }
.faq-item summary:hover { background: var(--orange-soft); }
.faq-item[open] { box-shadow: var(--shadow-lg); }
.faq-item[open] .faq-body { animation: faqIn .38s var(--ease) both; }
@keyframes faqIn { from { opacity: 0; transform: translateY(-8px); } }

/* ---- แถบ CTA: แสงเคลื่อนช้า ๆ ---- */
.cta-band { position: relative; overflow: hidden; }
.cta-band::before {
  content: ""; position: absolute; inset: -45%; pointer-events: none;
  background: radial-gradient(circle at 30% 40%, rgba(255,255,255,.20), transparent 45%),
              radial-gradient(circle at 74% 66%, rgba(255,255,255,.15), transparent 42%);
  animation: drift 18s ease-in-out infinite alternate;
}
.cta-band > .container { position: relative; z-index: 1; }
@keyframes drift { to { transform: translate3d(5%, -4%, 0) scale(1.1); } }

/* ---- ปุ่มลอย: กลับขึ้นบน + โทร/ไลน์บนมือถือ ---- */
.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 900;
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--white); color: var(--orange-dark); box-shadow: var(--shadow);
  display: grid; place-items: center; padding: 0;
  opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease), background-color .25s, color .25s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--orange); color: var(--white); }
.to-top .ico { width: 22px; height: 22px; stroke-width: 2.6; }

.mobile-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 950; display: none; gap: 10px;
  padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  box-shadow: 0 -6px 24px rgba(15,23,42,.14);
  transform: translateY(115%); transition: transform .4s var(--ease);
}
.mobile-cta.show { transform: none; }
.mobile-cta .btn { flex: 1 1 0; justify-content: center; padding: 12px 8px; font-size: .95rem; }
body.lightbox-open .mobile-cta, body.lightbox-open .to-top { display: none; }
@media (max-width: 768px) {
  .mobile-cta { display: flex; }
  body { padding-bottom: 70px; }
  .to-top { bottom: 86px; right: 14px; width: 42px; height: 42px; }
}

/* ---- ตัวเลขนับขึ้น ---- */
.hero-card strong { font-variant-numeric: tabular-nums; }

/* ---- เคารพการตั้งค่าลดการเคลื่อนไหวของผู้ใช้ ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .js-anim [data-anim] { opacity: 1 !important; transform: none !important; }
  .js-anim .hero-text > *, .js-anim .hero-img, .js-anim .hero-card { opacity: 1 !important; }
}
