:root{
  --primary:#0A2463; --accent:#FF9F1C; --ink:#1f2937; --muted:#6b7280; --bg:#ffffff; --bg-soft:#F5F7FB;
  --shadow:0 10px 30px rgba(2,6,23,.08); --radius:14px; --max:1100px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --sticky-h: 64px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:'Prompt','Montserrat',system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,'Helvetica Neue',Arial,sans-serif;
  color:var(--ink); background:#fff; line-height:1.65;
  padding-bottom: calc(var(--sticky-h) + var(--safe-bottom)); /* กัน sticky bar ทับ */
}
.container{max-width:var(--max);margin:0 auto;padding:0 20px}
h1,h2,h3{color:var(--primary);margin:0 0 .6em}
h1{font-size:clamp(26px,6vw,44px);line-height:1.15}
h2{font-size:clamp(20px,4.2vw,32px)}
p{margin:.4em 0 1em}
a{text-decoration:none;color:inherit}

/* Buttons */
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:12px 20px;border-radius:999px;font-weight:700;min-height:44px;min-width:44px;
  transition: background-color .25s, transform .25s; touch-action: manipulation;
}
.btn-primary{background:var(--accent);color:#fff}
.btn-primary:hover{background:#e68a00;transform:translateY(-1px)}
.btn-outline{background:transparent;border:2px solid rgba(255,255,255,.85);color:#fff}

/* Header */
.header{position:sticky;top:0;z-index:40;background:rgba(255,255,255,.92);backdrop-filter:blur(8px);border-bottom:1px solid #eef2f7}
.header__inner{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:12px 0;
    min-height: 54px;
}

/* *** CSS สำหรับ Image Logo (ใช้ !important เพื่อบังคับ) *** */
.logo-img{
    height: 54px !important;
    line-height: 54px !important;
    display: block;
    padding: 0;
}
.logo-img img{
    height:54px !important;
    width:auto !important;
    max-width:260px !important;
    display:block;
    vertical-align: middle;
}

/* โค้ดสำหรับ Text Logo ที่เราไม่ต้องการ แต่เก็บไว้กันเหนียว */
.logo-text{display:none;}

.nav{display:flex;gap:18px;align-items:center}
.nav--mobile{display:none}
@media(max-width:980px){.nav{display:none}.nav--mobile{display:block}}

/* Hamburger */
.hamburger{
  display:inline-flex;flex-direction:column;gap:4px;width:44px;height:44px;
  align-items:center;justify-content:center;border:1px solid #e5e7eb;border-radius:8px;background:#fff
}
.hamburger span{width:18px;height:2px;background:#111827}

/* Mobile sheet + lock */
.mobile-panel{
  position:fixed;inset:60px 14px auto 14px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;
  box-shadow:var(--shadow);padding:10px;display:none;z-index:60
}
.mobile-panel.open{display:block}
.mobile-panel a{display:block;padding:12px 10px;border-radius:10px;color:var(--primary);font-weight:500}
.mobile-panel a:hover{background:#f3f4f6}
.body-locked{overflow:hidden;touch-action:none}

/* ===== HERO (Floating Card - Bottom Adjusted) ===== */
.hero{
  position:relative;
  width:100%;
  height:clamp(400px, 70vh, 800px); /* ความสูงรวมของแบนเนอร์ (Desktop) */
  overflow:visible;
  display:block;
  padding: 0;
  /* ปรับ margin-bottom ให้ Promises Grid และ CTA ยื่นออกมาได้ */
  margin-bottom: 220px; /* ปรับเพิ่มเป็น 220px เพื่อรองรับไอคอน 40px */
}

.hero__media{
  position:absolute;
  top:0;left:0;width:100%;height:100%;
  z-index:1;
}
.hero__media picture,.hero__media img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  border:0;
}

/* === สโลแกนที่ 'ลอย' เหนือกล่อง (การแก้ไขที่ 2) === */
.motto-float {
    position: absolute;
    z-index: 5;
    left: 50%;
    top: 65%; /* ปรับตำแหน่งให้ 'ลอย' เหนือกล่องสีน้ำเงิน */
    transform: translate(-50%, -100%);
    color: var(--accent); /* ใช้สี Accent เพื่อความโดดเด่น */
    font-weight: 800;
    margin: 0;
    font-size: clamp(14px,3.8vw,18px);
    text-align: center;
    width: 100%;
    max-width: 600px;
    line-height: 1;
}
/* ================================================= */

/* กล่องข้อความที่ทับซ้อน (Floating Box) - ความทึบ 80% */
.hero-copy{
  position:absolute;
  z-index:3;
  left: 50%;
  bottom: 0; /* ติดด้านล่างของ Hero Media */
  transform: translateX(-50%);

  /* ปรับความทึบเป็น 80% (0.8) */
  background: rgba(10, 36, 99, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color:#fff;
  padding:20px 32px 15px;
  border-radius:var(--radius) var(--radius) 0 0;
  box-shadow:var(--shadow);
  text-align:center;
  max-width:700px;
  width:calc(100% - 40px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.hero-copy h1{
  color:#fff;
  margin-top:0;
  font-size:clamp(30px, 5vw, 48px);
  line-height: 1;
  margin-bottom: 0.3em;
}

.lead{
  max-width:600px;
  margin:6px auto 0;
  color:#fff;
  font-weight:500;
  font-size:clamp(16px, 3vw, 20px);
  line-height: 1.2;
}

/* แถบคำมั่นสัญญา (แยกออกมาอยู่ด้านนอก hero-copy) */
.hero-promises-grid{
  position: absolute;
  z-index: 5;
  bottom: -150px; /* ปรับให้ลงมามากขึ้นเพื่อรองรับไอคอน 40px */
  left: 50%;
  transform: translateX(-50%);

  display:flex;justify-content:center;gap:12px;
  flex-wrap:wrap;
  max-width:900px;
  width:calc(100% - 20px);
  padding: 10px 0;
}
.hero-promise-item{
  font-size:clamp(14px,3.6vw,17px);
  font-weight:600;
  color:var(--primary);

  /* *** แก้ไข: เปลี่ยน Flexbox ให้เรียงแนวตั้งและจัดกึ่งกลาง *** */
  display:flex;
  flex-direction: column;
  align-items:center;
  text-align: center;
  gap:4px; /* ลดช่องว่างระหว่างไอคอนกับข้อความ */

  background:var(--bg-soft);
  border:1px solid #eef2f7;
  border-radius:var(--radius);
  padding:10px 14px; /* ปรับ padding ให้มีพื้นที่รอบไอคอน */
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.hero-promise-item svg{
    width:40px;
    height:40px;
    fill:var(--primary); /* กำหนดสี Navy Blue */
    margin-bottom: 2px;
    flex-shrink: 0; /* ป้องกันการบีบ */
}

/* ************************************************** */
/* ********** การแก้ไข Mobile Display (ปรับตำแหน่งสุดท้าย) ************* */
/* ************************************************** */
@media(max-width:768px){
  .hero{
    height:clamp(300px, 50vh, 500px);
    margin-bottom: 380px;
  }

  .hero-copy h1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(20px, 4.5vw, 28px);
    margin-bottom: 4px;
  }

  .hero-copy .lead {
    font-size: clamp(14px, 3.2vw, 16px);
  }

  .motto-float {
    top: 45%;
    transform: translate(-50%, -100%);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  }

  .hero-copy{
    padding:15px 20px 10px;
    width:calc(100% - 40px);
    bottom: -15%;
    border-radius:var(--radius);
  }

  .lead{margin: 4px auto 0;}

  .hero-promises-grid{
    bottom: -360px;
    gap:8px;
    max-width:100%;
    justify-content: space-around;
  }
  .hero-promise-item{
    font-size:clamp(13px,4vw,16px);
    padding:6px 10px;
    flex-grow:0 !important;
    flex-basis: 48%;
    max-width: 280px;
    justify-content:center;
  }
}

@media(max-width:480px){
  .hero-promises-grid{
    gap: 6px;
    width:calc(100% - 40px);
  }
  .hero-promise-item{
    flex-basis: 48%;
    flex-grow: 1 !important;
    max-width: none;
  }
}

/* Quote Section */
.quote-section{background:var(--bg-soft);padding:34px 0}

/* Sections */
section{padding:56px 0}
.section-head{text-align:center;margin-bottom:28px;padding:0 8px}
.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
.card{
  background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);padding:20px;text-align:center;
  transition:transform .25s,box-shadow .25s;
}
.card:hover{transform:translateY(-4px);box-shadow:0 12px 40px rgba(2,6,23,.15)}
.card .ico svg{width:42px;height:42px;color:var(--primary)}
@media(max-width:980px){.cards{grid-template-columns:1fr 1fr}}
@media(max-width:680px){.cards{grid-template-columns:1fr}}

/* Steps */
.steps__grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}
.step{text-align:center;padding:8px}
.step-num{width:56px;height:56px;background:var(--primary);color:#fff;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;font-weight:800;font-size:20px;border:4px solid #eef2f7;margin-bottom:10px}
@media(max-width:980px){.steps__grid{grid-template-columns:1fr 1fr}}
@media(max-width:680px){.steps__grid{grid-template-columns:1fr}}

/* CTA */
.cta{background:var(--primary);color:#fff;text-align:center}

/* Footer */
.footer{background:#051433;color:#cbd5e1}
.footer a{color:#ccc;transition:color .25s}
.footer a:hover{color:var(--accent)}
.footer__grid{display:grid;grid-template-columns:repeat(4, 1fr);gap:24px}
.footer h4{color:#fff;margin-bottom:12px}
.footer-bottom{border-top:1px solid #223354;text-align:center;padding:16px 0;margin-top:24px}
@media(max-width:980px){.footer__grid{grid-template-columns:1fr 1fr}}
@media(max-width:680px){
  .footer__grid{
    grid-template-columns: 1fr;
  }
  .footer__grid-mobile-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

/* Sticky mobile bar */
.sticky-cta{
  position:fixed;left:0;right:0;bottom:0;
  display:flex;gap:8px;justify-content:space-between;padding:10px 14px calc(10px + var(--safe-bottom)) 14px;
  background:var(--primary);color:#fff;z-index:80;box-shadow:0 -2px 10px rgba(0,0,0,.2);
}
.sticky-cta a{flex:1;text-align:center;font-weight:800;padding:10px 12px;border-radius:10px;background:rgba(255,255,255,.08);color:#fff;transition:background-color .25s;min-height:44px}
.sticky-cta a:hover{background:rgba(255,255,255,.15)}
.sticky-cta a.primary{background:var(--accent)}
.sticky-cta a.primary:hover{background:#e68a00}
@media(min-width:980px){.sticky-cta{display:none}}

/* Motion */
@media (prefers-reduced-motion: reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}

/* CSS สำหรับหน้ารอง (เช่น services.php) */
.page-header{background-color:var(--primary);text-align:center;padding:50px 20px;color:#fff}
.page-header h1{color:#fff;font-size:2.8em;margin:0}
.page-header p{font-size:1.1em;opacity:.9;max-width:700px;margin:10px auto 0}
.service-detail{display:flex;align-items:center;gap:50px;margin-bottom:50px}
.service-detail:nth-child(even){flex-direction:row-reverse}
.service-image{flex:1}
.service-image img{width:100%;height:auto;border-radius:var(--radius);box-shadow:var(--shadow)}
.service-content{flex:1}
.service-content h2{font-size:clamp(24px, 4vw, 36px)}
.service-content .tagline{font-style:italic;color:var(--muted);margin-bottom:20px}
.service-content ul{list-style:none;padding-left:0}
.service-content ul li{padding-left:30px;position:relative;margin-bottom:10px;font-size:1em;}
.service-content ul li::before{content:'\2713';position:absolute;left:0;color:var(--accent);font-weight:bold;font-size:1.2em}
@media(max-width:980px){
  .service-detail,.service-detail:nth-child(even){flex-direction:column}
}

/* --- [อัปเดต] สไตล์สำหรับ Quote Form ในหน้าแรก --- */
.quote-section {
  text-align: center;
}
.quote-section h2 {
  color: var(--primary);
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.quote-form {
  max-width: 800px;
  margin: 1.5rem auto;
  display: flex;
  flex-direction: column; /* Mobile-first: stacked */
  gap: 1rem;
}
.quote-form .form-group {
  text-align: left;
}
.quote-form label {
  display: block; /* Show labels on mobile */
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #333;
}
.quote-form input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 18px 20px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ddd;
}
.quote-form button.button-primary {
  width: 100%; /* Full width on mobile */
  padding: 18px 20px;
  font-size: 1rem;
  font-weight: bold;
  color: #fff;
  background-color: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.quote-form button.button-primary:hover {
  background-color: #e68a00;
}

/* สำหรับหน้าจอ PC (กว้างกว่า 768px) */
@media (min-width: 768px) {
  .quote-form {
    flex-direction: row; /* Horizontal layout */
    align-items: flex-end; /* Align items to the bottom */
    gap: 0.75rem;
  }
  
  /* [ปรับแก้] ทำให้ Label แสดงผลบน PC */
  .quote-form label {
    display: block; /* เปลี่ยนจาก none เป็น block */
    margin-bottom: 0.5rem; /* เพิ่มระยะห่างด้านล่าง */
    font-weight: 500;
    text-align: left; /* จัดข้อความชิดซ้าย */
    color: #333;
  }

  .quote-form .form-group {
    flex-grow: 1; /* Allow input groups to grow and fill space */
    flex-basis: 0;
  }
  .quote-form button.button-primary {
    width: auto; /* Make button width fit its content */
    flex-grow: 0; /* Prevent button from growing */
    white-space: nowrap; /* Keep button text on one line */
  }
}