@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/bodoni-moda-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/bodoni-moda-700-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Sans Myanmar";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/noto-sans-myanmar-400-myanmar.woff2") format("woff2");
  unicode-range: U+1000-109F;
}
@font-face {
  font-family: "Noto Sans Myanmar";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/noto-sans-myanmar-700-myanmar.woff2") format("woff2");
  unicode-range: U+1000-109F;
}

:root {
  --blue: #0071dc;
  --blue-dark: #004f9e;
  --navy: #0a1931;
  --ink: #1a1a1a;
  --muted: #46545f;
  --line: #dbe4ec;
  --bg: #ffffff;
  --surface: #f4f8fc;
  --card: #ffffff;
  --accent-soft: #e6f1fd;
  --danger: #b3261e;
  --ok: #137333;
  --amber: #8a5a00;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 42, 67, 0.12), 0 4px 14px rgba(16, 42, 67, 0.08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Helvetica, Arial, "Noto Sans Myanmar", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
/* Bodoni is for the large display H1 only. At small sizes its hairlines
   break up on screen (prices misread, letters fragment), so everything
   else — headings, card titles, prices, small text — is Helvetica. */
h1 {
  font-family: "Bodoni Moda", "Bodoni MT", Didot, Georgia, serif;
}
h2, h3, .deal-price {
  font-family: Helvetica, Arial, "Noto Sans Myanmar", sans-serif;
}
a { color: var(--blue); }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; font-size: 1rem; }
.hidden { display: none !important; }

/* ---------- header ---------- */
.topbar { background: var(--blue); color: #fff; }
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 10px 16px; position: relative;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.top-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-left .search { flex: 1; min-width: 0; }
.top-right { display: flex; align-items: center; gap: 10px; justify-content: flex-end; position: relative; }
/* Logo: bag mark (with the "A" monogram inside) + အဝယ်တော်. The bag and
   the word sit on one line — baseline alignment made the bag float. */
.logo { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; justify-self: center; }
.logo-bag { width: 30px; height: 30px; flex: none; }
.logo-word { font-size: 1.6rem; font-weight: 700; font-family: "Noto Sans Myanmar", sans-serif; line-height: 1; }
.logo-sub { font-size: 0.8rem; opacity: 0.85; letter-spacing: 0.08em; }
.search-toggle {
  display: none; border: 1px solid rgba(255, 255, 255, 0.6); background: transparent;
  color: #fff; border-radius: 999px; width: 38px; height: 38px; padding: 8px; flex: none;
}
.search-toggle svg { width: 100%; height: 100%; }
.search { flex: 1; min-width: 200px; }
.search input {
  width: 100%; padding: 10px 16px; border: none; border-radius: 999px;
  background: #fff; color: var(--ink);
}
.cart-icon { width: 18px; height: 18px; vertical-align: -3px; }
.role-switch { display: flex; border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 999px; overflow: hidden; }
.role-btn {
  border: none; background: transparent; color: #fff; padding: 8px 16px; font-size: 0.95rem;
}
.role-btn.active { background: #fff; color: var(--blue); font-weight: 700; }
.cart-btn, .signout-btn, .menu-btn {
  border: 1px solid #fff; background: #fff; color: var(--blue);
  border-radius: 999px; padding: 8px 16px; font-weight: 700;
}
.signout-btn { background: transparent; color: #fff; }
.menu-btn { display: flex; align-items: center; gap: 6px; }
.menu-btn svg { width: 18px; height: 18px; }

/* ---------- header dropdown menu ---------- */
.menu-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 80;
  width: min(280px, calc(100vw - 24px));
  max-height: min(80vh, 560px); overflow-y: auto;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 6px;
}
.menu-item {
  display: flex; width: 100%; text-align: left; gap: 10px; align-items: center;
  background: none; border: none; padding: 10px 12px; border-radius: 8px;
  font-size: 0.95rem; color: var(--ink);
}
.menu-item:hover { background: var(--accent-soft); }
.menu-item .check { margin-left: auto; color: var(--blue); font-weight: 700; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-section { padding: 8px 12px 2px; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.cart-count {
  display: inline-block; min-width: 20px; text-align: center;
  background: var(--blue); color: #fff; border-radius: 999px; padding: 0 5px; margin-left: 4px;
}
.catnav {
  background: #eaf3fc; display: flex; gap: 8px; padding: 8px 16px;
  max-width: 1280px; margin: 0 auto; overflow-x: auto; align-items: center;
}
/* Categories submenu inside the header menu. */
.menu-cat-toggle .cat-toggle-arrow { margin-left: auto; transition: transform 0.15s; }
.menu-cat-toggle[aria-expanded="true"] .cat-toggle-arrow { transform: rotate(180deg); }
.menu-sub { max-height: 280px; overflow-y: auto; padding: 2px 0; }
.menu-cat-count { margin-left: auto; color: var(--muted); font-size: 0.85rem; }
/* Active category filter chip above the feed. */
.active-filter { margin: 12px 0 0; }
.filter-chip {
  border: 1px solid var(--blue); background: #eaf3fc; color: var(--blue);
  border-radius: 999px; padding: 6px 12px; font-size: 0.9rem; cursor: pointer;
}
.filter-chip strong { font-weight: 700; }
.how-btn {
  border: 1px dashed var(--blue); background: #fff; color: var(--blue);
  border-radius: 999px; padding: 7px 14px; font-size: 0.9rem; white-space: nowrap; font-weight: 700;
}
.catnav .role-switch { margin-left: auto; border-color: var(--blue); flex: none; }
.catnav .role-btn { color: var(--blue); }
.catnav .role-btn.active { background: var(--blue); color: #fff; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 28px 16px 20px; background: var(--surface); }
.hero h1 { font-size: 2.6rem; font-weight: 700; margin: 0 0 4px; color: var(--blue-dark); }
.hero-sub { font-size: 1.25rem; margin: 0; font-family: "Noto Sans Myanmar", sans-serif; }

/* ---------- layout ---------- */
.layout {
  max-width: 1280px; margin: 0 auto; padding: 20px 16px 40px;
  display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start;
}
.sidebar { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--card); }
.panel h2 { font-size: 1.15rem; margin: 0 0 10px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.panel-head h2 { margin-bottom: 10px; }
.sidebar-close {
  display: none; border: none; background: none; font-size: 1.6rem; line-height: 1;
  color: var(--muted); padding: 0 4px;
}
.more-stores {
  width: 100%; margin-top: 8px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 7px 10px; font-size: 0.9rem; color: var(--blue-dark); text-align: left;
}
.store-list { list-style: none; margin: 0; padding: 0; }
.store-list li { margin: 2px 0; }
.store-list button {
  width: 100%; text-align: left; border: none; background: none;
  padding: 6px 8px; border-radius: 8px; font-size: 0.95rem; color: var(--ink);
  display: flex; justify-content: space-between; gap: 8px;
}
.store-list button:hover { background: var(--accent-soft); }
.store-list button.active { background: var(--accent-soft); font-weight: 700; color: var(--blue-dark); }
.store-list .count { color: var(--muted); font-size: 0.85rem; }
.store-list .star { color: #e6a700; }
.how { margin: 0; padding-left: 20px; }
.how li { margin-bottom: 6px; }
.how-note { color: var(--muted); font-size: 0.9rem; }

.feed-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.feed-head h2 { font-size: 1.6rem; margin: 0; }
.feed-count { color: var(--muted); font-size: 0.9rem; }
.feed-actions { display: flex; gap: 10px; align-items: center; }

.btn {
  border: 1px solid var(--blue); border-radius: 8px; padding: 9px 16px;
  font-size: 0.95rem; background: #fff; color: var(--blue);
}
.btn-primary { background: var(--blue); color: #fff; font-weight: 700; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 0.85rem; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: 0.5; cursor: default; }

.alert {
  border: 1px solid #f0c36d; background: #fef7e0; color: var(--amber);
  border-radius: 8px; padding: 12px 14px; margin-bottom: 14px;
}
.field-error { color: var(--danger); font-size: 0.9rem; margin: 6px 0; }

/* ---------- deal grid ---------- */
.deal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.deal-card {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.deal-img { aspect-ratio: 16 / 9; background: var(--surface); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.deal-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
/* Placeholder tile for a deal with no photo yet: bag mark + store +
   category, on a surface that reads as a designed card — not an
   empty box with one word in it. */
.deal-img .tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; width: 100%; height: 100%; padding: 8px; text-align: center;
  font-family: Helvetica, Arial, sans-serif; color: var(--blue-dark);
  background:
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(0, 113, 220, 0.05) 10px 11px);
}
.deal-img .tile-bag { width: 22px; height: 22px; opacity: 0.7; }
.deal-img .tile-store { font-size: 0.95rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.deal-img .tile-cat { font-size: 0.75rem; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
.deal-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.deal-store {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--blue);
}
.deal-title {
  font-size: 0.95rem; margin: 0; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.deal-price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.deal-price { font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.deal-was { color: var(--muted); text-decoration: line-through; font-size: 0.9rem; }
.deal-badge {
  background: var(--danger); color: #fff; font-size: 0.8rem; font-weight: 700;
  border-radius: 6px; padding: 2px 7px; white-space: nowrap;
}
.deal-mmk { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.deal-note { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.deal-body .btn { margin-top: auto; }
.deal-card { cursor: pointer; }
.deal-title-link { color: inherit; text-decoration: none; }
.deal-title-link:hover { text-decoration: underline; }

/* ---------- product detail page ---------- */
.deal-back { margin-bottom: 14px; }
.deal-detail {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow); overflow: hidden;
}
.deal-detail .deal-img { aspect-ratio: 16 / 9; max-height: 420px; }
.deal-detail .deal-img img { object-fit: contain; }
.deal-detail-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.deal-detail-title { font-size: 1.4rem; line-height: 1.35; margin: 0; font-family: Helvetica, Arial, "Noto Sans Myanmar", sans-serif; }
.deal-detail .deal-price { font-size: 1.6rem; }
.deal-detail .btn { max-width: 320px; }
.deal-rate-note { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.account-note {
  border: 1px solid var(--line); background: var(--accent-soft);
  border-radius: 8px; padding: 10px 12px; font-size: 0.9rem; line-height: 1.5;
}
.account-note button { border: none; background: none; font-size: 1.2rem; color: var(--muted); float: right; padding: 0 4px; }

/* ---------- "How to order" visual strip ---------- */
.how-strip {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 14px 16px; margin-top: 28px; flex-wrap: wrap;
}
.how-step { display: flex; align-items: center; gap: 10px; }
.how-icon {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center;
}
.how-icon svg { width: 22px; height: 22px; }
.how-label { font-size: 0.95rem; line-height: 1.35; }
.how-label strong { font-weight: 700; }
.how-arrow { color: var(--blue); font-size: 1.3rem; font-weight: 700; }

/* ---------- "How to order" popup ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 25, 49, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100;
}
.modal {
  position: relative; background: var(--card); color: var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow);
  max-width: 440px; width: 100%; padding: 24px; max-height: 90vh; overflow-y: auto;
}
.modal h2 { margin: 0 0 16px; font-size: 1.4rem; padding-right: 32px; }
.modal-close {
  position: absolute; top: 10px; right: 12px; border: none; background: none;
  font-size: 1.8rem; line-height: 1; color: var(--muted); padding: 4px 8px;
}
.modal-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.modal-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 0.95rem; line-height: 1.5; }

/* ---------- orders ---------- */
.orders-section { margin-top: 36px; }
.orders-section h2, .orders-section h3 { font-size: 1.4rem; }
.order-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; background: var(--card);
}
.order-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.order-head h3 { margin: 0; font-size: 1.2rem; }
.status-pill {
  border-radius: 999px; padding: 4px 12px; font-size: 0.85rem; font-weight: 700;
  background: var(--accent-soft); color: var(--blue-dark); text-transform: capitalize;
}
.timeline {
  display: flex; gap: 4px; flex-wrap: wrap; list-style: none; margin: 12px 0; padding: 0;
}
.timeline li {
  font-size: 0.8rem; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 9px;
}
.timeline li.done { background: var(--blue); border-color: var(--blue); color: #fff; }
.timeline li small { display: block; font-size: 0.7rem; opacity: 0.85; }
.deliver-line { color: var(--muted); font-size: 0.95rem; margin: 8px 0 0; }
.pay-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 10px; background: var(--accent-soft); }
.pay-box p { margin: 0 0 8px; }
.pay-box .pay-sub { color: var(--muted); font-size: 0.9rem; margin: 8px 0 0; }
.pay-box label { display: block; font-size: 0.9rem; margin-top: 8px; }
.pay-box input { width: 100%; margin-top: 4px; }
.fee-note { color: var(--muted); font-size: 0.9rem; }
.cart-fee { color: var(--muted); font-size: 0.9rem; margin: 4px 0 0; }
/* Shopper Portal (shopper.awaltaw.com): same look as the main site. */
.portal-label { font-weight: 700; color: var(--blue); white-space: nowrap; }
.shopper-page { max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; }
.delivery-fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 12px; }
.delivery-fieldset legend { font-weight: 700; padding: 0 6px; }
.delivery-fieldset label { display: block; margin-top: 8px; }
.delivery-fieldset input { width: 100%; margin-top: 4px; }
.pay-accounts { margin-bottom: 16px; }
.pay-accounts summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
.order-item { border-top: 1px solid var(--line); padding: 10px 0; }
.order-item.cancelled-item .item-title { text-decoration: line-through; color: var(--muted); }
.item-title { font-weight: 700; }
.item-meta { color: var(--muted); font-size: 0.9rem; }
.item-alert {
  border: 1px solid #f0c36d; background: #fef7e0; border-radius: 8px;
  padding: 10px 12px; margin-top: 8px;
}
.item-alert p { margin: 0 0 8px; }
.item-alert .row { display: flex; gap: 8px; flex-wrap: wrap; }
.item-note { color: var(--ok); font-size: 0.9rem; margin-top: 6px; }
.item-flag { color: var(--amber); font-size: 0.9rem; margin-top: 6px; }
.bought-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: end; }
.bought-form label { display: flex; flex-direction: column; font-size: 0.85rem; color: var(--muted); }
.bought-form input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; width: 130px; }
.order-total { font-size: 1.05rem; margin-top: 10px; }
.empty { color: var(--muted); }

/* ---------- shopper gate ---------- */
.gate {
  max-width: 480px; margin: 24px auto; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; background: var(--card);
}
.gate h2 { margin-top: 0; }
.gate form { display: flex; flex-direction: column; gap: 8px; }
.gate input {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
}

/* ---------- cart drawer ---------- */
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 94vw);
  background: var(--card); border-left: 1px solid var(--line); box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 50; display: flex; flex-direction: column; padding: 16px; overflow-y: auto;
}
.cart-head { display: flex; justify-content: space-between; align-items: center; }
.cart-head h2 { margin: 0; }
.cart-line { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.cart-line .info { flex: 1; }
.cart-line .qty { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
/* Fixed 28px size is ONLY for the −/+ buttons. The old selector hit
   every button in the row, so the Remove button (btn-sm, auto width)
   was squeezed into 28px and its text spilled out of the pill
   (Wright, Nov 26, 2026: "Cart UI ကစာတွေထပ်နေ"). */
.cart-line .qty button[data-inc], .cart-line .qty button[data-dec] { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.cart-foot { border-top: 1px solid var(--line); padding-top: 14px; margin-top: auto; }
.cart-foot label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted); }
.cart-foot input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; width: 160px; }
.cart-total { font-size: 1.05rem; }
.cart-note { color: var(--muted); font-size: 0.88rem; }

.filters-btn { display: none; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 20px 16px 32px; text-align: center; color: var(--muted); font-size: 0.9rem; }
.footer p { margin: 4px 0; }
.footer .theme-switch select {
  padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 0.85rem; margin-left: 4px;
}

/* ---------- dark navy theme ---------- */
body.theme-navy {
  --blue: #7fb3ff;
  --blue-dark: #bcd6ff;
  --ink: #e8eef7;
  --muted: #9db2cc;
  --line: #22344f;
  --bg: #0a1931;
  --surface: #10233f;
  --card: #12294a;
  --accent-soft: #1b3a63;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
}
body.theme-navy .topbar { background: #081226; }
body.theme-navy .catnav { background: #12315e; }
body.theme-navy .hero { background: #0d2142; }
body.theme-navy .hero h1 { color: #dbe9ff; }
body.theme-navy .deal-img img { background: #fff; }
body.theme-navy .deal-img { background: #0d2142; }
body.theme-navy .deal-img .tile {
  color: #bcd6ff;
  background:
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(127, 179, 255, 0.07) 10px 11px);
}
body.theme-navy .deal-img .tile-cat { color: #8fa8cc; }
body.theme-navy .search input { background: #0d2142; color: #e8eef7; border: 1px solid #22344f; }
body.theme-navy .filter-chip { background: #16294d; border-color: #7fb3ff; color: #bcd6ff; }
body.theme-navy .menu-cat-count { color: #8fa8cc; }
body.theme-navy .btn { background: transparent; color: #bcd6ff; border-color: #3a5a8c; }
body.theme-navy .btn-primary { background: #2f6fd0; color: #fff; border-color: #2f6fd0; }
body.theme-navy .btn-ghost { color: #c6d6ee; }
body.theme-navy .role-btn.active { background: #fff; color: #0a1931; }
body.theme-navy .cart-btn { background: #fff; color: #0a1931; }
body.theme-navy .alert { background: #3a2f10; border-color: #6b5518; color: #f5d67b; }
body.theme-navy .item-alert { background: #3a2f10; border-color: #6b5518; }
body.theme-navy .bought-form input, body.theme-navy .gate input, body.theme-navy .cart-foot input {
  background: #0d2142; color: #e8eef7; border-color: #22344f;
}
body.theme-navy .cart-line .qty button { background: #0d2142; color: #e8eef7; }
body.theme-navy .footer .theme-switch select { background: #0d2142; color: #e8eef7; border-color: #22344f; }
body.theme-navy .footer .theme-switch select option { color: #e8eef7; }
body.theme-navy .catnav .role-btn.active { background: #7fb3ff; color: #0a1931; }

/* ---------- dark black theme (Facebook-style) ---------- */
/* Wright, Nov 26 ~14:39 EST: "dark theme, black black, facebook လို".
   Facebook dark palette: page #18191a, surfaces #242526, text #e4e6eb,
   secondary #b0b3b8, dividers #3e4042, blue #2d88ff. */
body.theme-black {
  --blue: #2d88ff;
  --blue-dark: #8ab4ff;
  --ink: #e4e6eb;
  --muted: #b0b3b8;
  --line: #3e4042;
  --bg: #18191a;
  --surface: #242526;
  --card: #242526;
  --accent-soft: #3a3b3c;
  --danger: #f02849;
  --ok: #31a24c;
  --amber: #f5c33b;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 4px 14px rgba(0, 0, 0, 0.4);
}
body.theme-black .topbar { background: #242526; border-bottom: 1px solid #3e4042; }
body.theme-black .catnav { background: #242526; border-bottom: 1px solid #3e4042; }
body.theme-black .hero { background: #18191a; }
body.theme-black .hero h1 { color: #e4e6eb; }
body.theme-black .deal-img img { background: #fff; }
body.theme-black .deal-img { background: #242526; }
body.theme-black .deal-img .tile {
  color: #b0b3b8;
  background:
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(255, 255, 255, 0.05) 10px 11px);
}
body.theme-black .deal-img .tile-cat { color: #b0b3b8; }
body.theme-black .search input { background: #3a3b3c; color: #e4e6eb; border: 1px solid #3e4042; }
body.theme-black .filter-chip { background: #3a3b3c; border-color: #2d88ff; color: #e4e6eb; }
body.theme-black .menu-cat-count { color: #b0b3b8; }
body.theme-black .btn { background: transparent; color: #e4e6eb; border-color: #3e4042; }
body.theme-black .btn-primary { background: #1877f2; color: #fff; border-color: #1877f2; }
body.theme-black .btn-primary:hover { background: #2d88ff; }
body.theme-black .btn-ghost { color: #e4e6eb; }
body.theme-black .role-btn.active { background: #e4e6eb; color: #18191a; }
body.theme-black .cart-btn { background: #e4e6eb; color: #18191a; }
body.theme-black .alert { background: #3a2f10; border-color: #6b5518; color: #f5d67b; }
body.theme-black .item-alert { background: #3a2f10; border-color: #6b5518; }
body.theme-black .bought-form input, body.theme-black .gate input, body.theme-black .cart-foot input {
  background: #3a3b3c; color: #e4e6eb; border-color: #3e4042;
}
body.theme-black .cart-line .qty button { background: #3a3b3c; color: #e4e6eb; }
body.theme-black .footer .theme-switch select { background: #3a3b3c; color: #e4e6eb; border-color: #3e4042; }
body.theme-black .footer .theme-switch select option { color: #e4e6eb; }
body.theme-black .catnav .role-btn.active { background: #2d88ff; color: #fff; }
body.theme-navy .how-btn { background: transparent; color: #bcd6ff; border-color: #3a5a8c; }
body.theme-navy .search-toggle { border-color: #3a5a8c; color: #e8eef7; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  /* The .content grid item must be allowed to shrink below its content:
     without min-width: 0 its min-content width (the ~402px feed-head row)
     forced the single-column track — and the whole feed — to 418px on a
     390px viewport, cutting off the right card column. */
  .content { min-width: 0; }
  /* Filters live behind a button on mobile — never stacked above the feed. */
  .sidebar { display: none; }
  .sidebar.open {
    display: flex; position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    width: min(300px, 85vw); background: var(--card); padding: 16px;
    overflow-y: auto; box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  }
  .sidebar.open .sidebar-close { display: block; }
  .filters-btn { display: inline-block; }
  /* Compact header: centered logo + search icon + cart + menu, one row. */
  .topbar-inner { gap: 8px; padding: 8px 12px; }
  .top-left { gap: 6px; }
  .top-right { gap: 8px; }
  .logo-bag { width: 24px; height: 24px; }
  .logo-word { font-size: 1.25rem; }
  .logo-sub { display: none; }
  .search-toggle { display: block; }
  .search { display: none; }
  /* Expanded search overlays below the header row — it never pushes
     the products down. */
  .search.expanded {
    display: block; position: absolute; top: calc(100% + 8px);
    left: 12px; right: 12px; z-index: 70; min-width: 0;
  }
  .cart-label { display: none; }
  /* The header "Sign out" button only shows when the shopper is signed
     in — and its ~63px forces the right grid track wider than the left
     one, pushing the logo ~56px left of center at 390px (~71px at 360px).
     The header grid is 1fr auto 1fr, so the logo is only truly centered
     when both side tracks fit their share. Sign out stays available in
     the ☰ menu and in My account, so hiding the header copy on phones
     loses nothing. Desktop keeps the button (plenty of free space). */
  .signout-btn { display: none; }
  .cart-btn { padding: 8px 12px; }
  .menu-btn { padding: 8px 12px; }
  .deal-detail-body { padding: 16px; }
  .deal-detail-title { font-size: 1.2rem; }
  /* Minimal hero so deals start near the top. */
  .hero { padding: 14px 16px 12px; }
  .hero h1 { font-size: 1.5rem; }
  .hero-sub { font-size: 1rem; }
  .layout { padding-top: 8px; }
  .feed-head { margin-bottom: 8px; }
  .feed-head h2 { font-size: 1.1rem; }
  .catnav { padding: 4px 12px; }
  .topbar-inner { padding-top: 6px; padding-bottom: 6px; }
  .how-strip { gap: 8px; padding: 10px 12px; }
  .how-icon { width: 32px; height: 32px; }
  .how-icon svg { width: 18px; height: 18px; }
  .how-label { font-size: 0.85rem; }
  .how-arrow { font-size: 1rem; }
}

@media (max-width: 640px) {
  /* No hero on mobile: products first, straight after the header.
     No Bodoni anywhere below 640px — its hairlines fragment on phone
     screens, so every heading is Helvetica here. */
  .hero { display: none; }
  h1 { font-family: Helvetica, Arial, "Noto Sans Myanmar", sans-serif; }
  /* Compact tabs & buttons: denser layout, more products on screen. */
  .catnav { gap: 6px; padding: 6px 12px; }
  .role-btn { padding: 6px 12px; font-size: 0.85rem; }
  .feed-actions .btn, .filters-btn { padding: 6px 10px; font-size: 0.85rem; }
  .sort-btn { padding: 6px 10px; font-size: 0.85rem; }
  /* Feed header wraps on phones: title + Filters + count + sort + Refresh
     is ~402px of min-content — wider than a 390px viewport — so the row
     used to force the whole feed to 418px wide and squeeze the sort
     switch until "Newest" clipped to "Ne". Wrapping keeps every control
     at its natural width; flex: none stops the switch shrinking at all
     (its overflow: hidden made its auto min-width 0, so it could shrink
     below its own content and clip the label). */
  .feed-head { flex-wrap: wrap; row-gap: 8px; }
  .feed-actions { flex-wrap: wrap; min-width: 0; }
  .sort-switch { flex: none; }
  .deal-body .btn { padding: 7px 10px; font-size: 0.85rem; }
  .cart-btn, .menu-btn { padding: 7px 10px; font-size: 0.9rem; }
  .menu-btn .menu-label { display: none; }
  .search-toggle { width: 34px; height: 34px; padding: 7px; }
  .menu-item { padding: 9px 10px; font-size: 0.9rem; }
}

@media (max-width: 560px) {
  /* 2-column grid with a TALL photo area: Wright said the 52px photo
     strip was too small ("ပုနေ"). Card budget ~280px: 120px photo +
     ~160px body, so ~2-3 cards per phone screen instead of 6 — the
     product photo is the point of a shopping card. The note stays on
     the detail page only — it costs a variable number of lines. */
  .deal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .deal-card .deal-img { aspect-ratio: auto; height: 120px; }
  /* At 120px the stacked tile fits again: bag + store + category. */
  .deal-card .deal-img .tile { flex-direction: column; gap: 2px; font-size: 0.85rem; }
  .deal-card .deal-img .tile-bag { width: 22px; height: 22px; }
  .deal-card .deal-img .tile-store { font-size: 0.85rem; }
  .deal-card .deal-img .tile-cat { display: block; font-size: 0.72rem; }
  .deal-card .deal-body { padding: 7px 10px; gap: 3px; }
  .deal-card .deal-store { font-size: 0.72rem; line-height: 1.3; }
  .deal-card .deal-title { font-size: 0.82rem; line-height: 1.2; }
  /* Price row packs onto two lines: "Now $X + badge" then "Was $Y". */
  .deal-card .deal-price-row { gap: 2px 6px; align-items: center; }
  .deal-card .deal-price { font-size: 0.95rem; }
  .deal-card .deal-badge { order: 2; font-size: 0.68rem; padding: 1px 5px; }
  .deal-card .deal-was { order: 3; font-size: 0.78rem; }
  .deal-card .deal-mmk { font-size: 0.75rem; line-height: 1.3; }
  .deal-card .deal-note { display: none; }
  .deal-card .deal-body .btn { padding: 6px 10px; font-size: 0.85rem; min-height: 30px; }
}

@media (max-width: 380px) {
  /* Smaller phones keep the tall photo, just a little shorter. */
  .deal-card .deal-img { height: 100px; }
  .deal-card .deal-title { font-size: 0.8rem; }
  .deal-card .deal-body .btn { min-height: 30px; }
  /* Keep the logo centered on the narrowest phones: a 2–3 digit cart
     count widens the cart button, and the right side's min-content then
     exceeds its 1fr track share, pushing the logo left (~6px at 12 items,
     ~14px at 100+). Tightening the header buttons/gap by ~14px keeps the
     right side inside its share so the 1fr auto 1fr grid stays centered. */
  .top-right { gap: 6px; }
  .cart-btn, .menu-btn { padding: 7px 7px; }
}

/* ---------- buyer auth + checkout ---------- */
.auth-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.auth-tab {
  flex: 1; border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 9px; font-size: 0.95rem; color: var(--ink);
}
.auth-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted); }
.auth-form input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
/* Request-an-item panel: same form look, plus selects. */
.request-panel { margin-bottom: 24px; }
/* Browse bar: Categories dropdown + Promotions on the page itself
   (Wright, Nov 26, 2026) — NOT hidden inside the ☰ menu. */
.browse-bar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cat-drop { position: relative; }
.cat-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 80;
  width: min(300px, calc(100vw - 32px));
  max-height: min(70vh, 480px); overflow-y: auto;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 6px;
}
/* Load-more pagination: single page, 48 deals at a time. */
.load-more-wrap { text-align: center; margin: 24px 0 8px; }
.load-more-wrap .btn { padding: 11px 28px; }
/* Feed sort switch (Best = server rotation, Newest = publish date).
   A refresh that finds new deals switches to Newest automatically,
   so the new products show at the top of the home page. */
.sort-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.sort-btn { border: none; background: transparent; padding: 8px 12px; font-size: 0.9rem; color: var(--ink); cursor: pointer; }
.sort-btn.active { background: var(--blue); color: #fff; font-weight: 700; }
/* Promotions: store-wide sales / coupon offers (no product price). */
.promo-card { border-top: 3px solid var(--blue); }
.promo-summary { color: var(--muted); font-size: 0.9rem; margin: 6px 0; }
.promo-exp { color: var(--amber); font-size: 0.9rem; font-weight: 700; margin: 6px 0; }
.promo-code-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.promo-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1rem; font-weight: 700;
  letter-spacing: 0.05em; background: var(--accent-soft); border: 1px dashed var(--blue);
  border-radius: 8px; padding: 6px 10px;
}
.request-panel select {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); font-size: 0.95rem; width: 100%;
}
body.theme-navy .request-panel select { background: #0d2142; color: #e8eef7; border-color: #22344f; }
body.theme-black .request-panel select { background: #3a3b3c; color: #e4e6eb; border-color: #3e4042; }
.auth-note { color: var(--muted); font-size: 0.88rem; line-height: 1.5; margin: 12px 0 0; }
.pay-form { display: flex; flex-direction: column; gap: 10px; }
.pay-option {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; cursor: pointer; font-size: 0.95rem;
}
.pay-option input { accent-color: var(--blue); width: 18px; height: 18px; flex: none; }
.pay-option:has(input:checked) { border-color: var(--blue); background: var(--accent-soft); }
.pay-sub { color: var(--muted); font-size: 0.85rem; }
#payBankLabel { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted); }
#payBankLabel input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.account-box {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 1px solid var(--line); background: var(--accent-soft); border-radius: 8px;
  padding: 10px 12px; font-size: 0.95rem; margin-bottom: 12px; flex-wrap: wrap;
}
.pay-line { color: var(--muted); font-size: 0.95rem; margin-top: 8px; }
.pay-later { font-size: 0.85rem; }
body.theme-navy .auth-form input, body.theme-navy #payBankLabel input {
  background: #0d2142; color: #e8eef7; border-color: #22344f;
}
body.theme-navy .pay-option { border-color: #22344f; }
body.theme-navy .auth-tab { background: #0d2142; color: #c6d6ee; border-color: #22344f; }
