/* ==========================================================================
   บ้านป่าอกาลิโก – Health Supplement Store
   Global Stylesheet
   Palette: Green #16A249 (primary) + green scale + soft gold accent
   ========================================================================== */

/* ฟอนต์ไทยหลัก — self-host (variable ไฟล์เดียวครอบทุกน้ำหนัก) โหลดจากโดเมนเดียวกัน
   เร็ว+นิ่ง ไม่ต้องรอ Google → ข้อความ (LCP) เรนเดอร์เร็ว. Latin ยังใช้ Inter จาก Google */
@font-face {
  font-family: "Noto Sans Thai";
  font-style: normal;
  font-weight: 100 900;   /* variable — ครอบทุกน้ำหนัก */
  font-display: swap;
  src: url("/assets/fonts/noto-sans-thai.woff2") format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

/* ---------- Accessibility utility: ซ่อนสายตา แต่ screen reader/SEO อ่านได้ ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Design Tokens ---------- */
:root {
  --forest: #16A249;   /* สีหลัก — logo, primary buttons, icons */
  --sage:   #94D1AA;   /* section backgrounds */
  --olive:  #22B45C;   /* เขียวสว่าง — gradient / focus / icons */
  --moss:   #128040;   /* เขียวเข้ม — hover / secondary / ข้อความเน้น */
  --bg:     #F5FAF6;   /* main background */
  --white:  #FFFFFF;
  --text:   #2E3E33;   /* main text */
  --muted:  #748B7C;   /* secondary text */
  --gold:   #C7A76C;   /* soft gold accent */
  --line:   #DDE9E1;   /* borders / dividers */

  --radius-sm: 12px;
  --radius:    18px;
  --radius-lg: 24px;
  --pill: 999px;

  --shadow-sm: 0 4px 14px rgba(24, 54, 35, .06);
  --shadow:    0 10px 30px rgba(24, 54, 35, .09);
  --shadow-lg: 0 20px 50px rgba(24, 54, 35, .14);

  --container: 1240px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  --font-th: "Noto Sans Thai", "Inter", sans-serif;
  --font-en: "Inter", "Noto Sans Thai", sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-th);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-wrap: break-word;   /* กันคำ/ชื่อไทยยาว (ไม่มีช่องว่าง) ดันจนล้นขอบจอ */
  overflow-x: hidden; /* fallback สำหรับเบราว์เซอร์เก่า */
  overflow-x: clip;   /* ไม่สร้าง scroll container -> header position:sticky ค้างจอได้ */
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
ul { list-style: none; }
:focus-visible { outline: 3px solid rgba(22, 162, 73, .35); outline-offset: 2px; }
/* [hidden] ของเบราว์เซอร์เป็น UA rule ซึ่งแพ้ author rule ทุกข้อ — คลาสที่ตั้ง display
   (เช่น .co-card, .summary__row) จะทำให้ el.hidden = true ซ่อนไม่ติด บังคับไว้ตรงนี้ทีเดียว */
[hidden] { display: none !important; }

/* ---------- Layout helpers ---------- */
.container { width: min(100% - 40px, var(--container)); margin-inline: auto; }
.section { padding: 72px 0; }
.section--tight { padding: 48px 0; }
.text-gold { color: var(--gold); }
.text-forest { color: var(--forest); }
.center { text-align: center; }

/* Section heading */
.eyebrow {
  font-size: .82rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 6px;
}
.section-title {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 800; line-height: 1.2; color: var(--text);
}
.section-head { margin-bottom: 34px; }
.section-head--row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}

/* ---------- Sort dropdown (เมนูจัดเรียงสินค้า) ---------- */
.sort-dd { position: relative; }
.sort-dd__btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 16px; border-radius: var(--radius);
  background: #fff; border: 1px solid var(--line); color: var(--text);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.sort-dd__btn:hover { background: #eff9f3; border-color: var(--forest); }
.sort-dd__btn .fa-chevron-down { font-size: .72rem; color: var(--muted); transition: transform .2s; }
.sort-dd.open .sort-dd__btn .fa-chevron-down { transform: rotate(180deg); }
.sort-dd__menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  min-width: 210px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.sort-dd__menu[hidden] { display: none; }
.sort-dd__menu button {
  text-align: left; padding: 10px 12px; border-radius: 8px;
  background: none; border: 0; cursor: pointer; font-size: .88rem; color: var(--text);
  transition: background .15s;
}
.sort-dd__menu button:hover { background: #eff9f3; }
.sort-dd__menu button[aria-checked="true"] { color: var(--forest); font-weight: 700; background: #e3f6ea; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 26px; border-radius: var(--pill);
  font-weight: 600; font-size: .96rem; line-height: 1;
  transition: transform .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease), color .25s;
  white-space: nowrap;
}
.btn i { font-size: .95em; }
.btn--primary { background: var(--forest); color: #fff; box-shadow: 0 8px 20px rgba(22,162,73,.28); }
.btn--primary:hover { background: var(--moss); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(22,162,73,.36); }
.btn--outline { background: transparent; color: var(--forest); border: 1.6px solid var(--forest); }
.btn--outline:hover { background: var(--forest); color: #fff; transform: translateY(-2px); }
.btn--ghost { background: rgba(255,255,255,.9); color: var(--text); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { background: #fff; transform: translateY(-2px); }
.btn--gold { background: var(--gold); color: #3a2f16; }
.btn--gold:hover { background: #b8965a; transform: translateY(-2px); }
.btn--light { background:#fff; color: var(--forest); }
.btn--light:hover { background:#ebf7f0; transform: translateY(-2px); }
.btn--line { background:#06C755; color:#fff; box-shadow: 0 8px 20px rgba(6,199,85,.28); }
.btn--line:hover { background:#05b34c; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(6,199,85,.36); }
.btn--line i { font-size: 1.15em; }
.btn--red { background:#EF3B3B; color:#fff; box-shadow: 0 8px 20px rgba(239,59,59,.30); }
.btn--red:hover { background:#DC2626; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(239,59,59,.40); }
.btn--block { width: 100%; }
.btn--sm { padding: 10px 18px; font-size: .88rem; }
.link-arrow { display:inline-flex; align-items:center; gap:7px; font-weight:600; color:var(--forest); }
.link-arrow:hover { color: var(--moss); }
.link-arrow i { transition: transform .25s var(--ease); }
.link-arrow:hover i { transform: translateX(4px); }

/* ==========================================================================
   HEADER
   ========================================================================== */
.topbar {
  background: var(--forest); color: #e3f6ea;
  font-size: .84rem;
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; }
.topbar__msg { display: flex; align-items: center; gap: 9px; }
.topbar__msg i { color: var(--gold); }
.topbar__links { display: flex; align-items: center; gap: 18px; }
.topbar__links a { display:inline-flex; align-items:center; gap:6px; opacity: .92; transition: opacity .2s; }
.topbar__links a:hover { opacity: 1; color: var(--gold); }

.header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header__inner { display: flex; align-items: center; gap: 22px; padding: 14px 0; }

.logo { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.logo__mark {
  width: 68px; height: 68px; border-radius: 13px;
  background: linear-gradient(135deg, var(--forest), var(--olive));
  display: grid; place-items: center; color: #fff; font-size: 1.15rem;
  box-shadow: 0 6px 14px rgba(22,162,73,.3);
}
.logo__mark--img { background: transparent; padding: 0; box-shadow: none; }   /* ตัดกล่องพื้นขาวหลังโลโก้ออก (โลโก้โปร่งใสอยู่แล้ว) */
.logo__mark--img img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.footer .logo__mark { width: 100px; height: 100px; }   /* footer โลโก้เด่น (Hero brand) */
.logo__text { line-height: 1.05; }
.logo__text b { font-size: 1.12rem; font-weight: 800; color: var(--text); display: block; }
.logo__text span { font-size: .72rem; color: var(--muted); letter-spacing: .04em; }

/* Main nav */
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 9px 15px; border-radius: var(--pill); font-weight: 600; font-size: .95rem;
  color: var(--text); transition: background .2s, color .2s;
}
.nav a:hover { background: #e3f6ea; color: var(--forest); }
.nav a.active { background: var(--forest); color: #fff; }

/* ลิงก์บัญชี: โชว์ "โปรไฟล์" เฉพาะเมื่อเข้าสู่ระบบด้วย LINE แล้ว (JS ใส่ .is-authed ที่ body)
   ก่อนล็อกอินให้โชว์ปุ่ม "เข้าสู่ระบบด้วย LINE" ในเมนูมือถือแทน */
.nav a[data-nav="profile"] { display: none; }
.drawer a.drawer__link[data-nav="profile"] { display: none; }   /* เพิ่ม .drawer__link กันโดนกฎ display:flex ทับ (specificity) */
body.is-authed .nav a[data-nav="profile"] { display: block; }
body.is-authed .drawer a.drawer__link[data-nav="profile"] { display: flex; }
body.is-authed .drawer a.drawer__link[data-line-enter] { display: none; }

/* Search */
.header__search { flex: 1; max-width: 360px; position: relative; }
.header__search input {
  width: 100%; padding: 11px 16px 11px 42px; border-radius: var(--pill);
  border: 1.5px solid var(--line); background: var(--bg); color: var(--text); font-size: .92rem;
  transition: border .2s, background .2s;
}
.header__search input:focus { outline: none; border-color: var(--olive); background: #fff; }
.header__search i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* Icon actions */
.header__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text); font-size: 1.05rem;
  transition: background .2s, color .2s, transform .2s;
}
.icon-btn:hover { background: #e3f6ea; color: var(--forest); transform: translateY(-1px); }
.icon-btn__badge {
  position: absolute; top: 3px; right: 2px; min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--gold); color: #3a2f16; font-size: .68rem; font-weight: 800;
  border-radius: var(--pill); display: grid; place-items: center; border: 2px solid #fff;
}
.icon-btn__badge:empty, .icon-btn__badge[data-count="0"] { display: none; }

.hamburger { display: none; }
.icon-btn--blog,
.icon-btn--search { display: none; }   /* โชว์เฉพาะมือถือ/แท็บเล็ต — ดูบล็อก BOTTOM NAV */
.icon-btn.active { background: #e3f6ea; color: var(--forest); }

/* Header user chip (รูปโปรไฟล์ + ชื่อ เมื่อล็อกอินแล้ว) */
.header-user {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 14px 4px 4px; border-radius: var(--pill);
  background: #e3f6ea; color: var(--text); font-weight: 700; font-size: .9rem;
  margin-left: 6px; max-width: 190px; transition: background .2s;
}
.header-user:hover { background: #d3f0de; }
.header-user__avatar {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex: 0 0 auto;
  background: var(--forest); color: #fff; display: grid; place-items: center;
  font-size: .9rem; font-weight: 800;
}
.header-user__avatar img { width: 100%; height: 100%; object-fit: cover; }
.header-user__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .header-user { padding: 3px; margin-left: 4px; }
  .header-user__name { display: none; }   /* จอเล็ก: โชว์แค่รูปโปรไฟล์ */
}

/* Mobile drawer */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(14,38,22,.45); z-index: 60;
  opacity: 0; visibility: hidden; transition: opacity .3s;
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: -320px; width: 300px; max-width: 85vw; height: 100%;
  background: #fff; z-index: 70; padding: 22px; transition: right .35s var(--ease);
  display: flex; flex-direction: column; gap: 6px; box-shadow: -20px 0 50px rgba(0,0,0,.15);
  overflow-y: auto;
}
.drawer.open { right: 0; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer__search { position: relative; margin-bottom: 12px; }
.drawer__search input { width: 100%; padding: 11px 16px 11px 40px; border-radius: var(--pill); border: 1.5px solid var(--line); background: var(--bg); }
.drawer__search i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.drawer a.drawer__link {
  padding: 13px 15px; border-radius: var(--radius-sm); font-weight: 600;
  display: flex; align-items: center; gap: 12px; transition: background .2s;
}
.drawer a.drawer__link:hover, .drawer a.drawer__link.active { background: #e3f6ea; color: var(--forest); }
.drawer a.drawer__link i { width: 20px; text-align: center; color: var(--forest); }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero { padding: 30px 0 20px; }
.hero__grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 44px; align-items: center;
  background: linear-gradient(135deg, #fff 0%, #eff9f3 100%);
  border-radius: var(--radius-lg); padding: 48px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.hero__grid::before {
  content: ""; position: absolute; top: -80px; right: -60px; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(199,167,108,.22), transparent 70%); border-radius: 50%;
}
/* Hero แบบภาพอย่างเดียว: ภาพกึ่งกลาง ไม่มีกรอบ/พื้นหลัง/เงา */
.hero__grid--imgonly {
  grid-template-columns: 1fr; justify-items: center; padding: 24px 0;
  background: none; box-shadow: none; border-radius: 0; overflow: visible;
}
.hero__grid--imgonly::before { display: none; }   /* เอาวงเงาสีทองมุมขวาบนออก */
.hero__grid--imgonly .hero__media { width: 100%; max-width: 600px; }
.hero__pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px;
  background: #fff; border-radius: var(--pill); font-size: .82rem; font-weight: 600;
  color: var(--forest); box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.hero__pill i { color: var(--gold); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.14; font-weight: 800; letter-spacing: -.01em; }
.hero h1 .hl { color: var(--forest); position: relative; }
.hero p.lead { color: var(--muted); font-size: 1.05rem; margin: 18px 0 28px; max-width: 46ch; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__badges { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .88rem; font-weight: 600; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: var(--pill);
  padding: 7px 16px 7px 7px; box-shadow: var(--shadow-sm);
}
.hero__badge i { width: 30px; height: 30px; border-radius: 50%; background: #e3f6ea; color: var(--forest); display: grid; place-items: center; font-size: .9rem; }

.hero__media { position: relative; }
.hero__media .hero-img {
  border-radius: var(--radius-lg);
  background: transparent; box-shadow: none;   /* ตัดการ์ดขาว → โลโก้ลอยบนพื้น hero */
  display: grid; place-items: center;
}
.hero__media .hero-img img {
  width: 100%; height: auto;       /* สูงตามสัดส่วนโลโก้ ไม่บังคับเป็นสี่เหลี่ยมจัตุรัส (ลดพื้นที่ว่าง) */
  object-fit: contain;
  padding: 12px;
}
.hero__float {
  position: absolute; background: #fff; border-radius: var(--radius); padding: 14px 18px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px;
}
.hero__float--tl { top: 24px; left: -18px; }
.hero__float--br { bottom: 24px; right: -18px; }
.hero__float .ic { width: 40px; height: 40px; border-radius: 12px; background: #e3f6ea; color: var(--forest); display: grid; place-items: center; font-size: 1.1rem; }
.hero__float b { display: block; font-size: .95rem; }
.hero__float span { font-size: .76rem; color: var(--muted); }
/* มือถือ + ไอแพด (≤1024px): ย้ายการ์ดลอยลงมาซ้อนแนวตั้งใต้โลโก้ ไม่ให้ทับโลโก้ */
@media (max-width: 1024px) {
  .hero__media { display: flex; flex-direction: column; align-items: center; gap: 10px; }
  .hero__media .hero-img { width: 100%; }
  .hero__float { position: static; width: 100%; max-width: 300px; justify-content: flex-start; }
}

/* Placeholder media surface (reusable) */
.ph-media {
  width: 100%; height: 100%;
  background: linear-gradient(150deg, var(--olive), var(--forest));
  display: grid; place-items: center; color: rgba(255,255,255,.9);
}
.ph-media i { font-size: 3rem; opacity: .5; }

/* ==========================================================================
   CATEGORY BAR (forest strip)
   ========================================================================== */
.catbar { background: var(--forest); overflow: hidden; }
.catbar__viewport { overflow: hidden; }
/* มาร์คีเลื่อนอัตโนมัติแบบวนต่อเนื่อง: track มี 2 ชุดเหมือนกัน เลื่อน -50% = ขยับพอดี 1 ชุด จึงไม่มีรอยต่อ */
.catbar__track { display: flex; align-items: center; width: max-content; animation: catbar-marquee 30s linear infinite; }
.catbar:hover .catbar__track, .catbar:focus-within .catbar__track { animation-play-state: paused; }  /* วางเมาส์/โฟกัส = หยุดชั่วคราว */
@keyframes catbar-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.catbar a {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 20px; color: #e3f6ea;
  font-weight: 600; font-size: .92rem; white-space: nowrap; position: relative; transition: color .2s;
}
.catbar a::after { content: "\f0da"; font-family: "Font Awesome 6 Free"; font-weight: 900; color: var(--gold); position: absolute; right: -4px; opacity: .6; font-size:.7rem; }
.catbar a:hover { color: #fff; }
.catbar a i { color: var(--gold); }
/* ผู้ใช้ที่ตั้งค่าลดการเคลื่อนไหว: หยุดอนิเมชัน แล้วเลื่อนดูเองด้วยการปัดแทน */
@media (prefers-reduced-motion: reduce) {
  .catbar__track { animation: none; }
  .catbar__viewport { overflow-x: auto; scrollbar-width: none; }
  .catbar__viewport::-webkit-scrollbar { display: none; }
}

/* ==========================================================================
   SHOP BY CATEGORY (circles)
   ========================================================================== */
/* หมวดหมู่วงกลม: สไลด์แถวเดียวเหมือนมือถือ (ทุกจอ) — PC จัดกึ่งกลาง, มือถือเลื่อนได้ */
.cat-circles {
  display: flex; flex-wrap: nowrap; justify-content: safe center; gap: 14px;
  overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-circles::-webkit-scrollbar { display: none; }
.cat-circle { flex: 0 0 auto; width: 90px; text-align: center; scroll-snap-align: start; transition: transform .25s var(--ease); }
.cat-circle:hover { transform: translateY(-6px); }
.cat-circle__img {
  width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; margin-bottom: 8px;
  box-shadow: var(--shadow-sm); border: 3px solid #fff; position: relative;
}
.cat-circle__img::after { content:""; position:absolute; inset:0; box-shadow: inset 0 0 0 1px var(--line); border-radius:50%; }
.cat-circle:hover .cat-circle__img { box-shadow: var(--shadow); }
.cat-circle b { display: block; font-size: .82rem; font-weight: 700; }
.cat-circle span { display: none; }   /* ซ่อนจำนวนรายการ (เหมือนมือถือ) */
/* ไอแพด/แท็บเล็ต (601–1024px): วงกลมหมวดหมู่ใหญ่ขึ้น */
@media (min-width: 601px) and (max-width: 1024px) {
  .cat-circles { gap: 20px; }
  .cat-circle { width: 124px; }
  .cat-circle b { font-size: .96rem; }
}
/* คอมพิวเตอร์ (>1024px): วงกลมหมวดหมู่ใหญ่สุด */
@media (min-width: 1025px) {
  .cat-circles { gap: 26px; }
  .cat-circle { width: 150px; }
  .cat-circle b { font-size: 1rem; }
}

/* ==========================================================================
   CATEGORY CARDS (หน้า /categories ก่อนเลือกหมวด)
   ========================================================================== */
.cat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cat-card {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--white);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--text);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s;
}
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--olive); }

/* ภาพหน้าปก: รูปประจำหมวด (CAT_COVER) หรือรูปสินค้าจริงในหมวดนั้น */
.cat-card__media { position: relative; aspect-ratio: 1; overflow: hidden; background: #e3f6ea; }
.cat-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.cat-card:hover .cat-card__media img { transform: scale(1.06); }
/* โลโก้แบรนด์: ไม่ครอบตัด วางกลางกรอบบนพื้นอ่อน */
.cat-card__media--logo { background: var(--white); }
.cat-card__media--logo img { object-fit: contain; padding: 16%; }
/* กรณีหมวดไม่มีรูปสินค้า → ใช้ไอคอนบนพื้นไล่เฉดแทน */
.cat-card__ic {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 2.6rem; color: #fff;
  background: linear-gradient(135deg, var(--forest), var(--olive));
}
.cat-card__chip {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255,255,255,.92); color: var(--forest); font-size: .95rem;
  box-shadow: var(--shadow-sm);
}
.cat-card__body { padding: 16px 18px 18px; text-align: center; display: flex; flex-direction: column; flex: 1; }
.cat-card__body b { font-size: 1.02rem; font-weight: 800; }
.cat-card__body p { margin-top: 5px; font-size: .8rem; color: var(--muted); line-height: 1.5; }
.cat-card__go {
  margin-top: auto; padding-top: 14px;
  font-size: .86rem; font-weight: 700; color: var(--forest);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.cat-card__go i { transition: transform .25s var(--ease); }
.cat-card:hover .cat-card__go i { transform: translateX(4px); }

@media (max-width: 1024px) { .cat-cards { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (max-width: 760px) {
  .cat-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-card__body { padding: 13px 12px 15px; }
  .cat-card__body b { font-size: .92rem; }
  .cat-card__body p { font-size: .74rem; }
  .cat-card__chip { width: 32px; height: 32px; border-radius: 10px; font-size: .8rem; }
}

/* ==========================================================================
   PROMO BANNERS
   ========================================================================== */
.promo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.promo {
  border-radius: var(--radius-lg); padding: 34px; position: relative; overflow: hidden;
  color: #fff; min-height: 220px; display: flex; flex-direction: column;
}
/* ปุ่มถูกดันลงล่างเสมอ → ปุ่มของทั้งสองการ์ดอยู่ระดับเดียวกัน แม้ข้อความยาวไม่เท่ากัน */
.promo .btn { margin-top: auto; align-self: flex-start; position: relative; z-index: 1; }
.promo--olive { background: linear-gradient(120deg, var(--olive), var(--moss)); }
.promo--forest { background: linear-gradient(120deg, var(--forest), #0d6633); }
.promo__tag { display: inline-block; background: rgba(255,255,255,.2); padding: 5px 13px; border-radius: var(--pill); font-size: .78rem; font-weight: 700; margin-bottom: 12px; width: fit-content; }
.promo h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; line-height: 1.2; max-width: 15ch; }
.promo p { color: rgba(255,255,255,.85); margin: 8px 0 18px; max-width: 30ch; font-size: .92rem; }
.promo__deco { position: absolute; right: -30px; bottom: -30px; font-size: 8rem; color: rgba(255,255,255,.08); }

/* ==========================================================================
   PRODUCT CARD
   ========================================================================== */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.product-grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: #fff; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  display: flex; flex-direction: column; position: relative;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.card__media { position: relative; aspect-ratio: 1/.92; overflow: hidden; background: #ebf7f0; }
.card__media img, .card__media .ph-media { width: 100%; height: 100%; object-fit: contain; transition: transform .5s var(--ease); }
.card:hover .card__media img { transform: scale(1.06); }
.card__badge {
  position: absolute; top: 12px; left: 12px; background: var(--gold); color: #3a2f16;
  font-size: .72rem; font-weight: 800; padding: 5px 11px; border-radius: var(--pill);
}
.card__badge--sale { background: #d9534f; color: #fff; }
.card__badge--out { background: #6b7280; color: #fff; }
/* สินค้าหมด: หรี่รูปลง แต่ยังกดดูรายละเอียดได้ */
.card--out .card__media img, .card--out .card__media .ph-media { opacity: .55; filter: grayscale(.35); }
.card__stock { font-size: .78rem; font-weight: 700; color: #a67c2e; }
.card__fav {
  position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.92); display: grid; place-items: center; color: var(--muted);
  box-shadow: var(--shadow-sm); transition: transform .2s, color .2s, background .2s; font-size: 1rem;
}
.card__fav:hover { transform: scale(1.1); color: #d9534f; }
.card__fav.active { color: #d9534f; background: #fff; }
.card__fav.active i { font-weight: 900; }
.card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__cat { font-size: .76rem; color: var(--moss); font-weight: 600; letter-spacing: .02em; }
.card__title { font-size: 1rem; font-weight: 700; line-height: 1.35; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.card__rating { display: flex; align-items: center; gap: 5px; font-size: .82rem; color: var(--muted); }
.card__rating .stars { color: var(--gold); letter-spacing: -1px; }
.card__price { display: flex; align-items: baseline; gap: 9px; margin-top: 2px; }
.card__price .now { font-size: 1.2rem; font-weight: 800; color: var(--forest); }
.card__price .was { font-size: .9rem; color: var(--muted); text-decoration: line-through; }
.card__price:has(.was) .now { color: #DC2626; }   /* ลดราคา → ราคาปัจจุบันเป็นสีแดง */
.card__desc { font-size: .82rem; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.card__foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.card__foot .btn { width: 100%; }
.card__media.card__open, .card__title.card__open { cursor: pointer; }
.card__title.card__open:hover { color: var(--forest); }

/* ================= Product detail — Full-screen premium ================= */
.pmodal {
  position: fixed; inset: 0; z-index: 300; background: var(--bg, #F5FAF6);
  opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s var(--ease);
}
.pmodal.open { opacity: 1; visibility: visible; }
.pfull {
  display: flex; flex-direction: column; height: 100%; width: 100%;
  transform: translateY(26px); transition: transform .3s var(--ease);
}
.pmodal.open .pfull { transform: none; }

/* แถบบน: ปุ่มกลับ / ชื่อหมวด / ปุ่มปิด */
.pfull__bar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; background: rgba(255,255,255,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); z-index: 3;
}
.pfull__back {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .95rem;
  color: var(--text); cursor: pointer; padding: 6px 4px; transition: color .2s, gap .2s; background: transparent;
}
.pfull__back:hover { color: var(--forest); gap: 11px; }
.pfull__cat {
  font-weight: 700; font-size: .9rem; color: var(--moss); letter-spacing: .02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 8px;
}
.pfull__x {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; background: #fff; color: var(--text);
  display: grid; place-items: center; font-size: 1.15rem; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: transform .2s, background .2s;
}
.pfull__x:hover { transform: rotate(90deg); background: #ebf7f0; }

/* พื้นที่เลื่อนอ่าน */
.pfull__scroll { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pfull__inner { max-width: 760px; margin: 0 auto; padding: 0 20px 40px; }
.pfull__details { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 22px; }

/* ส่วนสรุป (รูป+ชื่อ+ราคา) เลื่อนขึ้นไปพร้อมเนื้อหา ไม่ปักหมุดค้างด้านบน */
.pfull__summary {
  background: var(--bg, #F5FAF6);
  padding: 28px 0 4px;
  display: flex; align-items: center; gap: 34px;
}
.pfull__summary-info { flex: 1 1 auto; min-width: 0; }

/* รูปสินค้าใหญ่ ฝั่งซ้าย / ชื่อ+ราคา ฝั่งขวา */
.pfull__hero {
  position: relative; background: #fff; border-radius: var(--radius-lg); overflow: hidden;
  width: 100%; max-width: 380px; aspect-ratio: 1/1; margin: 0; flex: 0 0 auto;
  box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center;
}
.pfull__hero img { width: 100%; height: 100%; object-fit: contain; padding: 22px; }

/* ข้อมูลสินค้า */
.pfull__title { font-size: 1.5rem; font-weight: 800; line-height: 1.3; color: var(--text); margin: 6px 0 6px; overflow-wrap: anywhere; }
.pfull__rating { display: flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); }
.pfull__rating .stars { color: var(--gold); letter-spacing: -1px; }
.pfull__price { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 2px; flex-wrap: wrap; }
.pfull__price .now { font-size: 1.7rem; font-weight: 800; color: var(--forest); }
.pfull__price .was { font-size: 1rem; color: var(--muted); text-decoration: line-through; }
.pfull__price:has(.was) .now { color: #DC2626; }   /* ลดราคา → ราคาปัจจุบันเป็นสีแดง */
.pfull__dhead { font-size: 1.1rem; font-weight: 800; color: var(--text); margin: 4px 0 12px; }
.pfull__desc {
  font-size: .96rem; line-height: 1.85; color: var(--text); white-space: normal;
}
.pfull__note {
  font-size: .82rem; color: var(--muted); margin-top: 22px; display: flex; align-items: center; gap: 8px;
  background: #ebf7f0; padding: 12px 14px; border-radius: var(--radius-sm);
}

/* แถบปุ่มซื้อค้างด้านล่างตลอด */
.pfull__actionbar {
  flex: 0 0 auto; background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); box-shadow: 0 -6px 22px rgba(24,54,35,.06);
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
}
.pfull__actionbar-inner { max-width: 760px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.pfull__actionbar .card__add { flex: 1; }

/* ไอคอนแว่นขยายบนรูป + zoom */
.pfull__hero.pmodal__zoom { cursor: zoom-in; }
.pmodal__zoomhint {
  position: absolute; bottom: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; font-size: .95rem;
  pointer-events: none; opacity: .85; transition: transform .2s, opacity .2s;
}
.pmodal__zoom:hover .pmodal__zoomhint { transform: scale(1.1); opacity: 1; }

/* ---- แกลเลอรีรูปสินค้า (หลายรูป: ปัดนิ้ว / ลูกศร / จุด) ---- */
.pgal { display: block; }
.pgal__track {
  display: flex; width: 100%; height: 100%;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
  scroll-behavior: smooth; overscroll-behavior-x: contain;
}
.pgal__track::-webkit-scrollbar { display: none; }
.pgal__slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; cursor: zoom-in; }
.pgal__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.92); color: var(--text); font-size: .9rem;
  box-shadow: var(--shadow-sm); transition: background .2s, transform .2s;
}
.pgal__nav:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.pgal__nav--prev { left: 10px; }
.pgal__nav--next { right: 10px; }
.pgal__dots { position: absolute; left: 0; right: 0; bottom: 12px; z-index: 2; display: flex; justify-content: center; gap: 7px; }
.pgal__dots button {
  width: 8px; height: 8px; border-radius: 50%; padding: 0;
  background: rgba(24,54,35,.28); transition: background .2s, width .2s;
}
.pgal__dots button.active { background: var(--forest); width: 20px; border-radius: var(--pill); }

/* มือถือ: ปุ่มลูกศรเล็กลงและขยับชิดขอบ แต่ยังกดได้ (ปัดนิ้วก็ยังได้เหมือนเดิม) */
@media (max-width: 640px) {
  .pgal__nav { width: 34px; height: 34px; font-size: .8rem; }
  .pgal__nav--prev { left: 6px; }
  .pgal__nav--next { right: 6px; }
}

/* ปุ่มหัวใจ (ไอคอนวงกลมล้วน) */
.pmodal__fav {
  position: static; flex: 0 0 auto; width: 50px; height: 50px; border-radius: 50%;
  border: 1.6px solid var(--line); background: #fff; color: var(--muted);
  display: grid; place-items: center; font-size: 1.2rem; cursor: pointer;
  transition: transform .2s, color .2s, border-color .2s;
}
.pmodal__fav:hover { transform: scale(1.08); color: #d9534f; border-color: #d9534f; }
.pmodal__fav.active { color: #d9534f; border-color: #d9534f; }
.pmodal__fav.active i { font-weight: 900; }

/* Lightbox: ดูรูปสินค้าเต็มจอ */
.lightbox {
  position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(0,0,0,.9); cursor: zoom-out;
  opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility .25s var(--ease);
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: 8px;
  box-shadow: 0 12px 50px rgba(0,0,0,.5); background: #fff; cursor: default;
  transform: scale(.96); transition: transform .25s var(--ease);
}
.lightbox.open img { transform: scale(1); }
.lightbox__close {
  position: absolute; top: 18px; right: 22px; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff; display: grid; place-items: center;
  font-size: 1.3rem; cursor: pointer; transition: background .2s, transform .2s;
}
.lightbox__close:hover { background: rgba(255,255,255,.3); transform: rotate(90deg); }

/* แกลเลอรีในโหมดเต็มจอ */
.lightbox__gal { position: relative; width: min(96vw, 1100px); height: 92vh; }
.lightbox__track { height: 100%; }
.lightbox__slide { display: flex; align-items: center; justify-content: center; cursor: default; }
.lightbox__slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; padding: 0; }
.lightbox__dots { bottom: 6px; }
.lightbox__dots button { background: rgba(255,255,255,.45); }
.lightbox__dots button.active { background: #fff; }

@media (max-width: 760px) {
  .pfull__inner { max-width: 640px; padding: 22px 18px 32px; }
  .pfull__summary { flex-direction: column; align-items: stretch; gap: 0; }
  .pfull__hero { max-width: 340px; margin: 0 auto 20px; }
}
@media (max-width: 640px) {
  .pfull__hero { max-width: 280px; }
  .pfull__title { font-size: 1.3rem; }
  .pfull__price .now { font-size: 1.5rem; }
  .pfull__cat { max-width: 42vw; }
}

/* Toast */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  background: var(--text); color: #fff; padding: 13px 22px; border-radius: var(--pill);
  box-shadow: var(--shadow-lg); font-size: .92rem; font-weight: 600; display: flex; align-items: center; gap: 10px;
  animation: toastIn .3s var(--ease); max-width: 90vw;
}
.toast i { color: #7ce3a5; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   FLOATING CART BUTTON (ปุ่มตะกร้าลอย มุมขวาล่าง)
   ========================================================================== */
.cart-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 45;
  display: inline-flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 22px 0 20px; border-radius: var(--pill);
  background: var(--forest); color: #fff; font-weight: 700; font-size: .95rem;
  box-shadow: 0 14px 32px rgba(22,162,73,.42);
  transform: translateY(26px) scale(.85); opacity: 0; pointer-events: none;
  transition: transform .35s var(--ease), opacity .3s var(--ease), background .2s;
}
.cart-fab.show { transform: none; opacity: 1; pointer-events: auto; }
.cart-fab:hover { background: var(--moss); transform: translateY(-3px); }
.cart-fab > i { font-size: 1.3rem; }
.cart-fab__badge {
  position: absolute; top: -7px; right: -5px; min-width: 25px; height: 25px; padding: 0 6px;
  background: var(--gold); color: #3a2f16; font-size: .8rem; font-weight: 800;
  border-radius: var(--pill); display: grid; place-items: center; border: 2.5px solid #fff;
  box-shadow: var(--shadow-sm);
}
.cart-fab.bump { animation: cartBump .45s var(--ease); }
@keyframes cartBump { 0%{transform:scale(1)} 30%{transform:scale(1.15)} 55%{transform:scale(.95)} 100%{transform:scale(1)} }

/* ขณะเปิดหน้าสินค้าเต็มจอ (modal): ยกปุ่มตะกร้าให้อยู่เหนือ modal + ลอยเหนือแถบปุ่มล่าง */
body.pmodal-open .cart-fab { z-index: 320; bottom: calc(94px + env(safe-area-inset-bottom, 0px)); }

@media (max-width: 480px) {
  .cart-fab { right: 14px; bottom: 14px; height: 52px; padding: 0 18px; }
  .cart-fab__label { display: none; }   /* จอเล็ก: โชว์แค่ไอคอน + จำนวน */
}

/* ---------- ปุ่มตัวกรองลอย (คู่กับปุ่มตะกร้า) ---------- */
.filter-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 45;
  display: none;                        /* แสดงเฉพาะจอมือถือ (sidebar เป็น drawer) */
  align-items: center; gap: 10px;
  height: 56px; padding: 0 22px 0 20px; border-radius: var(--pill);   /* เท่าปุ่มตะกร้า */
  background: #fff; color: var(--forest); font-weight: 700; font-size: .95rem;
  border: 1.6px solid var(--forest);
  box-shadow: 0 10px 26px rgba(24,54,35,.18);
  transition: transform .2s var(--ease), background .2s var(--ease), color .2s, bottom .3s var(--ease);
}
.filter-fab:hover { background: var(--forest); color: #fff; transform: translateY(-3px); }
.filter-fab > i { font-size: 1.3rem; }
/* เมื่อปุ่มตะกร้าโผล่ ให้ปุ่มตัวกรองขยับขึ้นไปอยู่ด้านบน */
body.has-cart-fab .filter-fab { bottom: 90px; }

/* ==========================================================================
   สถานะสต็อกในหน้ารายละเอียดสินค้า
   ========================================================================== */
.pfull__stock { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; font-size: .88rem; font-weight: 700; color: #15803d; }
.pfull__stock--low { color: #a67c2e; }
.pfull__stock--out { color: #a13c3c; }

/* ==========================================================================
   ฟอร์มสั่งซื้อ (checkout) — เปิดจากปุ่ม "ดำเนินการสั่งซื้อ" ในหน้าตะกร้า
   ========================================================================== */
.co {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px;
  background: rgba(18,45,28,.55); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
}
.co.open { opacity: 1; pointer-events: auto; }
.co__panel {
  width: min(520px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto;
  background: #fff; border-radius: var(--radius-lg); box-shadow: 0 30px 70px rgba(18,45,28,.35);
  transform: translateY(16px) scale(.98); transition: transform .28s var(--ease);
}
.co.open .co__panel { transform: none; }
.co__head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 20px; background: #fff; border-bottom: 1px solid var(--line);
}
.co__head h3 { font-size: 1.05rem; font-weight: 800; }
.co__x { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: background .2s; }
.co__x:hover { background: #edf6f0; }

.co__form { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 14px; }
/* label เป็น block (ไม่ใช่ flex column) — ถ้าเป็น flex ข้อความกับ <span class="req">*</span>
   จะกลายเป็น flex item คนละตัวแล้วตกบรรทัดแยกกัน ช่องกรอกจึงใช้ margin-top ดันลงมาแทน */
.co__form label { display: block; font-size: .88rem; font-weight: 700; color: var(--text); }
.co__form label > input, .co__form label > textarea,
.co__form label > select, .co__form label > .cb { display: block; margin-top: 6px; }
.co__form .req { color: #d9534f; }
.co__form input:not([type="radio"]), .co__form textarea, .co__form select {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--radius);
  font: inherit; font-weight: 400; background: #fff; transition: border-color .2s, box-shadow .2s;
}
.co__form input:focus, .co__form textarea:focus, .co__form select:focus {
  outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(22,162,73,.12);
}
.co__form textarea { resize: vertical; }
/* select: ซ่อนลูกศรของ OS แล้ววาด chevron เอง ให้หน้าตาตรงกับช่องกรอกอื่น ๆ ทุกเบราว์เซอร์ */
.co__form select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23748B7C' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M8 10l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.co__form input[readonly] { background: var(--bg); color: var(--muted); cursor: default; }

/* ---------- COMBOBOX: dropdown + ช่องพิมพ์ค้นหา (จังหวัด / อำเภอ / ตำบล) ----------
   สร้างครอบ <select> ด้วย makeCombo() ใน main.js — select ตัวจริงถูกซ่อนแต่ยังเก็บค่า */
.cb { position: relative; }
.co__form select.cb__native {
  position: absolute; width: 1px; height: 1px; min-height: 0;
  padding: 0; margin: 0; border: 0; opacity: 0; pointer-events: none; appearance: none;
}
.cb__btn {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: #fff; font: inherit; transition: border-color .2s, box-shadow .2s;
}
.cb.is-open .cb__btn, .cb__btn:focus-visible { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(22,162,73,.12); }
.cb__btn > i { margin-left: auto; flex: none; color: var(--muted); font-size: .82rem; }
.cb__btn:disabled { background: var(--bg); cursor: not-allowed; }
.cb__val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb__val.is-empty { color: var(--muted); }

.cb__panel {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.cb--up .cb__panel { top: auto; bottom: calc(100% + 6px); }   /* ที่ว่างด้านล่างไม่พอ → เปิดขึ้นบน */
.cb__search { display: flex; align-items: center; gap: 9px; padding: 10px 13px; border-bottom: 1px solid var(--line); }
.cb__search > i { flex: none; color: var(--muted); font-size: .9rem; }
.co__form .cb__search input {
  border: 0; border-radius: 0; padding: 0; background: none;
  box-shadow: none; outline: none;
}
.cb__list { max-height: 260px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.cb__list li { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; transition: background .15s; }
.cb__list li > i { flex: none; width: 14px; font-size: .82rem; color: var(--forest); visibility: hidden; }
.cb__list li[aria-selected="true"] { font-weight: 700; background: #f1faf5; }
.cb__list li[aria-selected="true"] > i { visibility: visible; }
.cb__list li:hover, .cb__list li:focus { background: #e3f6ea; outline: none; }
.cb__list li.cb__none { color: var(--muted); cursor: default; }
.cb__list li.cb__none:hover { background: none; }

.co__pay { border: none; display: flex; flex-direction: column; gap: 10px; }
.co__pay legend { font-size: .88rem; font-weight: 700; margin-bottom: 8px; }
.co__radio {
  display: flex; flex-direction: row; align-items: center; gap: 12px; cursor: pointer;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius); transition: border-color .2s, background .2s;
}
.co__radio:has(input:checked) { border-color: var(--forest); background: #f1faf5; }
.co__radio input { width: 18px; height: 18px; accent-color: var(--forest); flex: none; }
.co__radio span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.co__radio small { font-weight: 400; font-size: .78rem; color: var(--muted); }
/* ป้ายวิธีชำระเงิน + ค่าธรรมเนียม = บรรทัดเดียวเสมอ
   nowrap กันตกบรรทัด + ย่อขนาดตัวอักษรบนจอแคบเพื่อให้พอดีไม่ล้นการ์ด */
.co__radio b { display: block; white-space: nowrap; }
.co__radio [data-co-cod-pct] {
  display: inline; font-weight: 400; font-size: .84rem; color: var(--muted);
}
@media (max-width: 430px) {
  .co__radio b { font-size: .92rem; }
  .co__radio [data-co-cod-pct] { font-size: .74rem; }
}
@media (max-width: 370px) {
  .co__radio b { font-size: .86rem; }
  .co__radio [data-co-cod-pct] { font-size: .68rem; }
}

.co__total {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: #f1faf5; border-radius: var(--radius); font-weight: 700;
}
.co__total b { font-size: 1.25rem; color: var(--forest); }
.co__err { background: #fdeaea; color: #a13c3c; padding: 11px 14px; border-radius: var(--radius); font-size: .88rem; font-weight: 600; }

/* ---------- ป๊อปอัพยืนยัน (askConfirm) — เช่น เตือนว่าสั่งของชุดนี้ไปแล้ววันนี้ ---------- */
.co__panel--sm { width: min(430px, 100%); }
.cf__body { padding: 18px 20px 4px; }
.cf__lead { font-size: .94rem; color: var(--muted); }
.cf__box {
  margin: 14px 0; padding: 12px 14px; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.cf__row { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; font-size: .92rem; }
.cf__row span { color: var(--muted); flex: none; }
.cf__row b { text-align: right; overflow-wrap: anywhere; }
.cf__ask { font-weight: 700; }
.cf__foot { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 9px; }

/* ==========================================================================
   หน้าชำระเงิน /checkout — การ์ดเรียงลงทีละใบ (ที่อยู่ → สินค้า → ชำระเงิน → สลิป → สรุป)
   ใช้สไตล์ label/input จาก .co__form ร่วมกัน จึงมีแค่ส่วนโครงการ์ดที่นี่
   ========================================================================== */
.co-page { max-width: 680px; }

.co-page__bar { display: flex; align-items: center; gap: 10px; padding: 4px 0 18px; }
.co-page__back {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 50%; color: var(--text); transition: background .2s, color .2s;
}
.co-page__back:hover { background: #e3f6ea; color: var(--forest); }
.co-page__bar h1 { font-size: 1.35rem; font-weight: 800; }

.co-form { display: flex; flex-direction: column; gap: 16px; padding: 0; }
.co-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.co-card__title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 800; }
.co-card__title i { color: var(--forest); }
/* label ใน .co__form เป็น flex column อยู่แล้ว — .co-lbl คือบรรทัดหัวข้อของช่องที่สลับ select/input ได้ */
.co-lbl { font-size: .88rem; font-weight: 700; }

/* ที่อยู่เต็ม (พรีวิวที่อยู่ที่ประกอบจากช่องด้านบน) */
.co-addr-full { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; }
.co-addr-full__label { font-size: .82rem; color: var(--muted); }
.co-addr-full p { margin-top: 4px; font-weight: 600; overflow-wrap: anywhere; }
.co-addr-full p.is-empty { font-weight: 400; color: var(--muted); }

/* รายการสินค้า */
.co-items { display: flex; flex-direction: column; gap: 10px; }
.co-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px;
}
.co-item__name { font-weight: 700; overflow-wrap: anywhere; }
.co-item__qty { font-weight: 700; text-align: right; white-space: nowrap; }
.co-item__unit { font-size: .84rem; color: var(--muted); }
.co-item__sum { font-weight: 700; text-align: right; white-space: nowrap; }

/* กล่องเลขบัญชีธนาคาร */
.co-bank { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.co-bank__head { font-weight: 700; margin-bottom: 10px; }
.co-bank__row { padding: 10px 0; }
.co-bank__row + .co-bank__row { border-top: 1px dashed var(--line); }
/* โลโก้ธนาคาร — กลางกล่อง ใต้หัวข้อ "โอนเงินผ่านบัญชี" */
.co-bank__logo {
  display: block; height: 40px; width: auto; max-width: 150px;
  margin: 2px auto 10px; object-fit: contain;
}
.co-bank__logo--txt {
  width: 40px; display: grid; place-items: center;
  border-radius: 10px; font-weight: 800; font-size: .9rem;
}
.co-bank__acct { font-weight: 700; overflow-wrap: anywhere; }
.co-bank__name { font-size: .92rem; color: var(--muted); margin-top: 2px; }
.co-bank__copy {
  margin-left: 8px; padding: 3px 10px; border-radius: var(--pill); font-size: .78rem; font-weight: 700;
  background: #e3f6ea; color: var(--forest); transition: background .2s;
}
.co-bank__copy:hover { background: #d3f0de; }
.co-bank__loading, .co-bank__empty { font-size: .9rem; color: var(--muted); }

/* กล่องอัปโหลดสลิป */
.co-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer;
  padding: 30px 20px; border: 2px dashed var(--line); border-radius: var(--radius);
  text-align: center; transition: border-color .2s, background .2s;
}
.co-drop:hover, .co-drop.is-over { border-color: var(--forest); background: #f1faf5; }
.co-drop > i { font-size: 1.7rem; color: var(--muted); }
.co-drop__cta { color: var(--forest); font-weight: 700; }
.co-drop__hint { font-size: .82rem; font-weight: 400; color: var(--muted); }
.co-drop__note { font-size: .8rem; color: var(--muted); }

.co-slip { display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.co-slip img { width: 54px; height: 54px; flex: none; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.co-slip__name { flex: 1; min-width: 0; font-size: .88rem; font-weight: 600; overflow-wrap: anywhere; }
.co-slip__x { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--muted); transition: background .2s, color .2s; }
.co-slip__x:hover { background: #fdeaea; color: #a13c3c; }

/* ตะกร้าว่าง / โหลดข้อมูลไม่สำเร็จ */
.co-blank { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 46px 24px; text-align: center; }
.co-blank > i { font-size: 2.6rem; color: var(--sage); }
.co-blank h2 { font-size: 1.2rem; font-weight: 800; margin: 14px 0 6px; }
.co-blank p { color: var(--muted); margin-bottom: 20px; }

@media (max-width: 600px) {
  .co-card { padding: 18px 16px; border-radius: var(--radius); }
  .co-card__title { font-size: 1.05rem; }
  .co-page__bar h1 { font-size: 1.2rem; }
}

/* ==========================================================================
   ป๊อบอัพแชท LINE — อยู่มุมซ้ายล่าง (มุมขวาเป็นของปุ่มตะกร้า/ตัวกรอง)
   ========================================================================== */
.line-chat { position: fixed; left: 22px; bottom: 22px; z-index: 46; }
.line-chat__fab {
  position: relative; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; background: #06C755; color: #fff;
  box-shadow: 0 12px 28px rgba(6,199,85,.4);
  transform: translateY(26px) scale(.85); opacity: 0; pointer-events: none;
  transition: transform .35s var(--ease), opacity .3s var(--ease), box-shadow .2s;
}
.line-chat.show .line-chat__fab { transform: none; opacity: 1; pointer-events: auto; }
.line-chat.show .line-chat__fab:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(6,199,85,.5); }
.line-chat__fab > i { position: absolute; font-size: 1.8rem; transition: opacity .2s var(--ease), transform .25s var(--ease); }
.line-chat__fab-x { font-size: 1.35rem !important; opacity: 0; transform: rotate(-90deg); }
.line-chat.open .line-chat__fab > .fa-line { opacity: 0; transform: rotate(90deg); }
.line-chat.open .line-chat__fab-x { opacity: 1; transform: none; }

.line-chat__panel {
  position: absolute; left: 0; bottom: 72px; width: 300px; max-width: calc(100vw - 44px);
  background: #fff; border-radius: var(--radius-lg); box-shadow: 0 20px 48px rgba(18,45,28,.24);
  padding: 0 18px 18px; overflow: hidden;
  transform: translateY(12px) scale(.96); transform-origin: 30px bottom;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: transform .28s var(--ease), opacity .22s var(--ease), visibility .28s;
}
.line-chat.open .line-chat__panel { transform: none; opacity: 1; pointer-events: auto; visibility: visible; }

.line-chat__head {
  display: flex; align-items: center; gap: 12px;
  margin: 0 -18px 14px; padding: 16px 14px 16px 18px;
  background: #06C755; color: #fff;
}
.line-chat__head > .fa-line { font-size: 2rem; }
.line-chat__head div { display: flex; flex-direction: column; line-height: 1.35; flex: 1; }
.line-chat__head b { font-size: .98rem; }
.line-chat__head span { font-size: .76rem; opacity: .88; }
.line-chat__x { width: 30px; height: 30px; border-radius: 50%; color: #fff; display: grid; place-items: center; transition: background .2s; }
.line-chat__x:hover { background: rgba(255,255,255,.22); }

.line-chat__msg { font-size: .9rem; line-height: 1.65; color: var(--text); margin-bottom: 14px; }
.line-chat__id {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  background: #eff8f2; border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px 12px;
}
.line-chat__id span { font-size: .74rem; color: var(--muted); }
.line-chat__id b { flex: 1; font-size: .95rem; letter-spacing: .3px; }
.line-chat__id button { width: 30px; height: 30px; border-radius: 8px; color: var(--forest); display: grid; place-items: center; transition: background .2s; }
.line-chat__id button:hover { background: #d3f0de; }

.line-chat__cta {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; border-radius: var(--pill); background: #06C755; color: #fff;
  font-weight: 700; font-size: .93rem; transition: background .2s, transform .2s var(--ease);
}
.line-chat__cta:hover { background: #05b34c; transform: translateY(-2px); }
.line-chat__cta > i { font-size: 1.25rem; }

/* ===== แชทในเว็บกับแอดมิน (ปุ่มลอยฝั่งซ้าย ซ้อนเหนือปุ่ม LINE) ===== */
.site-chat {
  position: fixed; right: 22px; bottom: 22px; left: auto; z-index: 47;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
/* ระยะยกให้พ้นปุ่มตะกร้า/ปุ่มตัวกรองที่อยู่มุมเดียวกัน คำนวณจากตำแหน่งจริงใน main.js
   (layoutRightFabs) แล้วเซ็ตเป็น inline style ทับค่าตรงนี้ — ตัวเลขตายตัวเดาไม่ครบทุกจอ */

/* ปุ่ม LINE เหนือปุ่มแชท — กดแล้วไปแชท LINE ของร้านตรง ๆ (ไม่เปิดแผงในเว็บ)
   ซ่อนตอนแผงแชทเปิด เพราะแผงกางขึ้นมาทับตำแหน่งนี้พอดี */
.site-chat__line {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--forest); color: #fff; font-size: 1.7rem;
  display: grid; place-items: center; box-shadow: 0 12px 28px rgba(24,54,35,.28);
  transform: translateY(24px) scale(.6); opacity: 0; pointer-events: none;
  transition: transform .3s var(--ease), opacity .3s var(--ease), box-shadow .2s;
}
.site-chat.show .site-chat__line { transform: none; opacity: 1; pointer-events: auto; }
.site-chat.show .site-chat__line:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(24,54,35,.4); }
.site-chat.open .site-chat__line { opacity: 0; transform: translateY(10px) scale(.8); pointer-events: none; }

.site-chat__fab {
  position: relative; width: 60px; height: 60px; border-radius: 50%;
  background: var(--forest); color: #fff; border: 0; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 12px 28px rgba(24,54,35,.28);
  transform: translateY(24px) scale(.6); opacity: 0; pointer-events: none;
  transition: transform .3s var(--ease), opacity .3s var(--ease), box-shadow .2s;
}
.site-chat.show .site-chat__fab { transform: none; opacity: 1; pointer-events: auto; }
.site-chat.show .site-chat__fab:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(24,54,35,.4); }
.site-chat__fab > i { position: absolute; font-size: 1.7rem; transition: opacity .2s var(--ease), transform .25s var(--ease); }
.site-chat__fab-x { font-size: 1.35rem !important; opacity: 0; transform: rotate(-90deg); }
.site-chat.open .site-chat__fab > .fa-comment-dots { opacity: 0; transform: rotate(90deg); }
.site-chat.open .site-chat__fab-x { opacity: 1; transform: none; }
.site-chat__badge {
  position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--gold); color: #3a2f16; font-size: .72rem; font-weight: 800;
  display: grid; place-items: center; border: 2px solid #fff;
}
.site-chat__panel {
  position: absolute; right: 0; left: auto; bottom: 72px; width: 330px; max-width: calc(100vw - 44px);
  background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: min(70vh, 520px);
  opacity: 0; transform: translateY(12px) scale(.96); transform-origin: right bottom; pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.site-chat.open .site-chat__panel { opacity: 1; transform: none; pointer-events: auto; }
.site-chat__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--forest); color: #fff; }
.site-chat__head > i { font-size: 1.3rem; }
.site-chat__head > div { flex: 1; }
.site-chat__head b { display: block; font-size: .96rem; }
.site-chat__head span { font-size: .76rem; opacity: .85; }
.site-chat__x { margin-left: auto; background: rgba(255,255,255,.18); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.site-chat__body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #f5faf6; min-height: 180px; }
.sc-msg { display: flex; }
.sc-msg--me { justify-content: flex-end; }
.sc-msg__bubble { max-width: 78%; padding: 9px 13px; border-radius: 14px; font-size: .9rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.sc-msg--admin .sc-msg__bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--text); }
.sc-msg--me .sc-msg__bubble { background: var(--forest); color: #fff; border-bottom-right-radius: 4px; }
.site-chat__gate { padding: 26px 20px; text-align: center; color: var(--muted); }
.site-chat__gate > i { font-size: 2.2rem; color: #06C755; }
.site-chat__gate p { font-size: .9rem; margin: 10px 0 16px; }
.site-chat__form { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.site-chat__form textarea { flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; font-family: inherit; font-size: .92rem; max-height: 110px; line-height: 1.5; }
.site-chat__form textarea:focus { outline: none; border-color: var(--olive); }
.site-chat__send { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; background: var(--forest); color: #fff; border: 0; cursor: pointer; display: grid; place-items: center; }
.site-chat__send:hover { filter: brightness(1.08); }
@media (max-width: 1024px) {
  /* จอนี้มีแถบเมนูล่าง (.bottom-nav) สูงราว 64px — วางให้พ้นแถบนั้นพอดี เท่าระดับปุ่ม LINE ฝั่งซ้าย */
  .site-chat { right: 16px; left: auto; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .site-chat__fab { width: 52px; height: 52px; }
  .site-chat__fab > i { font-size: 1.5rem; }
  .site-chat__line { width: 52px; height: 52px; font-size: 1.5rem; }
  .site-chat__panel { bottom: 64px; }
}

/* มือถือ/ไอแพด: ยกขึ้นเหนือแถบเมนูล่าง เท่ากับปุ่มตัวกรอง */
@media (max-width: 1024px) {
  .line-chat { left: 16px; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .line-chat__fab { width: 52px; height: 52px; }
  .line-chat__fab > i { font-size: 1.6rem; }
  .line-chat__panel { bottom: 66px; }
}

@media (max-width: 760px) {
  .filter-fab { display: inline-flex; }
  .shop-toolbar .filter-toggle { display: none; }  /* ใช้ปุ่มตัวกรองลอยแทน ไม่ให้ซ้ำซ้อน */
}
@media (max-width: 480px) {
  .filter-fab { right: 14px; bottom: 14px; height: 52px; padding: 0 18px; }   /* เท่าปุ่มตะกร้าบนจอเล็ก */
  body.has-cart-fab .filter-fab { bottom: 78px; }
  .filter-fab__label { display: none; }
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 50px; align-items: center; }
.about__media { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.about__media .m1 { aspect-ratio: 3/4; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.about__media .m2 { aspect-ratio: 3/4; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); margin-top: 32px; }
.about p.body { color: var(--muted); margin: 16px 0; font-size: 1.02rem; }
.about__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; background: var(--forest); border-radius: var(--radius-lg); padding: 26px 22px; color: #fff; }
.about__stats .st b { font-size: 1.7rem; font-weight: 800; display: block; }
.about__stats .st span { font-size: .84rem; color: rgba(255,255,255,.82); }
.about__list { display: grid; gap: 12px; margin: 20px 0; }
.about__list li { display: flex; align-items: flex-start; gap: 11px; font-size: .98rem; }
.about__list i { color: var(--forest); margin-top: 4px; }

/* ==========================================================================
   SPECIAL DEAL (wide banner)
   ========================================================================== */
.deal {
  border-radius: var(--radius-lg); padding: 46px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--forest), var(--moss) 60%, var(--olive));
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
}
.deal::before { content:""; position:absolute; right:-40px; top:-40px; width:220px; height:220px; background: radial-gradient(circle, rgba(199,167,108,.3), transparent 70%); border-radius:50%; }
.deal__left { max-width: 560px; position: relative; z-index: 1; }
.deal__tag { display:inline-block; background: var(--gold); color:#3a2f16; font-weight:800; padding:5px 14px; border-radius: var(--pill); font-size:.8rem; margin-bottom:14px; }
.deal h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800; line-height: 1.2; }
.deal p { color: rgba(255,255,255,.86); margin: 10px 0 22px; }
.countdown { display: flex; gap: 12px; position: relative; z-index: 1; }
.countdown .unit { background: rgba(255,255,255,.14); backdrop-filter: blur(4px); border-radius: var(--radius); padding: 14px 16px; text-align: center; min-width: 74px; }
.countdown .unit b { font-size: 1.8rem; font-weight: 800; display: block; line-height: 1; }
.countdown .unit span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.8); }

/* ==========================================================================
   TESTIMONIALS
   ========================================================================== */
.testimonials { background: var(--sage); }
.testi { max-width: 720px; margin-inline: auto; text-align: center; }
.testi__avatars { display: flex; justify-content: center; gap: -10px; margin-bottom: 22px; }
.testi__avatars img, .testi__avatars .av { width: 54px; height: 54px; border-radius: 50%; border: 3px solid #fff; margin-left: -8px; object-fit: cover; box-shadow: var(--shadow-sm); overflow: hidden; }
.testi__card { background: #fff; border-radius: var(--radius-lg); padding: 40px 44px; box-shadow: var(--shadow); position: relative; will-change: transform, opacity; }
.testi__quote { font-size: 1.15rem; line-height: 1.7; color: var(--text); font-weight: 500; }
.testi__stars { color: var(--gold); margin: 16px 0 10px; font-size: 1.05rem; }
.testi__who b { display: block; font-weight: 800; }
.testi__who span { color: var(--muted); font-size: .88rem; }
.testi__nav { display: flex; justify-content: center; gap: 14px; margin-top: 24px; }
.testi__nav button { width: 50px; height: 50px; border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; transition: background .2s, transform .2s; }
.testi__nav button:hover { background: var(--moss); transform: scale(1.06); }

/* ==========================================================================
   BLOG CARDS
   ========================================================================== */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
/* ข่าวสาร&บทความ หน้าแรก: ปุ่มเลื่อน (โชว์เฉพาะมือถือ) */
.home-blog__nav { display: none; }
.slider-btn {
  width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--forest);
  border: 1.5px solid var(--line); box-shadow: var(--shadow-sm);
  display: grid; place-items: center; font-size: 1rem; transition: background .2s, color .2s, transform .15s;
}
.slider-btn:hover { background: var(--forest); color: #fff; }
.slider-btn:active { transform: scale(.93); }
@media (max-width: 760px) {
  .home-blog .blog-grid {
    display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px;
  }
  .home-blog .blog-grid::-webkit-scrollbar { display: none; }
  .home-blog .blog-grid > .blog-card { flex: 0 0 84%; scroll-snap-align: center; }
  .home-blog__nav { display: flex; justify-content: center; gap: 14px; margin-top: 18px; }
}
.blog-card { background: #fff; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease); display: flex; flex-direction: column; }
.blog-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.blog-card__media { aspect-ratio: 16/10; overflow: hidden; }
.blog-card__media img, .blog-card__media .ph-media { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.blog-card:hover .blog-card__media img { transform: scale(1.05); }
.blog-card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.blog-card__meta { display: flex; align-items: center; gap: 14px; font-size: .8rem; color: var(--muted); }
.blog-card__meta .tag { background: #e3f6ea; color: var(--forest); padding: 4px 11px; border-radius: var(--pill); font-weight: 600; }
.blog-card__body h3 { font-size: 1.12rem; font-weight: 700; line-height: 1.4; }
.blog-card__body p { color: var(--muted); font-size: .92rem; flex: 1; }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq-grid { display: grid; grid-template-columns: 1.4fr .7fr; gap: 40px; align-items: start; }
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .2s; }
.faq-item.open { box-shadow: var(--shadow); }
.faq-q { width: 100%; text-align: left; padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-weight: 700; font-size: 1rem; color: var(--text); }
.faq-item.open .faq-q { color: var(--forest); }
.faq-q .ic { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: #e3f6ea; color: var(--forest); display: grid; place-items: center; transition: transform .3s var(--ease), background .3s; }
.faq-item.open .faq-q .ic { background: var(--forest); color: #fff; transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s var(--ease); }
.faq-a p { padding: 0 22px 22px; color: var(--muted); }
.faq-cta { background: var(--forest); border-radius: var(--radius-lg); padding: 34px; color: #fff; text-align: center; }
.faq-cta .ic { width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,.15); display: grid; place-items: center; margin: 0 auto 16px; font-size: 1.4rem; }
.faq-cta h3, .faq-cta h4 { font-size: 1.2rem; font-weight: 800; }
.faq-cta p { color: rgba(255,255,255,.82); margin: 8px 0 20px; font-size: .92rem; }

/* ---------- การ์ดติดต่อแบบยืนเดี่ยว (ไม่มีลิสต์คำถามข้าง ๆ) ----------
   ขนาดใหญ่กว่าเวอร์ชันที่อยู่ข้างลิสต์ · สเกลด้วย clamp ให้ย่อ-ขยายลื่นตามจอ
   ต้องอยู่ "หลัง" กฎ .faq-cta ด้านบน เพราะ .faq-cta--solo .ic กับ .faq-cta .ic
   ความจำเพาะเท่ากัน (0,2,0) — ถ้าวางไว้ก่อน กฎฐานจะทับ ขนาดจะไม่ใหญ่ขึ้นเลย */
.faq-cta--solo {
  max-width: 860px; margin: 0 auto;
  padding: clamp(34px, 6vw, 64px) clamp(22px, 5vw, 48px);
}
.faq-cta--solo .ic { width: 84px; height: 84px; margin: 0 auto 22px; font-size: 2rem; }
.faq-cta--solo h3, .faq-cta--solo h4 { font-size: clamp(1.35rem, 3.4vw, 1.9rem); line-height: 1.35; }
.faq-cta--solo p { font-size: clamp(.96rem, 2vw, 1.1rem); margin: 12px auto 26px; max-width: 46ch; }
.faq-cta--solo .btn { padding: 14px 30px; font-size: 1rem; }

/* ==========================================================================
   NEWSLETTER
   ========================================================================== */
.newsletter { background: linear-gradient(120deg, #eff9f3, #fff); }
.newsletter__inner { text-align: center; max-width: 640px; margin-inline: auto; }
.newsletter form { display: flex; gap: 10px; margin-top: 24px; max-width: 480px; margin-inline: auto; }
.newsletter input { flex: 1; padding: 15px 20px; border-radius: var(--pill); border: 1.5px solid var(--line); background: #fff; }
.newsletter input:focus { outline: none; border-color: var(--olive); }
.contact-cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.trust-row { display: flex; justify-content: center; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 40px; }
.trust-row .tr { display: flex; align-items: center; gap: 12px; }
.trust-row .tr i { width: 46px; height: 46px; border-radius: 14px; background: #e3f6ea; color: var(--forest); display: grid; place-items: center; font-size: 1.2rem; }
.trust-row .tr b { display: block; font-size: .96rem; }
.trust-row .tr span { font-size: .8rem; color: var(--muted); }
/* มือถือ: 3 คอลัมน์แถวเดียว ไม่มีกรอบ/พื้นหลัง ไอคอนบน-ข้อความล่าง จัดกึ่งกลาง */
@media (max-width: 600px) {
  .trust-row { flex-direction: row; flex-wrap: nowrap; align-items: flex-start; gap: 8px; margin-top: 26px; }
  .trust-row .tr {
    flex: 1 1 0; min-width: 0;
    flex-direction: column; align-items: center; text-align: center; gap: 8px;
    background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none;
  }
  .trust-row .tr i { flex: 0 0 auto; width: 40px; height: 40px; font-size: 1rem; }
  .trust-row .tr b { font-size: .82rem; }
  .trust-row .tr span { font-size: .68rem; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
/* Footer แบบ Hero brand — โลโก้เด่นกึ่งกลาง โปร่ง พรีเมียม (ทุกโหมด · ย่อขนาดตามจอด้านล่าง) */
/* พื้น footer = สีเขียวหลักของเว็บ (var(--forest)) เปลี่ยนสีหลักที่ :root แล้ว footer เปลี่ยนตาม
   พื้นสว่างกว่าเดิมมาก → ตัวอักษรใช้ขาวล้วน/ขาวโปร่งสูง ไม่ใช้เขียวอ่อนแบบตอนพื้นเข้ม */
.footer { background: var(--forest); color: #fff; padding: 44px 0 22px; margin-top: auto; }
.footer__grid { display: block; text-align: center; }
.footer__grid .logo { justify-content: center; }
.footer .logo__text b { color: #fff; }
.footer .logo__text span { color: rgba(255,255,255,.8); }
.footer__about { color: rgba(255,255,255,.92); font-size: .96rem; margin: 14px auto 16px; max-width: 54ch; }
.footer__social { display: flex; justify-content: center; gap: 14px; }
.footer__social a { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; color: #fff; transition: background .2s, color .2s, transform .2s; }
/* hover เป็นวงกลมทอง + ตัวอักษรน้ำตาลเข้ม (คอนทราสต์ในวงกลมชัด และเด่นตัดกับพื้นเขียว) */
.footer__social a:hover { background: var(--gold); color: #3a2f16; transform: translateY(-2px); }
.footer h5 { color: #fff; font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.footer__links { display: grid; gap: 10px; }
.footer__links a { color: rgba(255,255,255,.92); font-size: .92rem; transition: color .2s, padding .2s; }
/* hover ไม่ใช้ทอง เพราะทองบนพื้นเขียวสดคอนทราสต์ต่ำ อ่านยาก — ใช้ขาวล้วน + ขีดเส้นใต้ */
.footer__links a:hover { color: #fff; text-decoration: underline; padding-left: 4px; }
.footer__contact li { display: flex; align-items: flex-start; gap: 11px; font-size: .92rem; margin-bottom: 12px; color: rgba(255,255,255,.92); }
.footer__contact i { color: rgba(255,255,255,.85); margin-top: 3px; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.28); margin-top: 24px; padding-top: 16px; display: flex; align-items: center; justify-content: center; text-align: center; gap: 8px 22px; flex-wrap: wrap; font-size: .86rem; color: rgba(255,255,255,.85); }
.footer__bottom a { color: #fff; text-decoration: underline; }

/* ==========================================================================
   PAGE HERO (inner pages)
   ========================================================================== */
.page-hero { background: linear-gradient(120deg, #eff9f3, #dff3e7); padding: 46px 0; position: relative; overflow: hidden; }
/* โลโก้ akaligo โอเวอร์เลย์ชิดขวา (แบบหน้าแรก) — ข้อความอยู่ซ้าย */
.page-hero::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  right: max(20px, 4vw); top: 6px; transform: none;
  width: min(280px, 30vw); height: 62%;
  background: url("/assets/images/banner-akaligo.webp") no-repeat top right / contain;
  opacity: .9;
}
.page-hero__inner { position: relative; z-index: 1; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a:hover { color: var(--forest); }
.breadcrumb i { font-size: .7rem; }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
.page-hero p { color: var(--muted); margin-top: 8px; max-width: 55ch; }

/* ==========================================================================
   CATEGORIES PAGE (filter + grid)
   ========================================================================== */
.shop-layout { display: grid; grid-template-columns: 270px 1fr; gap: 30px; align-items: start; }
/* ไอแพด/แท็บเล็ต (761–1024px): บีบกรอบตัวกรองให้แคบลง เพื่อให้กรอบสินค้ากว้างขึ้น */
@media (min-width: 761px) and (max-width: 1024px) {
  .shop-layout { grid-template-columns: 208px 1fr; gap: 22px; }
  .sidebar { padding: 18px 16px; }
  .sidebar .filter-opt { font-size: .9rem; }
}
.filter-toggle { display: none; }
.icon-btn.filter-close { display: none; }              /* ปุ่มปิดตัวกรอง — ซ่อนบนจอใหญ่ */
.filter-backdrop { display: none; }                    /* ฉากหลังตัวกรอง — ใช้เฉพาะโหมด drawer */
.sidebar { background: #fff; border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); position: sticky; top: 96px; }
.sidebar h2, .sidebar h3, .sidebar h4 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }
.filter-group { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.filter-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.filter-opt { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; font-size: .94rem; }
.filter-opt input { width: 18px; height: 18px; accent-color: var(--forest); cursor: pointer; }
.filter-opt .count { margin-left: auto; font-size: .8rem; color: var(--text); background: var(--bg); padding: 2px 9px; border-radius: var(--pill); }
.price-row { display: flex; align-items: center; gap: 10px; }
.price-row input[type="number"] { width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); }
.shop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.shop-toolbar .count-text { color: var(--muted); font-size: .94rem; }
.shop-toolbar select { padding: 10px 16px; border-radius: var(--pill); border: 1.5px solid var(--line); background: #fff; font-weight: 600; color: var(--text); }
.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-state i { font-size: 3rem; color: var(--sage); margin-bottom: 16px; }
.empty-state h3 { color: var(--text); font-size: 1.3rem; margin-bottom: 8px; }
.active-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { display: inline-flex; align-items: center; gap: 7px; background: #e3f6ea; color: var(--forest); padding: 6px 12px; border-radius: var(--pill); font-size: .84rem; font-weight: 600; }
.chip button { color: var(--forest); font-size: .9rem; display: grid; place-items: center; }

/* ==========================================================================
   CART PAGE
   ========================================================================== */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 30px; align-items: start; }
.cart-layout.is-empty { grid-template-columns: 1fr; }   /* ตะกร้าว่าง: คอลัมน์เดียว ให้เนื้อหากึ่งกลางเต็มความกว้าง */
.cart-items { display: flex; flex-direction: column; gap: 14px; }
.cart-item { background: #fff; border-radius: var(--radius); padding: 16px; display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 16px; align-items: center; box-shadow: var(--shadow-sm); }
.cart-item__img { width: 92px; height: 92px; border-radius: var(--radius-sm); overflow: hidden; background: #ebf7f0; flex-shrink: 0; }
.cart-item__img img, .cart-item__img .ph-media { width: 100%; height: 100%; object-fit: cover; }
.cart-item__info { min-width: 0; }   /* ให้คอลัมน์ย่อได้ กันชื่อไทยยาวดันจนล้นจอ */
.cart-item__info .cat { font-size: .78rem; color: var(--moss); font-weight: 600; }
.cart-item__info h4 { font-size: 1rem; font-weight: 700; margin: 2px 0 6px; overflow-wrap: anywhere; }
.cart-item__info .price { color: var(--forest); font-weight: 700; }
.cart-item__right { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--pill); overflow: hidden; }
.qty button { width: 34px; height: 34px; display: grid; place-items: center; color: var(--forest); transition: background .2s; }
.qty button:hover { background: #e3f6ea; }
.qty span { min-width: 38px; text-align: center; font-weight: 700; }
.cart-item__remove { color: var(--muted); font-size: .86rem; display: inline-flex; align-items: center; gap: 6px; transition: color .2s; }
.cart-item__remove:hover { color: #d9534f; }
.cart-item__subtotal { font-weight: 800; color: var(--text); }

.summary { background: #fff; border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-sm); position: sticky; top: 96px; }
.summary h2, .summary h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 18px; }
.summary__row { display: flex; justify-content: space-between; padding: 9px 0; color: var(--muted); font-size: .96rem; }
.summary__row.total { border-top: 1.5px solid var(--line); margin-top: 8px; padding-top: 16px; color: var(--text); font-weight: 800; font-size: 1.15rem; }
.summary__row.total .val { color: var(--forest); }
.coupon { display: flex; gap: 8px; margin: 16px 0; }
.coupon input { flex: 1; min-width: 0; padding: 12px 15px; border-radius: var(--pill); border: 1.5px solid var(--line); }
.summary__note { font-size: .82rem; color: var(--muted); margin-top: 14px; display: flex; gap: 8px; align-items: flex-start; }
.summary__note i { color: var(--forest); margin-top: 3px; }

/* ==========================================================================
   PROFILE / AUTH PAGE
   ========================================================================== */
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; max-width: 900px; margin-inline: auto; }
.auth-grid--single { grid-template-columns: 1fr; max-width: 460px; }  /* เหลือการ์ดเข้าสู่ระบบใบเดียว จัดกึ่งกลาง */
.auth-card { background: #fff; border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-sm); }
.auth-card h3 { font-size: 1.4rem; font-weight: 800; }
.auth-card > p.sub { color: var(--muted); margin: 6px 0 22px; font-size: .94rem; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 7px; }
.field .input-wrap { position: relative; }
.field input { width: 100%; padding: 13px 16px 13px 44px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--bg); transition: border .2s, background .2s; }
.field input:focus { outline: none; border-color: var(--olive); background: #fff; }
.field .input-wrap > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.field .toggle-pass { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; font-size: .88rem; }
.auth-row label { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.auth-row a { color: var(--forest); font-weight: 600; }
.auth-divider { text-align: center; margin: 20px 0; color: var(--muted); font-size: .84rem; position: relative; }
.auth-divider::before { content:""; position:absolute; left:0; top:50%; width:100%; height:1px; background: var(--line); }
.auth-divider span { background:#fff; padding: 0 14px; position: relative; }
.auth-spinner { width: 42px; height: 42px; margin: 6px auto 0; border: 4px solid var(--line); border-top-color: var(--forest); border-radius: 50%; animation: bpa-spin .8s linear infinite; }
@keyframes bpa-spin { to { transform: rotate(360deg); } }
.field-error { color: #d9534f; font-size: .82rem; margin-top: 6px; display: none; }
.field-error.show { display: block; }

/* Logged-in dashboard */
.profile-head { position: relative; background: linear-gradient(120deg, var(--forest), var(--moss)); border-radius: var(--radius-lg); padding: 34px; color: #fff; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.profile-head__logout { position: absolute; top: 50%; right: 24px; transform: translateY(-50%); }
/* จอใหญ่: กันพื้นที่ด้านขวาไว้ให้ปุ่มออกจากระบบ เพื่อไม่ให้ตัวเลขสถิติไปชนใต้ปุ่ม */
@media (min-width: 761px) {
  .profile-head { padding-right: 170px; }
}
@media (max-width: 760px) {
  .profile-head__logout { position: static; transform: none; width: 100%; margin-top: 18px; justify-content: center; }
}
.profile-head__avatar { width: 84px; height: 84px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 2rem; border: 3px solid rgba(255,255,255,.3); overflow: hidden; }
.profile-head__avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-head__info h2 { font-size: 1.5rem; font-weight: 800; }
.profile-head__info p { color: rgba(255,255,255,.85); font-size: .94rem; }
.profile-head__stats { margin-left: auto; display: flex; gap: 26px; }
.profile-head__stats .st b { font-size: 1.5rem; display: block; font-weight: 800; }
.profile-head__stats .st span { font-size: .82rem; color: rgba(255,255,255,.8); }
.profile-tabs { display: flex; gap: 8px; margin: 26px 0; flex-wrap: wrap; }
.profile-tabs button { padding: 11px 20px; border-radius: var(--pill); font-weight: 600; background: #fff; box-shadow: var(--shadow-sm); transition: background .2s, color .2s; }
.profile-tabs button.active { background: var(--forest); color: #fff; }
.panel { display: none; }
.panel.active { display: block; animation: fadeIn .3s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.info-card { background: #fff; border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-sm); }
.order-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.order-row:last-child { border-bottom: none; }
.order-row .oid { font-weight: 700; }
.order-row .odate { color: var(--muted); font-size: .88rem; }
.order-row { color: inherit; transition: background .2s; }
a.order-row:hover { background: #f5fbf7; }
.status-badge { padding: 5px 12px; border-radius: var(--pill); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.status-badge.done { background: #dcf5e5; color: #15803d; }
.status-badge.ship { background: #fdf1dd; color: #a67c2e; }
.status-badge.pending { background: #e8eef5; color: #395c86; }
.status-badge.cancel { background: #f6e4e4; color: #a13c3c; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.info-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.info-item span { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 3px; }
.info-item b { font-weight: 700; }

/* Disclaimer note */
.disclaimer { background: #fdf6e9; border: 1px solid #f0e2c4; border-radius: var(--radius); padding: 16px 20px; display: flex; gap: 12px; font-size: .88rem; color: #6b5a34; }
.disclaimer i { color: var(--gold); margin-top: 2px; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1080px) {
  .cat-circles { grid-template-columns: repeat(4, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .header__search { display: none; }
}
@media (max-width: 940px) {
  .nav { display: none; }
  .hamburger { display: grid; }
  .hero__grid { grid-template-columns: 1fr; padding: 34px; }
  .hero__media { order: -1; max-width: 420px; }
  .about-grid { grid-template-columns: 1fr; gap: 34px; }
  .faq-grid { grid-template-columns: 1fr; }
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .footer { padding: 38px 0 22px; }
  .footer .logo__mark { width: 88px; height: 88px; }
  .footer__about { max-width: 48ch; }
  .topbar__msg span.hide-sm { display: none; }
}
@media (max-width: 760px) {
  .section { padding: 52px 0; }
  .product-grid, .product-grid--3 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .blog-grid { grid-template-columns: 1fr; }
  .promo-grid { grid-template-columns: 1fr; }
  .cat-circles { grid-template-columns: repeat(3, 1fr); }
  .auth-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .about__media .m2 { margin-top: 0; }   /* มือถือ: ยกเลิกการเยื้องขั้นบันได ให้ขอบบนรูป 2 อันตรงกัน */
  .about__stats { padding: 20px 14px; }
  .about__stats .st b { font-size: 1.35rem; }
  .profile-head__stats { margin-left: 0; width: 100%; justify-content: space-around; }
  /* มือถือ: บีบแท็บโปรไฟล์ให้อยู่แถวเดียว + ลดขนาดลงเล็กน้อย */
  .profile-tabs { flex-wrap: nowrap; gap: 6px; }
  .profile-tabs button { flex: 1 1 0; min-width: 0; padding: 9px 8px; font-size: .82rem; display: flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
  .profile-tabs button i { font-size: .9em; }
  .section-head--row { flex-direction: column; align-items: flex-start; }
  .deal { padding: 30px; }
  .testi__card { padding: 28px 22px; }
  /* Filter becomes toggle drawer */
  .shop-layout { grid-template-columns: 1fr; }
  .filter-toggle { display: inline-flex; }
  .icon-btn.filter-close { display: grid; }            /* โชว์ปุ่มปิด (X) ในโหมด drawer */
  .sidebar {
    position: fixed; top: 0; left: -320px; width: 300px; max-width: 85vw; height: 100%; z-index: 80;
    border-radius: 0; overflow-y: auto; transition: left .35s var(--ease); box-shadow: 20px 0 50px rgba(0,0,0,.15);
  }
  .sidebar.open { left: 0; }
  /* ฉากหลังโปร่ง — กดที่ว่างนอกกรอบเพื่อปิดตัวกรอง */
  .filter-backdrop {
    display: block; position: fixed; inset: 0; z-index: 79; background: rgba(24,54,35,.45);
    opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s var(--ease);
  }
  .filter-backdrop.open { opacity: 1; visibility: visible; }
  .cart-item { grid-template-columns: 76px minmax(0, 1fr); }
  .cart-item__img { width: 76px; height: 76px; }
  .cart-item__right { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
  .order-row { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (max-width: 460px) {
  .container { width: min(100% - 28px, var(--container)); }
  .cat-circles { grid-template-columns: repeat(2, 1fr); }
  .hero__cta .btn, .newsletter form { flex-wrap: wrap; }
  .newsletter form { flex-direction: column; }
  .countdown .unit { min-width: 62px; padding: 12px; }
}

/* ==========================================================================
   RESPONSIVE — รองรับมือถือทุกขนาด (fine-tuning)
   ========================================================================== */

/* กันการเลื่อนแนวนอนบนทุกจอ + สื่อไม่ล้นกรอบ */
html { overflow-x: hidden; }
img, svg, video, iframe, canvas { max-width: 100%; height: auto; }
.card__media img, .card__media .ph-media,
.cart-item__img img, .blog-card__media img { height: 100%; }

/* แท็บเล็ตเล็ก / มือถือแนวนอน */
@media (max-width: 860px) {
  .hero__grid { padding: 34px 26px; gap: 30px; }
  .hero__float--tl { left: 6px; }
  .hero__float--br { right: 6px; }
  .promo { min-height: 190px; padding: 28px; }
  .footer { padding: 48px 0 24px; }
  .page-hero::after { opacity: .16; width: 150px; }   /* จอเล็ก: โลโก้จาง กันทับข้อความ */
}

/* มือถือจอใหญ่ (≤600px) */
@media (max-width: 600px) {
  body { font-size: 15.5px; }
  .section { padding: 46px 0; }
  .section--tight { padding: 34px 0; }
  /* มือถือ: ตะกร้าซ้อนแนวตั้ง (ไม่มีคอลัมน์สรุป 360px ที่ดันทั้งหน้าเกินจอ) */
  .cart-layout { display: block; }
  .summary { margin-top: 16px; position: static; }
  /* มือถือ: ตะกร้าใช้ flex แทน grid — การันตีไม่ล้นขอบจอ + การ์ดเล็กลง */
  .cart-item { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; }
  .cart-item__img { width: 58px; height: 58px; flex: 0 0 auto; }
  .cart-item__info { flex: 1 1 0; min-width: 0; }
  .cart-item__info .cat { font-size: .72rem; }
  .cart-item__info h4 { font-size: .9rem; margin: 1px 0 3px; overflow-wrap: anywhere; }
  .cart-item__info .price { font-size: .9rem; }
  .cart-item__right { flex: 1 1 100%; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
  .qty button { width: 30px; height: 30px; }
  .qty span { min-width: 30px; }
  .cart-item__subtotal { font-size: .95rem; }
  .cart-item__remove { font-size: .82rem; }
  .summary { padding: 18px; }
  .hero { padding: 12px 0 6px; }
  .hero__grid { padding: 20px 16px; gap: 20px; border-radius: var(--radius); }
  .hero__pill { margin-bottom: 12px; font-size: .7rem; padding: 5px 11px; }
  .hero h1 { font-size: 1.45rem; line-height: 1.22; }
  .hero p.lead { font-size: .84rem; margin: 10px 0 0; max-width: none; }
  .hero__media { max-width: 200px; margin-inline: auto; }
  /* มือถือ: บังคับ badge ให้อยู่แถวเดียว แบ่งพื้นที่เท่ากัน หดขนาดให้พอดี */
  .hero__badges { flex-wrap: nowrap; gap: 7px; margin-top: 22px; }
  .hero__badge { flex: 1 1 0; min-width: 0; justify-content: center; font-size: .72rem; padding: 6px 8px; gap: 6px; white-space: nowrap; }
  .hero__badge i { width: 25px; height: 25px; font-size: .76rem; flex: 0 0 auto; }
  .hero__float { padding: 6px 9px; gap: 7px; }
  .hero__float .ic { width: 22px; height: 22px; border-radius: 7px; font-size: .66rem; }
  .hero__float b { font-size: .67rem; }
  .hero__float span { font-size: .57rem; }
  /* มือถือ: การ์ดโปรโมชั่น 2 คอลัมน์แถวเดียว กะทัดรัด */
  .promo-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .promo { padding: 16px 14px; min-height: 150px; border-radius: var(--radius); justify-content: flex-start; }
  .promo__tag { font-size: .6rem; padding: 3px 9px; margin-bottom: 8px; }
  .promo h3 { font-size: .95rem; max-width: none; }
  .promo p { font-size: .72rem; margin: 5px 0 12px; max-width: none; }
  .promo .btn--sm { align-self: flex-start; }
  .promo__deco { font-size: 3.5rem; right: -12px; bottom: -12px; }
  .header__inner { gap: 12px; padding: 12px 0; }
  .header__actions { gap: 4px; }
  /* ซ่อนปุ่มข้อความในแถบบน ใช้เมนู hamburger แทน เพื่อไม่ให้ล้นจอ */
  .header__actions .btn--primary { display: none; }
  .logo__text span { display: none; }
  .logo__mark { width: 54px; height: 54px; }
  .logo__text b { font-size: 1rem; }
  .deal { padding: 26px 22px; }
  .deal h2 { font-size: 1.4rem; }
  .testi__quote { font-size: 1.02rem; }
}

/* มือถือมาตรฐาน (iPhone / Android ทั่วไป ≤440px) */
@media (max-width: 440px) {
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { width: 100%; }
  .product-grid, .product-grid--3 { gap: 12px; }
  .card__body { padding: 13px 14px 15px; }
  .card__title { font-size: .95rem; }
  .card__price .now { font-size: 1.08rem; }
  .countdown { flex-wrap: wrap; justify-content: center; gap: 10px; }
  .countdown .unit { min-width: 58px; padding: 11px 12px; flex: 1 1 auto; }
  .countdown .unit b { font-size: 1.5rem; }
  .promo { padding: 14px 12px; min-height: 142px; }
  .promo h3 { font-size: .9rem; }
  .promo__deco { font-size: 3rem; }
  .faq-q { padding: 16px; font-size: .94rem; }
  .faq-a p { padding: 0 16px 18px; }
  .about__stats { grid-template-columns: 1fr 1fr; }
  .about__stats .st:last-child { grid-column: 1 / -1; }
  /* จอเล็กมาก: ซ่อนไอคอนแท็บ + บีบพื้นที่ ให้ข้อความอยู่ครบแถวเดียว */
  .profile-tabs button { padding: 8px 5px; font-size: .78rem; gap: 0; }
  .profile-tabs button i { display: none; }
  .profile-head { padding: 24px; }
  .pfull__inner { padding: 0 16px 32px; }
  .pfull__title { font-size: 1.22rem; }
  .pfull__actionbar { padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .pfull__actionbar-inner { gap: 8px; }
}

/* มือถือจอเล็ก (iPhone SE / จอแคบ ≤360px) */
@media (max-width: 360px) {
  body { font-size: 15px; }
  .hero h1 { font-size: 1.75rem; }
  .hero p.lead { font-size: .98rem; }
  .cat-circles { gap: 12px; }
  .cat-circle b { font-size: .9rem; }
  .product-grid, .product-grid--3 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card__foot .btn { padding: 11px 14px; font-size: .84rem; }
  .icon-btn { width: 40px; height: 40px; }
  .countdown .unit { min-width: 52px; }
  .countdown .unit b { font-size: 1.3rem; }
  .drawer { width: 88vw; }
  .testi__nav button { width: 44px; height: 44px; }
}

/* จอพับ / จอแคบมาก (Galaxy Fold ~280px) */
@media (max-width: 300px) {
  .product-grid, .product-grid--3, .cat-circles { grid-template-columns: 1fr; }
  .hero__grid { padding: 20px 14px; }
  .hero__cta .btn { font-size: .88rem; }
}

/* มือถือ: หมวดหมู่วงกลม → เลื่อนสไลด์แนวนอน + วงกลมเล็กลง */
@media (max-width: 600px) {
  .cat-circles {
    display: flex; flex-wrap: nowrap; grid-template-columns: none;
    overflow-x: auto; gap: 12px; padding-bottom: 6px;
    scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cat-circles::-webkit-scrollbar { display: none; }
  .cat-circle { flex: 0 0 auto; width: 66px; scroll-snap-align: start; }
  .cat-circle__img { margin-bottom: 6px; border-width: 2px; }
  .cat-circle__img .ph-media i { font-size: 1.1rem; }
  .cat-circle b { font-size: .7rem; line-height: 1.35; }
  .cat-circle span { display: none; }
  /* มือถือ: ลดพื้นที่ว่างรอบ section หมวดหมู่ ให้ชิด section อื่นมากขึ้น */
  .section:has(.cat-circles) { padding-top: 22px; padding-bottom: 10px; }
  .section:has(.cat-circles) .section-head { margin-bottom: 18px; }
  /* มือถือ: บีบช่องว่างเหนือ/ใต้ section โปรโมชั่นให้เหลือน้อยสุด */
  .section--tight:has(.promo-grid) { padding-top: 8px; padding-bottom: 8px; }
  .section--tight:has(.promo-grid) + .section { padding-top: 16px; }
  /* มือถือ: ซ่อน section บทความ/ข่าวสารในหน้าแรก */
  .section:has(.home-blog) { display: none; }
  /* มือถือ: ซ่อนบางข้อใน FAQ */
  .faq-item--hide-mobile { display: none; }
  /* มือถือ: hero ภาพอย่างเดียว ให้ภาพพอดีจอ (ทับค่าย่อของ hero__media เดิม) */
  .hero__grid--imgonly .hero__media { max-width: 320px; }
  /* มือถือ: footer Hero brand ย่อขนาดให้พอดีจอ */
  .footer .logo__mark { width: 72px; height: 72px; }
  .footer__about { font-size: .88rem; max-width: 40ch; margin: 12px auto 14px; }
  .footer__social a { width: 42px; height: 42px; }
  .footer__bottom { margin-top: 20px; padding-top: 14px; }
  /* มือถือ: หัวข้อ section แบบมีปุ่ม (section-head--row) เล็กลง ประหยัดพื้นที่ */
  .section-head--row { margin-bottom: 14px; gap: 10px; }
  .section-head--row .eyebrow { font-size: .7rem; margin-bottom: 2px; }
  .section-head--row .section-title { font-size: 1.32rem; }
  /* มือถือ: หัวข้อที่มี dropdown จัดเรียง → แถวเดียว ชื่อซ้าย / dropdown ขวา */
  .section-head--row:has(.sort-dd) { flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: space-between; }
  .section-head--row:has(.sort-dd) > div { min-width: 0; }
  .section-head--row:has(.sort-dd) .sort-dd { flex: 0 0 auto; }
  /* มือถือ: กล่อง FAQ CTA แบบอยู่ข้างลิสต์คำถาม → ย่อเป็นแถวเดียว ปุ่มชิดขวา
     ยกเว้นแบบยืนเดี่ยว (--solo) ที่ต้องการให้ใหญ่ ยังเป็นการ์ดจัดกลางเหมือนจอใหญ่
     (ถ้าไม่ยกเว้น กฎมือถือจะมาทีหลังในไฟล์ → ทับขนาดใหญ่ที่ตั้งไว้) */
  .faq-cta:not(.faq-cta--solo) { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; }
  .faq-cta:not(.faq-cta--solo) .ic { width: 38px; height: 38px; margin: 0; font-size: 1.05rem; flex: 0 0 auto; }
  .faq-cta:not(.faq-cta--solo) h3, .faq-cta:not(.faq-cta--solo) h4 { font-size: .98rem; flex: 1 1 auto; min-width: 0; }
  .faq-cta:not(.faq-cta--solo) p { display: none; }
  .faq-cta:not(.faq-cta--solo) .btn { flex: 0 0 auto; margin-left: auto; }
  /* แบบยืนเดี่ยวบนมือถือ: ไอคอนเล็กลงหน่อยพอดีจอ ที่เหลือ clamp คุมให้แล้ว */
  .faq-cta--solo .ic { width: 64px; height: 64px; margin-bottom: 16px; font-size: 1.6rem; }
}

/* มือถือแนวนอนจอเตี้ย: ให้เมนู drawer เลื่อนอ่านได้ครบ */
@media (max-height: 460px) and (max-width: 940px) {
  .drawer { padding: 16px; gap: 2px; }
  .drawer a.drawer__link { padding: 10px 14px; }
  .hero { padding: 12px 0; }
}

/* ==========================================================================
   MOBILE FLUID + SAFE-AREA
   คาลิเบรตตาม iPhone 14 Pro Max (กว้าง 430px) ให้ทุกรุ่นสเกลตามสัดส่วนเดียวกัน
   และเว้นพื้นที่ Dynamic Island (บน) / ปุ่มโฮม (ล่าง) ของ iPhone
   * ต้องมี viewport-fit=cover ใน <meta viewport> ของทุกหน้า *
   ========================================================================== */

/* เว้น safe-area ให้องค์ประกอบที่ตรึงขอบจอ (มีผลบน iPhone จริง/PWA; เครื่องอื่น = 0 ไม่กระทบ) */
.header { padding-top: env(safe-area-inset-top, 0px); }
.pfull__bar { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.drawer { padding-top: calc(22px + env(safe-area-inset-top, 0px)); }
.toast-wrap { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }

@media (max-width: 480px) {
  /* พื้นที่ + ตัวอักษร สเกลลื่นตามความกว้างจอ (จุดอ้างอิง 430px = iPhone 14 Pro Max) */
  .container { width: min(100% - 32px, var(--container)); }
  .section { padding: clamp(34px, 11vw, 48px) 0; }
  .section--tight { padding: clamp(26px, 8vw, 40px) 0; }
  .section-title { font-size: clamp(1.4rem, 6.4vw, 1.9rem); }
  .hero h1 { font-size: clamp(1.32rem, 6.2vw, 1.75rem); }
  .hero p.lead { font-size: clamp(.8rem, 3.3vw, .9rem); }
  .hero__media { max-width: clamp(160px, 47vw, 215px); }
  .btn { padding: clamp(11px, 3.4vw, 14px) clamp(18px, 5vw, 26px); font-size: clamp(.9rem, 3.6vw, .98rem); }
  .card__title { font-size: clamp(.9rem, 3.7vw, 1rem); }
  .card__price .now { font-size: clamp(1rem, 4.2vw, 1.2rem); }
  .product-grid, .product-grid--3 { gap: clamp(10px, 3vw, 16px); }

  /* ปุ่มลอย: เว้นปุ่มโฮม (home indicator) ของ iPhone */
  .cart-fab  { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .filter-fab { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  body.has-cart-fab .filter-fab { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
}

/* ==========================================================================
   BOTTOM NAV (มือถือ + แท็บเล็ต)
   ========================================================================== */
.bottom-nav { display: none; }

@media (max-width: 1024px) {
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; justify-content: space-around; align-items: stretch;
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom, 0px));
    background: rgba(255,255,255,.92); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 26px rgba(24,54,35,.09);
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 5px 2px; color: var(--muted);
    font-size: .69rem; font-weight: 600; transition: color .2s;
  }
  .bottom-nav__ic {
    position: relative; width: 44px; height: 30px; border-radius: var(--pill);
    display: grid; place-items: center; font-size: 1.06rem;
    transition: background .25s var(--ease), color .25s, transform .25s var(--ease);
  }
  .bottom-nav a.active { color: var(--forest); font-weight: 700; }
  .bottom-nav a.active .bottom-nav__ic { background: #e3f6ea; color: var(--forest); transform: translateY(-2px); }
  .bottom-nav a:active .bottom-nav__ic { transform: scale(.9); }
  .bottom-nav__badge {
    position: absolute; top: -3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px;
    background: var(--gold); color: #3a2f16; font-size: .62rem; font-weight: 800;
    border-radius: var(--pill); display: grid; place-items: center; border: 2px solid #fff;
  }
  .bottom-nav__badge:empty, .bottom-nav__badge[data-count="0"] { display: none; }

  /* เว้นที่ให้แถบล่าง ไม่ให้ทับเนื้อหา/ฟุตเตอร์ */
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }

  /* เมนูหลักย้ายลงแถบล่าง → ใช้เลย์เอาต์แบบมือถือทั้งช่วงนี้ (รวมไอแพดแนวนอน 1024px)
     ไม่ต้องมีปุ่มแฮมเบอร์เกอร์/drawer อีก เพราะทุกเมนูอยู่ที่แถบล่าง + ไอคอนบน header แล้ว */
  .nav { display: none; }
  .hamburger { display: none; }
  .icon-btn--blog { display: grid; }   /* "บทความ" ย้ายมาเป็นไอคอนตรงนี้แทนเมนูใน drawer */
  .icon-btn--search { display: grid; }

  /* ช่องค้นหา: ซ่อนไว้ก่อน กดไอคอนแว่นขยายแล้วค่อยสไลด์ลงมาเต็มความกว้างใต้ header */
  .header__search {
    display: block; position: absolute; left: 0; right: 0; top: 100%;
    max-width: none; padding: 10px 16px 12px;
    background: rgba(255,255,255,.97); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
  }
  body.search-open .header__search { opacity: 1; visibility: visible; transform: none; }
  .header__search i { left: 32px; }
  body.search-open .icon-btn--search { background: #e3f6ea; color: var(--forest); }

  /* ตะกร้าอยู่ในแถบล่างแล้ว → ปิดปุ่มตะกร้าใน header + ปุ่มตะกร้าลอย และยกปุ่มอื่นขึ้นเหนือแถบ */
  .header__actions .icon-btn[href="/cart"] { display: none; }
  .cart-fab { display: none; }
  .filter-fab,
  body.has-cart-fab .filter-fab { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .toast-wrap { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

  /* ขณะเปิดหน้าสินค้าเต็มจอ (modal) ให้ซ่อนแถบล่าง */
  body.pmodal-open .bottom-nav { display: none; }
}

/* Utility */
.hidden { display: none !important; }
.mt-0 { margin-top: 0; }
.no-scroll { overflow: hidden; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
/* มือถือ: ปิดสถานะซ่อนของ reveal — ให้เนื้อหา (รวม hero/แบนเนอร์) แสดงทันที ไม่ต้องรอ JS
   เร่ง FCP/LCP บนมือถือที่ CPU ช้า (เดสก์ท็อปยังมีอนิเมชันปกติ) */
@media (max-width: 768px) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
