/* JD Studio storefront — mobile-first, light base, one accent, subtle glass. */
:root {
  --accent: #5b3df5;
  --accent-600: #4a2be0;
  --accent-soft: rgba(91, 61, 245, .09);
  --ink: #0f1222;
  --ink-2: #3b4058;
  --muted: #6b7189;
  --line: rgba(15, 18, 34, .08);
  --bg: #f6f7fb;
  --card: #ffffff;
  --glass: rgba(255, 255, 255, .72);
  --glass-line: rgba(255, 255, 255, .65);
  --ok: #12a150;
  --warn: #b26b00;
  --danger: #d12f45;
  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 18, 34, .04), 0 4px 16px rgba(15, 18, 34, .05);
  --shadow-lg: 0 10px 40px rgba(15, 18, 34, .12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-my: "Noto Sans Myanmar", "Myanmar Text", "Padauk", "Pyidaungsu", system-ui, sans-serif;
  --nav-h: 104px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
/* Soft static color fields behind the glass (no animation = cheap on low-end phones). */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 300px at 10% -5%, rgba(91, 61, 245, .10), transparent 70%),
    radial-gradient(500px 260px at 100% 0%, rgba(0, 180, 220, .08), transparent 70%),
    var(--bg);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 12px; }
main { flex: 1; outline: none; padding-bottom: 32px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.my { font-family: var(--font-my); line-height: 1.9; }
.pre { white-space: pre-line; }

/* ---------- Glass ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid var(--glass-line);
}

/* ---------- Navbar ---------- */
.nav { position: sticky; top: 0; z-index: 50; border-width: 0 0 1px; border-bottom-color: var(--line); }
.nav-row { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "logo icons" "search search"; align-items: center; gap: 6px 8px; padding-top: 6px; padding-bottom: 8px; }
.logo { grid-area: logo; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; letter-spacing: -.02em; font-size: 18px; }
.logo-mark { background: var(--ink); color: #fff; border-radius: 8px; padding: 3px 6px; font-size: 13px; letter-spacing: .02em; }
.nav-icons { grid-area: icons; justify-self: end; display: flex; gap: 2px; }
.icon-btn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--ink-2); }
.icon-btn:active { background: var(--line); }
.badge-count { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }
.search { grid-area: search; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 12px; background: rgba(255, 255, 255, .85); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.search:focus-within { border-color: rgba(91, 61, 245, .45); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; height: 100%; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ---------- Category chips ---------- */
.chips-bar { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips-bar::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.75); font-size: 13.5px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; white-space: nowrap; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.sort-chip { position: relative; padding: 0 28px 0 12px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b4058' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }

/* ---------- Product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--card); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; contain: layout paint; }
.card:active { transform: scale(.985); }
.thumb { position: relative; aspect-ratio: 1 / 1; background: #eef0f6; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 28px; color: rgba(15,18,34,.35); background: linear-gradient(135deg, #eceefe, #f6f1ff 60%, #e9f7fb); letter-spacing: -.02em; }
.tags { position: absolute; inset: 6px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.tag { font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 999px; background: rgba(255,255,255,.88); color: var(--ink-2); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.tag .sd { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.tag.out { background: rgba(15,18,34,.78); color: #fff; }
.tag.out .sd { background: #9aa0b4; }
.card-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card-name { font-size: 13.5px; font-weight: 650; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.card-dur { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: nowrap; margin-top: 2px; white-space: nowrap; overflow: hidden; }
.price { color: var(--accent); font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.old { color: var(--muted); text-decoration: line-through; font-size: 12px; }
.card.is-out .thumb img { filter: grayscale(.5); opacity: .8; }
.skeleton { background: linear-gradient(90deg, #eceef4 0, #f6f7fb 50%, #eceef4 100%); background-size: 200% 100%; animation: sh 1.2s linear infinite; }
@keyframes sh { to { background-position: -200% 0; } }
.sk-card .thumb { background: none; }
.sk-line { height: 12px; border-radius: 6px; margin: 6px 0; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 18px; margin: 8px 0 4px; }
.more-btn { display: block; margin: 16px auto 0; }

/* ---------- Trust badges ---------- */
.trust { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 22px 0 6px; }
.trust-item { display: flex; gap: 10px; align-items: center; padding: 12px; background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: var(--r); }
.trust-item svg { flex: none; color: var(--ink); width: 22px; height: 22px; }
.trust-item b { display: block; font-size: 13px; }
.trust-item span { font-size: 12px; color: var(--muted); }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 15px; transition: background .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn-buy { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-buy:hover { background: var(--accent-600); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.input { height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid rgba(15,18,34,.14); background: #fff; outline: none; font-size: 16px; width: 100%; }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: rgba(91, 61, 245, .55); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.err { color: var(--danger); font-size: 13.5px; margin: 8px 0; }

/* ---------- Generic panels ---------- */
.page-title { font-size: 22px; letter-spacing: -.02em; margin: 16px 0 12px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 12px; }
.panel h3 { margin: 0 0 10px; font-size: 16px; }
.crumbs { font-size: 13px; color: var(--muted); margin: 12px 0 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--ink); }

/* ---------- Product page ---------- */
.pd { display: grid; gap: 16px; }
.pd-media .thumb { border-radius: var(--r); border: 1px solid var(--line); }
.pd-name { font-size: 22px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.02em; }
.pd-price { display: flex; align-items: baseline; gap: 10px; margin: 10px 0; }
.pd-price .price { font-size: 26px; }
.pd-price .old { font-size: 15px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.pill { font-size: 12.5px; font-weight: 650; padding: 5px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.pill .sd { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.pill.out .sd { background: #9aa0b4; }
.specs { display: grid; gap: 0; margin: 12px 0; border: 1px solid var(--line); border-radius: var(--r); background: #fff; overflow: hidden; }
.spec { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.spec:first-child { border-top: 0; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; font-weight: 550; }
.qty { display: inline-flex; align-items: center; border: 1px solid rgba(15,18,34,.14); border-radius: 12px; background: #fff; height: 46px; }
.qty button { width: 40px; height: 100%; border: 0; background: none; font-size: 20px; color: var(--ink-2); }
.qty span { min-width: 28px; text-align: center; font-weight: 700; }
.qty.sm { height: 34px; border-radius: 10px; }
.qty.sm button { width: 32px; font-size: 17px; }
.buy-row { display: flex; gap: 8px; margin: 14px 0; }
.buy-row .btn { flex: 1; }
.section-title { font-size: 17px; margin: 26px 0 10px; letter-spacing: -.01em; }
.sticky-buy { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: center; border-width: 1px 0 0; border-top-color: var(--line); }
.sticky-buy .price { font-size: 18px; }
.sticky-buy .btn { flex: 1; }
.has-sticky { padding-bottom: 80px; }

/* ---------- Cart ---------- */
.cart-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.cart-line:first-child { border-top: 0; }
.cart-line .thumb { width: 64px; border-radius: 10px; }
.cart-line .ph { font-size: 16px; }
.cl-name { font-weight: 650; font-size: 14px; line-height: 1.3; }
.cl-meta { font-size: 12.5px; color: var(--muted); }
.cl-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12.5px; text-decoration: underline; }
.summary-row { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0; }
.summary-row.total { font-size: 18px; font-weight: 800; padding-top: 10px; border-top: 1px dashed var(--line); margin-top: 10px; }
.summary-row.total .price { font-size: 20px; }
.unavail { color: var(--danger); font-size: 12.5px; font-weight: 600; }

/* ---------- Checkout ---------- */
.checkout { display: grid; gap: 12px; }
.glass-panel { border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.step-h { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 16px; }
.step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12.5px; display: grid; place-items: center; font-weight: 700; flex: none; }
.pay-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.pay-tab { height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 750; }
.pay-tab.active { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(15,18,34,.06); }
.pay-box { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,.9); border: 1px solid var(--line); }
.pay-qr { width: 180px; height: 180px; margin: 0 auto; border-radius: 12px; background: #fff; border: 1px solid var(--line); object-fit: contain; }
.copy-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.copy-row:first-child { border-top: 0; }
.copy-row b { font-size: 16px; letter-spacing: .01em; word-break: break-all; }
.upload { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; border: 1.5px dashed rgba(15,18,34,.2); border-radius: 12px; background: #fff; text-align: center; padding: 14px; color: var(--muted); font-size: 14px; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload img { max-height: 220px; border-radius: 8px; }
.notice { padding: 10px 12px; border-radius: 10px; background: #fff7e6; color: #7a4a00; font-size: 13.5px; border: 1px solid #ffe2a8; }

/* ---------- Orders ---------- */
.order-card { display: block; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 10px; position: relative; }
.order-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-code { font-weight: 800; letter-spacing: .02em; }
.status { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: #eef0f6; color: var(--ink-2); white-space: nowrap; }
.status.s-pending_review { background: #fff3d9; color: #8a5a00; }
.status.s-paid, .status.s-to_fulfill { background: #e8efff; color: #2343b5; }
.status.s-delivered, .status.s-completed { background: #e4f6ec; color: #0d7a3e; }
.status.s-warranty_claim { background: #fde8ec; color: #a3162c; }
.status.s-cancelled, .status.s-refunded { background: #eef0f6; color: #5a6075; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); display: inline-block; margin-left: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 22px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.timeline li::after { content: ""; position: absolute; left: 8.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.delivery { background: #f7f8fc; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; position: relative; }
.item-block { padding: 12px 0; border-top: 1px solid var(--line); }
.item-block:first-of-type { border-top: 0; padding-top: 0; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.notif { padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.notif:first-child { border-top: 0; }

/* ---------- Content pages ---------- */
.content { max-width: 760px; }
.content p, .content li { color: var(--ink-2); }
.tier { padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; margin-bottom: 10px; }
.tier h3 { margin: 0 0 4px; font-size: 16px; }

/* ---------- Toast & modal ---------- */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; transition: opacity .2s, transform .2s; z-index: 100; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(15,18,34,.4); display: flex; align-items: flex-end; justify-content: center; }
.modal-box { background: #fff; width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); max-height: 90vh; overflow: auto; }
.modal-box h3 { margin: 0 0 10px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: rgba(255,255,255,.6); padding: 22px 0 18px; margin-top: 24px; }
.footer-grid { display: grid; gap: 16px; }
.footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 14px; color: var(--ink-2); }
.footer-links a:hover { color: var(--ink); }
.copy { margin-top: 16px; }

/* ---------- Larger screens ---------- */
@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .trust { grid-template-columns: repeat(4, 1fr); }
  .modal { align-items: center; }
  .modal-box { border-radius: 18px; }
}
@media (min-width: 900px) {
  :root { --nav-h: 68px; }
  .wrap { padding: 0 24px; }
  .nav-row { grid-template-columns: auto minmax(0, 640px) auto; grid-template-areas: "logo search icons"; justify-content: space-between; gap: 24px; padding-top: 12px; padding-bottom: 12px; }
  .search { height: 46px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .card-name { font-size: 14.5px; }
  .price { font-size: 16.5px; }
  .chips-bar { padding: 16px 0 14px; gap: 8px; }
  .chip { height: 36px; padding: 0 16px; font-size: 14px; }
  .sort-chip { padding-right: 30px; }
  .pd { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 36px; margin-top: 8px; }
  .pd-name { font-size: 28px; }
  .sticky-buy { display: none; }
  .has-sticky { padding-bottom: 0; }
  .checkout { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; gap: 20px; }
  .checkout .side { position: sticky; top: calc(var(--nav-h) + 16px); }
  .cart-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
  .pay-box { grid-template-columns: 180px 1fr; align-items: center; }
  .footer-grid { grid-template-columns: 1fr auto; }
  .footer-links { grid-template-columns: repeat(3, auto); }
  .page-title { font-size: 26px; margin: 24px 0 16px; }
}
@media (hover: hover) and (pointer: fine) {
  /* Glass lift on hover — desktop only, keeps phones fast. */
  .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
  .card:hover .card-body { background: rgba(255,255,255,.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .chip:hover { border-color: rgba(15,18,34,.25); }
  .btn:hover { border-color: rgba(15,18,34,.2); }
  .btn-buy:hover { border-color: var(--accent-600); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
