/* หัว/ท้ายเว็บแบบบล็อก · ห้อง 04 · D-081 · ค่าขนาดมาจากการวัดหน้าเดิมที่ 375/768/1366 · ไม่ใช้ Tailwind/Font Awesome */

/* ให้หัวเว็บเป็นพี่น้องของเนื้อหา (เพื่อให้แถบเมนู sticky ทำงานทั้งหน้า) */
header.wp-block-template-part, footer.wp-block-template-part, .th-header { display: contents; }
.th-header { --co: #7a695b; }
.th-header, .th-header *, .th-header *::before, .th-header *::after, .tf, .tf *, .tf *::before, .tf *::after { box-sizing: border-box; }
:where(.th-header a, .tf a) { text-decoration: none; color: inherit; }
:where(.th-header button) { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:where(.th-header img, .tf img) { max-width: 100%; }
.th-strip, .th-bar, .th-drawer, .th-header { font-family: "Kanit", sans-serif; line-height: 1.5; color: #0f172a; font-size: 14px; font-weight: 400; }

/* ===== แถบเลือกบริษัท (สูงตายตัว) ===== */
.th-strip { background: #fff; height: 46px; overflow: hidden; }
.th-strip-in { display: flex; width: 100%; max-width: 1280px; margin: 0 auto; height: 100%; }
.th-tab { flex: 1 1 0; width: 20%; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 2px; background: #dcdcdc; color: #909090; border-right: 1px solid rgba(255,255,255,.6); overflow: hidden; transition: color .2s; }
.th-tab.is-active { background: var(--co); color: #fff; border-right-color: rgba(255,255,255,.4); box-shadow: inset 0 2px 4px rgba(0,0,0,.05); }
.th-tab:not(.is-active):hover { color: var(--co); }
.th-tab picture { display: block; }
.th-tab-img { display: block; width: auto; height: auto; max-width: 100%; max-height: 24px; }
.th-hov { display: none !important; }
.th-tab:not(.is-active):hover > picture:first-child { display: none; }
.th-tab:not(.is-active):hover > .th-hov { display: block !important; }
@media (min-width: 768px) {
  .th-strip { height: 54px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .th-strip::-webkit-scrollbar { display: none; }
  .th-strip-in { width: max-content; min-width: 100%; }
  .th-tab { flex: none; width: auto; padding: 13px 22px; }
  .th-tab.is-active { padding-left: 24px; padding-right: 24px; }
  .th-tab-img { height: 28px; max-height: 28px; width: auto; max-width: none; }
}
@media (min-width: 1024px) {
  .th-strip { overflow: hidden; }
  .th-strip-in { width: 100%; }
  .th-tab { width: 190px; padding: 13px 16px; }
  .th-tab.is-active { padding: 13px 18px; }
}

/* ===== แถบหัวเว็บหลัก (สูงตายตัว 80+1) ===== */
.th-bar { position: sticky; top: 0; z-index: 50; height: 81px; background: #fff; border-bottom: 1px solid #e2e8f0; box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1); }
.th-bar-in { height: 80px; width: 100%; max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.th-logo { display: flex; align-items: center; padding: 8px 0; flex: none; }
.th-logo img { display: block; height: 40px; width: auto; }
@media (min-width: 768px) { .th-logo img { height: 48px; } }

.th-desktop { display: none; }
.th-contact { display: none; }
.th-burger { display: flex; align-items: center; margin-left: auto; padding: 8px 16px 8px 8px; color: #0e1e38; }
.th-burger:hover { color: #c5a059; }
@media (min-width: 640px) { .th-burger { padding-right: 24px; } }
.th-burger-lines { display: flex; flex-direction: column; justify-content: space-between; width: 24px; height: 20px; }
.th-burger-lines i { display: block; width: 100%; height: 2px; border-radius: 9999px; background: currentColor; transition: transform .3s ease, opacity .3s ease; }
.th-burger[aria-expanded="true"] i:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.th-burger[aria-expanded="true"] i:nth-child(2) { opacity: 0; }
.th-burger[aria-expanded="true"] i:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

@media (min-width: 1024px) {
  .th-burger { display: none; }
  .th-desktop { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 auto; }
  .th-contact { display: flex; align-items: center; flex: none; padding: 8px 20px; border-radius: 9999px; background: var(--co); color: #fff !important; font-size: 14px; font-weight: 600; line-height: 20px; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: filter .2s, box-shadow .2s; }
  .th-contact:hover { filter: brightness(1.1); box-shadow: 0 4px 6px rgba(0,0,0,.1); }
}
@media (min-width: 1280px) { .th-desktop { gap: 24px; } }

.th-d-item { position: relative; }
.th-d-link { display: flex; align-items: center; gap: 6px; padding: 8px 12px; font-size: 16px; font-weight: 500; line-height: 24px; color: #334155; border-radius: 8px; transition: color .15s; white-space: nowrap; }
.th-d-link:hover, .th-d-has:focus-within > .th-d-link, .th-d-has:hover > .th-d-link { color: var(--co); }
.th-chev { flex: none; transition: transform .2s; }
.th-d-has:hover .th-chev, .th-d-has:focus-within .th-chev, .th-d-has.is-open .th-chev { transform: rotate(180deg); }
.th-d-panel { position: absolute; left: 0; top: 100%; width: 208px; padding-top: 8px; opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .2s, transform .2s, visibility .2s; z-index: 60; }
.th-d-has:hover .th-d-panel, .th-d-has:focus-within .th-d-panel, .th-d-has.is-open .th-d-panel { opacity: 1; visibility: visible; transform: none; }
.th-d-panel-in { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px; box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); }
.th-d-panel-in a { display: block; padding: 8px 12px; font-size: 14px; font-weight: 500; line-height: 20px; color: #475569; border-radius: 8px; }
.th-d-panel-in a:hover { background: #f8fafc; color: var(--co); }
@media (min-width: 1024px) and (max-width: 1200px) {
  .th-d-link { font-size: 14px; padding-left: 8px; padding-right: 8px; }
  .th-d-panel-in a { font-size: 12px; padding-top: 6px; padding-bottom: 6px; }
}

/* ===== ลิ้นชักเมนู (มือถือ/แท็บเล็ต) ===== */
.th-overlay { position: fixed; inset: 0; z-index: 999998; background: rgba(15,23,42,.6); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); opacity: 0; transition: opacity .3s; }
.th-overlay[hidden] { display: none; }
.th-overlay.is-open { opacity: 1; }
.th-drawer { position: fixed; top: 0; right: 0; z-index: 999999; width: 85%; max-width: 384px; height: 100%; background: #fff; box-shadow: 0 25px 50px -12px rgba(0,0,0,.25); transform: translateX(100%); transition: transform .3s ease-in-out; overflow-y: auto; display: flex; flex-direction: column; justify-content: space-between; visibility: hidden; }
.th-drawer.is-open { transform: none; visibility: visible; }
.th-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px; background: var(--co); color: #fff; border-bottom: 1px solid rgba(255,255,255,.1); }
.th-drawer-logo { height: 40px; padding: 4px 12px; border-radius: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; }
.th-drawer-logo img { display: block; height: 28px; width: auto; }
.th-close { width: 32px; height: 32px; border-radius: 9999px; background: rgba(0,0,0,.2); color: #fff; display: flex; align-items: center; justify-content: center; transition: background .2s, transform .2s; }
.th-close:hover { background: rgba(0,0,0,.4); transform: rotate(90deg); }
.th-mobile { padding: 16px; }
.th-mobile > * + * { margin-top: 6px; }
.th-m-link, .th-m-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 8px 12px; font-size: 16px; font-weight: 600; line-height: 24px; color: #1e293b; border-radius: 8px; text-align: left; transition: background .15s; }
.th-m-link:hover, .th-m-toggle:hover { background: #f8fafc; }
.th-m-toggle[aria-expanded="true"] .th-chev { transform: rotate(180deg); }
.th-m-sub { padding: 4px 0 4px 12px; }
.th-m-sub[hidden] { display: none; }
.th-m-sub a { display: block; padding: 8px 12px; font-size: 12px; font-weight: 500; line-height: 16px; color: #475569; border-radius: 8px; }
.th-m-sub a:hover { background: #f8fafc; color: var(--co); }
.th-drawer-foot { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-top: 1px solid #e2e8f0; background: #f8fafc; font-size: 12px; color: #475569; }
.th-drawer-foot a { display: flex; align-items: center; gap: 6px; }
.th-drawer-foot a:hover { color: #c5a059; }
body.th-lock { overflow: hidden; }

/* ===== ท้ายเว็บ ===== */
.tf { position: relative; background: #0a0a0a; color: #fff; padding-top: 51px; font-family: "Kanit", sans-serif; font-size: 14px; line-height: 1.7; }
.tf p { margin: 0; padding: 0; }
.tf-row { width: 80%; max-width: 1080px; margin: 0 auto; }
.tf-top { display: flex; align-items: flex-start; flex-wrap: wrap; }
.tf-col { width: 50%; }
.tf-logo { display: block; width: 82%; height: auto; margin: 0 0 30px; }
.tf-name { font-size: 19px; font-weight: 300; margin-bottom: 30px !important; }
.tf-addr { font-size: 18px; font-weight: 300; margin-bottom: 30px !important; }
.tf-right { display: flex; justify-content: center; align-items: flex-start; gap: 120px; padding: 40px 0; font-family: "Barlow Semi Condensed", "Kanit", sans-serif; }
.tf-contact { padding-top: 110px; }
.tf-ci { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 17px; font-family: "Kanit", sans-serif; font-weight: 200; }
.tf-menu-wrap { display: flex; align-items: flex-start; gap: 55px; }
.tf-divider { display: block; width: 1px; height: 300px; background: #fff; }
.tf-menu { display: flex; flex-direction: column; gap: 30px; }
.tf-menu a { color: #fff; font-size: 24px; font-weight: 500; text-transform: uppercase; line-height: 1.2; transition: opacity .3s; }
.tf-menu a:hover { opacity: .7; }
.tf-bottom { padding-top: 1px; padding-bottom: 20px; }
.tf-bottom p { font-size: 14px; font-weight: 300; margin-top: 2px; }
.tf-lang { position: fixed; left: 18px; bottom: 20px; z-index: 9990; padding: 6px 12px; background: #fff; color: #333; border-radius: 6px; font-size: 12px; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
@media (max-width: 980px) { .tf-col { width: 100%; } }
@media (max-width: 768px) {
  .tf-right { flex-direction: column; gap: 30px; align-items: center; }
  .tf-contact { padding-top: 0; }
  .tf-divider { height: 250px; }
}
@media (max-width: 768px) { .tf { padding-bottom: 56px; } }

/* ===== D-083/D-084: แท็บที่ไม่มีลิงก์ (EXOSPHERE/DISTRIBUTION) · ท้ายเว็บแบบกลุ่มลิงก์ ===== */
.th-tab.is-nolink { opacity: .45; cursor: default; }
.tf-ph { font-size: 14px; font-weight: 300; color: #9ca3af; margin-bottom: 20px !important; }
.tf-right { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: flex-start; gap: 28px 40px; padding: 0 0 20px; font-family: "Kanit", sans-serif; }
.tf-group { min-width: 130px; }
.tf-gt { margin: 0 0 12px; font-size: 14px; font-weight: 500; letter-spacing: .04em; color: #d6c9bc; text-transform: none; }
.tf-link { display: block; padding: 4px 0; font-size: 15px; font-weight: 300; line-height: 1.5; color: #fff; }
a.tf-link:hover { opacity: .7; }
.tf-link.is-nolink { color: rgba(255,255,255,.4); }
@media (max-width: 768px) { .tf-right { flex-direction: row; gap: 20px 28px; align-items: flex-start; } .tf-group { min-width: 120px; flex: 1 1 40%; } }

/* ===== แถบปุ่มโทร/ทักไลน์ติดล่างจอ (มือถือ/แท็บเล็ต) · ลิงก์จริงรอ Q33 (ตัวยึด) · ความสูงตายตัว ไม่ทำให้เลย์เอาต์เด้ง ===== */
.th-cbar { display: none; }
@media (max-width: 1023px) {
  .th-cbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 56px; z-index: 9980; background: #fff; box-shadow: 0 -2px 8px rgba(0,0,0,.15); font-family: "Kanit", sans-serif; }
  .th-cbar-b { flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; font-weight: 600; color: #fff; }
  .th-cbar-call { background: var(--th-co, #7a695b); }
  .th-cbar-line { background: #06c755; }
  .tf { padding-bottom: 72px; }
  .tf-lang { bottom: 68px; }
}
.tf-ct { font-size: 16px; font-weight: 300; margin-bottom: 12px !important; }
.tf-ct a:hover { opacity: .7; }
@media (max-width: 1023px) { .th-cbar-t { display: block; text-align: center; line-height: 1.15; white-space: nowrap; } .th-cbar-t small { display: block; font-size: 11px; font-weight: 400; opacity: .9; } }

.th-lang { display: none; font: 400 14px/1 "Kanit", sans-serif; color: #555; margin-right: 12px; white-space: nowrap; }
@media (min-width: 1024px) { .th-lang { display: inline-flex; align-items: center; } }

/* จัดกลางจอกว้าง: แถบเลือกบริษัทไม่ให้ min-width:100% ชนะ max-width */
@media (min-width: 1024px) { .th-strip-in { min-width: 0; width: 100%; max-width: 1280px; margin-left: auto; margin-right: auto; } .th-bar-in { margin-left: auto; margin-right: auto; } }

.th-lang-m { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font: 400 16px/1 "Kanit", sans-serif; color: #0f172a; }
@media (min-width: 1024px) { .th-lang-m { display: none; } }

.th-line { display: none; font: 500 14px/1 "Kanit", sans-serif; color: #fff; background: #06c755; border-radius: 4px; padding: 8px 12px; margin-right: 10px; text-decoration: none; white-space: nowrap; }
@media (min-width: 1024px) { .th-line { display: inline-flex; align-items: center; } }

/* D-092: แถบบน = แบรนด์ในเครือ + โทร/LINE/ภาษา ชิดขวา · มือถือซ่อนแถวแบรนด์ ย้ายไปลิ้นชัก */
.th-strip-r { display: none; }
.th-brands-m { display: flex; flex-direction: column; gap: 2px; padding: 8px 0 12px; border-bottom: 1px solid #e2e8f0; margin-bottom: 8px; }
.th-bm-t { font: 500 13px/1.4 "Kanit", sans-serif; color: #64748b; padding: 4px 0; letter-spacing: .04em; }
.th-bm { display: block; padding: 8px 0; font: 500 16px/1.4 "Kanit", sans-serif; color: #0f172a; text-decoration: none; }
.th-bm.is-active { color: var(--co, #0f172a); font-weight: 600; }
.th-bm.is-nolink { color: #94a3b8; }
@media (max-width: 1023px) { .th-strip { display: none; } }
@media (min-width: 1024px) {
  .th-brands-m { display: none; }
  .th-strip-r { display: flex; align-items: center; gap: 14px; margin-left: auto; padding-left: 12px; white-space: nowrap; font: 400 14px/1 "Kanit", sans-serif; color: #0f172a; }
  .th-strip-r a { display: inline-flex; align-items: center; gap: 6px; color: #0f172a; text-decoration: none; }
  .th-sr-tel span { font-weight: 500; }
  .th-sr-line { color: #06c755 !important; }
  .th-lang { display: inline-flex; margin: 0; color: #0f172a; }
  .th-tab { width: 150px; padding: 13px 10px; }
  .th-tab.is-active { padding: 13px 12px; }
}
@media (min-width: 1280px) { .th-tab { width: 170px; padding: 13px 14px; } .th-tab.is-active { padding: 13px 16px; } }
.th-brands-m { padding-left: 28px; padding-right: 16px; }

/* ตรวจธีมรอบ 17 พ.ย.: เข้าถึงได้ */
.th-skip { position: absolute; left: -9999px; top: 0; z-index: 1000000; background: #fff; color: #000; padding: 10px 16px; font: 500 16px/1.4 "Kanit", sans-serif; }
.th-skip:focus { left: 8px; top: 8px; outline: 3px solid #1d4ed8; }
.th-d-has.is-esc .th-d-panel { display: none !important; }
.th-cbar-line { color: #052e16; }
.th-sr-line { color: #00762a !important; }
@media (max-width: 1023px) {
  .th-close { min-width: 44px; min-height: 44px; }
  .th-burger { min-height: 44px; min-width: 44px; justify-content: center; }
  .th-m-link, .th-m-toggle { min-height: 44px; }
  .th-m-sub a { min-height: 44px; display: flex; align-items: center; font-size: 14px; }
  .th-bm { min-height: 44px; display: flex; align-items: center; padding-top: 0; padding-bottom: 0; }
  .th-drawer-foot a { min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; }
  .tf-link { min-height: 44px; display: flex; align-items: center; padding-top: 0; padding-bottom: 0; }
}

/* เมนูหลักมี ≥6 หัวข้อ (เช่น REALSULATE ฉบับสมบูรณ์): ลดช่องไฟ/ขนาดตัวอักษรให้พอดีแถวเดียว ไม่ดันปุ่มติดต่อล้นจอ */
@media (min-width: 1024px) {
  .th-desktop--dense { gap: 0; min-width: 0; flex: 1 1 auto; }
  .th-desktop--dense .th-d-link { font-size: 14px; padding: 8px 8px; white-space: nowrap; }
}
@media (min-width: 1280px) { .th-desktop--dense { gap: 2px; } .th-desktop--dense .th-d-link { font-size: 15px; padding: 8px 10px; } }

/* ===== layout-1 header-footer fragment ===== */
/* Append to assets/header-footer.css after all current rules.
   PHP adds this class only to the three placeholder controls.
   Real language links with href are explicitly excluded. */
.tnt-hide-lang-placeholder[data-placeholder="1"]:not([href]) {
  display: none !important;
}
/* Missing brands retain existing grey artwork, including on hover. */
.th-tab.is-nolink:not(.is-active):hover { color: #909090; }
.th-tab.is-nolink:not(.is-active):hover > picture:first-child { display: block; }
.th-tab.is-nolink:not(.is-active):hover > .th-hov { display: none !important; }
