:root {
  --cream: #f6f8ef;
  --paper: #fbfcf7;
  --sage-100: #e3ecd6;
  --sage-200: #cfdfba;
  --sage-300: #a6c78a;
  --sage-500: #5c8f43;
  --green-700: #1b4020;
  --earth: #8a6f56;
  --line: #d9e1cc;
  --serif: "Noto Serif Thai", serif;
  --sans: "Noto Sans Thai", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  font-family: var(--sans);
  font-weight: 300;
  background: var(--cream);
  color: var(--green-700);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand, .brand-lg { font-family: var(--serif); font-weight: 500; line-height: 1.35; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.container { width: min(1100px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(680px, 100% - 40px); }

/* แถบแจ้งเตือนช่วงทดสอบ: ลบก่อนเปิดขายจริง */
.test-banner {
  background: var(--earth); color: var(--paper);
  text-align: center; font-size: .9rem; font-weight: 500; line-height: 1.5;
  padding: 8px 16px;
}

/* header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(20px, 5vw, 56px);
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; color: var(--green-700); }
.brand img { width: 48px; height: 48px; object-fit: contain; mix-blend-mode: multiply; }
.brand-logo-lg { display: block; width: 110px; height: 110px; object-fit: contain; border-radius: 50%; margin-bottom: 10px; }
.nav { display: flex; gap: 32px; font-size: .95rem; }
.nav a { position: relative; padding: 4px 0; }
.nav a::after { content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 1px; background: currentColor; transition: width .3s; }
.nav a:hover::after { width: 100%; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.cart-btn { position: relative; padding: 6px; display: grid; place-items: center; }
.cart-count {
  position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--green-700); color: var(--cream);
  font-size: .7rem; line-height: 18px; text-align: center;
}
.cart-count:empty, .cart-count[data-n="0"] { display: none; }
.menu-btn { display: none; width: 36px; height: 36px; position: relative; }
.menu-btn span { position: absolute; left: 8px; right: 8px; height: 1.5px; background: currentColor; transition: .3s; }
.menu-btn span:first-child { top: 14px; }
.menu-btn span:last-child { top: 21px; }

/* hero */
.hero {
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 40px;
  width: min(1100px, 100% - 40px); margin: 0 auto; padding: clamp(48px, 9vw, 110px) 0;
}
.eyebrow { font-size: .85rem; letter-spacing: .12em; color: var(--sage-500); margin-bottom: 16px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: 20px; }
.lead { max-width: 30em; margin-bottom: 32px; color: color-mix(in srgb, var(--green-700) 85%, white); }
.hero-art { display: grid; place-items: center; }
.hero-svg { width: min(400px, 100%); height: auto; animation: sway 8s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes sway { 50% { transform: rotate(1.5deg); } }

.btn {
  display: inline-block; padding: 12px 32px; border-radius: 999px;
  background: var(--green-700); color: var(--cream); font-weight: 400; letter-spacing: .03em;
  transition: background .3s, transform .3s;
}
.btn:hover { background: var(--sage-500); transform: translateY(-1px); }
.btn.full { width: 100%; text-align: center; }
.btn.ghost { background: transparent; color: var(--green-700); border: 1px solid var(--green-700); padding: 9px 20px; }
.btn.ghost:hover { background: var(--green-700); color: var(--cream); }

/* sections */
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section-title { text-align: center; font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 12px; }
.section-sub { text-align: center; color: var(--sage-500); margin-bottom: 32px; }
.about { background: var(--paper); border-block: 1px solid var(--line); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 48px; text-align: center; }
.features svg { width: 44px; height: 44px; color: var(--sage-500); margin-bottom: 14px; }
.features h3 { font-size: 1.1rem; margin-bottom: 6px; }
.features p { font-size: .92rem; color: color-mix(in srgb, var(--green-700) 80%, white); }

/* products */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 40px; }
.filters button { padding: 6px 20px; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; transition: .25s; }
.filters button:hover { border-color: var(--sage-500); }
.filters button.active { background: var(--green-700); border-color: var(--green-700); color: var(--cream); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; transition: transform .35s, box-shadow .35s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px -18px rgba(27, 64, 32, .35); }
.card-img { aspect-ratio: 1 / 0.9; display: grid; place-items: center; }
.card-img svg { width: 56%; height: auto; }
.card-img img, .item-img img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.tag { font-size: .75rem; letter-spacing: .08em; color: var(--earth); }
.card h3 { font-size: 1.15rem; margin: 2px 0 6px; }
.card p.desc { font-size: .9rem; color: color-mix(in srgb, var(--green-700) 80%, white); flex: 1; margin-bottom: 16px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; }
.price { font-family: var(--serif); font-size: 1.15rem; }
.price small { font-family: var(--sans); font-size: .75rem; color: var(--sage-500); margin-left: 6px; }

/* story & reviews */
.story { background: var(--sage-100); }
.story p { margin-top: 16px; text-align: center; }
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; text-align: center; }
blockquote p { font-family: var(--serif); font-size: 1.05rem; margin-bottom: 8px; }
cite { font-style: normal; font-size: .85rem; color: var(--sage-500); }

/* footer */
.footer { background: var(--green-700); color: var(--sage-200); padding: 56px 0 24px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1.5fr 1fr; gap: 32px; }
.brand-lg { font-size: 1.6rem; color: var(--cream); }
.footer-h { color: var(--cream); font-weight: 400; margin-bottom: 6px; }
.copy { text-align: center; margin-top: 40px; font-size: .8rem; opacity: .7; }

/* drawer */
.overlay { position: fixed; inset: 0; background: rgba(20, 44, 24, .35); opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 30; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100%); z-index: 40;
  background: var(--paper); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .4s cubic-bezier(.2, .7, .2, 1);
}
body.cart-open .overlay { opacity: 1; pointer-events: auto; }
body.cart-open .drawer { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.2rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px; }
.empty { text-align: center; color: var(--sage-500); padding: 48px 0; }
.item { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.item-img { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; }
.item-img svg { width: 60%; }
.item h4 { font-family: var(--serif); font-weight: 500; font-size: .95rem; }
.item .sub { font-size: .8rem; color: var(--sage-500); }
.qty { display: inline-flex; align-items: center; gap: 10px; margin-top: 4px; }
.qty button { width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; line-height: 1; }
.qty button:hover { border-color: var(--green-700); }
.remove { font-size: .75rem; color: var(--earth); text-decoration: underline; display: block; margin-top: 6px; margin-left: auto; }
.item-price { text-align: right; font-family: var(--serif); }
.drawer-foot { padding: 20px 24px 24px; border-top: 1px solid var(--line); }
.calc { font-size: .88rem; margin-bottom: 10px; }
.calc[hidden] { display: none; }
.calc div { display: flex; justify-content: space-between; color: var(--sage-500); }
.total { display: flex; justify-content: space-between; margin-bottom: 14px; }
.total strong { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; }
.note { margin-top: 10px; font-size: .75rem; color: var(--sage-500); text-align: center; }
.step { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.step[hidden] { display: none; }
.back { font-size: .85rem; color: var(--sage-500); margin: 12px 0 4px; }
.form-h { font-size: 1.05rem; margin: 18px 0 10px; }
.field { display: block; font-size: .88rem; margin-bottom: 14px; }
.addr { border: 0; min-width: 0; }
.addr legend { font-size: .88rem; margin-bottom: 8px; padding: 0; }
.addr-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
.addr-grid .field:nth-child(5) { grid-column: 1 / -1; }
.field select { display: block; width: 100%; margin-top: 4px; padding: 10px 14px; font: inherit; font-weight: 300; color: inherit; background: var(--cream); border: 1px solid var(--line); border-radius: 12px; }
.field select:focus { outline: none; border-color: var(--sage-500); }
.field.invalid select { border-color: #b4574b; }
.field input, .field textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 14px; font: inherit; font-weight: 300; color: inherit; background: var(--cream); border: 1px solid var(--line); border-radius: 12px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--sage-500); }
.field.invalid input, .field.invalid textarea { border-color: #b4574b; }
.err { display: block; min-height: 0; font-size: .78rem; color: #b4574b; }
.pay-options { display: grid; gap: 8px; }
.pay { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: .92rem; }
.pay:has(input:checked) { border-color: var(--green-700); background: var(--sage-100); }
.pay input { margin-top: 6px; accent-color: var(--green-700); }
.pay small { display: block; color: var(--sage-500); font-size: .78rem; line-height: 1.5; }
.review-lead { margin: 14px 0 0; font-size: .88rem; color: var(--sage-500); }
.review-list { font-size: .9rem; }
.review-list dt { font-size: .78rem; color: var(--sage-500); margin-top: 10px; }
.review-list dd { overflow-wrap: anywhere; }
#editInfo { margin-top: 8px; }
.btn.ghost.full { padding: 11px 20px; }
.req { color: #b4574b; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; background: var(--green-700); }
.pay-info[hidden], .note[hidden] { display: none; }
.pay-info { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--sage-100); font-size: .85rem; }
.summary { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .85rem; }
.summary div { display: flex; justify-content: space-between; gap: 12px; }
.done .drawer-body { text-align: center; padding-top: 48px; }
.done svg { color: var(--sage-500); }
.done h3 { font-size: 1.3rem; margin: 14px 0 6px; }
.order-no { font-family: var(--serif); color: var(--sage-500); margin-bottom: 14px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--green-700); color: var(--cream); padding: 10px 22px; border-radius: 999px; font-size: .9rem; opacity: 0; pointer-events: none; transition: .35s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s, transform .8s; }
.reveal.in { opacity: 1; transform: none; }

:focus-visible { outline: 2px solid var(--sage-500); outline-offset: 3px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .lead { margin-inline: auto; }
  .hero-art { order: -1; }
  .hero-svg { width: 240px; }
  .features, .quotes, .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid { text-align: center; }
  .brand-logo-lg { margin-inline: auto; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .menu-btn { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--cream); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .35s;
  }
  .nav a { padding: 14px 24px; }
  .nav.open { max-height: 280px; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
