/*
Theme Name: Vehix 2026
Theme URI: https://vehix.co
Author: Vehix Team
Author URI: https://vehix.co
Description: Vehix 2026 — LINE CRM สำหรับอู่ซ่อมรถ คาร์แคร์ และศูนย์บริการรถยนต์ ธีมออกแบบตามเว็บไซต์ Vehix (หน้าแรก, ราคา, บริการ, บทความ, ติดต่อเรา) พร้อม Bootstrap, ฟอนต์ Prompt / IBM Plex Sans Thai แบบ Local ทั้งหมด ไม่ใช้ CDN
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vehix
Tags: business, one-column, custom-logo, custom-menu, translation-ready
*/

/* ===== Base (ตามไฟล์ HTML ต้นฉบับ) ===== */
html { scroll-behavior: smooth; }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #fff;
  font-family: 'IBM Plex Sans Thai', system-ui, sans-serif;
  color: #1F2430;
  -webkit-font-smoothing: antialiased;
}
a { color: #2B6BE8; text-decoration: none; }
a:hover { color: #1D3A7A; }
img { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 { font-family: 'Prompt', sans-serif; }

/* ===== Image slot placeholder ===== */
.vx-slot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  font-size: 11px;
  line-height: 1.5;
  color: #9AA3B5;
  background: repeating-linear-gradient(45deg, #F5F7FB, #F5F7FB 12px, #EFF3F9 12px, #EFF3F9 24px);
}
.vx-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ===== Nav dropdown (บริการ) ===== */
.vx-dd { position: relative; }
.vx-dd-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 12px;
  z-index: 60;
}
.vx-dd.open .vx-dd-panel, .vx-dd:hover .vx-dd-panel { display: block; }
.vx-dd.open .vx-dd-caret, .vx-dd:hover .vx-dd-caret { transform: rotate(180deg); }
.vx-dd-item:hover { background: #F5F7FB !important; }

/* ===== Hover: ลิงก์/ปุ่มข้อความสีน้ำเงินเข้ม (#1D3A7A) เปลี่ยนเป็นสีฟ้า (#2B6BE8) ทั้งเว็บ ===== */
a, button { transition: color .15s ease; }
a[style*="1D3A7A"]:hover,
button[style*="1D3A7A"]:hover,
.vx-nav a:hover { color: #2B6BE8 !important; }
/* ชื่อบริการใน dropdown (desktop) และลิสต์ในเมนูเต็มจอ */
.vx-dd-item:hover > span:last-child > span:first-child,
body.vx-nav-open .vx-dd-item:hover > span:last-child > span:first-child { color: #2B6BE8 !important; }
/* สารบัญบทความ */
.vx-toc-link:hover { color: #2B6BE8; }
/* เพจจิเนชัน */
.vx-pagination .page-numbers:not(.current):hover { color: #2B6BE8; border-color: #2B6BE8; }

/* ===== Hamburger menu (มือถือ + แท็บเล็ต ≤1024px) ===== */
.vx-burger {
  display: none;
  margin-left: auto;
  width: 44px; height: 44px;
  border: 1px solid #E6EAF2; border-radius: 12px;
  background: #fff; cursor: pointer; padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  position: relative; z-index: 130;
}
.vx-burger span {
  display: block; width: 20px; height: 2px; border-radius: 2px;
  background: #1D3A7A;
  transition: transform .2s ease, opacity .2s ease;
}
body.vx-nav-open .vx-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.vx-nav-open .vx-burger span:nth-child(2) { opacity: 0; }
body.vx-nav-open .vx-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1024px) {
  .vx-burger { display: flex; }
  .vx-nav { display: none !important; }

  /* backdrop-filter บนแถบบนทำให้ position:fixed ยึดกับแถบแทน viewport — ปิดชั่วคราวตอนเมนูเปิด */
  body.vx-nav-open .vx-topbar { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  body.vx-nav-open { overflow: hidden; }
  body.vx-nav-open .vx-nav-logo { position: relative; z-index: 130; }

  /* เมนูเต็มจอ — ลิงก์อยู่กึ่งกลาง */
  body.vx-nav-open .vx-nav {
    display: flex !important;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 120;
    background: #fff;
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    gap: 26px !important;
    font-size: 20px !important;
    white-space: normal !important;
    padding: 90px 24px 40px !important;
    overflow-y: auto;
    text-align: center;
  }
  body.vx-nav-open .vx-nav li { list-style: none; }

  /* dropdown "บริการ" ในเมนูเต็มจอ: กางเป็นลิสต์กึ่งกลาง */
  body.vx-nav-open .vx-dd { position: static; display: flex; flex-direction: column; align-items: center; gap: 10px; }
  body.vx-nav-open .vx-dd-toggle { font-size: 20px; }
  body.vx-nav-open .vx-dd-panel { position: static; padding-top: 0; }
  /* รายการบริการในเมนูเต็มจอ: โชว์เป็นลิสต์เรียบ ๆ ไม่เป็นกล่อง dropdown */
  body.vx-nav-open .vx-dd-panel > div {
    width: auto !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 2px !important;
    max-height: none !important;
    overflow: visible !important;
  }
  body.vx-nav-open .vx-dd-item { padding: 7px 10px !important; justify-content: center; }
  body.vx-nav-open .vx-dd-item:hover { background: transparent !important; }
  /* ซ่อนเลขลำดับและคำโปรย เหลือชื่อบริการเป็นลิสต์ */
  body.vx-nav-open .vx-dd-item > span:first-child { display: none !important; }
  body.vx-nav-open .vx-dd-item > span:last-child { align-items: center; text-align: center; }
  body.vx-nav-open .vx-dd-item > span:last-child > span:first-child { font-size: 16px !important; font-weight: 600 !important; color: #2F3542 !important; }
  body.vx-nav-open .vx-dd-item > span:last-child > span:last-child { display: none !important; }
}

/* ===== Pillar tabs (7 เสาหลัก) ===== */
.vx-pillar-tab { opacity: .45; }
.vx-pillar-tab.active { opacity: 1; }
.vx-pillar-tab .vx-pillar-q { display: none; }
.vx-pillar-tab.active .vx-pillar-q { display: block; }
.vx-pillar-tab .vx-pillar-dot { opacity: 0; }
.vx-pillar-tab.active .vx-pillar-dot { opacity: 1; }
.vx-pillar-tab.active .vx-pillar-n { color: #9DBBF5; }
.vx-pillar-pane { display: none; }
.vx-pillar-pane.active { display: flex; }

/* ===== FAQ accordion ===== */
.vx-faq-a { display: none; }
.vx-faq.open .vx-faq-a { display: block; }
.vx-faq.open { border-color: #2B6BE8 !important; }
.vx-faq .vx-faq-ic { background: #EEF2F8; color: #1D3A7A; }
.vx-faq.open .vx-faq-ic { background: #2B6BE8; color: #fff; transform: rotate(45deg); }

/* ===== Pricing compare groups ===== */
.vx-group .vx-group-rows { display: block; }
.vx-group.closed .vx-group-rows { display: none; }
.vx-group .vx-group-caret { transform: rotate(0deg); transition: transform .2s; display: inline-block; }
.vx-group.closed .vx-group-caret { transform: rotate(180deg); }

/* ===== Contact form ===== */
.vx-chip.on { border-color: #2B6BE8 !important; background: #E8F0FD !important; color: #1D3A7A !important; }
.vx-type-btn { background: transparent; color: #6B7280; box-shadow: none; }
.vx-type-btn.on { background: #fff; color: #1D3A7A; box-shadow: 0 2px 8px rgba(29,58,122,.12); }
.vx-hidden { display: none !important; }
.vx-field-err { border-color: #C0392B !important; }

/* ===== Blog / TOC ===== */
.vx-toc-link { color: #9AA3B5; font-weight: 500; }
.vx-toc-link.done, .vx-toc-link.current { color: #1D3A7A; }
.vx-toc-link.current { font-weight: 700; }
.vx-toc-link .vx-toc-dot { background: #E6EAF2; box-shadow: none; }
.vx-toc-link.done .vx-toc-dot, .vx-toc-link.current .vx-toc-dot { background: #2B6BE8; }
.vx-toc-link.current .vx-toc-dot { box-shadow: 0 0 0 4px #E8F0FD; }
.vx-toc-link .vx-toc-line { background: #E6EAF2; }
.vx-toc-link.done .vx-toc-line { background: #2B6BE8; }

/* ===== เนื้อหาบทความ (the_content) ===== */
.vx-article { max-width: 760px; display: flex; flex-direction: column; gap: 24px; }
.vx-article > h2 {
  margin: 16px 0 0;
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1.25;
  color: #1D3A7A;
  scroll-margin-top: 96px;
}
.vx-article > h3 { margin: 8px 0 0; font-weight: 700; font-size: clamp(19px, 2.2vw, 24px); color: #1D3A7A; }
.vx-article p { margin: 0; font-size: 17px; line-height: 1.8; color: #2F3542; text-wrap: pretty; }
.vx-article ul, .vx-article ol {
  margin: 0; padding-left: 22px;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 16px; line-height: 1.7; color: #2F3542;
}
.vx-article blockquote {
  margin: 8px 0 0; padding: 20px 24px;
  background: #F5F7FB; border-radius: 16px;
  font-family: 'Prompt', sans-serif; font-weight: 600;
  font-size: 19px; line-height: 1.5; color: #1D3A7A;
}
.vx-article img { border-radius: 16px; }
.vx-article a { text-decoration: underline; }

/* ===== หน้า page ทั่วไป ===== */
.vx-page-content { font-size: 16.5px; line-height: 1.8; color: #2F3542; }
.vx-page-content h2, .vx-page-content h3 { color: #1D3A7A; }

/* ===== Pagination (WP paginate_links) ===== */
.vx-pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.vx-pagination .page-numbers {
  min-width: 38px; height: 38px; padding: 0 12px;
  border-radius: 999px; border: 1px solid #DDE3EE; background: #fff;
  color: #1D3A7A; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.vx-pagination .page-numbers.current { background: #2B6BE8; border-color: #2B6BE8; color: #fff; }
.vx-pagination .page-numbers.dots { border: 0; background: transparent; color: #6B7280; }

/* ===== FAQ ด้วยบล็อก Details ของ WordPress (ใช้ในหน้า Service Detail ฯลฯ) ===== */
.vx-article details {
  border: 1px solid #E6EAF2;
  border-radius: 16px;
  background: #fff;
}
/* การ์ด FAQ ติดกันให้ห่าง 10px (ชดเชย gap 24px ของ .vx-article) */
.vx-article details + details { margin-top: -14px; }
.vx-article details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  font-weight: 700;
  color: #1D3A7A;
  font-size: 15px;
  line-height: 1.5;
  transition: color .15s ease;
}
.vx-article details summary::-webkit-details-marker { display: none; }
.vx-article details summary:hover { color: #2B6BE8; }
.vx-article details summary::after {
  content: "+";
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #E6EAF2;
  color: #2B6BE8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}
.vx-article details[open] summary::after { content: "−"; }
.vx-article details > *:not(summary) { margin: 0 0 14px; padding: 0 18px; }
.vx-article details p { font-size: 14.5px; line-height: 1.7; color: #4B5563; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .vx-pillar-grid { grid-template-columns: 1fr !important; }
  .vx-post-layout, .vx-svc-layout { grid-template-columns: 1fr !important; }
  .vx-toc-nav, .vx-svc-aside { position: static !important; }
  .vx-home-posts-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important; }
}
