/* =========================================================
   NexGen System Solutions — Frontend Stylesheet
   ธีมสี: Playful Gradient (ม่วง-ชมพู-ส้ม) — สดใส เข้าถึงได้ทุกวัย
   โลโก้ NEXTGEN (ดำ+แดง) คงเดิม / ตัวหนังสือหลักยังเป็นสีเข้มกลางๆ เพื่อความอ่านง่าย
   สีสันสดใสจะอยู่ที่ปุ่ม, ไอคอน, gradient พื้นหลังส่วนไฮไลต์ และ hover state ทั่วเว็บ
   ========================================================= */

:root {
  --c-primary: #1a1a1a;
  --c-primary-dark: #0d0d0e;
  --c-secondary: #6b7280;
  --c-accent: #ec4899;
  --c-accent-2: #8b5cf6;
  --c-accent-3: #f97316;
  --c-dark: #0d0d0e;
  --c-dark-2: #242424;
  --c-text: #33414f;
  --c-muted: #64748b;
  --c-light: #f5f7fa;
  --c-border: #e2e6eb;
  --gradient-main: linear-gradient(135deg, #8b5cf6 0%, #ec4899 55%, #f97316 100%);
  --gradient-soft: linear-gradient(135deg, rgba(139,92,246,0.10) 0%, rgba(236,72,153,0.10) 100%);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(139, 92, 246, 0.10);
  --shadow-lg: 0 20px 50px rgba(139, 92, 246, 0.18);
}

* { box-sizing: border-box; }

/* ป้องกันข้อความ (โดยเฉพาะภาษาไทยที่มักไม่มีช่องว่างระหว่างคำ) ล้นออกนอกกรอบ/การ์ด
   บนหน้าจอมือถือ — ใช้ overflow-wrap:anywhere เป็นทางเลือกสุดท้ายเมื่อไม่มีจุดตัดคำตามธรรมชาติ */
body, h1, h2, h3, h4, h5, h6, p, span, a, li, label, small, div, td, th, blockquote, .btn-gradient, .btn-outline-soft {
  overflow-wrap: break-word;
  word-break: normal;
}

body {
  font-family: 'Prompt', 'Poppins', sans-serif;
  color: var(--c-text);
  background: #ffffff;
  overflow-x: hidden;
}

/* กันรูปภาพ (โดยเฉพาะรูปที่แอดมินอัปโหลดเอง ซึ่งอาจมีขนาดใหญ่เกินคาด) ล้นออกนอกกรอบบนมือถือ
   ครอบคลุมทุกหน้า — รูปที่มี inline style หรือคลาสเฉพาะกำหนดขนาดเองอยู่แล้วจะไม่ถูกกระทบ (specificity สูงกว่า) */
img { max-width: 100%; height: auto; }

a { text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--c-dark);
}

.text-gradient {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section {
  padding: 90px 0;
}
.section-sm { padding: 60px 0; }

.section-tag {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 999px;
  background: var(--gradient-soft);
  color: var(--c-primary);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  margin-bottom: 14px;
  border: 1px solid rgba(236, 72, 153, 0.28);
}

.section-title {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  margin-bottom: 14px;
}

.section-sub {
  color: var(--c-muted);
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 640px;
}

/* ---------- Buttons ---------- */
.btn-gradient {
  background: var(--gradient-main);
  color: #fff !important;
  border: none;
  padding: 12px 30px;
  border-radius: 999px;
  font-weight: 600;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 10px 25px rgba(26, 26, 26, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
}
.btn-gradient:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(26, 26, 26, 0.45);
  color: #fff !important;
}
.btn-outline-soft {
  border: 2px solid var(--c-primary);
  color: var(--c-primary) !important;
  padding: 10px 28px;
  border-radius: 999px;
  font-weight: 600;
  background: transparent;
  transition: all .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
}
.btn-outline-soft:hover {
  background: var(--c-primary);
  color: #fff !important;
}

/* ---------- Navbar ---------- */
.navbar-nexgen {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  /* Header สูงขึ้นเพื่อรองรับโลโก้ขนาดใหญ่ขึ้น — Mobile ~64-68px, Tablet ~72-78px, Desktop ~86-92px
     (ความสูง = padding บน-ล่าง x2 + ความสูงโลโก้ + เส้นขอบ 1px ด้านล่าง) */
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--c-border);
  transition: all .3s ease;
}
@media (min-width: 768px) {
  .navbar-nexgen { padding: 14px 0; }
}
@media (min-width: 1200px) {
  .navbar-nexgen { padding: 15px 0; }
}
/* หมายเหตุ: ห้ามใส่ flex-wrap: nowrap ตรงนี้แบบไม่จำกัดขนาดจอ — จะทำให้เมนูมือถือ (.navbar-collapse.show)
   ไม่สามารถขึ้นบรรทัดใหม่ใต้แถวโลโก้/ปุ่มแฮมเบอร์เกอร์ได้ แล้วถูก align-items:center ดันให้ลอยขึ้นไปทับแถวบนแทน
   (นี่คือสาเหตุจริงของปัญหาเมนูลอย/ซ้อนทับบนมือถือที่รายงานซ้ำหลายรอบ) จึงต้องจำกัดไว้เฉพาะเดสก์ท็อป (xl ขึ้นไป) เท่านั้น
   หมายเหตุ v32: ขยับจุดพับเมนูจาก lg (992px) เป็น xl (1200px) เนื่องจากมีเมนู "บทความ" เพิ่มเข้ามา ทำให้พื้นที่แถบเมนูแคบเกินไป
   จนตัวอักษรในเมนูขึ้นบรรทัดใหม่ (ตัด/หลุด) ที่ความกว้างจอระดับ 992-1199px — ทุกจุดที่อ้างอิง breakpoint lg ของแถบเมนูบนหน้าเว็บไซต์
   (ไม่ใช่ของหลังบ้าน) ต้องเปลี่ยนเป็น xl ให้ตรงกันทั้งหมด (ดู includes/header.php ที่เปลี่ยนเป็น navbar-expand-xl แล้ว) */
@media (min-width: 1200px) {
  .navbar-nexgen .container {
    flex-wrap: nowrap;
  }
}
/* ครอบโลโก้+ชื่อบริษัท กับปุ่มแฮมเบอร์เกอร์ไว้ในแถวเดียวกันเสมอ (ดูหมายเหตุใน includes/header.php) */
.navbar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}
.navbar-brand-nexgen {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: clamp(0.82rem, 2.6vw, 1.15rem);
  color: var(--c-dark) !important;
  min-width: 0;
  flex: 0 0 auto;
  /* เว้นระยะขวาของโลโก้เพิ่มขึ้น เพื่อให้เมนูนำทางไม่ชิดโลโก้จนเกินไป (ดูโปร่ง หรูขึ้น) */
  margin-right: 8px;
}
/* ชื่อบริษัทข้าง Logo ถูกซ่อนตามค่าเริ่มต้น เพราะโลโก้มีคำว่า "NEXTGEN" อยู่ในตัวภาพอยู่แล้ว
   การแสดงข้อความซ้ำอีกครั้งข้างๆ ทำให้ Header ดูรกและแย่งพื้นที่จากโลโก้ที่ควรเป็นจุดเด่นอันดับแรก
   (ยังคงชื่อบริษัทไว้ให้ Screen Reader / SEO ผ่าน title + aria-label บนลิงก์ และ alt บนรูปโลโก้) */
.navbar-brand-nexgen .brand-logo-img {
  /* Mobile */
  max-height: 44px;
  max-width: 190px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .navbar-brand-nexgen .brand-logo-img { max-height: 50px; max-width: 220px; }
}
@media (min-width: 1200px) {
  .navbar-brand-nexgen .brand-logo-img { max-height: 58px; max-width: 260px; }
}
/* ข้อความสำรอง แสดงเฉพาะกรณียังไม่มีการอัปโหลดโลโก้เข้าระบบเท่านั้น (ป้องกัน Header โล่งไม่มีชื่อแบรนด์เลย) */
.navbar-brand-nexgen .brand-fallback-text {
  min-width: 0;
  white-space: normal;
  line-height: 1.2;
  word-break: break-word;
}
.navbar-nexgen .navbar-toggler {
  flex-shrink: 0;
  border: none;
  padding: 6px 10px;
  font-size: 1.1rem;
}
.navbar-nexgen .navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(26,26,26,0.15);
}

.navbar-brand-nexgen .logo-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 1.1rem;
}
@media (min-width: 768px) {
  .navbar-brand-nexgen .logo-badge { width: 50px; height: 50px; border-radius: 13px; }
}
@media (min-width: 1200px) {
  .navbar-brand-nexgen .logo-badge { width: 58px; height: 58px; border-radius: 15px; font-size: 1.3rem; }
}
.navbar-nexgen .nav-link {
  font-weight: 500;
  color: var(--c-text) !important;
  margin: 0 6px;
  position: relative;
}
/* กันตัวอักษรเมนู/ปุ่ม/ตัวเลือกภาษาบนแถบเมนูขึ้นบรรทัดใหม่ (ตัดหลุด) เมื่อพื้นที่แถบเมนูเริ่มแคบใกล้จุดพับ (xl) */
@media (min-width: 1200px) {
  .navbar-nexgen .nav-link,
  .navbar-nexgen .lang-switch-btn,
  .navbar-nexgen .btn-gradient {
    white-space: nowrap;
  }
  .navbar-nexgen .nav-link {
    margin: 0 4px;
  }
}
@media (min-width: 1200px) and (max-width: 1365px) {
  /* ช่วงความกว้างที่ยังค่อนข้างแคบแม้จะพ้นจุดพับมาแล้ว — ลดระยะห่าง/ขนาดตัวอักษรลงอีกนิดเพื่อความสบายตา */
  .navbar-nexgen .nav-link {
    margin: 0 3px;
    font-size: 0.93rem;
  }
  .navbar-nexgen .lang-switch-btn {
    padding: 8px 12px;
    font-size: 0.82rem;
  }
}
.navbar-nexgen .nav-link.active,
.navbar-nexgen .nav-link:hover {
  color: var(--c-primary) !important;
}
.navbar-nexgen .nav-link.active::after {
  content: "";
  position: absolute;
  left: 4px; right: 4px; bottom: -4px;
  height: 2px;
  background: var(--c-accent);
  border-radius: 2px;
}
.lang-switch-dropdown { list-style: none; }
.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text);
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  transition: border-color .2s ease, color .2s ease;
}
.lang-switch-btn i { font-size: 0.95rem; color: var(--c-accent); }
.lang-switch-btn:hover,
.lang-switch-btn[aria-expanded="true"] {
  border-color: var(--c-accent);
  color: var(--c-primary);
}
.lang-switch-btn::after { margin-left: 2px; vertical-align: 1px; }
.lang-dropdown-menu {
  min-width: 170px;
  padding: 6px;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-text);
}
.lang-dropdown-item .lang-check { visibility: hidden; color: var(--c-accent); }
.lang-dropdown-item:hover { background: var(--gradient-soft); color: var(--c-primary); }
.lang-dropdown-item.active {
  background: var(--gradient-soft);
  color: var(--c-primary);
  font-weight: 700;
}
.lang-dropdown-item.active .lang-check { visibility: visible; }

.services-dropdown-menu {
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.services-dropdown-item {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--c-text);
}
.services-dropdown-item:hover { background: var(--gradient-soft); color: var(--c-primary); }
.services-dropdown-item.active {
  background: var(--gradient-soft);
  color: var(--c-primary);
  font-weight: 700;
}
@media (max-width: 1199px) {
  .lang-dropdown-menu {
    position: static !important;
    width: 100%;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 0 14px;
    margin-top: 4px;
  }
}

/* Mobile services submenu: plain, always-in-flow list (no Bootstrap dropdown/Popper
   involved at all), so it cannot overlap or float over other nav items on small screens. */
.services-nav-item-mobile .nav-link {
  position: relative;
}
.services-nav-item-mobile .nav-link::after {
  content: "\f282";
  font-family: "bootstrap-icons";
  font-size: 0.7rem;
  margin-left: 6px;
  color: var(--c-secondary);
  vertical-align: 1px;
}
.services-mobile-submenu {
  list-style: none;
  margin: 2px 0 4px;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--c-border);
}
.services-mobile-sublink {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--c-text-muted, var(--c-secondary));
  text-decoration: none;
  border-radius: 8px;
}
.services-mobile-sublink:hover,
.services-mobile-sublink.active {
  background: var(--gradient-soft);
  color: var(--c-primary);
  font-weight: 700;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 110px 0 90px;
  background: linear-gradient(180deg, #f5f6ff 0%, #ffffff 100%);
  overflow: hidden;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  z-index: 0;
}
.hero::before {
  width: 380px; height: 380px;
  background: var(--c-accent-2);
  top: -120px; right: -100px;
}
.hero::after {
  width: 320px; height: 320px;
  background: var(--c-accent-3);
  bottom: -140px; left: -80px;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  line-height: 1.25;
}
.hero-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.hero-badge {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-badge i { color: var(--c-accent); }
.hero-visual {
  background: var(--gradient-main);
  border-radius: 28px;
  padding: 50px 30px;
  color: #fff;
  position: relative;
  box-shadow: var(--shadow-lg);
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.hero-visual .glow-icon {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem;
  margin: 0 auto 20px;
}

/* ---------- Trust bar (แถบสถิติความน่าเชื่อถือ ใต้ Hero) ---------- */
.trust-bar { padding: 0 0 0; margin-top: -34px; position: relative; z-index: 2; }
.trust-bar-inner {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 28px 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.trust-stat { text-align: center; padding: 0 6px; position: relative; min-width: 0; }
.trust-stat:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -8px; top: 50%;
  transform: translateY(-50%);
  width: 1px; height: 32px;
  background: var(--c-border);
}
.trust-stat-number {
  font-size: clamp(1.15rem, 2.2vw, 1.7rem);
  font-weight: 700;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 4px;
  line-height: 1.2;
}
.trust-stat-label {
  font-size: 0.76rem;
  color: var(--c-muted);
  font-weight: 500;
  line-height: 1.35;
}
@media (max-width: 767px) {
  .trust-bar { margin-top: -22px; }
  .trust-bar-inner { grid-template-columns: repeat(2, 1fr); gap: 20px 8px; padding: 22px 16px; border-radius: 16px; }
  .trust-stat::after { display: none; }
}

/* ---------- Process / ขั้นตอนการทำงาน ---------- */
.process-step {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 30px 22px;
  height: 100%;
  text-align: center;
  transition: transform .25s ease, box-shadow .25s ease;
}
.process-step:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.process-step-number {
  width: 50px; height: 50px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--gradient-main);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
}

/* ---------- FAQ (คำถามที่พบบ่อย) ---------- */
.faq-item {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
  height: 100%;
}
.faq-item:hover { border-color: transparent; box-shadow: var(--shadow); }
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: transparent;
  border: none;
  padding: 18px 20px;
  text-align: left;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--c-dark);
  cursor: pointer;
  min-height: 44px;
}
.faq-question-text { flex: 1 1 auto; min-width: 0; }
.faq-question[aria-expanded="true"] { color: var(--c-accent); }
.faq-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gradient-soft);
  color: var(--c-accent);
  display: flex; align-items: center; justify-content: center;
  transition: transform .25s ease, background .25s ease, color .25s ease;
  font-size: 0.8rem;
}
.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(135deg);
  background: var(--gradient-main);
  color: #fff;
}
.faq-answer {
  padding: 0 20px 20px;
  color: var(--c-muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

/* ---------- Why us ---------- */
.why-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 30px 26px;
  height: 100%;
  transition: transform .25s ease, box-shadow .25s ease;
}
.why-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.why-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--gradient-soft);
  color: var(--c-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 18px;
}

/* ---------- Services ---------- */
.service-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 32px 26px;
  height: 100%;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  position: relative;
}
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.service-icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: var(--gradient-main);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 20px;
}
.service-card h3 { font-size: 1.15rem; margin-bottom: 10px; line-height: 1.4; }
.service-card p { color: var(--c-muted); font-size: 0.95rem; margin-bottom: 0; line-height: 1.65; }
.service-card.is-featured { border: 2px solid var(--c-accent); }
.service-card-badge {
  position: absolute;
  top: 18px; right: 18px;
}
.service-card-price {
  margin-top: 14px;
  font-weight: 700;
  color: var(--c-accent);
  font-size: 0.95rem;
}

/* ---------- หน้าแรก: รูปปกผลงานในการ์ด (ลดความสูงลงบนจอเล็กแทนที่จะคงที่ 280px ทุกขนาดจอ) ---------- */
.home-portfolio-cover {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}
.home-portfolio-cover-empty {
  background: var(--gradient-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}
@media (max-width: 767px) {
  .home-portfolio-cover { height: 220px; }
}
@media (max-width: 480px) {
  .home-portfolio-cover { height: 190px; }
}

/* ---------- CTA ---------- */
.cta-section {
  background: var(--gradient-main);
  border-radius: 28px;
  padding: 60px 40px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section h2 { color: #fff; }
.cta-section p { color: rgba(255,255,255,0.85); }
.cta-section .btn-gradient {
  background: #fff;
  color: var(--c-primary) !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.cta-section .btn-gradient:hover { color: var(--c-primary-dark) !important; }

/* ---------- Contact ---------- */
.contact-info-card {
  background: var(--gradient-main);
  color: #fff;
  border-radius: var(--radius);
  padding: 36px 30px;
  height: 100%;
}
.contact-info-card h3 { color: #fff; }
.contact-info-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.contact-info-item i {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-info-item > div { min-width: 0; }
.contact-form-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 36px 30px;
  box-shadow: var(--shadow);
}
.form-control, .form-select {
  border-radius: 10px;
  border: 1px solid var(--c-border);
  padding: 12px 16px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(26,26,26,0.15);
}
.form-label { font-weight: 600; font-size: 0.9rem; }

/* ---------- Footer ---------- */
.footer-nexgen {
  /* เปลี่ยนจากพื้นหลังดำล้วนเป็นไล่เฉดม่วง-เข้มโทนเดียวกับ CI ของเว็บไซต์ (แทนที่จะเป็นสีดำแบนราบที่ดูหนักและแยกจากธีมสีสันสดใสของเว็บ)
     ยังคงความเข้ม/คอนทราสต์พอให้ตัวหนังสือสีขาวอ่านง่าย แต่มี "ฮิว" ของสีทำให้ดูออกแบบมาจงใจ ไม่ใช่แค่โหมดมืดทั่วไป */
  background: linear-gradient(160deg, #1e1533 0%, #211a3d 45%, #241a35 100%);
  color: rgba(255,255,255,0.7);
  padding: 64px 0 24px;
  position: relative;
  overflow: hidden;
}
.footer-nexgen-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 36px;
  margin-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
@media (max-width: 767px) {
  .footer-nexgen-top { flex-direction: column; text-align: center; padding-bottom: 28px; margin-bottom: 32px; }
}
.footer-col-links { position: relative; }
@media (min-width: 768px) {
  .footer-col-links::before {
    content: "";
    position: absolute;
    left: -14px; top: 4px; bottom: 4px;
    width: 1px;
    background: rgba(255,255,255,0.08);
  }
}
.footer-nexgen-glow {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-main);
}
.footer-nexgen h5 {
  color: #fff;
  margin-bottom: 18px;
  font-size: 1rem;
  position: relative;
  padding-bottom: 10px;
  display: inline-block;
}
.footer-nexgen h5::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 32px; height: 3px;
  background: var(--gradient-main);
  border-radius: 2px;
}
.footer-col { margin-bottom: 8px; }
.footer-col ul li a { display: inline-flex; align-items: center; }
.footer-nexgen a { color: rgba(255,255,255,0.65); transition: color .2s ease, transform .2s ease; }
.footer-nexgen a:hover { color: #fff; }
.footer-col ul li a:hover { transform: translateX(3px); }
@media (max-width: 767px) {
  .footer-col ul li a:hover { transform: none; }
}
.footer-tagline { color: rgba(255,255,255,0.55); }
.footer-contact-list li { display: flex; align-items: flex-start; gap: 0; color: rgba(255,255,255,0.65); }
.footer-contact-list li i { color: var(--c-accent-2); margin-top: 2px; }
.footer-contact-list li a { color: rgba(255,255,255,0.65); align-items: flex-start; }
.footer-contact-list li a:hover { color: #fff; }
@media (max-width: 767px) {
  .footer-contact-list li { justify-content: center; }
}
.footer-nexgen .logo-badge {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--gradient-main);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
}
.footer-logo-chip {
  /* โลโก้จริงเป็นตัวหนังสือสีดำ+แดง คอนทราสต์กับพื้นหลัง footer สีเข้มต่ำมาก
     จึงใส่ "การ์ดสีขาว" รองรับด้านหลังเสมอ เพื่อให้โลโก้เด่นชัดในทุกที่ที่แสดงผล ไม่ว่าพื้นหลังหน้านั้นจะเป็นสีอะไร */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  flex-shrink: 0;
}
.footer-logo-chip .brand-logo-img {
  max-height: 32px;
  max-width: 130px;
  width: auto;
  object-fit: contain;
  display: block;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 40px;
  padding-top: 22px;
  font-size: 0.85rem;
  text-align: center;
  color: rgba(255,255,255,0.5);
}
.footer-bottom .sep { margin: 0 8px; }
@media (max-width: 480px) {
  .footer-bottom { display: flex; flex-direction: column; gap: 4px; }
  .footer-bottom .sep { display: none; }
}
.social-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.05rem;
  transition: background .2s ease, transform .2s ease;
}
.social-icon:hover { background: var(--gradient-main); transform: translateY(-3px); border-color: transparent; }

/* ---------- Page header (inner pages) ---------- */
.page-header {
  background: var(--gradient-main);
  padding: 70px 0 60px;
  color: #fff;
  text-align: center;
}
.page-header h1 { color: #fff; margin-bottom: 8px; }
.page-header .breadcrumb-nexgen a { color: rgba(255,255,255,0.75); }
.page-header .breadcrumb-nexgen span { color: #fff; }

/* ---------- Alerts ---------- */
.alert-nexgen {
  border-radius: 12px;
  border: none;
  padding: 16px 20px;
}

/* ---------- Fade-in on scroll ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   Responsive — tablet & mobile
   ========================================================= */
@media (max-width: 991px) {
  .section { padding: 64px 0; }
  .hero { padding: 90px 0 50px; }
  .hero-visual { min-height: 260px; padding: 40px 24px; margin-top: 8px; }
  .cta-section { padding: 44px 26px; }
  .contact-info-card, .contact-form-card { padding: 28px 22px; }
}

/* หมายเหตุ v32: กฎด้านล่างนี้ทั้งหมดเกี่ยวกับ "เมนูแบบพับ" (.navbar-collapse) ของแถบเมนูบนสุดเท่านั้น
   แยกออกมาจากบล็อกด้านบน (ซึ่งเป็นระยะห่าง section/hero ทั่วไปที่ยังคงพับที่ 991px เหมือนเดิม)
   เพราะแถบเมนูเปลี่ยนไปพับที่ระดับ xl (1200px) แล้ว (ดู includes/header.php: navbar-expand-xl) */
@media (max-width: 1199px) {
  /* บังคับให้แถวโลโก้+แฮมเบอร์เกอร์ยึดพื้นที่เต็ม 100% ของบรรทัดแรกเสมอบนมือถือ/แท็บเล็ต
     เพื่อไม่ให้ปุ่มแฮมเบอร์เกอร์แยกไปคนละบรรทัดกับโลโก้ (ไม่ว่าชื่อบริษัทจะยาวแค่ไหน)
     และผลพลอยได้คือมันจะดันเมนู .navbar-collapse ให้ตกไปบรรทัดถัดไปเองโดยอัตโนมัติ */
  .navbar-brand-row {
    width: 100%;
  }

  /* Collapsed mobile menu: give it its own row + a proper floating card look
     instead of a flat list squeezed under the navbar */
  .navbar-nexgen .navbar-collapse {
    flex-basis: 100%;
  }
  .navbar-nexgen .navbar-collapse.collapsing,
  .navbar-nexgen .navbar-collapse.show {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    margin-top: 14px;
    padding: 14px 18px;
    overflow: hidden; /* กันไม่ให้ element ลูกใดๆ ล้นออกนอกกรอบการ์ดโค้งมน */
  }
  .navbar-nexgen .navbar-nav {
    gap: 2px;
  }
  .navbar-nexgen .nav-link {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    box-sizing: border-box;
  }
  /* ใช้แถบสีด้านซ้าย + ตัวหนา แทนพื้นหลังเต็มแถว เพื่อไม่ให้ดูเหมือนกล่องลอยทับเมนูอื่น */
  .navbar-nexgen .nav-link:hover {
    background: var(--gradient-soft);
  }
  .navbar-nexgen .nav-link.active {
    background: transparent;
    color: var(--c-accent);
    font-weight: 700;
    border-left: 3px solid var(--c-accent);
    padding-left: 9px;
  }
  .navbar-nexgen .nav-link.active::after { display: none; }
  .navbar-nexgen li.nav-item:not(:last-child) {
    border-bottom: 1px solid var(--c-border);
  }
  .navbar-nexgen li.nav-item.ms-xl-2 {
    border-bottom: none;
  }

  /* เมนูย่อย "บริการของเรา" บนมือถือ ก็ใช้ตรรกะเดียวกัน (ไม่ใช้พื้นหลังเต็มแถว) */
  .services-mobile-sublink:hover,
  .services-mobile-sublink.active {
    background: transparent;
    color: var(--c-accent);
    font-weight: 700;
  }

  /* สลับภาษาบนมือถือ: แถวธรรมดา ไม่มี dropdown/Popper เกี่ยวข้องเลย */
  .lang-switch-mobile-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--c-secondary);
    font-size: 0.92rem;
  }
  .lang-switch-mobile-row i { color: var(--c-accent); }
  .lang-switch-mobile-link {
    color: var(--c-text);
    text-decoration: none;
    font-weight: 500;
  }
  .lang-switch-mobile-link.active {
    color: var(--c-accent);
    font-weight: 700;
    text-decoration: underline;
  }
  .lang-switch-mobile-sep { color: var(--c-border); }
}

@media (max-width: 767px) {
  .section { padding: 52px 0; }
  .section-sm { padding: 42px 0; }
  .section-sub { max-width: 100%; }
  .navbar-nexgen { padding: 10px 0; }
  .navbar-brand-nexgen { font-size: 1rem; }
  .navbar-brand-nexgen .brand-logo-img { max-height: 38px; max-width: 72px; }
  .navbar-brand-nexgen .logo-badge { width: 34px; height: 34px; font-size: 0.95rem; }
  .navbar-nexgen .navbar-nav { padding-top: 10px; }
  .navbar-nexgen .nav-link { margin: 2px 0; padding: 12px 12px; min-height: 44px; display: flex; align-items: center; }
  .lang-switch-dropdown { margin-top: 6px; }
  .lang-switch-btn { width: 100%; justify-content: center; }

  .hero { padding: 78px 0 46px; text-align: center; }
  .hero h1 { line-height: 1.3; }
  .hero .d-flex.gap-3 { justify-content: center; }
  .hero-badges { justify-content: center; }
  .hero-badge { font-size: 0.82rem; padding: 10px 14px; }
  .hero-visual { min-height: 220px; padding: 34px 20px; }
  .hero-visual .glow-icon { width: 76px; height: 76px; font-size: 2rem; }

  .why-card, .service-card { padding: 26px 20px; }
  .service-icon, .why-icon { margin-bottom: 14px; }

  .cta-section { padding: 38px 20px; border-radius: 20px; }
  .contact-info-card, .contact-form-card { padding: 24px 18px; border-radius: 14px; }
  .contact-info-item { margin-bottom: 18px; }

  .footer-nexgen { padding: 44px 0 22px; text-align: center; }
  .footer-col { margin-bottom: 30px; }
  .footer-col:last-child { margin-bottom: 0; }
  .footer-nexgen h5::after { left: 50%; transform: translateX(-50%); }
  .footer-brand-link { justify-content: center; }
  .footer-social-row { justify-content: center; }
  .footer-col ul li { text-align: center; }
  .footer-col-brand p { max-width: 360px; margin-left: auto; margin-right: auto; }

  .page-header { padding: 54px 0 42px; }
  .page-header h1 { font-size: 1.7rem; }
}

@media (max-width: 575px) {
  .section-title { font-size: 1.5rem; }
  .btn-gradient, .btn-outline-soft { padding: 10px 22px; font-size: 0.92rem; width: 100%; text-align: center; }
  .hero .d-flex.gap-3 { flex-direction: column; }
  .hero .d-flex.gap-3 a { width: 100%; }
  .hero-badges { flex-direction: column; align-items: stretch; }
  .hero-badge { justify-content: center; }
}


/* ---------- Services pricing accordion ---------- */
.service-accordion {
  --bs-accordion-border-color: var(--c-border);
  --bs-accordion-active-bg: #fff;
  --bs-accordion-active-color: var(--c-dark);
  --bs-accordion-btn-focus-box-shadow: 0 0 0 3px rgba(220,38,38,0.18);
}
.service-accordion-item {
  border: 1px solid var(--c-border);
  border-radius: var(--radius) !important;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.service-accordion-item.is-featured {
  border: 2px solid var(--c-accent);
}
.service-accordion-item .accordion-button {
  padding: 20px 24px;
  font-weight: 600;
  gap: 16px;
}
.service-accordion-item .accordion-button:not(.collapsed) {
  background: var(--gradient-soft);
  color: var(--c-dark);
  box-shadow: inset 0 -1px 0 var(--c-border);
}
.service-accordion-item .accordion-button::after {
  margin-left: 12px;
}
.service-icon-sm {
  width: 44px; height: 44px;
  min-width: 44px;
  border-radius: 12px;
  background: var(--gradient-main);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.service-accordion-title {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.service-accordion-name {
  font-size: 1.02rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.service-accordion-price {
  font-weight: 700;
  color: var(--c-accent);
  font-size: 0.95rem;
  white-space: nowrap;
}
.badge-featured {
  display: inline-block;
  background: var(--c-accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.service-accordion-desc {
  color: var(--c-muted);
  margin-bottom: 16px;
}
.service-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 20px;
}
.service-feature-list li {
  font-size: 0.92rem;
  color: var(--c-text);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.service-feature-list li i {
  color: var(--c-accent);
  margin-top: 3px;
  flex-shrink: 0;
}
.btn-sm-inline {
  padding: 9px 22px;
  font-size: 0.9rem;
}

@media (max-width: 767px) {
  .service-accordion-item .accordion-button { padding: 16px 16px; gap: 12px; }
  .service-icon-sm { width: 38px; height: 38px; min-width: 38px; font-size: 1.05rem; }
  .service-accordion-title { flex-direction: column; align-items: flex-start; gap: 4px; }
  .service-feature-list { grid-template-columns: 1fr; }
}


/* ---------- รับทำเว็บไซต์ (Website Packages) ---------- */
.package-section-alt { background: var(--c-light); }
.package-visual {
  border-radius: 24px;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.package-visual img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}
.package-visual-placeholder {
  color: #fff;
  text-align: center;
  padding: 40px;
}
.package-visual-placeholder i { font-size: 3.2rem; display: block; margin-bottom: 12px; opacity: 0.85; }
.package-visual-placeholder span { font-weight: 700; font-size: 1.3rem; }
.package-badge {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 999px;
  border: 1.5px solid;
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 14px;
}
.package-name {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 6px;
}
.package-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--c-dark);
}
.package-price span { font-size: 1rem; font-weight: 600; color: var(--c-muted); }
.package-price-note { font-size: 0.82rem; color: var(--c-muted); margin-bottom: 16px; }
.package-headline { font-size: 1.2rem; font-weight: 700; margin: 14px 0 10px; line-height: 1.4; }
.package-desc { color: var(--c-muted); margin-bottom: 22px; line-height: 1.75; max-width: 58ch; }
.package-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
}
.package-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 0.95rem;
  line-height: 1.55;
}
.package-feature-list li i { margin-top: 3px; flex-shrink: 0; font-size: 1.05rem; }

.package-freebies-title {
  display: inline-block;
  border: 1.5px solid var(--c-accent);
  color: var(--c-dark);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 10px 22px;
  border-radius: 12px;
}
.package-freebie-item {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 14px 18px;
  height: 100%;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.package-freebie-num {
  width: 26px; height: 26px;
  min-width: 26px;
  border-radius: 50%;
  background: var(--c-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Comparison table */
.compare-card {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.compare-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.compare-card-head {
  padding: 26px 22px 22px;
  color: #fff;
  position: relative;
}
.compare-card-ribbon {
  position: absolute;
  top: 14px; right: 14px;
  background: #fff;
  color: var(--c-dark);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.compare-card-tag {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.compare-card-head h3 { color: #fff; font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.compare-card-price { font-size: 1.7rem; font-weight: 800; }
.compare-card-price span { font-size: 0.85rem; font-weight: 600; opacity: 0.85; }
.compare-card-note { font-size: 0.72rem; opacity: 0.85; }
.compare-card-body {
  background: #fff;
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.compare-card-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  flex: 1;
}
.compare-card-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  margin-bottom: 10px;
  color: var(--c-text);
}
.compare-card-list li i { margin-top: 2px; flex-shrink: 0; }

@media (max-width: 767px) {
  .package-visual { min-height: 220px; }
  .package-visual img { min-height: 220px; }
  .package-price { font-size: 1.6rem; }
  .compare-card-head { padding: 22px 18px 18px; }
}

/* ---------- 404 page ---------- */
.error-404-number {
  font-size: clamp(4.5rem, 14vw, 9rem);
  font-weight: 800;
  line-height: 1;
  margin: 18px 0 6px;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Portfolio detail page ---------- */
.portfolio-back-link {
  color: var(--c-primary);
}
.portfolio-back-link:hover { color: var(--c-accent); }
.portfolio-detail-media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-lg);
}
.portfolio-detail-media img {
  width: 100%;
  display: block;
  object-fit: cover;
  max-height: 640px;
}
.portfolio-detail-media-empty {
  width: 100%;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-soft);
  color: var(--c-primary);
  font-size: 3rem;
}
.portfolio-detail-body {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--c-text);
}
.blog-article-body {
  font-size: 1.05rem;
}
.blog-article-body br + br {
  display: block;
  margin-top: 14px;
}
.portfolio-info-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 28px 26px;
  position: sticky;
  top: 100px;
}
.portfolio-info-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--c-border);
}
.portfolio-info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--c-border);
  font-size: 0.92rem;
}
.portfolio-info-row:last-of-type { border-bottom: none; }
.portfolio-info-label {
  color: var(--c-muted);
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.portfolio-info-value {
  font-weight: 600;
  color: var(--c-text);
  text-align: right;
}

.portfolio-card-link h3 { transition: color .2s ease; }
.portfolio-card-link:hover h3 { color: var(--c-accent); }
.portfolio-card-tag {
  display: inline-block;
  background: var(--gradient-soft);
  color: var(--c-primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.portfolio-card-cta {
  color: var(--c-primary);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
}
.portfolio-card-cta i { transition: transform .2s ease; }
.portfolio-card-link:hover .portfolio-card-cta i { transform: translateX(4px); }

.portfolio-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.portfolio-gallery-thumb {
  border: none;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  background: var(--gradient-soft);
  transition: transform .2s ease, box-shadow .2s ease;
}
.portfolio-gallery-thumb:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.portfolio-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
