/* Home V2 — Hero (ผู้บริหาร) + แถบลิงก์ลอยสีขาว | โทนน้ำเงิน Sabo */
.hx-hero{ --hx-bg-image:none; position:relative; color:#fff; overflow:hidden; padding:70px 0 120px;
  background:var(--hx-bg-image) center/cover no-repeat,
    radial-gradient(800px 400px at 80% 15%, rgba(56,189,248,.5), transparent 60%),
    radial-gradient(600px 380px at 0% 100%, rgba(99,102,241,.35), transparent 60%),
    linear-gradient(135deg,var(--blue-deep),var(--blue-dark) 50%,var(--blue)); }
.hx-bg{ position:absolute; inset:0; z-index:0; background:center/cover no-repeat; }
.hx-hero::before{ content:""; position:absolute; inset:0; z-index:1; background:linear-gradient(100deg,rgba(6,46,99,.82) 0%,rgba(8,66,152,.5) 50%,rgba(11,94,215,.12) 100%); }
.hx-hero::after{ content:""; position:absolute; left:0; right:0; bottom:-1px; height:64px; background:#f8fbff; clip-path:ellipse(75% 100% at 50% 100%); }
.hx-hero .container{ position:relative; z-index:2; }
.hx-grid{ display:grid; grid-template-columns:1.2fr .8fr; gap:40px; align-items:end; }
.hx-copy{ align-self:center; padding-bottom:20px; }
.hx-eyebrow{ display:inline-flex; align-items:center; gap:12px; font-size:13px; letter-spacing:.2em; text-transform:uppercase; color:#bcd7ff; margin-bottom:14px; }
.hx-eyebrow::before{ content:""; width:44px; height:2px; background:#7db4ff; }
.hx-hero h1{ color:#fff; font-size:clamp(32px,4.6vw,56px); font-weight:700; line-height:1.2; margin:0 0 16px; }
.hx-quote{ font-size:clamp(17px,2vw,24px); font-weight:500; line-height:1.55; max-width:560px; margin:0 0 28px; color:#fff; }
.hx-quote span{ color:#fde68a; }
.hx-actions{ display:flex; gap:14px; flex-wrap:wrap; }
.hx-btn{ display:inline-flex; align-items:center; gap:12px; padding:13px 22px; border-radius:14px; color:#fff; font-weight:500; box-shadow:0 10px 26px rgba(0,0,0,.25); transition:transform .2s; }
.hx-btn:hover{ transform:translateY(-3px); color:inherit; }
.hx-btn small{ display:block; font-size:11px; font-weight:300; opacity:.85; }
.hx-btn .lead{ font-size:22px; }
.hx-btn-1{ background:linear-gradient(135deg,#fbbf24,#f59e0b); color:#3b2a00 !important; }
.hx-btn-2{ background:rgba(255,255,255,.16); border:1px solid rgba(255,255,255,.4); backdrop-filter:blur(8px); }

/* ผู้บริหาร: รูปตัดพื้นโผล่เหนือการ์ดกระจก */
.hx-portrait{ position:relative; max-width:400px; width:100%; margin:0 auto; padding-top:340px; }
.hx-doctor{ position:absolute; left:50%; bottom:46px; transform:translateX(-50%); height:420px; width:auto; max-width:none; z-index:2;
  filter:drop-shadow(0 18px 30px rgba(0,0,0,.35)); pointer-events:none; }
.hx-glass{ position:relative; z-index:3; background:rgba(255,255,255,.16); border:1px solid rgba(255,255,255,.4);
  backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px); border-radius:24px; padding:16px 18px;
  box-shadow:0 24px 60px rgba(6,46,99,.4); margin-top:80px; }
.hx-glass-head{ display:flex; align-items:center; gap:8px; font-size:12px; color:#d6e6ff; margin-bottom:10px; }
.hx-dot{ width:9px; height:9px; border-radius:50%; background:var(--teal); box-shadow:0 0 0 4px rgba(18,183,106,.3); }
.hx-name{ display:flex; align-items:center; gap:12px; }
.hx-name img{ width:48px; height:48px; border-radius:50%; background:#fff; padding:3px; object-fit:contain; flex:none; }
.hx-name strong{ display:block; font-size:16px; line-height:1.3; }
.hx-name span{ font-size:12.5px; color:#d6e6ff; }

/* แถบลิงก์สีขาว ลอยทับขอบ hero */
.hx-quick{ position:relative; z-index:5; margin-top:-58px; margin-bottom:10px; }
.hx-quick-bar{ display:grid; grid-template-columns:repeat(4,1fr); background:#fff; border-radius:24px; padding:14px 10px;
  box-shadow:var(--shadow-lg); border-top:4px solid var(--blue); }
.hx-q{ display:flex; align-items:center; gap:12px; padding:12px 18px; color:var(--ink); border-right:1px solid var(--border); transition:background .2s; }
.hx-q:last-child{ border-right:0; }
.hx-q:hover{ background:var(--blue-pale); border-radius:14px; color:var(--ink); }
.hx-q i{ width:44px; height:44px; flex:none; display:grid; place-items:center; border-radius:12px; font-size:21px; background:var(--blue-light); color:var(--blue); transition:.2s; }
.hx-q:hover i{ background:var(--blue); color:#fff; }
.hx-q strong{ display:block; font-size:14.5px; font-weight:500; line-height:1.3; } .hx-q span{ font-size:11.5px; color:var(--gray-400); }

@media (max-width:991px){
  .hx-hero{ padding:50px 0 110px; }
  .hx-grid{ grid-template-columns:1fr; gap:10px; }
  .hx-copy{ text-align:center; } .hx-eyebrow{ justify-content:center; } .hx-quote{ margin-inline:auto; } .hx-actions{ justify-content:center; }
  .hx-quick-bar{ grid-template-columns:repeat(2,1fr); }
  .hx-q:nth-child(2){ border-right:0; }
}
@media (max-width:520px){
  .hx-hero h1{ font-size:30px; }
  .hx-portrait{ padding-top:290px; } .hx-doctor{ height:360px; }
  .hx-quick-bar{ grid-template-columns:1fr; } .hx-q{ border-right:0; border-bottom:1px solid var(--border); } .hx-q:last-child{ border-bottom:0; }
}

/* =========================================================
   Sticky quick bar — วิ่งตามใต้ navbar + ไฮไลต์ section ที่กำลังดู
   ========================================================= */
.hx-quick{ position:sticky; top:84px; /* JS ปรับตามความสูง header จริง */ z-index:900; pointer-events:none; }
.hx-quick .container{ pointer-events:none; }
.hx-quick-bar{ pointer-events:auto; transition:padding .25s, border-radius .25s, box-shadow .25s; }
html:has(.hx-quick){ scroll-padding-top:var(--hx-offset,150px); }

.hx-q{ position:relative; }
.hx-q.active{ background:linear-gradient(135deg,var(--blue-dark),var(--blue)); border-radius:14px; color:#fff; box-shadow:0 8px 18px rgba(11,94,215,.3); }
.hx-q.active strong{ color:#fff; } .hx-q.active span{ color:#cfe1fa; }
.hx-q.active i{ background:rgba(255,255,255,.2); color:#fff; }

/* ตอนติดขอบบน: แถบกะทัดรัด ชิดใต้ navbar */
.hx-quick.is-stuck .hx-quick-bar{ border-top:0; border-radius:0 0 20px 20px; padding:6px 8px; box-shadow:0 12px 28px rgba(6,46,99,.2); }
.hx-quick.is-stuck .hx-q{ padding:7px 14px; }
.hx-quick.is-stuck .hx-q i{ width:34px; height:34px; font-size:17px; border-radius:10px; }
.hx-quick.is-stuck .hx-q span{ display:none; }
.hx-quick.is-stuck .hx-q strong{ font-size:14px; }

/* แท็บเล็ต/มือถือ: เลื่อนแนวนอนบรรทัดเดียว */
@media (max-width:991px){
  .hx-quick{ margin-top:-48px; }
  .hx-quick-bar{ display:flex; gap:6px; overflow-x:auto; scroll-snap-type:x proximity; scrollbar-width:none; padding:10px; border-radius:20px; }
  .hx-quick-bar::-webkit-scrollbar{ display:none; }
  .hx-q{ flex:none; scroll-snap-align:center; border:0 !important; padding:8px 14px; border-radius:999px; background:var(--blue-pale); white-space:nowrap; }
  .hx-q i{ width:30px; height:30px; font-size:16px; } .hx-q span{ display:none; }
  .hx-q strong{ font-size:13.5px; }
  .hx-quick.is-stuck .hx-quick-bar{ border-radius:0 0 18px 18px; }
}
@media (max-width:520px){ .hx-quick-bar{ display:flex; grid-template-columns:none; } .hx-q{ border-bottom:0 !important; } }

/* =========================================================
   มือถือ (<=767px): ย้ายแถบลัดไปไว้ด้านล่างจอ เหมือนแถบเมนูของแอป
   ========================================================= */
@media (max-width:767px){
  .hx-quick, .hx-quick.is-stuck{
    position:fixed; left:0; right:0; bottom:0; top:auto !important; margin:0;
    z-index:950; pointer-events:none;
  }
  .hx-quick .container{ max-width:none; padding:0; }
  .hx-quick-bar, .hx-quick.is-stuck .hx-quick-bar{
    display:grid; grid-template-columns:repeat(4,1fr); gap:2px; overflow:visible;
    padding:6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    border-radius:20px 20px 0 0; border-top:1px solid var(--border);
    background:rgba(255,255,255,.96); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
    box-shadow:0 -8px 26px rgba(6,46,99,.14);
  }
  .hx-q, .hx-quick.is-stuck .hx-q{
    flex-direction:column; justify-content:center; gap:2px; padding:7px 2px 6px; min-width:0;
    border-radius:14px; background:transparent; text-align:center; white-space:normal;
  }
  .hx-q > div{ display:none; }
  .hx-q i, .hx-quick.is-stuck .hx-q i{ width:auto; height:auto; font-size:22px; background:transparent; color:var(--gray-600); border-radius:0; transition:transform .2s, color .2s; }
  .hx-q::after{ content:attr(data-short); font-size:11.5px; font-weight:500; line-height:1.25; color:var(--gray-600); }
  .hx-q:hover{ background:transparent; }
  .hx-q:hover i{ background:transparent; color:var(--blue); }
  /* แท็บที่กำลังดูอยู่ */
  .hx-q.active{ background:var(--blue-light); box-shadow:none; }
  .hx-q.active i{ background:transparent; color:var(--blue); transform:translateY(-1px) scale(1.08); }
  .hx-q.active::after{ color:var(--blue); font-weight:600; }

  /* เว้นที่ท้ายหน้าไม่ให้แถบทับเนื้อหา/ท้ายเว็บ และยกปุ่มลอยขึ้นพ้นแถบ */
  body:has(.hx-quick){ padding-bottom:calc(70px + env(safe-area-inset-bottom, 0px)); }
  body:has(.hx-quick) .back-top{ bottom:calc(84px + env(safe-area-inset-bottom, 0px)); right:16px; }
  body:has(.hx-quick) .cookie-bar{ bottom:calc(84px + env(safe-area-inset-bottom, 0px)); left:16px; }
}

/* กันแถบกระพริบ: ปิด transition ตอนวัดขนาด และไม่ให้เบราว์เซอร์เลื่อนหน้าชดเชยเอง */
.hx-quick{ overflow-anchor:none; }
.hx-quick.hx-measure, .hx-quick.hx-measure *{ transition:none !important; }
