:root {
  /* warm paper ramp; WhatsApp green only on order actions */
  --bg: #f7f4ee;
  --card: #fdfbf7;
  --raised: #efe9df;
  --text: #1f1b16;
  --text-2: #5e554a;
  --muted: #7b7266;
  --line: rgba(31, 27, 22, .1);
  --line-strong: rgba(31, 27, 22, .18);
  --accent: #008069;
  --accent-hover: #006e5a;
  --danger: #b42318;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --shadow: 0 8px 24px rgba(31, 27, 22, .06);
  --font: "Noto Sans", "Noto Sans Lao", system-ui, sans-serif;
  --display: "Noto Sans Lao Looped", "Noto Sans", "Noto Sans Lao", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.container { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }

/* Lao script needs room above and below for vowels and tone marks: no negative tracking, tall line height */
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 500; line-height: 1.35; letter-spacing: 0; }
h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.3; }
h2 { font-size: clamp(28px, 3.4vw, 36px); }
h3 { font-size: 17px; font-family: var(--font); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 244, 238, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  font-size: 16px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-size: 16px; font-weight: 600; }
.brand-text small { color: var(--muted); font-size: 12px; }

.site-nav { display: flex; align-items: center; gap: 32px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.site-nav a { transition: color .15s var(--ease); }
.site-nav a:not(.nav-wa):hover { color: var(--text); }

.nav-wa {
  background: var(--text);
  color: var(--bg);
  height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 8px;
  transition: background .15s var(--ease);
}
.site-nav .nav-wa { color: var(--bg); }
.nav-wa:hover { background: #3a332b; }

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
}

.site-nav.open {
  display: flex;
  position: absolute;
  top: 64px;
  left: 16px;
  right: 16px;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.site-nav.open a { padding: 8px 12px; border-radius: 8px; }
.site-nav.open a:not(.nav-wa):hover { background: var(--raised); }
.site-nav.open .nav-wa { justify-content: center; height: 40px; margin-top: 4px; }

/* Hero */
.hero { padding: 80px 0 0; }

.hero-inner {
  display: grid;
  grid-template-columns: 1fr minmax(0, 440px);
  gap: 64px;
  align-items: center;
}

.hero-copy h1 { max-width: 560px; }
.hero-copy p { color: var(--text-2); max-width: 520px; margin: 24px 0 0; font-size: 18px; line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 20px;
  font-weight: 500;
  font-size: 15px;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: #3a332b; }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--raised); }
.btn-ghost .i { color: var(--accent); }
.btn.small { height: 36px; padding: 0 16px; font-size: 14px; }
.btn.full { width: 100%; }

/* Hero moment: the WhatsApp message a customer sends */
.chat { margin: 0; }
.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
}
.chat-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--text); color: var(--bg); font-weight: 600; font-size: 15px; }
.chat-head strong, .chat-head small { display: block; line-height: 1.4; }
.chat-head strong { font-size: 14px; font-weight: 600; }
.chat-head small { color: var(--muted); font-size: 12px; }

.chat-body {
  background: #efeae2;
  border: 1px solid var(--line);
  border-radius: 0 0 16px 16px;
  padding: 24px 16px 20px 48px;
}
.bubble {
  position: relative;
  background: #d9fdd3;
  border-radius: 10px 2px 10px 10px;
  padding: 8px 12px 6px;
  box-shadow: 0 1px 1px rgba(11, 20, 26, .13);
  color: #111b21;
}
.bubble p { margin: 0; white-space: pre-line; font-size: 14px; line-height: 1.6; font-family: "Noto Sans Lao", "Noto Sans", sans-serif; }
.bubble-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; color: #667781; margin-top: 2px; font-variant-numeric: tabular-nums; }
.ticks { width: 16px; height: 16px; color: #53bdeb; stroke-width: 2; }
.chat figcaption { margin-top: 12px; color: var(--muted); font-size: 13px; text-align: center; }

.feature-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  margin-top: 80px;
  margin-bottom: 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: 14px;
}
.feature-row li { display: flex; align-items: center; gap: 8px; }
.feature-row .i { color: var(--muted); }

/* Products */
.products-section { padding: 80px 0 96px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.section-sub { color: var(--text-2); margin: 8px 0 0; max-width: 560px; }
.count { font-family: var(--font); font-size: 15px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; margin-left: 4px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 12px;
  min-width: 280px;
  color: var(--muted);
  transition: border-color .15s var(--ease);
}
.search-box:focus-within { border-color: var(--text); }
.search-box input { border: 0; outline: 0; background: transparent; padding: 0; height: 100%; width: 100%; color: var(--text); box-shadow: none; }
.search-box input:focus { box-shadow: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.chip {
  height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 14px;
  color: var(--text-2);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.chip:hover { background: var(--raised); color: var(--text); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }

.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s var(--ease);
}
.product-card:hover { border-color: var(--line-strong); }

.product-image { aspect-ratio: 4 / 3; background: var(--raised); display: grid; place-items: center; overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-image .placeholder { font-family: var(--display); font-size: 56px; color: rgba(31, 27, 22, .18); }

.product-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.product-category { color: var(--muted); font-size: 13px; }
.product-name { margin-top: 4px; font-weight: 500; }
.product-description { color: var(--text-2); font-size: 14px; margin: 8px 0 20px; flex: 1; }

.product-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.product-price { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }

.qty { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.qty button { width: 36px; height: 36px; border: 0; background: transparent; color: var(--text); font-size: 18px; transition: background .15s var(--ease); }
.qty button:hover { background: var(--raised); }
.qty-value { min-width: 28px; text-align: center; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }

.order-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  font-size: 14px;
  transition: background .15s var(--ease), transform .12s var(--ease);
}
.order-btn:hover { background: var(--accent-hover); }
.order-btn:active { transform: scale(.98); }

.empty-state { text-align: center; padding: 64px 24px; color: var(--text-2); border: 1px dashed var(--line-strong); border-radius: 16px; }
.empty-state h3 { color: var(--text); }
.empty-state p { margin: 8px 0 0; }
.empty-icon { display: none; }

/* Contact */
.contact-section { padding: 80px 0; border-top: 1px solid var(--line); }
.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.contact-section p { color: var(--text-2); max-width: 460px; margin: 16px 0 0; }
.contact-section .contact-note { font-size: 14px; color: var(--muted); margin-top: 16px; }
.contact-cards { display: grid; gap: 12px; }

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
a.contact-card:hover { border-color: var(--line-strong); background: #fff; }
.contact-card > .i { color: var(--text-2); }
.contact-card strong, .contact-card small { display: block; line-height: 1.5; }
.contact-card strong { font-size: 15px; font-weight: 500; }
.contact-card small { color: var(--text-2); font-size: 14px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.contact-card .arrow { margin-left: auto; color: var(--muted); }

/* Footer */
.site-footer { padding: 24px 0 32px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner a:hover { color: var(--text); }

.floating-wa {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 35;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px rgba(31, 27, 22, .16);
  transition: background .15s var(--ease);
}
.floating-wa .i { width: 22px; height: 22px; }
.floating-wa:hover { background: var(--accent-hover); }

/* Admin */
.admin-page { background: var(--bg); }
.admin-header { background: var(--card); border-bottom: 1px solid var(--line); }
.admin-header .brand-text strong { font-size: 15px; }
.admin-header-actions { display: flex; align-items: center; gap: 16px; }
.view-link { font-size: 14px; font-weight: 500; color: var(--text-2); }
.view-link:hover { color: var(--text); }
.admin-main { padding-top: 48px; padding-bottom: 96px; }
.admin-title-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.eyebrow { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }

.admin-list { display: grid; gap: 8px; }
.admin-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
}
.admin-row.inactive { opacity: .6; }
.admin-thumb { width: 64px; height: 64px; border-radius: 8px; background: var(--raised); display: grid; place-items: center; color: var(--muted); font-weight: 500; overflow: hidden; }
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-info { min-width: 0; }
.admin-info strong { display: block; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.admin-info small { color: var(--text-2); display: block; font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.admin-price { font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.status-pill { display: inline-block; border-radius: 4px; padding: 0 8px; font-size: 12px; background: rgba(0, 128, 105, .1); color: var(--accent-hover); }
.status-pill.off { background: var(--raised); color: var(--muted); }

.table-btn { height: 32px; border: 1px solid var(--line-strong); background: var(--card); border-radius: 8px; padding: 0 12px; font-size: 13px; font-weight: 500; color: var(--text); transition: background .15s var(--ease), color .15s var(--ease); }
.table-btn:hover { background: var(--raised); }
.table-btn.danger:hover { color: var(--danger); }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-card { width: min(400px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 32px; }
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.login-brand strong { font-weight: 600; }
.login-card h1 { font-size: 28px; margin-top: 24px; }
.login-card p { color: var(--text-2); font-size: 14px; }
.login-card form { display: grid; gap: 8px; margin-top: 24px; }
.login-card form .btn { margin-top: 8px; }
.login-card label, .field label { font-size: 13px; font-weight: 500; color: var(--text-2); }

input, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 12px; min-height: 40px; background: #fff; color: var(--text); outline: none; transition: border-color .15s var(--ease); }
input:focus, textarea:focus { border-color: var(--text); box-shadow: 0 0 0 3px rgba(31, 27, 22, .08); }
textarea { resize: vertical; }
input[type="checkbox"] { min-height: 0; }
.login-error, .form-error { color: var(--danger); font-size: 13px; margin: 12px 0 0; }
.back-link { display: inline-block; margin-top: 24px; font-size: 14px; color: var(--text-2); }
.back-link:hover { color: var(--text); }

.modal-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(31, 27, 22, .45); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 20px; }
.icon-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; font-size: 24px; line-height: 1; color: var(--muted); }
.icon-btn:hover { background: var(--raised); color: var(--text); }
#productForm { padding: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.checkbox-field label { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.checkbox-field input { width: 16px; height: 16px; accent-color: var(--accent); }
.image-preview-wrap img { max-height: 128px; border-radius: 8px; object-fit: contain; background: var(--raised); }
.image-preview-wrap span { font-size: 13px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); }

@media (max-width: 900px) {
  .hero-inner, .contact-inner { grid-template-columns: 1fr; gap: 48px; }
  .chat { max-width: 480px; }
  .hero { padding-top: 56px; }
  .feature-row { margin-top: 56px; }
}

@media (max-width: 700px) {
  .menu-toggle { display: grid; }
  .site-nav { display: none; }
  .hero { padding-top: 40px; }
  .hero-copy p { font-size: 16px; }
  .feature-row { flex-direction: column; gap: 8px; margin-top: 48px; }
  .products-section { padding: 56px 0 72px; }
  .search-box { width: 100%; min-width: 0; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
  .contact-section { padding: 56px 0; }
  .chat-body { padding-left: 32px; }
  .admin-row { grid-template-columns: 56px 1fr; gap: 12px; }
  .admin-thumb { width: 56px; height: 56px; }
  .admin-price-area { grid-column: 2; display: flex; align-items: center; gap: 12px; }
  .admin-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 460px) {
  .container { width: calc(100% - 32px); }
  .hero-actions .btn { flex: 1 1 100%; }
  .product-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  .login-card { padding: 24px 20px; }
  .floating-wa { right: 16px; bottom: 16px; }
}
