/* ============================================================
   core.css — ไฟล์ที่ถูกสร้างขึ้นอัตโนมัติ ห้ามแก้ไฟล์นี้โดยตรง
   แก้ที่ไฟล์ย่อยแล้วรัน  bash build-css.sh
   รวมจาก: variables base header footer floating
   ============================================================ */


/* ===================== variables.css ===================== */
/* ============================================================
   variables.css — Design Tokens ของโปรเจค Enzea
   สี / ระยะ / เงา / ฟอนต์ ทั้งหมดอยู่ที่ไฟล์นี้ไฟล์เดียว
   ============================================================ */

:root {
  /* ---------- Brand / Teal ---------- */
  --c-teal-700: #2F8375;
  --c-teal-600: #3E9A8B;
  --c-teal-500: #50AE9E; /* สีหลัก: ปุ่ม, ตัวอักษรเน้น */
  --c-teal-400: #81CFC2; /* แถบ Highlight */
  --c-teal-300: #A7DED4;
  --c-teal-200: #C8E7E1;
  --c-teal-100: #DCF0EC;

  /* ---------- Mint / Background ---------- */
  --c-mint-50:  #F6FBFA;
  --c-mint-100: #EDF6F5;
  --c-mint-200: #DCEDEA;
  --c-mint-300: #C6E3DE;
  --c-mint-400: #B4DAD3;

  /* ---------- Neutral ---------- */
  --c-ink:     #1C252B; /* พื้น Footer + หัวข้อเข้ม */
  --c-ink-soft:#26313A;
  --c-title:   #2B3439;
  --c-text:    #45565B;
  --c-muted:   #7C8D91;
  --c-line:    #E2ECEB;
  --c-card:    #F7FAFA;
  --c-white:   #FFFFFF;

  /* ---------- Placeholder ---------- */
  --c-ph-bg:   #CFDBDB;
  --c-ph-fg:   #B4C4C4;

  /* ---------- Layout ---------- */
  --container: 1200px;
  --gutter: 24px;
  --header-h: 150px;          /* ความสูง Header ตอนยังไม่ scroll */
  --header-h-sm: 80px;        /* ความสูง Header หลัง scroll / มือถือ */

  /* ---------- Radius ---------- */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* ---------- Shadow ---------- */
  --sh-card: 0 14px 34px rgba(31, 74, 68, 0.07);
  --sh-card-hover: 0 22px 48px rgba(31, 74, 68, 0.13);
  --sh-float: 0 10px 24px rgba(31, 74, 68, 0.22);
  --sh-header: 0 6px 24px rgba(31, 74, 68, 0.08);

  /* ---------- Typography ---------- */
  --f-body: "IBM Plex Sans Thai", "Noto Sans Thai", -apple-system,
            "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --f-display: "Prompt", "IBM Plex Sans Thai", -apple-system,
            "Segoe UI", sans-serif;
  --f-latin: "Poppins", "IBM Plex Sans Thai", -apple-system,
            "Segoe UI", sans-serif;

  /* ---------- Motion ---------- */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --t-fast: .2s var(--ease);
  --t-base: .35s var(--ease);
  --t-slow: .55s var(--ease);
}


/* ===================== base.css ===================== */
/* ============================================================
   base.css — Reset, Typography พื้นฐาน, Layout helper, ปุ่ม
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.85;
  color: var(--c-text);
  background: var(--c-mint-300);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img { max-width: 100%; display: block; border: 0; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast);
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--f-display);
  color: var(--c-title);
  line-height: 1.35;
  font-weight: 500;
}

p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { position: relative; }

/* ---------- Hero ของหน้าเดี่ยวทั่วไป (about / contact / product-list ฯลฯ) ----------
   ใช้ร่วมกันได้ทุกหน้าที่ไม่มีภาพพื้นหลังเฉพาะของตัวเอง
   หน้าไหนต้องการภาพพื้นหลัง (เช่น contact.css ที่มี .page-hero__bg/.page-hero__veil)
   ให้ประกาศทับใน CSS เฉพาะหน้านั้นได้ตามปกติ (โหลดทีหลัง core.css จึงชนะ) */
.page-hero {
  position: relative;
  padding: calc(var(--header-h-sm) + 60px) 0 30px;
  background: linear-gradient(180deg,
      var(--c-mint-50) 0%,
      var(--c-mint-50) 55%,
      var(--c-mint-50) 100%);
  overflow: hidden;
}

/* ---------- หัวข้อ Section + ใบไม้คั่น ---------- */
.section-head {
  text-align: center;
  margin-bottom: 54px;
}

.section-head__title {
  font-family: var(--f-body);
  font-size: 30px;
  font-weight: 500;
  color: var(--c-title);
  letter-spacing: .2px;
}

.leaf-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}

.leaf-divider::before,
.leaf-divider::after {
  content: "";
  width: 70px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-teal-300));
}

.leaf-divider::after { transform: scaleX(-1); }

.leaf-divider svg { width: 24px; height: 24px; color: var(--c-teal-400); }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 22px;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast),
              background-color var(--t-fast), color var(--t-fast);
}

.btn--primary {
  background: var(--c-teal-400);
  color: var(--c-white);
  box-shadow: 0 8px 18px rgba(80, 174, 158, .25);
}

.btn--primary:hover {
  background: var(--c-teal-500);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(80, 174, 158, .34);
}

.btn--ghost {
  background: transparent;
  color: var(--c-teal-600);
  border: 1px solid var(--c-teal-300);
}

.btn--ghost:hover {
  background: var(--c-teal-100);
  transform: translateY(-2px);
}

.btn__arrow { transition: transform var(--t-fast); height: 19px; }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ---------- รูป Placeholder ---------- */
.placeholder {
  display: grid;
  place-items: center;
  background: var(--c-ph-bg);
  border-radius: var(--r-md);
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.placeholder svg {
  width: 42%;
  height: 42%;
  color: var(--c-ph-fg);
}

/* ---------- Animation ตอน Scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Accessibility ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--c-teal-500);
  outline-offset: 3px;
  border-radius: 4px;
}


.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 1rem !important; }
.mt-2 { margin-top: 2rem !important; }

/* ===================== header.css ===================== */
/* ============================================================
   header.css — Section Header
   • เริ่มต้นสูง 150px พื้นหลังโปร่งใส (ทับบน Hero)
   • เมื่อ scroll > 0px จะยุบเหลือ 80px + พื้นหลังขาวโปร่ง + blur
   • มือถือสูง 80px คงที่ + Hamburger menu (animate เป็น X)
   ============================================================ */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  border-bottom: 1px solid transparent;
  transition: height var(--t-base), background-color var(--t-base),
              backdrop-filter var(--t-base), border-color var(--t-base),
              box-shadow var(--t-base);
}

body.is-locked .site-header {
    background-color: #FFFFFF;
}

/* ---- สถานะหลัง Scroll ---- */
.site-header.is-scrolled {
  height: var(--header-h-sm);
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: rgba(31, 74, 68, .07);
  box-shadow: var(--sh-header);
}

.site-header__inner {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* ---------- โลโก้ ---------- */
.brand { display: inline-flex; align-items: center; }

.brand__logo {
  height: 62px;
  width: auto;
  transition: height var(--t-base);
}

.site-header.is-scrolled .brand__logo { height: 48px; }

/* ---------- เมนู Desktop ---------- */
.nav { display: flex; align-items: center; gap: 6px; }

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--c-title);
  white-space: nowrap;
  transition: color var(--t-fast), background-color var(--t-fast);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--c-teal-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-fast);
}

.nav__link:hover { color: var(--c-teal-600); }
.nav__link:hover::after { transform: scaleX(1); }

/* เมนูที่กำลังใช้งาน = pill สีเข้ม */
.nav__link.is-active {
  background: var(--c-teal-400);
  color: var(--c-white);
  font-weight: 500;
  box-shadow: 0 8px 18px rgba(80, 174, 158, .25);
}

.nav__link.is-active::after { display: none; }

/* ---------- ปุ่ม Hamburger (มือถือ) ---------- */
.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border-radius: var(--r-sm);
  transition: background-color var(--t-fast);
}

.hamburger:hover { background: rgba(31, 74, 68, .06); }

.hamburger__box {
  position: relative;
  width: 24px;
  height: 16px;
}

.hamburger__bar {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--c-ink);
  transition: transform var(--t-base), opacity var(--t-fast), top var(--t-base);
}

.hamburger__bar:nth-child(1) { top: 0; }
.hamburger__bar:nth-child(2) { top: 7px; }
.hamburger__bar:nth-child(3) { top: 14px; }

/* animate เป็นเครื่องหมาย X */
.hamburger.is-open .hamburger__bar:nth-child(1) { top: 7px; transform: rotate(45deg); }
.hamburger.is-open .hamburger__bar:nth-child(2) { opacity: 0; transform: scaleX(.4); }
.hamburger.is-open .hamburger__bar:nth-child(3) { top: 7px; transform: rotate(-45deg); }

/* ---------- เมนูแบบ Drawer (มือถือ) ---------- */
.mobile-nav {
  position: fixed;
  inset: var(--header-h-sm) 0 auto 0;
  z-index: 88;
  display: none;
  padding: 8px var(--gutter) 22px;
  background: rgb(255, 255, 255);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(31, 74, 68, .08);
  box-shadow: var(--sh-header);
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition: opacity var(--t-base), transform var(--t-base);
  height: 100dvh;
}

.mobile-nav.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.mobile-nav__link {
  display: block;
  padding: 13px 6px;
  font-size: 16px;
  color: var(--c-title);
  border-bottom: 1px solid var(--c-line);
}

.mobile-nav__link:last-child { border-bottom: 0; }
.mobile-nav__link.is-active { color: var(--c-teal-600); font-weight: 500; }

.mobile-nav__backdrop {
  position: fixed;
  inset: 0;
  z-index: 87;
  display: none;
  /* background: rgba(28, 37, 43, .28); */
  background: #FFFFFF;
  opacity: 0;
  pointer-events: none;          /* ตอนเมนูปิดต้องคลิกทะลุไปหาเนื้อหาข้างหลังได้ */
  transition: opacity var(--t-base);
}

/* responsive.css สั่ง .mobile-nav__backdrop { display: block } ที่จอ ≤768px
   ซึ่งไปทับ [hidden] ของเบราว์เซอร์ ทำให้ฉากหลังยังกางเต็มจออยู่ตลอด
   กฎนี้เจาะจงกว่า (class + attribute) จึงชนะและซ่อนได้จริง */
.mobile-nav__backdrop[hidden] { display: none; }

.mobile-nav__backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   เมนูย่อย (Dropdown) — สร้างจาก components/header.js
   ============================================================ */

.nav__item {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* ---- สถานะตอนเปิดเมนูย่อย : กรอบบาง + ขีดใต้ตัวอักษร ---- */
.nav__item--menu.is-open > .nav__link:not(.is-active) {
  color: var(--c-teal-600);
  box-shadow: inset 0 0 0 1px var(--c-teal-300);
}

.nav__item--menu.is-open > .nav__link:not(.is-active)::after {
  transform: scaleX(1);
}

/* ---- กล่องเมนูย่อย ---- */
.nav__menu {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 5;
  padding-top: 14px;        /* เว้นเป็นสะพานให้เมาส์เลื่อนลงมาได้โดยไม่หลุด hover */
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-6px);
  transition: opacity var(--t-fast), transform var(--t-fast),
              visibility var(--t-fast);
}

.nav__item--menu.is-open > .nav__menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav__menu-card {
  min-width: 208px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--c-white);
  border: 1px solid rgba(31, 74, 68, .05);
  box-shadow: 0 18px 40px rgba(31, 74, 68, .16);
}

.nav__menu-link {
  display: block;
  padding: 11px 16px;
  border-radius: var(--r-sm);
  font-family: var(--f-latin);
  font-size: 15px;
  font-weight: 400;
  color: var(--c-title);
  white-space: nowrap;
  transition: background-color var(--t-fast), color var(--t-fast);
}

.nav__menu-link:hover {
  background: var(--c-teal-100);
  color: var(--c-teal-700);
}

/* ============================================================
   เมนูย่อยบนมือถือ — พับ/กางด้วยปุ่มลูกศร
   ============================================================ */

.mobile-nav__row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--c-line);
}

.mobile-nav__row .mobile-nav__link {
  flex: 1;
  border-bottom: 0;
}

.mobile-nav__toggle {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  color: var(--c-muted);
  transition: transform var(--t-base), background-color var(--t-fast),
              color var(--t-fast);
}

.mobile-nav__toggle:hover { background: rgba(31, 74, 68, .06); }

.mobile-nav__toggle.is-open {
  transform: rotate(180deg);
  color: var(--c-teal-600);
}

.mobile-nav__sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-base);
}

.mobile-nav__sub.is-open { max-height: 400px; }

.mobile-nav__sublink {
  display: block;
  padding: 11px 6px 11px 24px;
  font-family: var(--f-latin);
  font-size: 15px;
  color: var(--c-text);
  border-bottom: 1px solid var(--c-line);
}

.mobile-nav__sublink:hover { color: var(--c-teal-600); }

/* ---- รายการสินค้าที่กำลังเปิดอยู่ ---- */
.nav__menu-link.is-active {
  background: var(--c-teal-100);
  color: var(--c-teal-700);
  font-weight: 500;
}

.mobile-nav__sublink.is-active {
  background: var(--c-teal-100);
  color: var(--c-teal-700);
  font-weight: 500;
  border-radius: var(--r-sm);
  border-bottom-color: transparent;
}


/* ===================== footer.css ===================== */
/* ============================================================
   footer.css — Section Footer
   ============================================================ */

.site-footer {
  position: relative;
  overflow: hidden;
  padding: 68px 0 0;
  background: #18373F;
  color: rgba(255, 255, 255, .78);
  font-size: 13.5px;
  line-height: 1.95;
}

/* ---------- ลวดลายตกแต่งมุมซ้ายล่าง ---------- */
.site-footer__deco {
  position: absolute;
    left: 40px;
    bottom: -214px;
    width: 500px;
    height: 500px;
    pointer-events: none;
    opacity: .03;
}

/* .site-footer__deco::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 40%,
      rgba(80, 174, 158, .30), rgba(80, 174, 158, 0) 62%);
} */

.site-footer__deco svg {
  position: absolute;
  left: 90px;
  top: 60px;
  width: 300px;
  height: 300px;
  color: rgba(126, 200, 150, .22);
}

.site-footer__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 40px 60px;
  align-items: start;
}

/* ---------- คอลัมน์แบรนด์ ---------- */
.footer-brand { text-align: center; }

.footer-brand__logo {
  height: 74px;
  width: auto;
  margin: 0 auto 18px;
}

.footer-brand__text {
  max-width: 460px;
  margin-inline: auto;
  color: rgba(255, 255, 255, .70);
}

/* ---------- คอลัมน์เมนู + ติดต่อ ---------- */
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-bottom: 26px;
}

.footer-nav a {
  font-size: 14px;
  color: rgba(255, 255, 255, .86);
}

.footer-nav a:hover { color: var(--c-teal-400); }

.footer-company__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-white);
  margin-bottom: 4px;
}

.footer-company__addr { color: rgba(255, 255, 255, .70); }

.footer-contact {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-contact li {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-contact svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: rgba(255, 255, 255, .82);
}

.footer-contact a:hover { color: var(--c-teal-400); }

/* ---------- แถบล่างสุด ---------- */
.site-footer__bottom {
  position: relative;
  z-index: 1;
  margin-top: 54px;
  padding: 18px 0 22px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  text-align: center;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .55);
}


/* ===================== floating.css ===================== */
/* ============================================================
   floating.css — ปุ่มลอยมุมขวาล่าง
   • ปุ่มแชท LINE : แสดงตลอดเวลา
   • ปุ่มกลับขึ้นบน : แสดงเมื่อ scroll ลงมาแล้ว (เรียงต่อจากปุ่ม LINE)
   ============================================================ */

.floating {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* ---------- ปุ่มกลับขึ้นบน ---------- */
.to-top {
  order: 1; /* อยู่เหนือปุ่ม LINE */
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c-teal-400);
  color: var(--c-white);
  box-shadow: var(--sh-float);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(.85);
  transition: opacity var(--t-base), transform var(--t-base), visibility var(--t-base),
              background-color var(--t-fast);
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover { background: var(--c-teal-500); }
.to-top svg { width: 20px; height: 20px; }

/* ---------- ปุ่มแชท LINE ---------- */

.line-chat {
  order: 2;
  display: none;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px 0 14px;
  border-radius: var(--r-pill);
  background: var(--c-teal-400);
  color: var(--c-white);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--sh-float);
  transition: background-color var(--t-fast), transform var(--t-fast);
}

.line-chat:hover {
  background: var(--c-teal-500);
  transform: translateY(-2px);
  color: var(--c-white);
}

.line-chat__icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  /* background: var(--c-teal-400); */
}

.line-chat__icon svg {
  width: 100%;
    height: auto;
    color: #FFFFFF;
}

