:root {
  --brand: #126a66;
  --brand-ink: #0b4d4a;
  --brand-soft: #e6f2f1;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f7f5;
  --card: #ffffff;
  --danger: #b91c1c;
  --warn-bg: #fef3c7;
  --warn: #92400e;
  --ok: #047857;
  --radius: 14px;
  font-family: "Inter", "Noto Sans Myanmar", "Myanmar Text", Padauk, system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); }
body { min-height: 100vh; display: flex; flex-direction: column; line-height: 1.6; }
a { color: var(--brand); }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 17px; min-width: 0; }
.brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 18px; flex: none; }
.topnav { display: flex; align-items: center; gap: 14px; flex: none; }
.navlink { text-decoration: none; font-size: 14px; }
.cart-btn { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }

.notice { padding: 10px 16px; text-align: center; font-size: 14px; background: var(--warn-bg); color: var(--warn); }
.notice.closed { background: #fee2e2; color: var(--danger); font-weight: 600; }

main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; outline: none; }
.loading, .empty { padding: 60px 16px; text-align: center; color: var(--muted); }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: 14px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.search { flex: 1 1 220px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; width: 100%; scrollbar-width: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; border: 1px solid var(--line); transition: box-shadow .15s; }
.card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.thumb { aspect-ratio: 1; background: var(--brand-soft); object-fit: cover; width: 100%; }
.thumb.placeholder { display: grid; place-items: center; font-size: 40px; color: var(--brand); }
.card-body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { font-size: 14px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 700; color: var(--brand); }
.price small { font-weight: 400; color: var(--muted); }
.soldout { align-self: flex-start; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: #f3f4f6; color: var(--muted); }

.product { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .product { grid-template-columns: 1.1fr 1fr; } }
.gallery-main { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); background: var(--brand-soft); }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.gallery-thumbs button { flex: none; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: none; }
.gallery-thumbs button[aria-current="true"] { border-color: var(--brand); }
.gallery-thumbs img { width: 64px; height: 64px; object-fit: cover; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.tiers { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.tiers th, .tiers td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.tiers td:last-child, .tiers th:last-child { text-align: right; }
.tiers tr.active td { background: var(--brand-soft); font-weight: 700; }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; margin: 12px 0; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.stepper button { width: 42px; height: 42px; border: 0; background: none; font-size: 20px; cursor: pointer; }
.stepper button:disabled { color: #cbd5e1; cursor: default; }
.stepper input { width: 64px; height: 42px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 12px; border: 0; background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-ink); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: var(--brand-soft); color: var(--brand); }
.btn.block { width: 100%; }
.btn.link { background: none; color: var(--danger); padding: 0 8px; min-height: 0; font-weight: 400; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }

.cart-line { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line img, .cart-line .placeholder { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--brand-soft); }
.cart-line .name { font-weight: 600; font-size: 14px; }
.muted { color: var(--muted); font-size: 13px; }
.summary { display: grid; gap: 6px; margin-top: 12px; }
.summary .line { display: flex; justify-content: space-between; }
.summary .total { font-size: 18px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 8px; }

.layout-2 { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .layout-2 { grid-template-columns: 1.3fr 1fr; align-items: start; } }

form .field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
form label { font-size: 14px; font-weight: 600; }
form input, form textarea { padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
form input:focus, form textarea:focus, .search:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
form .error { color: var(--danger); font-size: 13px; }
.field.invalid input { border-color: var(--danger); }
.pay-options { display: grid; gap: 8px; }
.pay-option { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; }
.pay-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; white-space: pre-line; }
.alert.error { background: #fee2e2; color: var(--danger); }
.alert.info { background: var(--brand-soft); color: var(--brand-ink); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }

.success-mark { width: 56px; height: 56px; border-radius: 50%; background: #d1fae5; color: var(--ok); display: grid; place-items: center; font-size: 28px; margin-bottom: 8px; }
.steps { display: flex; gap: 6px; margin: 16px 0; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps span.on { background: var(--brand); }
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--brand-soft); color: var(--brand-ink); }
.status-pill.cancelled { background: #fee2e2; color: var(--danger); }

.footer { padding: 18px 16px 28px; text-align: center; color: var(--muted); font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 14px; z-index: 20; max-width: calc(100% - 32px); }

@media (max-width: 480px) {
  .navlink { font-size: 13px; }
  h1 { font-size: 20px; }
}

/* ---- Chat widget ---- */
.chat-bubble { position: fixed; right: 18px; bottom: 18px; z-index: 30; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 26px; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.chat-dot { position: absolute; top: 6px; right: 6px; width: 12px; height: 12px; border-radius: 50%; background: #ef4444; border: 2px solid #fff; }
.chat-panel { position: fixed; right: 18px; bottom: 88px; z-index: 30; width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 120px)); display: flex; flex-direction: column; background: #fff; border-radius: 16px; box-shadow: 0 16px 48px rgba(0,0,0,.2); overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; background: var(--brand); color: #fff; }
.chat-sub { font-size: 11px; opacity: .85; }
.chat-close { border: 0; background: none; color: #fff; font-size: 18px; cursor: pointer; }
.chat-log { flex: 1; overflow-y: auto; padding: 12px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; }
.chat-msg { max-width: 85%; padding: 8px 11px; border-radius: 12px; font-size: 14px; white-space: pre-line; line-height: 1.5; }
.chat-msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-msg.agent { align-self: flex-start; background: #fef3c7; border-bottom-left-radius: 4px; }
.chat-who { font-size: 11px; font-weight: 700; color: var(--warn); }
.chat-quick { display: flex; gap: 6px; padding: 8px 10px 0; overflow-x: auto; background: #fff; }
.chat-quick button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.chat-form { display: flex; gap: 8px; padding: 10px; background: #fff; }
.chat-form textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; max-height: 100px; }
.chat-send { width: 42px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; cursor: pointer; }
.chat-send:disabled { opacity: .5; }
@media (max-width: 480px) { .chat-panel { right: 12px; bottom: 82px; } .chat-bubble { right: 12px; bottom: 12px; } }
