/* =====================================================================
   J.Food — ระบบดีไซน์ทั้งเว็บ (ไฟล์เดียว เขียนแบบ mobile-first)

   ชุดสี (สัดส่วน 60-30-10)
     60% พื้นกลาง : ครีม --bg + การ์ดขาว
     30% สีแบรนด์  : เหลืองธงเจ --yellow
     10% สีเน้น    : แดงชาด --red (ปุ่มหลัก หมุดร้าน โลโก้)
     สีความหมาย  : เขียว --green ใช้เฉพาะ "เปิดอยู่ / อนุมัติแล้ว"
   คู่สีข้อความหลักตรวจอัตราคอนทราสต์ตาม WCAG AA (≥ 4.5:1)

   สเกลที่ใช้ซ้ำทั้งเว็บ
     มุมโค้ง  : --r-sm 12 (ปุ่ม) · --r-md 18 (การ์ด) · --r-lg 24 (แผงใหญ่)
     ระยะ section : 48px มือถือ / 80px จอใหญ่
     ตัวอักษร : เนื้อหา 16 · รายละเอียด 14 · เล็กสุด 12.5
   ===================================================================== */

:root {
  --yellow: #F4C542;
  --yellow-100: #FCE9B6;
  --yellow-50: #FFF5D8;
  --red: #B92D26;
  --red-700: #92231E;
  --red-50: #FBECE9;
  --ink: #29251F;
  --ink-2: #6B6258;
  --cocoa: #3A1D17;
  --bg: #FFFCF5;
  --surface: #FFFFFF;
  --line: #DFD6C5;
  --line-2: #EDE7DB;
  --green: #236747;
  --green-50: #E8F3EB;
  --star: #986300;
  --on-primary: #FFFFFF;
  --on-secondary: #29251F;
  --focus: #92231E;
  --pin-closed: #8C8178;
  --you: #0866FF;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --sh-1: 0 1px 2px rgba(64, 40, 12, .04), 0 6px 18px rgba(64, 40, 12, .06);
  --sh-2: 0 2px 6px rgba(64, 40, 12, .06), 0 18px 40px rgba(64, 40, 12, .13);
  --ease: cubic-bezier(.22, .8, .24, 1);

  --font-body: "Noto Sans Thai Looped", Tahoma, sans-serif;
  --font-head: "Noto Sans Thai Looped", Tahoma, sans-serif;
  --font-logo: "Noto Serif TC", "Microsoft JhengHei", "PingFang TC", serif;
  --gutter: 20px;
  --tab-h: 70px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.75 var(--font-body);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
body.map-open { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.4; letter-spacing: 0; margin: 0; color: var(--ink); }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 10px; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
/* รูปแทนสำหรับร้านที่ยังไม่มีรูป: ไอคอนประเภทร้านบนพื้นสีของหมวด + ลายจุดจาง ๆ */
.ph {
  --ph-bg: #FDECEA; --ph-fg: #C8282B;
  position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(rgba(255, 255, 255, .55) 1.2px, transparent 1.4px) 0 0 / 14px 14px, var(--ph-bg);
}
.ph .ms { font-size: clamp(28px, 34%, 64px); color: var(--ph-fg); --fill: 1; --opsz: 48; width: auto; height: auto; }
.card__media .ph .ms { font-size: 56px; }
.row__thumb .ph .ms { font-size: 38px; }
.pop__thumb .ph .ms, .hero-pick .ph .ms { font-size: 30px; }
.row__thumb, .pop__thumb { position: relative; }
.ph--noodle { --ph-bg: #FFE9C7; --ph-fg: #B4560C; }
.ph--curry { --ph-bg: #FFF0C2; --ph-fg: #A26A00; }
.ph--veg { --ph-bg: #E3F2E6; --ph-fg: #2C7A45; }
.ph--vegan { --ph-bg: #E6F3DC; --ph-fg: #3F7A22; }
.ph--dimsum { --ph-bg: #FCE4DF; --ph-fg: #B23A2A; }
.ph--dessert { --ph-bg: #FBE3EC; --ph-fg: #A8325E; }
.ph--bakery { --ph-bg: #F5E6D6; --ph-fg: #8A5426; }
.ph--trad { --ph-bg: #FDECEA; --ph-fg: #C8282B; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* ข้อความแจ้งบนแผนที่ เมื่อโหลดภาพแผนที่ไม่ได้ */
.map-note {
  position: absolute; z-index: 3; top: 12px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px);
  padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .95); box-shadow: 0 2px 10px rgba(40, 25, 5, .14);
  font-size: 12.5px; line-height: 1.5; color: var(--ink-2); text-align: center; pointer-events: none;
}
.noscroll { scrollbar-width: none; }
.noscroll::-webkit-scrollbar { display: none; }

/* ไอคอนทั้งเว็บ: Material Symbols Rounded
   ปรับด้วยตัวแปร --fill (0 เส้น / 1 ทึบ), --wght, --opsz */
.ms {
  font-family: "Material Symbols Rounded";
  font-weight: normal; font-style: normal; font-size: 22px; line-height: 1;
  letter-spacing: normal; text-transform: none; white-space: nowrap; word-wrap: normal; direction: ltr;
  display: inline-block; flex: none; width: 1em; height: 1em; overflow: hidden;
  font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; user-select: none;
  font-variation-settings: "FILL" var(--fill, 0), "wght" var(--wght, 500), "GRAD" 0, "opsz" var(--opsz, 24);
}

/* เผยทีละส่วนตอนเลื่อนลง (ทำงานเมื่อมี JS เท่านั้น) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 22px; border-radius: var(--r-sm);
  font: 600 16px/1 var(--font-head); white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s;
}
.btn .ms { font-size: 22px; }
.btn:active { transform: scale(.98); }
.btn--red { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(214, 40, 40, .22); }
.btn--yellow { background: var(--yellow); color: var(--ink); box-shadow: 0 8px 20px rgba(0, 0, 0, .2); }
.btn--sm { height: 44px; padding: 0 16px 0 12px; font-size: 15px; }
.btn--block { width: 100%; }

/* ---------- App bar ---------- */
.appbar {
  position: fixed; inset: 0 0 auto; z-index: 30;
  /* เว้นแถบสถานะของมือถือ เมื่อเปิดในแอป */
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(255, 250, 236, .82);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s, box-shadow .3s;
}
.appbar.is-scrolled { background: rgba(255, 251, 242, .95); border-color: var(--line); box-shadow: 0 6px 24px rgba(64, 40, 12, .06); }
.appbar__inner { display: flex; align-items: center; gap: 12px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand__logo {
  flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--red); color: var(--yellow); font: 900 27px/1 var(--font-logo);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__text strong { font: 700 21px/1.15 var(--font-head); }
.brand__text small { margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.topnav, .appbar .desktop-only { display: none; }
.icon-btn {
  position: relative; flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, background-color .2s;
}
.icon-btn .dot { position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #fff; }

/* ---------- Hero ----------
   โครง: พื้นเหลืองธงเจเต็มจอ + รูปอาหารเต็มขอบด้านขวาที่จางกลืนกับพื้น (ไม่มีกรอบรูป)
   มือถือ/แท็บเล็ต: รูปอยู่บนสุดแล้วจางลงสู่พื้นเหลือง ตามด้วยข้อความ ช่องค้นหา ตัวกรอง และตัวเลข
   --hero-bg ตรงกับสีขอบซ้ายของไฟล์ assets/hero.jpg รูปจึงกลืนกับพื้นได้สนิท */
.hero {
  --hero-bg: #FED94F;
  --hero-ink: #33210F;
  --hero-muted: #5E4620;
  --hero-line: rgba(120, 80, 0, .2);
  position: relative; isolation: isolate; overflow: hidden;
  padding: 68px 0 32px; background: var(--hero-bg); color: var(--hero-ink);
}
/* ลายน้ำ 齋 จาง ๆ */
.hero::before {
  content: "齋"; position: absolute; z-index: -1; left: -48px; bottom: -64px; pointer-events: none;
  font: 900 260px/1 var(--font-logo); color: rgba(190, 110, 0, .07);
}
.hero__media { position: relative; z-index: -1; height: 230px; }
.hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 78% 45%; }
.hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(254, 217, 79, 0) 45%, var(--hero-bg) 100%); }
.hero__flag {
  position: absolute; z-index: 1; top: 76px; right: 12px; width: 52px; height: auto; pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(120, 60, 0, .28)); transform-origin: 50% 0; animation: hero-flag 5s ease-in-out infinite;
}
@keyframes hero-flag { 0%, 100% { transform: rotate(5deg); } 50% { transform: rotate(1deg); } }

.hero__inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: -40px; }
.hero__content, .hero__search { min-width: 0; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--hero-muted); }
.hero-eyebrow .ms { font-size: 20px; color: var(--red); --fill: 1; }
.hero__title { margin: 0 0 10px; font-size: clamp(28px, 8.4vw, 38px); font-weight: 700; line-height: 1.35; letter-spacing: 0; color: var(--hero-ink); }
.hero__title .line { display: block; white-space: nowrap; }
.hero__title strong { font-weight: 700; color: var(--red); }
.hero-description { max-width: 32em; font-size: 15px; line-height: 1.75; color: var(--hero-muted); }

/* ช่องค้นหา: มือถือเป็นการ์ดซ้อน 2 ช่อง + ปุ่มเต็มความกว้าง / จอใหญ่เป็นแถบเดียว */
.search {
  display: grid; grid-template-columns: minmax(0, 1fr); padding: 6px; border-radius: 16px;
  background: #fff; box-shadow: 0 12px 30px rgba(140, 90, 0, .18);
}
.search__field {
  position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; height: 58px; padding: 0 12px;
  border-radius: 10px; cursor: text; transition: background-color .2s, box-shadow .2s;
}
.search__field + .search__field::before { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 1px; background: var(--line-2); }
.search__field:focus-within { background: var(--yellow-50); box-shadow: inset 0 0 0 2px var(--red); }
.search__field:focus-within + .search__field::before, .search__field:focus-within::before { opacity: 0; }
.search__field > .ms { font-size: 24px; color: var(--red); }
.search__body { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.search__label { font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--ink-2); }
.search input, .search select {
  width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent;
  font: 500 16px/1.45 var(--font-body); color: var(--ink);
}
.search input:focus-visible, .search select:focus-visible { outline: 0; }
.search input::placeholder { color: #7A6B5C; opacity: 1; }
.search input::-webkit-search-cancel-button { display: none; }
.search select { -webkit-appearance: none; appearance: none; cursor: pointer; }
.search__field--where { cursor: pointer; }
.search__caret { font-size: 22px; color: var(--ink-2); pointer-events: none; }
.search__btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 50px; margin-top: 6px; padding: 0 24px;
  border-radius: 10px; background: var(--red); color: #fff; font: 600 16px/1 var(--font-head);
  transition: background-color .2s, transform .2s var(--ease);
}
.search__btn .ms { font-size: 22px; }
.search__btn:active { transform: scale(.98); }

.quick { display: flex; gap: 8px; overflow-x: auto; margin: 12px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter) 2px; }
.pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 11px; border-radius: 999px;
  border: 1px solid rgba(160, 110, 0, .22); background: rgba(255, 255, 255, .88); color: var(--hero-ink);
  font-size: 14px; font-weight: 500; white-space: nowrap; transition: background-color .2s, border-color .2s, color .2s;
}
.pill .ms { font-size: 19px; color: var(--red); }
.pill[aria-pressed="true"] { background: var(--hero-ink); border-color: var(--hero-ink); color: #fff; }
.pill[aria-pressed="true"] .ms { color: var(--hero-bg); --fill: 1; }

/* ตัวเลขความน่าเชื่อถือ */
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 4px 0 0; padding: 16px 0 0; list-style: none; border-top: 1px solid var(--hero-line); }
.hero-stats li { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 0 12px; }
.hero-stats li:first-child { padding-left: 0; }
.hero-stats li + li { border-left: 1px solid var(--hero-line); }
.hero-stats b { font: 700 22px/1.25 var(--font-head); color: var(--hero-ink); }
.hero-stats span { font-size: 12.5px; line-height: 1.45; color: var(--hero-muted); }

@media (hover: hover) {
  .search__field:hover:not(:focus-within) { background: #FFFBEF; }
  .search__btn:hover { background: var(--red-700); }
  .pill:hover { background: #fff; border-color: rgba(160, 110, 0, .4); }
  .pill[aria-pressed="true"]:hover { background: #4A3219; }
}
@media (max-width: 359px) {
  .hero-stats li { padding: 0 8px; }
  .hero-stats b { font-size: 19px; }
  .hero-stats span { font-size: 12px; }
}
/* แท็บเล็ต: ยังเรียงลงมา รูปใหญ่ขึ้น ช่องค้นหาเป็นแถบเดียว */
@media (min-width: 768px) {
  .hero { padding: 76px 0 48px; }
  .hero::before { font-size: 340px; }
  .hero__media { height: 340px; }
  .hero__flag { top: 96px; right: 32px; width: 72px; }
  .hero__inner { gap: 22px; margin-top: -64px; }
  .hero__title { font-size: 46px; }
  .hero-description { font-size: 17px; }
  .search { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; align-items: center; padding: 8px; border-radius: 18px; }
  .search__field { height: 62px; }
  .search__field + .search__field::before { left: 0; right: auto; top: 14px; bottom: 14px; width: 1px; height: auto; }
  .search__btn { height: 56px; margin: 0 0 0 8px; border-radius: 12px; }
  .quick { flex-wrap: wrap; overflow: visible; margin: 14px 0 0; padding: 0; }
  .hero-stats { padding-top: 20px; }
  .hero-stats li { padding: 0 20px; }
  .hero-stats b { font-size: 26px; }
  .hero-stats span { font-size: 14px; }
}
/* จอคอม: ข้อความซ้าย รูปเต็มขอบขวาจางกลืนกับพื้น */
@media (min-width: 1024px) {
  .hero { display: flex; align-items: center; min-height: 620px; padding: 76px 0 40px; }
  .hero::before { left: 34%; bottom: -90px; font-size: 400px; }
  .hero__media { position: absolute; inset: 0 0 0 auto; width: 64%; height: auto; }
  .hero__media img { object-position: 82% 50%; }
  .hero__media::after {
    background:
      linear-gradient(90deg, var(--hero-bg) 0%, rgba(254, 217, 79, .82) 14%, rgba(254, 217, 79, 0) 44%),
      linear-gradient(0deg, rgba(254, 217, 79, .55) 0%, rgba(254, 217, 79, 0) 22%);
  }
  .hero__flag { top: 104px; right: 56px; width: 96px; }
  .hero__inner { margin-top: 0; padding-top: 40px; padding-bottom: 24px; }
  .hero__content, .hero__search, .hero-stats { max-width: 620px; }
  .hero__title { font-size: clamp(46px, 4.3vw, 60px); line-height: 1.32; }
  .hero-description { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__flag { animation: none; transform: rotate(4deg); }
}

/* ---------- แถบชวนโปรโมทผ่านเพจ (คาบรอยต่อ hero กับหมวดหมู่) ----------
   มือถือ: ซ้าย = โลโก้ Facebook + จำนวนผู้ติดตาม | ขวา = ข้อความชวน + ลิงก์ลงร้านฟรี
   จอใหญ่: เรียงแถวเดียว และมีปุ่ม "ลงร้านฟรี" ด้านขวา */
.fb-hook {
  position: relative; z-index: 2; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "page body" "page cta";
  align-items: center; column-gap: 14px; margin-top: -24px; padding: 12px 14px 12px 12px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  box-shadow: 0 14px 34px rgba(110, 70, 0, .14);
}
.fb-hook__page {
  grid-area: page; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-width: 104px; padding: 10px 8px; border-radius: var(--r-md); background: #EEF4FF; color: #0B4FD1; text-align: center;
}
.fb-hook__logo { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #0866FF; color: #fff; }
.fb-hook__logo svg { width: 18px; height: 18px; fill: currentColor; }
.fb-hook__num { display: flex; flex-direction: column; line-height: 1.2; }
.fb-hook__num b { font: 700 20px/1.2 var(--font-head); color: #0B4FD1; }
.fb-hook__num small { margin-top: 2px; font-size: 12px; font-weight: 600; color: #3B5A93; }
.fb-hook__body { grid-area: body; min-width: 0; }
.fb-hook__title { font: 700 16px/1.45 var(--font-head); color: var(--ink); }
.fb-hook__title em { font-style: normal; color: var(--red); }
.fb-hook__title .nowrap { white-space: nowrap; }
.fb-hook__sub { margin-top: 2px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.fb-hook__cta {
  grid-area: cta; justify-self: start; display: inline-flex; align-items: center; gap: 2px; height: 36px; margin-top: 8px; padding: 0 8px 0 14px;
  border-radius: 999px; background: var(--red); color: #fff; font: 600 14px/1 var(--font-head); transition: background-color .2s;
}
.fb-hook__cta .ms { font-size: 20px; transition: transform .2s var(--ease); }
/* รูปร้านที่ลงแล้ว ซ้อนกันเป็นวงกลม + จำนวนร้าน (มือถือซ่อน ที่ไม่พอ) */
.fb-hook__shops { display: none; grid-area: shops; align-items: center; gap: 12px; justify-self: end; color: var(--ink); }
.fb-hook__faces { display: flex; }
.fb-hook__faces img {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 3px solid var(--surface);
  background: var(--line); box-shadow: 0 2px 6px rgba(110, 70, 0, .18);
}
.fb-hook__faces img + img { margin-left: -14px; }
.fb-hook__count { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.fb-hook__count b { font: 700 20px/1.2 var(--font-head); color: var(--red); }
.fb-hook__count small { margin-top: 2px; font-size: 13px; color: var(--ink-2); }
/* ระยะหัวข้อหมวดหมู่ถัดจากแถบนี้ ไม่ต้องห่างเท่า section ปกติ */
.fb-hook + .section { margin-top: 36px; }
@media (hover: hover) {
  .fb-hook__page:hover { background: #E2ECFF; }
  .fb-hook__cta:hover { background: var(--red-700); }
  .fb-hook__cta:hover .ms { transform: translateX(3px); }
}
@media (max-width: 359px) {
  .fb-hook { column-gap: 10px; padding: 10px; }
  .fb-hook__page { min-width: 88px; }
  .fb-hook__num b { font-size: 17px; }
  .fb-hook__title { font-size: 15px; }
}
@media (min-width: 768px) {
  .fb-hook {
    grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "page body cta";
    column-gap: 24px; margin-top: -36px; padding: 14px 20px 14px 14px;
  }
  .fb-hook__page { flex-direction: row; gap: 12px; padding: 12px 18px 12px 14px; text-align: left; }
  .fb-hook__logo { width: 44px; height: 44px; }
  .fb-hook__logo svg { width: 22px; height: 22px; }
  .fb-hook__num b { font-size: 26px; }
  .fb-hook__num small { font-size: 13px; }
  .fb-hook__title { font-size: 20px; }
  .fb-hook__sub { font-size: 14.5px; }
  .fb-hook__cta { height: 48px; margin: 0; padding: 0 12px 0 22px; border-radius: var(--r-sm); font-size: 16px; }
  .fb-hook + .section { margin-top: 56px; }
}
@media (min-width: 1024px) {
  .fb-hook { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "page body shops cta"; }
  .fb-hook__shops:not([hidden]) { display: flex; margin-right: 8px; }
}
@media (min-width: 1024px) and (hover: hover) {
  .fb-hook__faces img { transition: transform .2s var(--ease); }
  .fb-hook__shops:hover .fb-hook__faces img { transform: translateY(-2px); }
  .fb-hook__shops:hover .fb-hook__count small { color: var(--red); }
}

/* ---------- หัวข้อ section (รูปแบบเดียวกันทุกส่วน) ---------- */
.section { margin-top: 48px; scroll-margin-top: 88px; }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section__head h2 { font-size: 22px; font-weight: 700; }
.section__note { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.more {
  flex: none; display: inline-flex; align-items: center; height: 40px; margin-right: -8px; padding: 0 6px 0 12px;
  border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--red-700); white-space: nowrap;
  transition: background-color .2s;
}
.more .ms { font-size: 20px; transition: transform .2s var(--ease); }

/* ---------- หมวดหมู่ ---------- */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cat {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 100px; padding: 12px 0; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--sh-1);
  font-size: 13px; font-weight: 600; line-height: 1.3; text-align: center; white-space: nowrap;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .2s, background-color .2s;
}
.cat__icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow-50); transition: background-color .2s; }
.cat__icon .ms { font-size: 26px; color: var(--red); --fill: 1; }
.cat[aria-pressed="true"] { border-color: var(--red); background: #FFF6F4; color: var(--red-700); }
.cat[aria-pressed="true"] .cat__icon { background: var(--red); }
.cat[aria-pressed="true"] .cat__icon .ms { color: #fff; }

/* การ์ดประเภทร้าน: รูปอาหารเต็มใบ ชื่อประเภทบนแถบไล่สีด้านล่าง
   มือถือ: แถวเดียวปัดซ้ายขวา / จอใหญ่: เรียงเต็มแถว */
.catgrid {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 10px; scroll-padding: 0 var(--gutter);
}
.catcard {
  position: relative; isolation: isolate; flex: none; width: 46%; max-width: 210px; aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: 20px; background: var(--cocoa); color: #fff; text-align: left; scroll-snap-align: start;
  box-shadow: 0 8px 22px rgba(90, 50, 10, .16); transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.catcard img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.catcard::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(30, 12, 4, 0) 38%, rgba(30, 12, 4, .55) 62%, rgba(30, 12, 4, .9) 100%);
}
.catcard__count {
  position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px 5px 8px;
  border-radius: 999px; background: var(--yellow); color: var(--cocoa); font-size: 12.5px; font-weight: 700; line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.catcard__count .ms { font-size: 16px; color: var(--red); --fill: 1; }
.catcard__check {
  position: absolute; top: 10px; right: 10px; display: none; place-items: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--red); color: #fff; box-shadow: 0 0 0 3px #fff;
}
.catcard__check .ms { font-size: 20px; }
.catcard__body { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 3px; }
.catcard__body b { font: 700 18px/1.3 var(--font-head); text-shadow: 0 1px 10px rgba(0, 0, 0, .35); }
.catcard__body small { font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, .9); }
.catcard[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--red), 0 12px 26px rgba(150, 30, 20, .25); }
.catcard[aria-pressed="true"] .catcard__check { display: grid; }
.catcard:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (min-width: 768px) {
  /* แถวละไม่เกิน 4 ใบ ขนาดการ์ดคงที่ (มีหมวดเดียวก็ไม่ยืดเต็มจอ) */
  .catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(200px, calc((100% - 54px) / 4)), 1fr)); gap: 18px; overflow: visible; margin: 0; padding: 4px 0 0; }
  .catcard { width: auto; max-width: none; aspect-ratio: 5 / 6; border-radius: 24px; }
  .catcard__body { left: 20px; right: 20px; bottom: 20px; }
  .catcard__body b { font-size: 22px; }
  .catcard__body small { font-size: 14px; }
  .catcard__count { top: 14px; left: 14px; font-size: 13.5px; }
}
@media (min-width: 768px) and (hover: hover) {
  .catcard:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(90, 50, 10, .24); }
  .catcard:hover img { transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .catcard, .catcard img { transition: none; }
}

/* ---------- แผนที่ + ร้านใกล้คุณ ---------- */
.view-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 12px; padding: 4px; border-radius: 14px; background: #F2ECE1; }
.view-switch button {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border-radius: 11px;
  font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background-color .2s, color .2s, box-shadow .2s;
}
.view-switch button[aria-pressed="true"] { background: #fff; color: var(--red-700); box-shadow: 0 2px 8px rgba(56, 41, 13, .08); }
.view-switch .ms { font-size: 20px; }

.mapbox { position: relative; isolation: isolate; height: 340px; overflow: hidden; border-radius: var(--r-lg); background: #F2EFE9; border: 1px solid var(--line); }
.mapbox.is-full { position: fixed; inset: 0; z-index: 60; height: auto; border: 0; border-radius: 0; }
#mapSection.show-list .mapbox:not(.is-full) { display: none; }
#map { position: absolute; inset: 0; z-index: 0; }
.leaflet-container { font-family: var(--font-body); background: #F2EFE9; }
/* ลดความสดของแผนที่ให้เข้ากับโทนครีม หมุดแดงจะได้เด่น */
.leaflet-tile-pane { filter: saturate(.6) sepia(.15) brightness(1.03); }
.leaflet-control-attribution { font-size: 11px; }
.map-legend {
  position: absolute; left: 10px; bottom: 10px; z-index: 2; display: flex; gap: 10px; padding: 6px 12px;
  border-radius: 999px; background: rgba(255, 255, 255, .95); box-shadow: 0 2px 10px rgba(40, 25, 5, .14);
  font-size: 12.5px; font-weight: 500;
}
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend i { width: 10px; height: 10px; border-radius: 50%; }
/* ปุ่มแผนที่รวมไว้มุมขวาล่าง นิ้วโป้งกดถึงง่าย และไม่บังป๊อปอัปร้าน */
.map-ctrl { position: absolute; right: 10px; bottom: 26px; z-index: 2; display: grid; gap: 8px; }
.map-btn { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: #fff; color: var(--ink); box-shadow: 0 2px 10px rgba(40, 25, 5, .18); transition: background-color .2s; }
.map-btn .ms { font-size: 24px; }
.map-zoom { display: grid; overflow: hidden; border-radius: 14px; box-shadow: 0 2px 10px rgba(40, 25, 5, .18); }
.map-zoom .map-btn { border-radius: 0; box-shadow: none; }
.map-zoom .map-btn + .map-btn { border-top: 1px solid var(--line); }
.mapbox.is-full .map-legend { bottom: calc(10px + env(safe-area-inset-bottom)); }
.mapbox.is-full .map-ctrl { bottom: calc(26px + env(safe-area-inset-bottom)); }
.mapbox.is-full .leaflet-bottom { margin-bottom: env(safe-area-inset-bottom); }
.map-hint {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 24px;
  background: rgba(31, 26, 23, .55); color: #fff; font: 600 17px/1.5 var(--font-head); text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.map-hint .ms { display: block; margin: 0 auto 6px; font-size: 44px; --opsz: 48; }
.map-hint.is-show { opacity: 1; }
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--ink-2); }

.pin-icon { background: none; border: 0; }
.pin { position: relative; width: 40px; height: 52px; transform-origin: 50% 100%; transition: transform .2s var(--ease); }
.pin:hover { transform: scale(1.12); }
.pin svg { position: absolute; inset: 0; z-index: 0; width: 40px; height: 52px; filter: drop-shadow(0 4px 5px rgba(60, 20, 0, .3)); }
.pin path { fill: var(--red); stroke: #fff; stroke-width: 2.5; }
.pin--closed path { fill: var(--pin-closed); }
.pin__icon { position: absolute; z-index: 1; left: 7px; top: 7px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff; }
.pin__icon .ms { font-size: 18px; color: var(--red); --fill: 1; --opsz: 20; }
.pin--closed .pin__icon .ms { color: var(--pin-closed); }
.cluster {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow); color: var(--red-700); border: 3px solid #fff; font: 700 18px/1 var(--font-head);
  box-shadow: 0 0 0 6px rgba(214, 40, 40, .2), 0 6px 14px rgba(60, 20, 0, .25);
}
.leaflet-popup-content-wrapper { padding: 0; border-radius: var(--r-md); box-shadow: 0 14px 34px rgba(40, 25, 5, .25); }
.leaflet-popup-content { position: relative; margin: 0; font-size: 15px; line-height: 1.5; }
.leaflet-popup-tip { box-shadow: none; }
.pop { display: flex; gap: 12px; padding: 12px 12px 10px; }
.pop__close { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.pop__close .ms { font-size: 20px; }
.pop__thumb { flex: none; width: 68px; height: 68px; overflow: hidden; border-radius: 14px; background: #F3EDE2; }
.pop__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pop__body { flex: 1; min-width: 0; padding-right: 22px; }
.pop__name { font: 600 16px/1.35 var(--font-head); color: var(--ink); }
.pop__meta { font-size: 13.5px; color: var(--ink-2); }
.pop__foot { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 13.5px; }
.pop__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px 12px; }
.pop__btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; border-radius: var(--r-sm); background: var(--yellow-50); color: var(--ink); font-size: 15px; font-weight: 600; }
.pop__btn .ms { font-size: 20px; }
.leaflet-container a.pop__btn { color: var(--ink); }
.pop__btn--primary { background: var(--red); color: #fff; }

.near-panel { display: none; padding: 8px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--sh-1); }
#mapSection.show-list .near-panel { display: block; }
.near-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 4px 10px; }
.near-panel__head h3 { font-size: 17px; }
.near-list { display: grid; gap: 2px; }

/* ---------- การ์ดร้าน ---------- */
.cards {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 78%); gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 18px; scroll-padding: 0 var(--gutter);
}
.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden; scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--sh-1);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #F3EDE2; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.card__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 10, 0, .22), transparent 34%); pointer-events: none; }
.badges { position: absolute; left: 12px; top: 12px; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .96); box-shadow: 0 2px 6px rgba(0, 0, 0, .1); font-size: 12.5px; font-weight: 600; line-height: 1;
}
.badge--open { color: var(--green); }
.badge--open::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--closed { color: var(--ink-2); }
.badge--feat { background: var(--yellow); color: var(--ink); }
.badge--new { background: var(--red); color: #fff; }
.fav {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, .96); color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  transition: transform .2s var(--ease), color .2s;
}
.fav .ms { font-size: 22px; }
.fav:active { transform: scale(.88); }
.fav[aria-pressed="true"] { color: var(--red); }
.fav[aria-pressed="true"] .ms { --fill: 1; }
.card__body { display: flex; flex: 1; flex-direction: column; gap: 2px; padding: 14px 16px 16px; }
.card__title { font-size: 17px; font-weight: 600; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__title a::after, .row__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card__meta { font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: auto; padding-top: 12px;
  font-size: 14px; color: var(--ink-2);
}
.dist { display: inline-flex; align-items: center; gap: 3px; }
.dist .ms { font-size: 17px; color: var(--red); --fill: 1; }
.rating { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--ink); }
.rating .ms { font-size: 18px; color: var(--star); --fill: 1; --opsz: 20; }
.rating small { font-size: 13px; font-weight: 400; color: var(--ink-2); }
.sep { width: 3px; height: 3px; border-radius: 50%; background: #CDBFAD; }
.status { font-weight: 600; }
.status.is-open { color: var(--green); }

/* ---------- รายการร้าน (แถว) ---------- */
.list { display: grid; gap: 12px; }
.row {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 10px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--sh-1);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background-color .2s;
}
.row__thumb { flex: none; width: 96px; height: 96px; overflow: hidden; border-radius: 14px; background: #F3EDE2; }
.row__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.row__body { flex: 1; min-width: 0; padding-right: 36px; }
.row__title { font-size: 16px; font-weight: 600; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__meta { font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.row__approved {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 3px 10px 3px 6px; border-radius: 999px;
  background: var(--green-50); font-size: 12.5px; font-weight: 600; color: var(--green);
}
.row__approved .ms { font-size: 16px; --fill: 1; }
.row .fav { top: 8px; right: 8px; width: 36px; height: 36px; background: var(--yellow-50); box-shadow: none; }
.row .fav .ms { font-size: 20px; }
/* แถวแบบย่อ ใช้ในแผง "ใกล้คุณที่สุด" */
.row--compact { padding: 8px; background: transparent; border-color: transparent; box-shadow: none; }
.row--compact .row__thumb { width: 76px; height: 76px; border-radius: 12px; }
.row--compact .row__title { font-size: 15.5px; }
.row--compact .row__meta, .row--compact .row__foot { font-size: 13.5px; }
.row--compact .row__foot { margin-top: 3px; }

/* ---------- ผลการค้นหา ---------- */
.results__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.results__head h2 { font-size: 22px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results__count { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.clear-btn {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 14px 0 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; transition: border-color .2s;
}
.clear-btn .ms { font-size: 19px; }
.empty { padding: 36px 20px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-2); text-align: center; color: var(--ink-2); }
.empty b { display: block; margin-bottom: 4px; font: 600 18px/1.4 var(--font-head); color: var(--ink); }
.empty .ms { display: block; margin: 0 auto 8px; font-size: 48px; color: var(--red); --opsz: 48; }
.empty__picks { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.empty__picks .pill .ms { display: inline; margin: 0; font-size: 19px; --opsz: 24; }
.results__title { min-width: 0; }
/* ตัวกรองที่ใช้อยู่ (กดเพื่อเอาออก) + เรียงลำดับ */
.results__bar { display: flex; align-items: center; gap: 10px; margin: -4px 0 16px; }
.results__chips { display: flex; flex: 1; gap: 8px; min-width: 0; overflow-x: auto; }
.fchip {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 8px 0 10px; border-radius: 999px;
  background: var(--yellow-50); border: 1px solid var(--yellow-100); font-size: 14px; font-weight: 600; color: var(--ink);
}
.fchip .ms { font-size: 18px; color: var(--red); }
.fchip .fchip__x { margin-left: 2px; font-size: 17px; color: var(--ink-2); }
.results__sort {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 10px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600;
}
.results__sort .ms { font-size: 19px; color: var(--red); }
.results__sort select { -webkit-appearance: none; appearance: none; border: 0; background: transparent; font: inherit; color: var(--ink); cursor: pointer; }
.results__note { margin: -6px 0 14px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--yellow-50); font-size: 14px; color: var(--ink-2); }
.results__more { margin-top: 16px; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); }
@media (max-width: 559px) {
  /* มือถือจอแคบ: ตัวกรองแถวหนึ่ง เรียงลำดับอีกแถว */
  .results__bar { flex-wrap: wrap; }
  .results__chips { flex-basis: 100%; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }
  .results__chips:empty { display: none; }
}

/* ---------- คำแนะนำระหว่างพิมพ์ค้นหา ---------- */
/* วางตำแหน่ง (left/top/width/max-height) ด้วย home.js ใต้ช่องค้นหา */
.suggest {
  position: fixed; z-index: 45; max-height: 440px; overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--sh-2);
}
.suggest[hidden] { display: none; }
.suggest__head { padding: 8px 12px 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.suggest__item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 10px; border-radius: 12px; text-align: left;
}
.suggest__item[aria-selected="true"] { background: var(--yellow-50); }
.suggest__icon {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; overflow: hidden; border-radius: 10px;
  background: var(--red-50); color: var(--red);
}
.suggest__icon .ms { font-size: 22px; }
.suggest__icon img { width: 100%; height: 100%; object-fit: cover; }
.suggest__item--near .suggest__icon { background: #E7F0FF; color: var(--you); }
.suggest__text { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.35; }
.suggest__text b { overflow: hidden; font-weight: 600; font-size: 15.5px; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.suggest__text small { overflow: hidden; font-size: 13px; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.suggest__go { flex: none; font-size: 20px; color: var(--ink-2); }
.suggest__item--all { border-top: 1px solid var(--line-2); border-radius: 0 0 12px 12px; margin-top: 4px; }
.suggest__item--all .suggest__icon { background: var(--red); color: #fff; }
@media (hover: hover) {
  .suggest__item:hover { background: var(--yellow-50); }
  .fchip:hover { border-color: #EBCB7A; }
  .results__more:hover { border-color: #D9C6A4; }
  .sheet__prov:hover { border-color: var(--red); }
}

/* ---------- เลือกจังหวัดทั้งหมด (มือถือ: แผ่นจากด้านล่าง / จอใหญ่: กล่องกลางจอ) ---------- */
.sheet {
  width: 100%; max-width: 100%; max-height: 86vh; margin: auto 0 0; padding: 0 0 env(safe-area-inset-bottom);
  border: 0; border-radius: 22px 22px 0 0; background: var(--bg); color: var(--ink); box-shadow: var(--sh-2);
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: rgba(30, 20, 10, .45); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 16px 10px 20px; }
.sheet__head h2 { font-size: 19px; }
.sheet__close { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); }
.sheet__search {
  display: flex; align-items: center; gap: 8px; height: 48px; margin: 0 16px 10px; padding: 0 14px;
  border-radius: 12px; background: var(--surface); border: 1.5px solid var(--line);
}
.sheet__search:focus-within { border-color: var(--red); }
.sheet__search .ms { color: var(--red); }
.sheet__search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 500 16px/1.4 var(--font-body); color: var(--ink); }
.sheet__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 4px 16px 20px; overflow-y: auto; }
.sheet__prov {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; padding: 8px 14px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); text-align: left; font-weight: 600;
}
.sheet__prov small { flex: none; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.sheet__empty { grid-column: 1 / -1; padding: 20px; text-align: center; color: var(--ink-2); }
@media (min-width: 768px) {
  .sheet { width: min(720px, calc(100% - 48px)); max-height: 80vh; margin: auto; border-radius: 22px; }
  .sheet__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- แบนเนอร์ (โครงเดียวกัน 3 สี) ---------- */
.banners {
  display: grid; grid-auto-flow: column; grid-auto-columns: 88%; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 6px; scroll-padding: 0 var(--gutter);
}
.banner {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center;
  min-height: 210px; padding: 24px 22px; border-radius: var(--r-lg); scroll-snap-align: start;
  background: var(--b-bg); color: var(--b-fg);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
/* รูปอยู่ครึ่งขวาและจางเข้าหาสีพื้น ข้อความจึงอยู่บนสีพื้นล้วน อ่านง่าย */
.banner__img {
  position: absolute; z-index: -1; top: 0; right: 0; width: 50%; height: 100%; object-fit: cover;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, .35) 32%, #000 78%);
  mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, .35) 32%, #000 78%);
}
.banner__text { max-width: 60%; }
.banner .eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--b-accent); }
.banner .eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.banner h3 { margin: 6px 0 6px; font-size: 21px; font-weight: 700; line-height: 1.3; color: inherit; }
.banner p { font-size: 14px; line-height: 1.6; opacity: .9; }
.banner__cta {
  display: inline-flex; align-items: center; gap: 2px; height: 40px; margin-top: 16px; padding: 0 10px 0 16px; border-radius: var(--r-sm);
  background: var(--b-cta-bg); color: var(--b-cta-fg); font: 600 14px/1 var(--font-head);
}
.banner__cta .ms { font-size: 20px; transition: transform .2s var(--ease); }
.banner--red { --b-bg: #C42626; --b-fg: #fff; --b-accent: #FFD866; --b-cta-bg: var(--yellow); --b-cta-fg: var(--ink); }
.banner--cocoa { --b-bg: var(--cocoa); --b-fg: #fff; --b-accent: #FFD866; --b-cta-bg: var(--yellow); --b-cta-fg: var(--ink); }
.banner--yellow { --b-bg: var(--yellow); --b-fg: var(--ink); --b-accent: var(--red-700); --b-cta-bg: var(--ink); --b-cta-fg: #fff; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.dots span { width: 7px; height: 7px; border-radius: 99px; background: #E3D6BF; transition: width .3s var(--ease), background-color .3s; }
.dots span.is-on { width: 20px; background: var(--red); }

/* ---------- จังหวัด ---------- */
.provs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.prov {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end;
  aspect-ratio: 1 / 1; padding: 14px; border-radius: var(--r-md); background: #E9DFCF; color: #fff; text-align: left; box-shadow: var(--sh-1);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.prov img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.prov::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(24, 14, 6, .78) 0%, rgba(24, 14, 6, .25) 45%, transparent 70%); }
.prov strong { font: 700 18px/1.3 var(--font-head); }
.prov small {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 3px 10px 3px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, .2); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-size: 13px; font-weight: 500;
}
.prov small .ms { font-size: 16px; }

/* ---------- ส่วนเจ้าของร้าน ---------- */
.owner {
  position: relative; isolation: isolate; overflow: hidden; margin-top: 56px; border-radius: var(--r-lg); color: #fff;
  background: radial-gradient(circle at 100% 0, rgba(214, 40, 40, .45) 0, transparent 55%), linear-gradient(150deg, #4A1E17, var(--cocoa) 55%, #2A1611);
}
.owner__photo { position: relative; height: 180px; }
.owner__photo img { width: 100%; height: 100%; object-fit: cover; }
.owner__photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, #43201A 100%); }
.owner__body { padding: 4px 22px 0; }
.owner .eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--yellow); }
.owner .eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.owner h2 { margin-top: 8px; font-size: 26px; font-weight: 700; line-height: 1.35; color: #fff; }
.owner h2 em { font-style: normal; color: var(--yellow); }
.owner__lead { margin-top: 10px; font-size: 15px; line-height: 1.75; color: rgba(255, 255, 255, .86); }
.steps { list-style: none; display: grid; gap: 10px; margin: 0; padding: 20px 22px 0; }
.step { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.step__num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: var(--ink); font: 700 16px/1 var(--font-head); }
.step h3 { font-size: 16px; color: #fff; }
.step p { margin-top: 2px; font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, .78); }
.owner__cta { padding: 20px 22px 24px; }
.owner__note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font-size: 14px; color: rgba(255, 255, 255, .82); }
.owner__note .ms { font-size: 18px; color: var(--yellow); --fill: 1; }

/* ---------- Footer ---------- */
.footer { margin-top: 64px; padding: 40px 0 24px; border-top: 1px solid var(--line); background: linear-gradient(180deg, #FFF7E4, var(--bg) 70%); }
.footer__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 20px; }
.footer__brand { grid-column: 1 / -1; }
.footer__brand > p { max-width: 340px; margin-top: 12px; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.fb-follow {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 16px; padding: 7px 18px 7px 7px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); line-height: 1.3; transition: border-color .2s, box-shadow .2s;
}
.fb-follow__icon { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #0866FF; color: #fff; }
.fb-follow__icon svg { width: 16px; height: 16px; fill: currentColor; }
.fb-follow b { display: block; font-size: 14px; }
.fb-follow small { font-size: 12.5px; color: var(--ink-2); }
.footer__heading { margin-bottom: 6px; font: 700 15px/1.4 var(--font-head); color: var(--ink); }
.footer__col a { display: flex; align-items: center; min-height: 40px; font-size: 14.5px; color: var(--ink-2); transition: color .2s; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }

/* ---------- แถบเมนูล่าง (มือถือ) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(64, 40, 12, .06);
}
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.tab > .ms { width: 52px; height: 30px; display: grid; place-items: center; border-radius: 999px; font-size: 24px; transition: background-color .25s var(--ease); }
.tab.is-active { color: var(--red-700); font-weight: 600; }
.tab.is-active > .ms { background: #FFEFD6; --fill: 1; }
.tab__plus { width: 48px; height: 38px; border-radius: 14px; display: grid; place-items: center; background: var(--red); color: #fff; box-shadow: 0 6px 14px rgba(214, 40, 40, .3); }
.tab__plus .ms { font-size: 26px; --wght: 600; }
.tab__count {
  position: absolute; top: 2px; left: calc(50% + 8px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; border: 2px solid #fff;
  display: grid; place-items: center; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
}
body:has(.search input:focus) .tabbar { display: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom)); z-index: 70;
  display: flex; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 32px); padding: 12px 18px 12px 14px;
  border-radius: 14px; background: var(--ink); color: #fff; font-size: 14.5px; line-height: 1.5; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast .ms { font-size: 22px; color: var(--yellow); --fill: 1; }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
body.map-open .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

/* มือถือ: ซ่อนแผนที่ตอนค้นหา ให้ผลลัพธ์อยู่ใต้หมวดหมู่ทันที */
@media (max-width: 767px) {
  body.is-filtering #mapSection { display: none; }
  /* หัวข้อ section บนมือถือ: ลิงก์ "ดูทั้งหมด" อยู่บรรทัดเดียวกับหัวข้อ คำอธิบายได้เต็มความกว้าง */
  .section__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 12px; }
  .section__head > div { display: contents; }
  .section__head h2 { grid-row: 1; grid-column: 1; }
  .section__head .more { grid-row: 1; grid-column: 2; }
  .section__head .section__note { grid-row: 2; grid-column: 1 / -1; }
  .footer__col a { min-height: 44px; }
}
@media (max-width: 359px) {
  :root { --gutter: 16px; }
  .cats { gap: 8px; }
  .cat { font-size: 12.5px; }
}

/* ---------- Hover (เฉพาะอุปกรณ์ที่มีเมาส์) ---------- */
@media (hover: hover) {
  .btn--red:hover { background: #C42222; box-shadow: 0 10px 22px rgba(214, 40, 40, .28); transform: translateY(-1px); }
  .btn--yellow:hover { transform: translateY(-1px); }
  .icon-btn:hover { border-color: #E5CD98; }
  .more:hover { background: var(--red-50); }
  .more:hover .ms { transform: translateX(3px); }
  .cat:hover { transform: translateY(-4px); box-shadow: var(--sh-2); border-color: #F0DDB0; }
  .card:hover, .prov:hover, .banner:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }
  .card:hover .card__media img, .row:hover .row__thumb img { transform: scale(1.06); }
  .prov:hover img { transform: scale(1.07); }
  .banner:hover .banner__cta .ms { transform: translateX(3px); }
  .row:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
  .row--compact:hover { transform: none; box-shadow: none; background: var(--yellow-50); }
  .map-btn:hover { background: var(--yellow-50); }
  .clear-btn:hover { border-color: #D9C6A4; }
  .fb-follow:hover { border-color: #C9D8F5; box-shadow: 0 6px 16px rgba(8, 102, 255, .12); }
  .footer__col a:hover { color: var(--red-700); }
}

/* ---------- แท็บเล็ตขึ้นไป ---------- */
@media (min-width: 768px) {
  :root { --gutter: 32px; --tab-h: 0px; }
  body { padding-bottom: 0; }
  .tabbar, .dots, .view-switch { display: none; }
  .appbar__inner { height: 76px; }
  .appbar .desktop-only { display: inline-flex; }


  .section { margin-top: 80px; }
  .section__head { margin-bottom: 22px; }
  .section__head h2, .results__head h2 { font-size: 28px; }
  .section__note, .results__count { font-size: 15px; }

  .cats { grid-template-columns: repeat(8, 1fr); gap: 14px; }
  .cat { min-height: 128px; gap: 10px; font-size: 14.5px; }
  .cat__icon { width: 58px; height: 58px; }
  .cat__icon .ms { font-size: 30px; }

  .map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
  .mapbox { height: 500px; }
  #mapSection.show-list .mapbox:not(.is-full) { display: block; }
  .near-panel, #mapSection.show-list .near-panel { display: flex; flex-direction: column; }
  .near-list { flex: 1; align-content: space-between; }

  .cards { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; overflow: visible; margin: 0; padding: 0; }
  .banners { grid-auto-columns: 64%; }
  .banner { min-height: 230px; padding: 28px; }
  .provs { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .prov { aspect-ratio: 4 / 3.4; padding: 18px; }
  .prov strong { font-size: 20px; }
  .list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }

  .owner { margin-top: 80px; }
  .owner__photo { height: 220px; }
  .owner h2 { font-size: 30px; }

  .footer { margin-top: 88px; padding-top: 56px; }
  .footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
  .footer__brand { grid-column: auto; }
  .toast { bottom: 28px; }
}

/* ---------- จอคอม ---------- */
@media (min-width: 1024px) {
  .topnav { display: flex; gap: 4px; margin-right: 12px; }
  .topnav a { display: inline-flex; align-items: center; height: 42px; padding: 0 14px; border-radius: 12px; font-size: 15px; font-weight: 500; color: var(--ink-2); transition: background-color .2s, color .2s; }
  .topnav a:hover { background: rgba(255, 199, 44, .2); color: var(--ink); }
  .topnav a.is-active { background: var(--yellow-100); color: var(--ink); font-weight: 600; }

  .map-layout { grid-template-columns: minmax(0, 1fr) 360px; }
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .banners { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; overflow: visible; margin: 0; padding: 0; }
  .banner { padding: 26px 24px; }
  .banner h3 { font-size: 20px; }

  /* เจ้าของร้าน: รูป | ข้อความ + ปุ่ม | ขั้นตอน */
  .owner {
    display: grid; grid-template-columns: 30% minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "photo body steps" "photo cta steps"; align-items: center; min-height: 340px;
  }
  .owner__photo { grid-area: photo; align-self: stretch; height: auto; -webkit-mask-image: linear-gradient(90deg, #000 55%, transparent); mask-image: linear-gradient(90deg, #000 55%, transparent); }
  .owner__photo::after { display: none; }
  .owner__body { grid-area: body; align-self: end; padding: 40px 28px 0 4px; }
  .owner__cta { grid-area: cta; align-self: start; padding: 24px 28px 40px 4px; }
  .owner__cta .btn { width: auto; }
  .owner__note { justify-content: flex-start; }
  .steps { grid-area: steps; padding: 40px 40px 40px 0; }
}

/* Shared brand roles, applied to both mobile and desktop. */
.appbar { background: rgba(255,252,245,.95); }
.appbar.is-scrolled { background: rgba(255,252,245,.98); }
.btn--red { color: var(--on-primary); }
.btn--yellow { color: var(--on-secondary); }
.cat[aria-pressed="true"] { background: var(--red-50); }
.cat, .card__title, .row__title { line-height: 1.5; }
.banner--red { --b-bg: var(--red); --b-accent: var(--yellow-100); }
.banner--cocoa { --b-accent: var(--yellow-100); }
.footer { background: linear-gradient(180deg, var(--yellow-50), var(--bg) 75%); }
.tab.is-active > .ms { background: var(--red-50); }
:focus-visible { outline-color: var(--focus); }
@media (hover:hover) {
  .btn--red:hover { background: var(--red-700); }
  .cat:hover { border-color: #BBA57A; }
}
.cats-heading-desktop { display: none; }
@media (max-width:767px) {
  .list { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .row { min-width: 0; }
  .row__approved { max-width: 100%; flex-wrap: wrap; line-height: 1.6; }
}
@media (min-width: 768px) {
  .cats-heading-mobile { display: none; }
  .cats-heading-desktop { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- โลโก้ ร้านอาหารเจ.com (ไฟล์ใน assets/brand/) ---------- */
.brand__img { display: block; width: auto; height: 40px; }
.brand__img--footer { height: 60px; }
@media (min-width: 768px) { .brand__img { height: 46px; } .brand__img--footer { height: 64px; } }

/* ---------- สูตรอาหารเจจาก อาหารเจ.com (หน้าแรก) ---------- */
.ajgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ajcard { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ajcard__img {
  position: relative; display: flex; align-items: flex-end; aspect-ratio: 4 / 3; overflow: hidden; margin-bottom: 8px; padding: 12px;
  border-radius: var(--r-md); color: #fff; background: radial-gradient(circle at 85% 12%, rgba(255, 255, 255, .25), transparent 45%), linear-gradient(140deg, var(--c), #062447);
}
.ajcard__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ajcard__name { font: 700 17px/1.3 var(--font-head); text-wrap: balance; }
.ajcard b { font: 600 15px/1.4 var(--font-head); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ajcard small { font-size: 13px; color: var(--ink-2); }
@media (min-width: 768px) { .ajgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; } }

/* ---------- ท้ายเว็บ: แบ่งคอลัมน์ (แบบเดียวกับ อาหารเจ.com) ----------
   มือถือ: แบรนด์เต็มแถว · ซ้าย = เมนูหลัก · ขวา = เจ้าของร้าน + ช่วยเหลือ (เส้นคั่นกลาง)
   จอใหญ่: 4 คอลัมน์ มีเส้นคั่นแนวตั้ง */
.footer__grid { column-gap: 0; row-gap: 22px; }
.footer__brand { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.footer__col { min-width: 0; }
.footer__col:nth-of-type(1) { grid-row: span 2; padding-right: 16px; }
.footer__col:nth-of-type(2), .footer__col:nth-of-type(3) { padding-left: 16px; border-left: 1px solid var(--line); }
.footer__heading { width: fit-content; padding-bottom: 6px; margin-bottom: 8px; border-bottom: 2px solid var(--yellow); }
@media (min-width: 768px) {
  .footer__grid { row-gap: 0; column-gap: 0; }
  .footer__brand { padding: 0 32px 0 0; border-bottom: 0; }
  .footer__col:nth-of-type(1) { grid-row: auto; }
  .footer__col { padding: 0 28px !important; border-left: 1px solid var(--line); }
}

/* ---------- ปุ่มลอย ติดต่อเจ้าหน้าที่ทาง LINE (อยู่เหนือแถบเมนูล่างบนมือถือ) ---------- */
.line-fab {
  position: fixed; right: 14px; bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom)); z-index: 39;
  display: inline-flex; align-items: center; gap: 7px; height: 46px; padding: 0 16px 0 12px; border-radius: 999px;
  background: #06C755; color: #fff; font: 600 14.5px/1 var(--font-head); box-shadow: 0 8px 22px rgba(6, 199, 85, .35); transition: transform .2s var(--ease);
}
.line-fab svg { width: 24px; height: 24px; flex: none; }
body.map-open .line-fab, body:has(.lightbox:not([hidden])) .line-fab, body:has(dialog[open]) .line-fab { display: none; }
@media (max-width: 359px) { .line-fab span { display: none; } .line-fab { padding: 0 11px; } }
@media (hover: hover) { .line-fab:hover { transform: translateY(-2px); } }
@media (min-width: 768px) { .line-fab { right: 24px; bottom: 24px; height: 50px; font-size: 15px; } }
