/* =========================================================
   RightwayHub — ส่วนกลางของทุกหน้า (เมนูด้านบน + ท้ายเว็บ)
   แก้ไฟล์นี้ไฟล์เดียว หน้าตาเมนูและ footer จะเปลี่ยนทั้งเว็บ
   ทุก class ขึ้นต้นด้วย rw- เพื่อไม่ชนกับ CSS เดิมของแต่ละหน้า
   ========================================================= */
:root {
  --rw-bar: #343A40;        /* สีแถบเมนู / footer (สีเดิมของเว็บ) */
  --rw-bar-2: #2B3035;
  --rw-brand: #4CAF50;      /* เขียวโลโก้ */
  --rw-green: #2E8B47;      /* เขียวสำหรับปุ่ม / ตัวหนังสือ (อ่านชัดกว่า) */
  --rw-text: #FFFFFF;
  --rw-dim: #B9C2BC;
}

/* ───────── เมนูด้านบน ───────── */
.rw-header {
  position: sticky; top: 0; z-index: 900;
  background: var(--rw-bar); color: var(--rw-text);
  font-family: 'Sarabun', Tahoma, sans-serif;
  box-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.rw-header *, .rw-footer * { box-sizing: border-box; }
.rw-header-in {
  max-width: 1240px; margin: 0 auto; padding: 0 24px;
  height: 68px; display: flex; align-items: center; gap: 20px;
}
.rw-brand {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  color: #fff; text-decoration: none; font-weight: 700; font-size: 15.5px; line-height: 1.3;
  margin-right: auto;
}
.rw-brand img { height: 44px; width: auto; max-width: 140px; object-fit: contain; display: block; flex-shrink: 0; }
.rw-brand span { max-width: 190px; }   /* ชื่อบริษัทตัดเป็น 2 บรรทัด ประหยัดที่ให้เมนู */

.rw-menu { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.rw-menu a {
  position: relative; color: #fff; text-decoration: none; white-space: nowrap;
  font-size: 15.5px; line-height: 1; padding: 10px 11px; border-radius: 7px;
  transition: background-color .15s;
}
.rw-menu a:hover { background: rgba(255,255,255,.08); }
.rw-menu a.rw-active::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 2px;
  height: 3px; border-radius: 3px; background: var(--rw-brand);
}
.rw-menu a.rw-free {               /* เมนูเครื่องมือฟรี — เด่นขึ้นเล็กน้อย */
  color: #CDEFD3;
}

.rw-burger {
  display: none; margin-left: 4px; background: none; border: 1px solid rgba(255,255,255,.25);
  color: #fff; border-radius: 8px; padding: 7px 9px; cursor: pointer; line-height: 0;
}
.rw-burger svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.rw-header :focus-visible, .rw-footer :focus-visible { outline: 2px solid var(--rw-brand); outline-offset: 2px; }

/* ปุ่ม "ปรึกษาเรา" */
.rw-cta {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  background: var(--rw-brand); color: #fff; text-decoration: none; white-space: nowrap;
  font-weight: 700; font-size: 15px; line-height: 1; padding: 11px 16px; border-radius: 8px;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); transition: background-color .15s;
}
.rw-cta:hover { background: #43A047; }
.rw-cta svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linejoin: round; }

/* จอกลาง / มือถือ: ย่อเมนูเป็นปุ่ม ☰ (ปุ่มปรึกษาเรายังอยู่ให้กดได้) */
@media (max-width: 1240px) {
  .rw-burger { display: inline-flex; }
  .rw-menu {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--rw-bar-2); padding: 8px 16px 14px;
    box-shadow: 0 10px 24px rgba(0,0,0,.25);
  }
  .rw-header.rw-open .rw-menu { display: flex; }
  .rw-menu a { padding: 13px 12px; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,.07); border-radius: 0; }
  .rw-menu a:last-child { border-bottom: none; }
  .rw-menu a.rw-active::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; }
}
@media (max-width: 560px) {
  .rw-header-in { padding: 0 14px; height: 60px; gap: 10px; }
  .rw-brand img { height: 36px; }
  .rw-brand img { height: 36px; max-width: 110px; }
  .rw-brand span { font-size: 14px; max-width: 170px; }
  .rw-cta { padding: 9px 11px; font-size: 14px; }
}

/* ───────── ท้ายเว็บ ───────── */
.rw-footer {
  background: var(--rw-bar); color: var(--rw-dim);
  font-family: 'Sarabun', Tahoma, sans-serif; font-size: 15px; line-height: 1.7;
  margin-top: 0;
}
.rw-footer a { color: #fff; text-decoration: none; }
.rw-footer a:hover { text-decoration: underline; }
.rw-footer-in {
  max-width: 1240px; margin: 0 auto; padding: 40px 24px 28px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 28px;
}
.rw-footer h4 { color: #fff; font-size: 16px; font-weight: 700; margin: 0 0 10px; }
.rw-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rw-f-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; margin-bottom: 10px; }
.rw-f-brand img { height: 40px; width: auto; }
.rw-f-about { margin: 0; max-width: 340px; }
.rw-contact a { display: inline-flex; align-items: center; gap: 9px; }
.rw-contact i { width: 18px; text-align: center; color: var(--rw-brand); font-size: 1.1em; }
.rw-copy {
  border-top: 1px solid rgba(255,255,255,.1);
  max-width: 1240px; margin: 0 auto; padding: 14px 24px 22px;
  font-size: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px;
}
@media (max-width: 900px) {
  .rw-footer-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .rw-footer-in { grid-template-columns: 1fr; padding: 32px 18px 20px; gap: 22px; }
  .rw-copy { padding: 14px 18px 22px; }
}

/* จอแคบมาก (≤400px): ซ่อนชื่อบริษัท เหลือโลโก้ ให้ปุ่มปรึกษาเราอยู่ครบ */
@media (max-width: 400px) {
  .rw-brand span { display: none; }
}
