/* =========================================================
   สวนเมล็ดดี — สไตล์หลัก
   เดสก์ท็อปตามดีไซน์ P-1.png / มือถือ (≤1023px) ตาม P-2.png
   ========================================================= */

:root {
  --green-900: #1f4a14;
  --green-800: #2b5c1c;
  --green-700: #356b22;
  --green-600: #44802c;
  --green-100: #e6efd8;
  --green-50:  #f1f5e9;
  --cream:     #f8f6f0;
  --cream-2:   #f2eee4;
  --sand:      #f6efe2;
  --ink:       #1d2618;
  --muted:     #5d6555;
  --line:      #e3ded1;
  --price:     #9e2a1c;
  --badge-hot: #c8302a;
  --badge-new: #356722;
  --star:      #f2a81d;
  --white:     #ffffff;

  --radius: 14px;
  --shadow: 0 2px 10px rgba(40, 50, 20, .08);
  --container: 1420px;
  --font-head: "Prompt", "Sarabun", system-ui, sans-serif;
  --font-body: "Sarabun", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* หน้าเนื้อหาสั้น: ดันส่วนท้ายเว็บลงไปชิดล่างจอ */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; line-height: 1.25; }
p { margin: 0; }
svg { width: 1em; height: 1em; flex-shrink: 0; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 26px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 17px;
  border: 2px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s, background .15s, box-shadow .15s;
}
.btn svg { width: 22px; height: 22px; }
.btn .chev { width: 14px; height: 14px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green-800); color: var(--white); box-shadow: 0 4px 12px rgba(43, 92, 28, .3); }
.btn-primary:hover { background: var(--green-900); }
.btn-outline { background: rgba(255, 255, 255, .92); color: var(--green-900); border-color: var(--green-800); }
.btn-outline:hover { background: var(--white); }
.btn-dark { background: var(--green-900); color: var(--white); border-color: rgba(255, 255, 255, .7); height: 42px; font-size: 15px; padding: 0 22px; }
.btn-dark:hover { background: #163a0d; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  color: var(--green-900);
  border-bottom: 1px solid var(--green-100);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}
.logo { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; white-space: nowrap; }
.logo-mark { width: 44px; height: 30px; }
.logo-text {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 27px;
  color: var(--green-800);
  letter-spacing: -.3px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-left: 10px;
  padding-left: 26px;
  border-left: 1px solid var(--green-100);
  height: 30px;
}
.main-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 500;
  color: inherit;
  padding: 20px 0;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--green-700); }
.main-nav a.active { color: var(--green-800); font-weight: 600; }
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 12px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--green-700);
}

.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 280px;
  height: 40px;
  padding: 0 16px;
  border: 1.5px solid var(--green-100);
  border-radius: 999px;
  background: var(--green-50);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--green-800); outline: 2px solid var(--green-800); outline-offset: 2px; }
.search svg { width: 18px; height: 18px; color: var(--green-700); }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.main-nav + .header-actions { margin-left: auto; }
.header-order-guide { display: none; }
.search-link { display: none !important; }
.icon-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; color: var(--ink); }
.icon-btn svg { width: 27px; height: 27px; }
.site-header .cart-btn { color: var(--green-900); border-radius: 50%; }
.site-header .cart-btn:hover,
.site-header .cart-btn[aria-current="page"] { color: var(--green-800); background: var(--green-100); }
.cart-count {
  position: absolute;
  top: -1px; right: -3px;
  min-width: 19px; height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--green-700);
  color: var(--white);
  font-size: 11.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--white);
}
.cart-count.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.35); } }

/* ---------- Hero ---------- */
.hero {
  /* รูปยึดกึ่งกลางจอ ซองเมล็ดจึงอยู่ขวาของกึ่งกลางเสมอ ข้อความอยู่ซ้ายไม่ทับกัน */
  background:
    linear-gradient(90deg, rgba(247, 245, 234, .7) 0%, rgba(247, 245, 234, .35) 38%, rgba(247, 245, 234, 0) 55%),
    url("../images/banners/hero-bg.jpg") center / auto 100% no-repeat,
    #e6ead6;
}
@media (min-width: 1960px) { .hero { background-size: auto, cover; } }
.hero-inner {
  min-height: 300px;
  display: flex;
  align-items: center;
}
.hero-text { padding: 24px 0 24px 130px; }
.hero h1 {
  font-size: 46px;
  font-weight: 700;
  color: var(--green-900);
  letter-spacing: -.5px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
}

.hero p { margin-top: 12px; font-size: 19px; color: #2a3323; font-weight: 500; }
.hero-actions { display: flex; gap: 16px; margin-top: 24px; flex-wrap: wrap; }

/* ---------- จุดเด่น ---------- */
.features { background: var(--cream); border-bottom: 1px solid var(--line); }
.features-inner { display: grid; grid-template-columns: repeat(3, 1fr); padding-top: 12px; padding-bottom: 12px; }
.feature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 6px 16px;
}
.feature + .feature { border-left: 1px solid #d9d2c2; }
.feature-icon {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
}
.feature-icon svg { width: 32px; height: 32px; }
.feature h2 { font-size: 19px; font-weight: 600; color: var(--green-900); }
.feature p { font-size: 14px; color: var(--muted); }

/* ---------- หัวข้อ section ---------- */
.section { padding: 18px 0 4px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-head h2 { font-size: 24px; font-weight: 700; color: var(--ink); }

.see-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--green-900);
  flex-shrink: 0;
  white-space: nowrap;
}
.see-all svg { width: 12px; height: 12px; }
.see-all:hover { color: var(--green-600); }

/* ---------- หมวดหมู่ ---------- */
.cat-list { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.cat {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 66px;
  border-radius: 10px;
  overflow: hidden;
  background: #efeadf;
  transition: background .15s, transform .15s;
}
.cat:hover { background: var(--green-100); transform: translateY(-2px); }
.cat img { width: 46%; height: 100%; object-fit: cover; }
.cat-label.sm { font-size: 13px; gap: 6px; white-space: nowrap; }
.cat-label.sm svg { width: 20px; height: 20px; }
.cat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.15;
}
.cat-label svg { width: 24px; height: 24px; color: var(--green-700); }


/* ---------- ป้าย "ขายดี / มาใหม่" บนการ์ด ---------- */
.badge {
  position: absolute;
  top: -8px; left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  color: var(--white);
  font-size: 12.5px;
  font-weight: 600;
  z-index: 2;
}
.badge svg { width: 13px; height: 13px; }
.badge.hot { background: var(--badge-hot); }
.badge.hot svg { color: #ffd34d; }
.badge.new { background: var(--badge-new); }
.price { font-family: var(--font-head); font-weight: 700; }
.empty-note { padding: 24px 0; text-align: center; color: var(--muted); }

/* ---------- การ์ดสินค้า (ใช้ทั้ง "สินค้าขายดี" และ "ผักสวนครัว" ตามดีไซน์ S-1.png) ----------
   ★ ปรับขนาดการ์ดได้ที่ตัวแปร --gc-* ตรงนี้ที่เดียว ★
   ทุกแถวในการ์ดถูกล็อกความสูงไว้ การ์ดทุกใบจึงสูงเท่ากันเสมอ
   แม้ชื่อผักจะยาวไม่เท่ากัน */
:root {
  --gc-gap: 14px;            /* ระยะห่างระหว่างการ์ด */
  --gc-pad: 12px;            /* ระยะขอบด้านในการ์ด */
  /* รูปซองเมล็ด — มาตรฐาน 2:3 แนวตั้ง (ไฟล์รูปแนะนำ 600×900 px)
     ความสูงคำนวณจากความกว้าง × สัดส่วน จึงไม่มีทางเพี้ยน */
  --gc-img-w: 76px;          /* กรอบรูปซองเมล็ด: กว้าง */
  --gc-img-ratio: 1.5;       /* สูง ÷ กว้าง (2:3 = 1.5) */
  --gc-name-size: 14px;      /* ขนาดตัวอักษรชื่อเมล็ด */
  --gc-name-lines: 2;        /* ชื่อเมล็ดกินพื้นที่กี่บรรทัด (ยาวเกินจะตัดเป็น …) */
  --gc-star-size: 11px;      /* ขนาดดาวรีวิว */
  --gc-rating-size: 11.5px;  /* ขนาดตัวเลขรีวิว */
  --gc-price-size: 21px;     /* ขนาดราคา */
  --gc-btn-h: 34px;          /* ความสูงปุ่ม "เพิ่มใส่ตะกร้า" และ "ดูข้อมูล" (เท่ากัน) */
  --gc-btn-font: 13px;       /* ขนาดตัวอักษรบนปุ่ม */
  --gc-card-w-mobile: 250px; /* ความกว้างการ์ดบนมือถือ */
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--gc-gap);
  padding-top: 10px;
}
.g-card {
  position: relative;
  display: grid;
  grid-template-columns: var(--gc-img-w) minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 10px;
  padding: var(--gc-pad);
  background: var(--white);
  border: 1px solid #ebe8df;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.g-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(40, 50, 20, .13); }
.g-img { width: var(--gc-img-w); height: calc(var(--gc-img-w) * var(--gc-img-ratio)); align-self: center; }
.g-img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .12)); }
.g-body { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.g-body h3 {
  font-family: var(--font-body);
  font-size: var(--gc-name-size);
  font-weight: 600;
  line-height: 1.3;
  height: calc(var(--gc-name-size) * 1.3 * var(--gc-name-lines));
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--gc-name-lines);
}
/* ชื่อพันธุ์อยู่บรรทัดที่ 2 เสมอ ยาวเกินจะตัดเป็น … (ไม่ตัดกลางคำ) */
.g-body h3 small { display: block; font-size: inherit; font-weight: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rating {
  display: flex;
  flex-direction: column;
  height: calc(var(--gc-star-size) + 2px + var(--gc-rating-size) * 1.35);
  font-size: var(--gc-rating-size);
  line-height: 1.35;
  color: #444;
  white-space: nowrap;
}
.rating.none { justify-content: center; color: var(--muted); }
.rating .stars { color: var(--star); display: flex; gap: 1px; height: calc(var(--gc-star-size) + 2px); }
.rating .stars svg { width: var(--gc-star-size); height: var(--gc-star-size); }
.g-body .price {
  height: calc(var(--gc-price-size) * 1.25);
  font-size: var(--gc-price-size);
  line-height: 1.25;
  color: var(--green-900);
  white-space: nowrap; /* ราคาและหน่วยอยู่บรรทัดเดียวกันเสมอ */
}
.g-body .price small { font: 500 .62em var(--font-body); color: var(--muted); }
/* แถวปุ่มเต็มความกว้างการ์ด: "เพิ่มใส่ตะกร้า" ซ้าย (ยืด) · "ดูข้อมูล" ขวา */
.g-actions { grid-column: 1 / -1; display: flex; gap: 6px; padding-top: 10px; border-top: 1px dashed #e6e1d3; }
.g-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: var(--gc-btn-h);
  padding: 0 6px;
  border: 1.5px solid var(--green-700);
  border-radius: 7px;
  font: 600 var(--gc-btn-font) var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
}
.g-btn svg { width: calc(var(--gc-btn-font) + 3px); height: calc(var(--gc-btn-font) + 3px); }
.g-btn:active { transform: scale(.95); }
.g-btn.add { flex: 1 1 auto; }
.g-btn.info { flex: 0 0 auto; padding: 0 10px; background: var(--white); color: var(--green-800); }
.g-btn.info:hover { background: var(--green-50); }
.g-btn.add { background: var(--green-700); color: var(--white); }
.g-btn.add:hover { background: var(--green-900); border-color: var(--green-900); }

/* จอแคบกว่า 1440px: แถวละ 6 ใบจะแคบจนปุ่มล้น จึงเปลี่ยนเป็นแถวละ 3 ใบ */
@media (max-width: 1439px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); --gc-img-w: 90px; }
}

/* ---------- หน้าต่างรายละเอียดสินค้า ---------- */
.pd {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.pd::backdrop { background: rgba(20, 30, 10, .5); }

.shop-notice {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow: auto;
  padding: clamp(20px, 5vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 16px 48px rgba(20, 30, 10, .25);
}
.shop-notice::backdrop { background: rgba(20, 30, 10, .55); }
.shop-notice h2 { color: var(--green-900); margin-bottom: 12px; }
.shop-notice p + p { margin-top: 12px; }
.shop-notice ol { margin: 12px 0 0; padding-inline-start: 1.55em; }
.shop-notice li + li { margin-top: 6px; }
.shop-notice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
html:has(.shop-notice[open]) { overflow: hidden; }
.pd[open] { animation: pd-in .18s ease-out; }
@keyframes pd-in { from { opacity: 0; transform: translateY(12px); } }
.pd-inner { position: relative; display: grid; grid-template-columns: 180px 1fr; gap: 22px; padding: 26px; }
.pd-close {
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  background: var(--cream-2);
  font-size: 22px; line-height: 1;
  cursor: pointer;
}
.pd-close:hover { background: var(--line); }
.pd-img { display: grid; place-items: center; padding: 18px; border-radius: 14px; background: var(--cream-2); }
.pd-img img { width: 120px; height: calc(120px * var(--gc-img-ratio)); object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .15)); }
.pd-info { display: flex; flex-direction: column; gap: 8px; padding-right: 26px; }
.pd-info h3 { font-size: 22px; }
.pd-variety { color: var(--muted); font-size: 16px; }
.pd-info .rating { height: auto; flex-direction: row; gap: 6px; align-items: center; font-size: 14px; }
.pd-info .rating .stars { height: auto; }
.pd-info .rating .stars svg { width: 16px; height: 16px; }
.pd-info .price { font-size: 30px; color: var(--green-900); }
.pd-facts { margin: 0; padding: 0; list-style: none; font-size: 15px; color: #333; }
.pd-facts li { padding: 4px 0; border-top: 1px dashed var(--line); }
.pd-info .g-btn { width: 100%; height: 44px; font-size: 16px; margin-top: auto; }
.pd-info .g-btn svg { width: 20px; height: 20px; }

/* ---------- บทความ / เคล็ดลับการปลูก (ดีไซน์ S-2.png) ----------
   ปรับขนาดการ์ดบทความได้ที่ตัวแปร --ac-* ตรงนี้ */
:root {
  --ac-gap: 16px;            /* ระยะห่างระหว่างการ์ด */
  --ac-img-w: 124px;         /* รูปบทความ: กว้าง */
  --ac-img-h: 112px;         /* รูปบทความ: สูง */
  --ac-title-size: 16px;     /* หัวข้อ (2 บรรทัด แบ่งตรงช่องว่างแรก) */
  --ac-desc-size: 14px;      /* คำอธิบาย (2 บรรทัด) */
  --ac-card-w-mobile: 310px; /* ความกว้างการ์ดบนมือถือ */
}

.see-all .arrow { width: 16px; height: 16px; }
.article-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--ac-gap); }
.a-card {
  display: grid;
  grid-template-columns: var(--ac-img-w) minmax(0, 1fr);
  gap: 14px;
  padding: 8px 14px 8px 8px;
  background: var(--white);
  border: 1px solid #ebe8df;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.a-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(40, 50, 20, .13); }
.a-card img { width: var(--ac-img-w); height: var(--ac-img-h); object-fit: cover; border-radius: 10px; }
.a-body { display: flex; flex-direction: column; min-width: 0; padding-top: 4px; }
.a-body h3 span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-body p {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.a-body h3 {
  font-size: var(--ac-title-size);
  font-weight: 600;
  line-height: 1.3;
  height: calc(var(--ac-title-size) * 1.3 * 2);
}
.a-body p {
  margin-top: 4px;
  font-size: var(--ac-desc-size);
  line-height: 1.35;
  height: calc(var(--ac-desc-size) * 1.35 * 2);
  color: var(--muted);
}
.a-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.tag {
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--green-100);
  color: var(--green-900);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.a-foot > svg { width: 18px; height: 18px; color: var(--ink); transition: transform .15s; }
.a-card:hover .a-foot > svg { transform: translateX(3px); color: var(--green-700); }

/* ---------- รับข่าวสาร ---------- */
.newsletter {
  margin-top: 28px;
  color: var(--white);
  background: #304c32;
}
.newsletter-inner { display: flex; align-items: center; gap: 18px; min-height: 64px; padding-top: 18px; padding-bottom: 18px; }
.nl-icon { width: 38px; height: 38px; }
.nl-text h2 { font-size: 21px; font-weight: 600; }
.nl-text p { font-size: 13.5px; opacity: .92; }
.nl-form { display: flex; gap: 12px; margin-left: auto; }
.nl-input {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 320px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--white);
  color: #555;
  border: 2px solid transparent;
}
.nl-input.error { border-color: #e45b4b; }
.nl-input svg { width: 20px; height: 20px; }
.nl-input input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 14px; }

/* ---------- Footer ---------- */
.site-footer { background: #f6f4ee; font-size: 13.5px; }
.footer-inner {
  display: grid;
  grid-template-columns: 2.1fr 1fr 1fr 1.3fr 1fr;
  gap: 0;
  padding-top: 14px;
  padding-bottom: 14px;
}
.footer-brand { display: flex; align-items: center; gap: 18px; padding-left: 40px; padding-right: 20px; }
.footer-brand .logo-text { font-size: 25px; }
.footer-brand p { padding-left: 18px; border-left: 1px solid #cfc8b6; color: #333; }
.footer-col, .footer-social { padding: 0 0 0 32px; border-left: 1px solid #ddd6c6; }
.footer-col:first-of-type { border-left: 0; }
.footer-col :is(h2, h4), .footer-social :is(h2, h4) { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.footer-col a { display: block; color: #333; line-height: 1.65; }
.footer-col a:hover { color: var(--green-700); }
.footer-social { border-left: 1px solid #ddd6c6; }
.socials { display: flex; gap: 10px; margin-top: 8px; }
.socials a { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--white); transition: transform .15s; }
.socials a:hover { transform: scale(1.1); }
.socials svg { width: 19px; height: 19px; }
.s-fb { background: #1877f2; }
.s-line { background: #06c755; }
.s-ig { background: radial-gradient(circle at 30% 110%, #fdd56f 0%, #f7782a 30%, #d62976 60%, #7a3ab8 100%); }
.s-yt { background: #e62117; }
.footer-bottom { background: #4b6b2f; color: #f1f4ea; font-size: 13px; }
.footer-bottom-inner { display: flex; justify-content: space-between; align-items: center; height: 30px; }
.legal { display: flex; gap: 18px; }
.legal a:hover { text-decoration: underline; }

/* ---------- เมนูล่าง & toast ---------- */
.bottom-nav { display: none; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--green-900);
  color: var(--white);
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   จอขนาดกลาง (แล็ปท็อปเล็ก)
   ========================================================= */
@media (max-width: 1280px) {
  .main-nav { gap: 22px; }
  .search { width: 230px; }
  .hero-text { padding-left: 40px; }
  .cat-label.sm svg { display: none; }
  .nl-input { width: 260px; }
  .footer-inner { grid-template-columns: 1.9fr 1fr 1fr 1.3fr 1fr; }
  .footer-col, .footer-social { padding-left: 20px; }
  .footer-brand { padding-left: 0; }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   แท็บเล็ต / มือถือ  — ตามดีไซน์ P-2.png
   ========================================================= */
@media (max-width: 1023px) {
  body { background: #fbfaf6; padding-bottom: 76px; }
  body.home { background: var(--cream); }
  .container { padding: 0 16px; }
  .hide-mobile { display: none !important; }

  /* header */
  .main-nav { display: none; }
  .header-inner { gap: 12px; height: 64px; }
  .header-actions { gap: 6px; }
  .header-order-guide {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    color: var(--green-800);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
  }
  .header-order-guide[aria-current="page"] { text-decoration: underline; }
  .header-order-guide svg { display: none; }
  .logo-mark { width: 38px; height: 26px; }
  .logo-text { font-size: 23px; }
  .search { width: auto; min-width: 0; flex: 1; height: 42px; }
  .search input { font-size: 15px; }
  .bottom-nav .cart-count { background: var(--badge-hot); }

  /* hero → การ์ดมุมมน */
  .hero { background: none; padding: 12px 16px 0; }
  .hero-inner {
    padding: 26px 20px 0;
    min-height: 0;
    display: block;
    border-radius: 18px;
    overflow: hidden;
    background:
      linear-gradient(180deg, rgba(250, 248, 238, .97) 0%, rgba(250, 248, 238, .9) 52%, rgba(250, 248, 238, 0) 70%),
      url("../images/banners/hero-bg.jpg") 74% 100% / auto 250px no-repeat,
      #eef0e2;
    box-shadow: var(--shadow);
  }
  .hero-text { padding: 0 0 220px; }
  .hero h1 { font-size: clamp(26px, 7vw, 36px); }

  .hero p { font-size: clamp(15px, 4vw, 18px); }
  .hero p br { display: none; }
  .hero p strong { white-space: nowrap; }
  .hero-actions { gap: 10px; margin-top: 16px; }
  .btn { height: 44px; padding: 0 20px; font-size: 16px; }

  /* จุดเด่น */
  .features { background: none; border: 0; padding: 14px 16px 0; }
  .features-inner {
    padding: 12px 6px;
    background: var(--cream);
    border-radius: 16px;
  }
  .feature { flex-direction: column; text-align: center; gap: 6px; padding: 4px 6px; }
  .feature-icon { width: 46px; height: 46px; }
  .feature-icon svg { width: 34px; height: 34px; }
  .feature h2 { font-size: 16px; }
  .feature p { font-size: 12px; line-height: 1.35; }

  /* หัวข้อ */
  .section { padding-top: 22px; }
  .section-head h2 { font-size: 21px; }
  .see-all svg { width: 14px; height: 14px; }

  /* หมวดหมู่ → ไทล์สี่เหลี่ยม เลื่อนแนวนอน */
  .cat-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    margin: 0 -16px;
    padding: 2px 16px 6px;
    scrollbar-width: none;
  }
  .cat-list::-webkit-scrollbar { display: none; }
  .cat {
    flex: 0 0 92px;
    flex-direction: column;
    gap: 6px;
    height: auto;
    background: none;
    overflow: visible;
    scroll-snap-align: start;
  }
  .cat:hover { background: none; }
  .cat img { width: 92px; height: 92px; border-radius: 14px; background: var(--cream-2); }
  .cat-label svg { display: none; }
  .cat .cat-label, .cat .cat-label.sm { font-family: var(--font-body); font-weight: 500; font-size: 15px; text-align: center; }




  .badge { top: 6px; left: 6px; }  /* แถวเลื่อนแนวนอนตัดของที่ล้นขอบบน จึงย้ายป้ายเข้ามาในการ์ด */

  /* การ์ดสินค้า → เลื่อนแนวนอน */
  .card-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    margin: 0 -16px;
    padding: 4px 16px 10px;
    scrollbar-width: none;
  }
  .card-grid::-webkit-scrollbar { display: none; }
  .card-grid { --gc-img-w: 86px; --gc-name-size: 15px; }
  .g-card { flex: 0 0 var(--gc-card-w-mobile); scroll-snap-align: start; }
  .pd-inner { grid-template-columns: 1fr; padding: 22px; gap: 16px; }
  .pd-info { padding-right: 0; }

  /* บทความ → เลื่อนแนวนอน */
  .article-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    margin: 0 -16px;
    padding: 4px 16px 10px;
    gap: 12px;
    scrollbar-width: none;
    --ac-img-w: 100px;
    --ac-img-h: 104px;
    --ac-title-size: 15.5px;
    --ac-desc-size: 13px;
  }
  .article-grid::-webkit-scrollbar { display: none; }
  .a-card { flex: 0 0 var(--ac-card-w-mobile); gap: 12px; scroll-snap-align: start; }


  /* รับข่าวสาร */
  .newsletter-inner { flex-wrap: wrap; padding: 20px 16px; gap: 12px; }
  .nl-icon { width: 32px; height: 32px; }
  .nl-text { flex: 1; min-width: 200px; }
  .nl-text h2 { font-size: 18px; }
  .nl-form { width: 100%; margin: 0; flex-wrap: wrap; }
  .nl-input { flex: 1; width: auto; min-width: 0; }

  /* footer */
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 18px 12px; padding-top: 22px; padding-bottom: 22px; }
  .footer-brand { grid-column: 1 / -1; flex-wrap: wrap; gap: 10px 18px; }
  .footer-col, .footer-social { padding: 0; border: 0; }
  .footer-social { grid-column: 1 / -1; }
  .footer-col a { line-height: 1.9; }
  .footer-bottom-inner { flex-direction: column; height: auto; padding: 10px 16px; gap: 4px; text-align: center; }

  /* เมนูล่าง */
  .bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: var(--white);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .05);
  }
  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 2px;
    border-radius: 14px;
    font-size: 12px;
    color: #333;
    white-space: nowrap;
  }
  .bottom-nav svg { width: 26px; height: 26px; }
  .bottom-nav a.active { background: var(--green-100); color: var(--green-800); font-weight: 600; }
  .bn-cart { position: relative; }
  .bn-cart .cart-count { top: 0; right: calc(50% - 26px); background: var(--green-700); }
  .toast { bottom: 92px; }
}

@media (max-width: 767px) {
  .home .hero-inner { background-size: auto, auto 200px, auto; }
  .home .hero-text { padding-bottom: 170px; }
}

@media (max-width: 380px) {
  .logo-text { font-size: 19px; }
  .logo-mark { width: 30px; }
}

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

/* =========================================================
   หน้ารอง: หน้ารวมสินค้า (products.html) และตะกร้า (cart.html)
   ========================================================= */
[hidden] { display: none !important; }

.page-head { background: var(--sand); border-bottom: 1px solid var(--line); padding: 14px 0 16px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.crumbs svg { width: 10px; height: 10px; }
.crumbs a:hover { color: var(--green-700); text-decoration: underline; }
.page-head h1 { margin-top: 4px; font-size: 30px; font-weight: 700; color: var(--green-900); }

.link-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0; border: 0; background: none;
  font: inherit; font-weight: 600; color: var(--green-800);
  cursor: pointer;
}
.link-btn:hover { color: var(--badge-hot); text-decoration: underline; }
.link-btn svg { width: 16px; height: 16px; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 48px 16px; text-align: center;
}
.empty-state h2 { font-size: 22px; color: var(--green-900); }
.empty-state p { color: var(--muted); }
.empty-state .btn { margin-top: 10px; }

/* ---------- หน้ารวมสินค้า ---------- */
.shop { padding-top: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border: 1.5px solid #d6d0c1; border-radius: 999px;
  background: var(--white); color: var(--ink);
  font: 500 14.5px var(--font-body);
  white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--green-600); color: var(--green-800); }
.chip.active { background: var(--green-800); border-color: var(--green-800); color: var(--white); }
.chip-n {
  min-width: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--cream-2); color: var(--muted);
  font-size: 12px; font-weight: 600; line-height: 20px; text-align: center;
}
.chip.active .chip-n { background: rgba(255, 255, 255, .2); color: var(--white); }
.chip-sep { width: 1px; align-self: stretch; margin: 4px; background: var(--line); flex-shrink: 0; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 4px; }
.result-count { color: var(--muted); }
.result-count strong { color: var(--ink); }
.result-count .link-btn { margin-left: 6px; font-size: 14px; }
.sort { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.sort select {
  height: 36px; padding: 0 12px; border: 1.5px solid #d6d0c1; border-radius: 8px;
  background: var(--white); color: var(--ink); font: 500 14px var(--font-body); cursor: pointer;
}
.sort select:focus { outline: 2px solid var(--green-600); outline-offset: 1px; }
.card-grid.full { row-gap: 22px; padding-bottom: 8px; }

/* ---------- ตะกร้าสินค้า ---------- */
.cart-page { padding-top: 22px; }
#categories, #bestsellers, #articles, #sum-title { scroll-margin-top: 84px; }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.cart-list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--muted); font-weight: 500; }
.cart-list-head .link-btn { font-size: 14px; color: var(--muted); }
.cart-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.ci {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto 96px 40px;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid #ebe8df;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.ci-img { width: 64px; height: calc(64px * var(--gc-img-ratio)); }
.ci-img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .12)); }
.ci-info { min-width: 0; }
.ci-info h3 { font-family: var(--font-body); font-size: 16px; font-weight: 600; }
.ci-variety { font-size: 14px; color: var(--muted); }
.ci-unit { margin-top: 2px; font-size: 14px; color: #444; }
.ci-total { font-size: 19px; color: var(--green-900); text-align: right; }
.ci-remove {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer;
}
.ci-remove svg { width: 20px; height: 20px; }
.ci-remove:hover { background: #fbe9e6; color: var(--badge-hot); }

.qty { display: inline-flex; align-items: center; border: 1.5px solid #d6d0c1; border-radius: 10px; background: var(--white); overflow: hidden; }
.qty button {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 0; background: none; color: var(--green-800); cursor: pointer;
}
.qty button svg { width: 15px; height: 15px; }
.qty button:hover:not(:disabled) { background: var(--green-50); }
.qty button:disabled { color: #c4c0b5; cursor: default; }
.qty input {
  width: 44px; height: 36px; border: 0; border-inline: 1px solid #e6e1d3;
  text-align: center; font: 600 16px var(--font-body); color: var(--ink);
  -moz-appearance: textfield; appearance: textfield;
}
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { outline: 2px solid var(--green-600); outline-offset: -2px; }

.cart-summary {
  position: sticky; top: 84px;
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px;
  background: var(--white);
  border: 1px solid #ebe8df;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cart-summary h2 { font-size: 20px; }
.sum-rows { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sum-rows div { display: flex; justify-content: space-between; gap: 12px; }
.sum-rows dt { color: #444; }
.sum-rows dd { margin: 0; font-weight: 600; }
.sum-rows .free { color: var(--badge-new); }
.free-ship { padding: 10px 12px; border-radius: 10px; background: var(--green-50); font-size: 14px; }
.free-ship p { display: flex; align-items: center; gap: 6px; }
.free-ship p svg { width: 20px; height: 20px; color: var(--green-700); }
.free-ship strong { color: var(--green-900); }
.fs-bar { height: 6px; margin-top: 8px; border-radius: 999px; background: #dfe6d2; overflow: hidden; }
.fs-bar span { display: block; height: 100%; border-radius: inherit; background: var(--green-600); transition: width .3s; }
.free-ship.done { background: var(--green-100); font-weight: 600; color: var(--green-900); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; border-top: 1px dashed var(--line); font-weight: 600; }
.sum-total .price { font-size: 28px; color: var(--green-900); }
.checkout { justify-content: center; width: 100%; }
.continue { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14.5px; font-weight: 600; color: var(--green-800); }
.continue:hover { text-decoration: underline; }
.continue svg { width: 11px; height: 11px; }
.flip { transform: scaleX(-1); }
.cart-empty .empty-icon { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--green-100); color: var(--green-700); }
.cart-empty .empty-icon svg { width: 42px; height: 42px; }

@media (max-width: 1023px) {
  .page-head { padding: 10px 0 12px; }
  .page-head h1 { font-size: 24px; }

  /* ชิปเลื่อนแนวนอนบนมือถือ */
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .toolbar { margin-top: 10px; }

  /* หน้ารวมสินค้าใช้ตาราง ไม่ใช่แถวเลื่อน */
  .card-grid.full {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    overflow: visible;
    margin: 0;
    padding: 10px 0 8px;
  }
  .card-grid.full .g-card { flex: none; }

  .cart-layout { grid-template-columns: 1fr; gap: 18px; }
  .cart-summary { position: static; }
}

@media (max-width: 600px) {
  /* แถวสินค้าในตะกร้า: รูป | ชื่อ (ลบ) / จำนวน | ราคารวม */
  .ci {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-areas: "img info remove" "img qty total";
    gap: 8px 12px;
    padding: 12px;
  }
  .ci-img { grid-area: img; width: 56px; height: calc(56px * var(--gc-img-ratio)); align-self: start; }
  .ci-info { grid-area: info; }
  .ci-remove { grid-area: remove; align-self: start; justify-self: end; width: 34px; height: 34px; margin: -4px -4px 0 0; }
  .qty { grid-area: qty; justify-self: start; }
  .ci-total { grid-area: total; align-self: center; }
  .ci-info h3 { font-size: 15px; }
}

/* ช่องที่ยังต้องกรอกข้อมูลจริง — แถบเหลืองเห็นชัด (หายเองเมื่อกรอก SHOP ใน js/data.js) */
mark { background: none; color: inherit; }
.todo { padding: 0 5px; border-radius: 4px; background: #fff0a8; color: #6b4a00; font-weight: 600; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

.page-sub { margin-top: 4px; color: var(--muted); }
.cart-page, .doc-page, .contact-page { min-height: 46vh; padding-bottom: 36px; }
.sum-note { text-align: center; font-size: 13px; color: var(--muted); text-decoration: underline; }
.sum-note:hover { color: var(--green-700); }

/* ข้อความยินยอมใต้ช่องสมัครรับข่าวสาร */
.nl-form { flex-wrap: wrap; }
.nl-consent { flex-basis: 100%; font-size: 12.5px; opacity: .9; }
.nl-consent a { margin-left: 4px; text-decoration: underline; font-weight: 600; }

/* ---------- หน้าเอกสาร (นโยบาย) ---------- */
.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 860px); gap: 28px; align-items: start; }
.doc-toc {
  position: sticky; top: 84px;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid #ebe8df;
  border-radius: var(--radius);
}
.doc-toc h2 { font-size: 15px; margin-bottom: 6px; color: var(--muted); }
.doc-toc ol { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.doc-toc li { padding: 3px 0; }
.doc-toc a:hover { color: var(--green-700); text-decoration: underline; }
.doc {
  padding: 26px 32px 32px;
  background: var(--white);
  border: 1px solid #ebe8df;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 16px;
  line-height: 1.75;
}
.doc h2 { margin: 28px 0 8px; font-size: 20px; color: var(--green-900); scroll-margin-top: 84px; }
.doc > h2:first-of-type { margin-top: 18px; }
.doc p + p { margin-top: 8px; }
.doc ul, .doc ol { margin: 6px 0 10px; padding-left: 22px; }
.doc li { margin: 4px 0; }
.doc li::marker { color: var(--green-600); }
.doc a { color: var(--green-700); text-decoration: underline; }
.doc .lead { font-size: 17px; color: #333; }
.doc-facts { margin: 0; display: grid; gap: 6px; }
.doc-facts div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.doc-facts dt { color: var(--muted); }
.doc-facts dd { margin: 0; }
.table-wrap { overflow-x: auto; margin: 8px 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.doc th, .doc td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc th { background: var(--green-50); color: var(--green-900); font-family: var(--font-head); font-weight: 600; white-space: nowrap; }
.doc-highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.doc-highlights > div {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 16px; border-radius: 12px; background: var(--green-50);
  font-size: 14px; line-height: 1.45;
}
.doc-highlights svg { width: 28px; height: 28px; color: var(--green-700); margin-bottom: 4px; }
.doc-highlights strong { font-size: 15.5px; color: var(--green-900); }
.doc-highlights span { color: var(--muted); }
.steps { counter-reset: step; list-style: none; padding-left: 0 !important; }
.steps li { position: relative; padding-left: 40px; margin: 10px 0; counter-increment: step; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--green-700); color: var(--white);
  font: 600 14px var(--font-head);
}

/* ---------- ติดต่อเรา ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.contact-pending { padding: 18px 20px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--white); color: var(--muted); text-align: center; }
.c-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 24px 16px 20px; text-align: center;
  background: var(--white);
  border: 1px solid #ebe8df;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.c-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; color: var(--white); margin-bottom: 4px; }
.c-icon svg { width: 30px; height: 30px; }
.c-line .c-icon { background: #06c755; }
.c-phone .c-icon { background: var(--green-700); }
.c-mail .c-icon { background: #c27a1a; }
.c-fb .c-icon { background: #1877f2; }
.c-card h2 { font-size: 18px; }
.c-card p { font-size: 16px; word-break: break-word; }
.c-card .btn { height: 40px; margin-top: 8px; font-size: 15px; padding: 0 20px; }
.contact-info { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.contact-info > div {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 20px; border-radius: var(--radius); background: var(--sand);
}
.contact-info > div > svg { width: 28px; height: 28px; color: var(--green-700); margin-top: 2px; }
.contact-info h2 { font-size: 17px; margin-bottom: 2px; }
.contact-help { margin-top: 28px; }
.contact-help > h2 { font-size: 20px; margin-bottom: 10px; }
.help-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.help-links a {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-radius: 12px;
  background: var(--white); border: 1px solid #ebe8df;
  font-weight: 600; transition: border-color .15s, color .15s;
}
.help-links a:hover { border-color: var(--green-600); color: var(--green-800); }
.help-links svg { width: 22px; height: 22px; color: var(--green-700); }
.help-links .chev { width: 12px; height: 12px; margin-left: auto; color: var(--muted); }

@media (max-width: 1023px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .doc-toc { position: static; }
  .doc { padding: 18px 18px 24px; font-size: 15.5px; overflow-wrap: anywhere; }
  .doc-highlights { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .contact-info, .help-links { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 600px) {
  .doc-facts div { grid-template-columns: 80px 1fr; }
  .c-card { padding: 18px 10px 16px; }
  .c-card p { font-size: 14.5px; }
}

/* ปุ่มสั่งซื้อทาง LINE (หน้าตะกร้า) */
.btn-line { background: #06763a; color: var(--white); }
.btn-line:hover { background: #055b2e; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.checkout-note { margin-top: -6px; font-size: 13px; line-height: 1.5; color: var(--muted); text-align: center; }
.copy-order { align-self: center; font-size: 14px; text-decoration: underline; }

/* ---------- หมวดหมู่ 8 หมวด (แคตตาล็อก 80 ชนิด) ----------
   เดสก์ท็อป 4 หมวดต่อแถว × 2 แถว · มือถือเลื่อนแนวนอนเหมือนเดิม */
.cat-list { grid-template-columns: repeat(4, 1fr); gap: 12px 16px; }
.cat:nth-child(n+9) { display: none !important; }   /* สูงสุด 8 หมวด */
@media (min-width: 1024px) { .cat img { width: 40%; } }
.cat-label > span { white-space: normal; }
.pd-cat { align-self: flex-start; font-size: 12.5px; }
.pd-cat:hover { background: var(--green-600); color: var(--white); }

@media (max-width: 1023px) {
  .cat-label { flex-direction: column; }
  .cat .cat-label { width: 92px; font-size: 14px; line-height: 1.25; }
}
.cat-label .nw { white-space: nowrap; }

/* =========================================================
   ราคาส่งขั้นบันได · ใบสั่งซื้อ · ช่องจำนวนบนการ์ด · แถบสรุปติดล่างจอ
   ========================================================= */

/* ---------- ราคาบนการ์ด: ราคาปลีก + ราคาส่งต่ำสุด ---------- */
.g-price { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
.tier-hint { font-size: 12.5px; font-weight: 600; color: var(--green-700); white-space: nowrap; }

/* ---------- ช่องจำนวนในการ์ด (แทนปุ่ม "เพิ่มใส่ตะกร้า" เมื่ออยู่ในตะกร้าแล้ว) ---------- */
.g-cta { flex: 1 1 auto; display: flex; min-width: 0; }
.g-cta .g-btn.add { width: 100%; }
.qty.g-qty { display: flex; width: 100%; height: var(--gc-btn-h); border-color: var(--green-700); border-radius: 7px; }
.g-qty button { width: 32px; height: 100%; }
.g-qty input { flex: 1; min-width: 0; width: auto; height: 100%; font-size: 15px; }
.qty input { width: 60px; }
.qty input::placeholder { color: #8a8f80; font-weight: 500; }

/* ---------- บันไดราคา (หน้าแรก / ตะกร้า) ---------- */
.ladder { display: flex; align-items: flex-end; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ladder li {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 96px; padding: 8px 12px;
  margin-bottom: calc(var(--step, 0) * 6px);   /* ขั้นบันได: สั่งมาก (ขวา) อยู่สูงกว่า */
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--white);
}
.l-range { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.l-price { font-size: 13px; color: var(--muted); white-space: nowrap; }
.l-price .price { font-size: 19px; color: var(--green-900); }
.ladder li.on { background: var(--green-800); border-color: var(--green-800); }
.ladder li.on .l-range, .ladder li.on .l-price, .ladder li.on .price { color: var(--white); }

/* ---------- แถบราคาส่งบนหน้าแรก ---------- */
.wholesale { background: var(--cream); }
.ws-inner { display: flex; align-items: center; gap: 28px; padding-top: 18px; padding-bottom: 18px; }
.ws-text { flex: 0 1 460px; }
.nowrap { white-space: nowrap; }
.ws-text h2 { font-size: 22px; color: var(--green-900); }
.ws-text p { margin-top: 2px; font-size: 14.5px; color: var(--muted); }
.ws-ladder { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ws-ladder::-webkit-scrollbar { display: none; }
.ws-cta { flex-shrink: 0; margin-left: auto; }

/* ---------- สั่งซื้ออย่างไร (ใต้แถบราคาส่ง) ---------- */
.how { display: flex; align-items: center; gap: 28px; padding-top: 14px; padding-bottom: 16px; }
.how-title { flex: 0 0 auto; display: flex; flex-direction: column; font-size: 16px; color: var(--green-900); }
.how-title h3 { font-size: inherit; }
.how-title span { font: 500 13px var(--font-body); color: var(--muted); }
.how-steps { flex: 1 1 auto; display: flex; gap: 24px; margin: 0; padding: 0; list-style: none; counter-reset: how; }
.how-steps li { flex: 1 1 0; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; counter-increment: how; }
.how-steps li::before {
  content: counter(how);
  grid-row: span 2;
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--green-100); color: var(--green-800);
  font: 700 14px var(--font-head);
}
.how-steps strong { font-size: 15px; line-height: 1.35; }
.how-steps span { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.how-line { flex-shrink: 0; height: 42px; font-size: 15px; padding: 0 20px; }
.how-line svg { width: 20px; height: 20px; }

/* ---------- ปุ่มสลับ การ์ด / ใบสั่งซื้อ ---------- */
.toolbar .view-toggle { margin-left: auto; }
.view-toggle { display: inline-flex; padding: 3px; gap: 2px; border: 1.5px solid #d6d0c1; border-radius: 10px; background: var(--white); }
.view-toggle button {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 0; border-radius: 7px; background: none;
  font: 600 14px var(--font-body); color: var(--muted); cursor: pointer;
}
.view-toggle button svg { width: 17px; height: 17px; }
.view-toggle button:hover { color: var(--green-800); }
.view-toggle button[aria-pressed="true"] { background: var(--green-800); color: var(--white); }
.view-toggle button:focus-visible, .s-name:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; }

/* ---------- ใบสั่งซื้อ (ตาราง) ---------- */
.sheet-wrap { padding-top: 10px; }
.sheet-help { margin-bottom: 10px; font-size: 14px; color: var(--muted); }
.sheet {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  background: var(--white);
  border: 1px solid #ebe8df; border-radius: var(--radius);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.sheet thead th {
  padding: 10px 16px;
  background: var(--cream-2);
  font: 600 13.5px var(--font-body); color: var(--muted); text-align: left;
}
.sheet tbody th, .sheet td { padding: 6px 16px; border-top: 1px solid #efebe1; text-align: left; font-weight: inherit; }
.sheet .s-qty { width: 1%; white-space: nowrap; text-align: right; }
.sheet .s-price { width: 1%; white-space: nowrap; }
.sheet .s-price .price { font-size: 16px; color: var(--green-900); }
.sheet .s-cat { color: var(--muted); font-size: 14px; }
.sheet tbody tr.in-cart { background: var(--green-50); }
.sheet tbody tr.in-cart .s-name span { color: var(--green-900); }
.s-name {
  display: flex; align-items: center; gap: 12px;
  padding: 2px 0; border: 0; background: none;
  font: 600 15.5px var(--font-body); color: var(--ink); text-align: left; cursor: pointer;
}
.s-name img { width: 26px; height: 39px; object-fit: contain; flex-shrink: 0; }
.s-name small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
.s-name:hover span { text-decoration: underline; text-underline-offset: 3px; }
.s-qty-ctl input { width: 72px; }

/* ---------- ราคาส่งในตะกร้า ---------- */
.tier-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.tier-box h3 { font-size: 15.5px; color: var(--green-900); }
.tier-box h3 span { font: 500 12.5px var(--font-body); color: var(--muted); margin-left: 4px; }
.tier-box p { color: #444; }
.tier-box strong { color: var(--green-900); }
.tier-box .ladder { overflow-x: auto; scrollbar-width: none; gap: 4px; }
.tier-box .ladder li { min-width: 0; flex: 1 0 auto; padding: 6px 8px; }
.tier-box .l-price .price { font-size: 16px; }
.tb-bar, .ob-progress { height: 5px; border-radius: 999px; background: #dfe6d2; overflow: hidden; }
.tb-bar span, .ob-progress span { display: block; height: 100%; border-radius: inherit; background: var(--green-600); transition: width .35s cubic-bezier(.2, .8, .2, 1); }
.ci-unit s { margin-left: 4px; font-size: 13px; color: var(--muted); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ---------- แถบสรุปติดล่างจอ ---------- */
.order-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  background: var(--white);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(40, 50, 20, .08);
}
.ob-inner { display: flex; align-items: center; gap: 18px; padding-top: 10px; padding-bottom: 10px; }
.ob-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; max-width: 620px; }
#ob-count { font-size: 15.5px; }
#ob-count strong { font-family: var(--font-head); color: var(--green-900); }
.ob-tier { font-size: 13.5px; color: var(--muted); }
.ob-tier strong { color: var(--green-900); }
.ob-btn { flex-shrink: 0; margin-left: auto; height: 44px; font-size: 16px; }
body.has-order-bar { padding-bottom: 86px; }
body.has-order-bar .toast { bottom: 100px; }

@media (min-width: 1024px) {
  .ob-mobile-only { display: none !important; }
}
@media (max-width: 1023px) {
  .ws-inner { flex-wrap: wrap; gap: 12px 16px; padding-top: 16px; padding-bottom: 16px; }
  .ws-text { flex: 1 1 100%; }
  .ws-text h2 { font-size: 19px; }
  .ws-ladder { flex: 1 1 100%; margin: 0 -16px; padding: 0 16px; }
  .ws-cta { margin-left: 0; height: 42px; font-size: 15px; }
  .how { flex-direction: column; align-items: stretch; gap: 12px; padding-top: 14px; padding-bottom: 18px; }
  .how-steps { flex-direction: column; gap: 10px; }
  .how-line { align-self: flex-start; }
  .sheet .s-cat { display: none; }
  .order-bar { bottom: calc(75px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 14px rgba(40, 50, 20, .07); }
  .ob-inner { gap: 12px; padding-top: 8px; padding-bottom: 8px; }
  .ob-btn { height: 40px; padding: 0 16px; font-size: 14.5px; }
  .ob-btn svg { display: none; }
  #ob-count { font-size: 14.5px; }
  .ob-tier { font-size: 12.5px; line-height: 1.4; }
  .order-bar .mix { display: none; }
  body.has-order-bar { padding-bottom: 160px; }
  body.has-order-bar .toast { bottom: 172px; }
}
@media (max-width: 600px) {
  .toolbar .view-toggle { margin-left: 0; }
  .toolbar { gap: 10px; }
  .result-count { flex-basis: 100%; }
  .sort { margin-left: auto; font-size: 0; gap: 0; }   /* ซ่อนคำว่า "เรียงตาม" (ยังอ่านได้ด้วยโปรแกรมอ่านหน้าจอ) ให้อยู่แถวเดียวกับปุ่มสลับ */
  .sheet .s-price { display: none; }
  .sheet tbody th, .sheet td { padding: 6px 10px; }
  .sheet thead th { padding: 9px 10px; }
  .s-name { font-size: 15px; gap: 10px; }
  .s-qty-ctl button { width: 34px; }
  .s-qty-ctl input { width: 56px; }
}

/* หน้าแรก: การ์ดสินค้าและส่วนท้าย */
.home .g-card { border-radius: 8px; box-shadow: none; }
.home .g-card:hover { border-color: #aaa998; box-shadow: 0 3px 10px rgba(40, 50, 20, .08); transform: none; }
.home .cat, .home .cat img, .home .a-card { border-radius: 8px; }
.home .ws-text p { text-wrap: pretty; }

/* ส่วนท้ายเว็บแบบเดียวกันทุกหน้า */
@media (min-width: 768px) {
  .footer-inner { display: flex; align-items: flex-start; gap: 24px; padding-block: 24px; }
  .footer-brand { flex: 1.4 1 0; display: grid; gap: 8px; padding: 0; }
  .footer-brand p { padding: 0; border: 0; }
  .footer-col, .footer-social { flex: 1 1 0; min-width: 0; padding: 0; border: 0; }
  .socials { flex-wrap: wrap; }
}

@media (max-width: 400px) {
  .header-order-guide { min-width: 36px; }
  .header-order-guide svg { display: block; width: 22px; height: 22px; }
  .header-order-guide span { display: none; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  body.home { padding-bottom: 0; }
  .home .container { padding-inline: 24px; }
  .header-inner { gap: 16px; padding-inline: 24px; }
  .main-nav { display: flex; gap: 14px; margin: 0; padding-left: 14px; }
  .main-nav a { font-size: 14px; }
  .header-order-guide { display: none; }
  .home .bottom-nav { display: none; }
  .home .hero { padding: 0; }
  .home .hero-inner {
    display: flex;
    min-height: 300px;
    border-radius: 0;
    box-shadow: none;
    background: linear-gradient(90deg, rgba(247, 245, 234, .88) 26%, rgba(247, 245, 234, .7) 42%, transparent 71%),
      url("../images/banners/hero-bg.jpg") center right / auto 100% no-repeat #e6ead6;
  }
  .home .hero-text { padding: 20px 0; }
  .home .hero p { font-size: 16px; }
  .home .hero p br { display: initial; }
  .home .features { padding: 0; background: var(--cream); }
  .home .features-inner { border-radius: 0; }
  .home .feature { flex-direction: row; text-align: left; gap: 10px; }
  .home .feature-icon { flex-shrink: 0; }
  .home .how-steps { flex-direction: row; }
  .home .cat-list, .home .card-grid, .home .article-grid {
    display: grid;
    margin: 0;
    padding-inline: 0;
    overflow: visible;
  }
  .home .cat-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home .cat { flex-direction: row; gap: 8px; height: 66px; background: #efeadf; overflow: hidden; }
  .home .cat img { width: 34%; height: 100%; border-radius: 0; }
  .home .cat .cat-label { width: auto; font-size: 13px; text-align: left; align-items: flex-start; }
  .home .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); --gc-img-w: 72px; }
  .home .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home .ws-ladder { margin-inline: 0; padding-inline: 0; }
  .home .toast { bottom: 24px; }
}

/* มือถือ: ช่องค้นหาในหัวเว็บแคบเกินไป → แสดงเป็นไอคอนแว่นขยาย พาไปช่องค้นหาในหน้าสินค้า */
@media (max-width: 767px) {
  .site-header .search { display: none; }
  .site-header .search-link { display: grid !important; }
  .header-actions { margin-left: auto; }
}
