/* ===== Yuanma Shop — Grab × Apple Store Design System ===== */
:root {
  --brand: #0077B6;
  --brand-light: #00B4D8;
  --brand-dark: #023E8A;
  --brand-bg: #E8F6FA;
  --brand-glow: rgba(0, 119, 182, 0.16);
  --leaf: #2D6A4F;
  --leaf-light: #52B788;
  --leaf-bright: #40916C;
  --leaf-bg: #EDF7F2;
  --accent: #40916C;
  --accent-light: #74C69D;
  --gold: #CA8A04;
  --danger: #DC2626;
  --text: #1A1A1A;
  --text-secondary: #666;
  --text-muted: #999;
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --border: #E5E7EB;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,.08);
  --shadow-brand: 0 4px 20px rgba(0, 119, 182, 0.22);
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;
  --tabbar-h: 52px;
  --max-w: 1200px;
  --ease: cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Noto Sans TC', 'Noto Sans Thai', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: .4; }
}

.safe-bottom { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0)); }
.page {
  max-width: var(--max-w); margin: 0 auto;
  padding: 14px 14px 24px;
  animation: fadeUp .4s var(--ease) both;
}
@media(min-width:768px) {
  .safe-bottom { padding-bottom: 0; }
  .page { padding: 24px 20px 48px; }
}

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(160deg, var(--brand-dark) 0%, var(--brand) 60%, #0096C7 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, var(--shadow-brand);
}
.site-header::after { display: none; }
.header-wrap { position: relative; max-width: var(--max-w); margin: 0 auto; padding: 10px 14px 12px; }
.header-row { display: flex; align-items: center; gap: 10px; }
.header-logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; min-width: 0; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: #fff; color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.logo-text { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-search { flex: 1; min-width: 0; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #aaa; pointer-events: none; }
.search-input {
  width: 100%; border: none; outline: none;
  background: #fff; border-radius: var(--radius-pill);
  padding: 10px 16px 10px 40px; font-size: 13px; color: var(--text);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  transition: box-shadow .2s;
}
.search-input:focus { box-shadow: 0 0 0 3px rgba(255,255,255,.4), 0 2px 8px rgba(0,0,0,.1); }
.search-input::placeholder { color: #bbb; }
.header-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.trust-lang { padding: 0 2px; overflow: visible; position: relative; z-index: 10; }

/* ===== Language picker ===== */
.lang-open-btn {
  border: none; background: transparent; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  font: inherit; color: inherit;
}
.lang-open-btn--inline {
  width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.lang-open-btn--inline .ti-icon { margin-bottom: 4px; }
.lang-open-btn--inline > span {
  display: block; font-size: 9px; color: var(--text-secondary); font-weight: 600;
  line-height: 1.25; white-space: nowrap;
}
.lang-open-btn--inline:active .ti-icon { transform: scale(.95); }
.lang-open-btn--drawer {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius);
  background: var(--brand-bg); color: var(--brand); border: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
}
.lang-open-globe { width: 18px; height: 18px; flex-shrink: 0; }
.lang-open-arrow { width: 16px; height: 16px; margin-left: auto; opacity: .45; }

.lang-sheet {
  position: fixed; inset: 0; z-index: 1200;
  visibility: hidden; pointer-events: none;
  transition: visibility .25s;
}
.lang-sheet.open {
  visibility: visible; pointer-events: auto;
}
.lang-sheet-mask {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0);
  transition: background .25s;
}
.lang-sheet.open .lang-sheet-mask { background: rgba(0, 0, 0, .42); }
.lang-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 20px 20px 0 0;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .12);
  transform: translateY(100%);
  transition: transform .28s var(--ease);
}
.lang-sheet.open .lang-sheet-panel { transform: translateY(0); }
.lang-sheet-handle {
  width: 36px; height: 4px; border-radius: 99px; background: #ddd;
  margin: 4px auto 14px;
}
.lang-sheet-title {
  font-size: 16px; font-weight: 800; color: var(--text);
  text-align: center; margin-bottom: 12px; letter-spacing: -.02em;
}
.lang-sheet-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: min(52vh, 420px); overflow-y: auto;
  -webkit-overflow-scrolling: touch; padding-right: 2px;
}
.lang-sheet-item {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto;
  gap: 2px 12px; align-items: center;
  padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--border); background: #fff;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.lang-sheet-item-main { font-size: 15px; font-weight: 700; color: var(--text); grid-column: 1; }
.lang-sheet-item-sub { font-size: 12px; color: var(--text-muted); grid-column: 1; }
.lang-sheet-check { width: 20px; height: 20px; color: var(--leaf-bright); grid-column: 2; grid-row: 1 / span 2; }
.lang-sheet-item.is-active {
  border-color: rgba(64, 145, 108, .35);
  background: linear-gradient(135deg, #f0faf5, #fff);
  box-shadow: 0 4px 14px rgba(64, 145, 108, .12);
}
.lang-sheet-item:active { transform: scale(.985); }
body.lang-sheet-open { overflow: hidden; }

@media (min-width: 768px) {
  .lang-open-btn--inline > span { font-size: 10px; }
  .lang-open-btn--inline .ti-icon { margin-bottom: 6px; }
  .lang-sheet-panel {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: 360px; max-width: calc(100vw - 32px);
    border-radius: var(--radius-xl);
    padding: 20px 18px 18px;
    transform: translate(-50%, -46%) scale(.94);
    opacity: 0;
  }
  .lang-sheet.open .lang-sheet-panel {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  .lang-sheet-handle { display: none; }
}

.drawer-lang-label { padding: 4px 16px 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.lang-open-btn--drawer { margin: 0 12px 8px; width: calc(100% - 24px); }
.icon-btn {
  width: 38px; height: 38px; border: none; border-radius: 10px;
  background: rgba(255,255,255,.18); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  backdrop-filter: blur(4px); transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.28); }
.icon-btn svg { width: 20px; height: 20px; }
.mobile-search { margin-top: 10px; }
.desktop-nav {
  display: none; flex-wrap: wrap; align-items: center; gap: 4px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.15);
}
.desktop-nav a {
  color: rgba(255,255,255,.92); font-size: 13px; font-weight: 500;
  padding: 6px 14px; border-radius: 20px; transition: background .15s;
}
.desktop-nav a:hover { background: rgba(255,255,255,.15); }
.nav-pill-white { background: #fff !important; color: var(--brand) !important; font-weight: 700; box-shadow: var(--shadow-sm); }
@media(min-width:768px) {
  .mobile-drawer-btn, .mobile-search { display: none; }
  .desktop-nav { display: flex; }
  .logo-text { font-size: 18px; }
}

/* ===== Bottom Tab ===== */
.mobile-tab {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0));
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,.05);
}
@media(min-width:768px) { .mobile-tab { display: none; } }
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-muted); font-size: 10px; font-weight: 600;
  transition: color .2s; position: relative;
  font-family: 'Noto Sans TC', 'Noto Sans Thai', 'Inter', sans-serif;
}
.nav-item svg { width: 22px; height: 22px; stroke-width: 1.7; transition: transform .2s; }
.nav-item.active { color: var(--leaf-bright); font-weight: 700; }
.nav-item.active svg { stroke: var(--leaf-bright); transform: scale(1.05); }
.nav-item.active::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 3px; border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--brand), var(--leaf-bright));
}

/* ===== Drawer ===== */
.drawer-overlay { position: fixed; inset: 0; z-index: 200; visibility: hidden; }
.drawer-overlay.open { visibility: visible; }
.drawer-bg { position: absolute; inset: 0; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .25s; }
.drawer-overlay.open .drawer-bg { opacity: 1; }
.drawer-panel {
  position: absolute; left: 0; top: 0; bottom: 0; width: 290px; max-width: 86vw;
  background: #fff; box-shadow: 8px 0 32px rgba(0,0,0,.15);
  transform: translateX(-100%); transition: transform .28s var(--ease);
  display: flex; flex-direction: column;
}
.drawer-overlay.open .drawer-panel { transform: translateX(0); }
.drawer-head {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-light));
  padding: 24px 18px; color: #fff;
  display: flex; justify-content: space-between; align-items: center;
}
.drawer-head span { font-weight: 700; font-size: 17px; }
.drawer-nav { padding: 14px; flex: 1; overflow-y: auto; }
.drawer-link {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  border-radius: var(--radius); color: var(--text); font-weight: 500; font-size: 14px;
  transition: background .15s, color .15s; margin-bottom: 2px;
}
.drawer-link svg { width: 20px; height: 20px; color: var(--text-muted); flex-shrink: 0; }
.drawer-link:hover { background: var(--brand-bg); }
.drawer-link:hover svg { color: var(--brand); }
.drawer-link.highlight { background: var(--brand-bg); color: var(--brand); font-weight: 700; }
.drawer-link.highlight svg { color: var(--brand); }
.drawer-divider { border: none; border-top: 1px solid var(--border); margin: 10px 0; }

/* ===== Sections ===== */
.section { margin-bottom: 22px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-size: 17px; font-weight: 800; color: var(--text);
  letter-spacing: -.025em;
}
.section-title::before { display: none; }
.section-more {
  font-size: 12px; color: var(--text-muted); font-weight: 500;
  display: flex; align-items: center; gap: 2px; transition: color .15s;
}
.section-more:hover { color: var(--brand); }

/* ===== Trust Strip ===== */
.trust-strip {
  display: flex; align-items: stretch; gap: 4px;
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 12px 8px; border: 1px solid var(--border);
  margin-bottom: 16px; overflow: visible; position: relative; z-index: 5;
}
.trust-item {
  flex: 1; min-width: 0; text-align: center; padding: 2px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.trust-item .ti-icon {
  width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 4px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-bg); color: var(--brand); flex-shrink: 0;
}
.trust-item .ti-icon svg { width: 16px; height: 16px; }
.trust-item span {
  display: block; font-size: 9px; color: var(--text-secondary); font-weight: 600;
  line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.trust-lang { padding: 0 2px; overflow: visible; position: relative; z-index: 10; }

/* ===== Banner ===== */
.banner-track {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  margin: 0 -14px; padding: 0 14px 6px;
}
.banner-track::-webkit-scrollbar { display: none; }
.banner-wrap { position: relative; margin-bottom: 4px; }
.banner-hero { margin-bottom: 16px; }
.banner-hero .banner-track { margin: 0; padding: 0 0 6px; }
.banner-hero .banner-item { flex: 0 0 100%; aspect-ratio: 2.35/1; }
@media(min-width:768px) {
  .banner-hero .banner-item { aspect-ratio: 2.8/1; }
}
.banner-item {
  flex: 0 0 92%; scroll-snap-align: center;
  border-radius: var(--radius-xl); overflow: hidden; position: relative;
  aspect-ratio: 2.1/1; border: 1px solid rgba(255,255,255,.6);
  box-shadow: var(--shadow-md);
}
.banner-dots {
  display: flex; justify-content: center; gap: 6px; margin-top: 12px;
}
.banner-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #D1D5DB; transition: all .25s;
}
.banner-dots span.on { width: 18px; border-radius: 3px; background: var(--brand); }
@media(min-width:768px) {
  .banner-item { flex: 1; aspect-ratio: 2.6/1; }
  .banner-track { margin: 0; padding: 0; }
}
.banner-item img { width: 100%; height: 100%; object-fit: cover; }
.banner-caption {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.6) 0%, rgba(0,0,0,.05) 60%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 20px;
}
.banner-caption h2 { color: #fff; font-size: 18px; font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.3); }
.banner-caption p { color: rgba(255,255,255,.85); font-size: 12px; margin-top: 4px; }

/* ===== Quick Menu ===== */
.quick-menu {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px;
  background: var(--surface); border-radius: var(--radius-xl);
  padding: 18px 10px; border: 1px solid var(--border); margin-bottom: 14px;
}
.quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 8px 4px; border-radius: var(--radius); transition: background .15s;
}
.quick-item:active { background: var(--brand-bg); }
.qi-icon {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.qi-icon svg { width: 22px; height: 22px; }
.qi-icon.red   { background: linear-gradient(135deg, #E0F4FA, #B8E6F5); color: var(--brand-dark); }
.qi-icon.orange{ background: linear-gradient(135deg, #E0F4FA, #B8E6F5); color: var(--brand); }
.qi-icon.blue  { background: linear-gradient(135deg, #E3F2FD, #BBDEFB); color: #1976D2; }
.qi-icon.green { background: linear-gradient(135deg, #D8F3DC, #B7E4C7); color: var(--leaf); }
.quick-item span { font-size: 11px; color: var(--text-secondary); font-weight: 600; text-align: center; line-height: 1.2; }

/* ===== Categories ===== */
.cat-scroll {
  display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px;
}
.cat-scroll::-webkit-scrollbar { display: none; }
@media(min-width:768px) { .cat-scroll { display: grid; grid-template-columns: repeat(4,1fr); overflow: visible; } }
.cat-item {
  flex: 0 0 auto; width: 76px; text-align: center;
  background: var(--surface); border-radius: var(--radius);
  padding: 14px 8px; box-shadow: var(--shadow-xs);
  transition: transform .15s, box-shadow .15s;
}
@media(min-width:768px) { .cat-item { width: auto; } }
.cat-item:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.cat-item img {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  margin: 0 auto 8px; border: 2px solid #fff; box-shadow: var(--shadow-sm);
}
.cat-item span { font-size: 11px; font-weight: 600; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cat-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
@media(min-width:768px) { .cat-grid { grid-template-columns: repeat(4,1fr); gap: 14px; } }
.cat-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 24px 14px; text-align: center; box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cat-card img { width: 68px; height: 68px; border-radius: 18px; object-fit: cover; margin: 0 auto 12px; box-shadow: var(--shadow-sm); }
.cat-card span { font-size: 13px; font-weight: 700; color: var(--text); }

/* ===== Product Grid & Card ===== */
.product-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
@media(min-width:768px) { .product-grid { grid-template-columns: repeat(4,1fr); gap: 14px; } }

.product-card {
  background: var(--surface); border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--border);
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
  display: block;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: transparent; }
.product-card:active { transform: scale(.98); }
.product-card .thumb { position: relative; aspect-ratio: 1; background: #fff; overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8px; transition: transform .4s var(--ease); }
.product-card:hover .thumb img { transform: scale(1.06); }
.tag-flash {
  position: absolute; top: 0; left: 0;
  background: linear-gradient(135deg, var(--leaf), var(--leaf-bright));
  color: #fff; font-size: 10px; font-weight: 700; padding: 4px 10px;
  border-radius: 0 0 10px 0; letter-spacing: .02em;
}
.tag-hot {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  color: var(--gold); font-size: 9px; font-weight: 800; padding: 3px 7px; border-radius: 4px;
}
.product-body { padding: 12px 12px 14px; }
.product-name {
  font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.8em;
}
.product-price-row { margin-top: 8px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price-now { font-size: 16px; font-weight: 800; color: var(--leaf); letter-spacing: -.02em; }
.price-was { font-size: 11px; color: var(--text-muted); text-decoration: line-through; }
.product-meta { margin-top: 6px; display: flex; align-items: center; gap: 5px; font-size: 11px; }
.stars { color: var(--gold); letter-spacing: -1px; font-size: 10px; }
.sold-count { color: var(--text-muted); }

/* ===== Flash Sale ===== */
.flash-section {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 50%, var(--leaf-bright) 100%);
  border-radius: var(--radius-xl); padding: 16px; margin-bottom: 22px;
  box-shadow: var(--shadow-brand); position: relative; overflow: hidden;
}
.flash-section::before {
  content: ''; position: absolute; top: -30%; right: -10%;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.08); pointer-events: none;
}
.flash-section .section-title { color: #fff; }
.flash-section .section-title::before { background: #fff; }
.flash-section .section-more { color: rgba(255,255,255,.85); }
.flash-section .product-card { border-radius: var(--radius-sm); }

/* ===== Merchant Banner ===== */
.merchant-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(100deg, var(--brand) 0%, var(--brand-light) 50%, var(--leaf-bright) 100%);
  border-radius: var(--radius-xl); padding: 16px 18px; margin-bottom: 16px;
  color: #fff; box-shadow: var(--shadow-brand); position: relative; overflow: hidden;
}
.merchant-banner::after {
  content: ''; position: absolute; right: -20px; top: -20px;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255,255,255,.1); pointer-events: none;
}
.merchant-banner h3 { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.merchant-banner p { font-size: 12px; opacity: .88; margin-top: 3px; }
.merchant-banner .cta-btn {
  background: #fff; color: var(--brand); font-size: 12px; font-weight: 800;
  padding: 9px 18px; border-radius: 24px; white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,.12); flex-shrink: 0;
  transition: transform .15s;
}
.merchant-banner .cta-btn:active { transform: scale(.96); }

/* ===== Forms & Buttons ===== */
.card-box {
  background: var(--surface); border-radius: var(--radius-xl);
  border: 1px solid var(--border); padding: 28px 24px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; font-weight: 700; border-radius: var(--radius-pill);
  padding: 14px 28px; font-size: 14px; letter-spacing: -.01em;
  transition: transform .12s, box-shadow .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn-brand {
  background: linear-gradient(135deg, var(--brand), var(--leaf-bright));
  color: #fff; width: 100%; box-shadow: var(--shadow-brand);
}
.btn-brand:hover { box-shadow: 0 6px 24px rgba(0, 119, 182, 0.35); }
.btn-outline {
  background: transparent; color: var(--brand);
  border: 2px solid var(--brand); width: 100%;
}
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 7px; }
.form-input {
  width: 100%; padding: 12px 15px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: #FAFAFA; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); background: #fff; }
textarea.form-input { resize: vertical; min-height: 80px; }
.alert-error {
  background: #FFF0F0; color: #C62828; padding: 11px 14px;
  border-radius: var(--radius-sm); font-size: 13px; text-align: center;
  margin-bottom: 18px; border: 1px solid #FFCDD2;
}
.alert-success {
  background: #E8F5E9; color: #2E7D32; padding: 11px 14px;
  border-radius: var(--radius-sm); font-size: 13px; text-align: center;
  margin-bottom: 18px; border: 1px solid #C8E6C9;
}

/* ===== Profile / My ===== */
.profile-card {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 55%, var(--leaf-bright) 100%);
  border-radius: var(--radius-xl); padding: 22px 20px; color: #fff;
  margin-bottom: 14px; box-shadow: var(--shadow-brand);
  display: flex; align-items: center; gap: 16px; position: relative; overflow: hidden;
}
.profile-card::before {
  content: ''; position: absolute; right: -30px; bottom: -30px;
  width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.08);
}
.avatar {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.2); border: 2.5px solid rgba(255,255,255,.45);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
}
.profile-info { position: relative; }
.profile-info small { opacity: .75; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.profile-info h3 { font-size: 18px; font-weight: 800; margin-top: 2px; }
.profile-info p { font-size: 12px; opacity: .85; margin-top: 3px; }

.menu-card {
  background: var(--surface); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: 12px;
}
.menu-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid #F5F5F5;
  transition: background .12s;
}
.menu-row:last-child { border-bottom: none; }
.menu-row:active { background: #FAFAFA; }
.menu-left { display: flex; align-items: center; gap: 14px; font-weight: 500; }
.menu-icon-wrap {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.menu-arrow { color: #D0D0D0; font-size: 20px; font-weight: 300; }
.badge-new { background: var(--leaf-bright); color: #fff; font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 12px; }

.lang-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 18px 18px; }
.lang-btn {
  text-align: center; padding: 11px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; border: 1.5px solid var(--border);
  color: var(--text-secondary); transition: all .15s;
}
.lang-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-bg); }

/* ===== Product Detail ===== */
.product-detail { display: grid; gap: 16px; }
@media(min-width:768px) { .product-detail { grid-template-columns: 1fr 1fr; gap: 32px; } }
.detail-gallery {
  background: #fff; border-radius: var(--radius-xl);
  overflow: hidden; border: 1px solid var(--border);
}
.detail-gallery img { width: 100%; aspect-ratio: 1; object-fit: contain; padding: 16px; }
.detail-info {
  background: var(--surface); border-radius: var(--radius-xl);
  padding: 24px; border: 1px solid var(--border);
}
.detail-title { font-size: 22px; font-weight: 800; line-height: 1.3; letter-spacing: -.025em; }
.detail-price { font-size: 32px; font-weight: 800; color: var(--leaf); margin: 14px 0; letter-spacing: -.03em; }
.detail-price del { font-size: 16px; color: var(--text-muted); font-weight: 400; margin-left: 10px; }
.detail-desc { color: var(--text-secondary); line-height: 1.75; margin: 16px 0; font-size: 14px; }
.detail-stock { font-size: 13px; color: var(--text-secondary); }
.detail-stock strong { color: var(--leaf-bright); font-weight: 700; }
.detail-buy-desktop { display: none; gap: 10px; margin-top: 22px; align-items: center; }
@media(min-width:768px) { .detail-buy-desktop { display: flex; } }
.qty-input {
  width: 52px; text-align: center; padding: 10px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-weight: 600;
}
.buy-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: rgba(255,255,255,.97); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 10px 14px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}
@media(min-width:768px) { .buy-bar { display: none; } }
.has-tabbar .buy-bar { bottom: var(--tabbar-h); padding-bottom: 10px; }
.has-tabbar .product-detail { padding-bottom: 80px; }
.buy-bar-price { flex: 1; font-size: 20px; font-weight: 900; color: var(--brand); }

/* ===== Cart ===== */
.cart-head { margin-bottom: 12px; }
.cart-list { display: flex; flex-direction: column; gap: 10px; }
.cart-item {
  display: flex; gap: 12px; background: var(--surface);
  border-radius: var(--radius); padding: 12px;
  box-shadow: var(--shadow-xs); align-items: flex-start;
}
.cart-item img { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 13px; font-weight: 500; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cart-item-price { color: var(--brand); font-weight: 700; margin-top: 6px; font-size: 13px; }
.cart-item-right { display: flex; flex-direction: row; align-items: center; gap: 6px; flex-shrink: 0; }
.cart-item-total { font-weight: 700; font-size: 13px; color: var(--text); white-space: nowrap; }
.cart-remove {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 10px;
  background: #FEE2E2; color: #DC2626;
}
.cart-remove svg { width: 17px; height: 17px; }
.cart-remove:active { transform: scale(.92); background: #FECACA; }
.cart-footer {
  position: static; margin-top: 16px;
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: var(--shadow-sm);
}
.cart-footer-sum { min-width: 0; flex: 1; }
.cart-checkout-btn { width: auto !important; padding: 10px 16px !important; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.cart-total-label { font-size: 12px; color: var(--text-muted); }
.cart-total-price { font-size: 20px; font-weight: 900; color: var(--brand); line-height: 1.2; }
@media(min-width:768px) {
  .cart-item { align-items: center; padding: 14px; }
  .cart-item img { width: 82px; height: 82px; }
  .cart-item-right { flex-direction: column; align-items: flex-end; gap: 8px; }
  .cart-item-total { font-size: 14px; }
  .cart-total-price { font-size: 22px; }
  .cart-checkout-btn { padding: 10px 18px !important; }
}

/* ===== Orders ===== */
.order-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 16px 18px; margin-bottom: 10px; box-shadow: var(--shadow-xs);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  transition: box-shadow .15s;
}
.order-card:hover { box-shadow: var(--shadow-sm); }
.order-no { font-weight: 700; font-size: 14px; }
.order-date { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.order-amount { font-size: 17px; font-weight: 800; color: var(--brand); text-align: right; }
.status-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 3px 10px; border-radius: 12px; margin-top: 6px;
  text-transform: uppercase; letter-spacing: .04em;
}
.status-pending   { background: #FFF3E0; color: #E65100; }
.status-paid      { background: var(--leaf-bg); color: var(--leaf); }
.status-shipped   { background: var(--brand-bg); color: var(--brand-dark); }
.status-completed { background: #F3E5F5; color: #7B1FA2; }
.status-cancelled { background: #FFEBEE; color: #C62828; }

/* ===== Empty / 404 ===== */
.empty-state { text-align: center; padding: 56px 24px; }
.empty-state .empty-icon { font-size: 52px; opacity: .25; margin-bottom: 14px; }
.empty-state p { color: var(--text-muted); margin-bottom: 20px; font-size: 14px; }
.page-404 { text-align: center; padding: 80px 24px; }
.page-404 h1 { font-size: 72px; font-weight: 900; color: var(--brand); opacity: .3; line-height: 1; }
.page-404 p { color: var(--text-muted); margin: 16px 0 24px; }

/* ===== Products Layout ===== */
.products-layout { display: grid; gap: 16px; }
@media(min-width:768px) { .products-layout { grid-template-columns: 220px 1fr; gap: 24px; } }
.products-sidebar { display: none; }
@media(min-width:768px) { .products-sidebar { display: block; } }
.sidebar-link {
  display: block; padding: 9px 14px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-secondary); margin-bottom: 2px;
  transition: background .12s, color .12s;
}
.sidebar-link:hover { background: var(--brand-bg); color: var(--brand); }
.sidebar-link.active { background: var(--brand-bg); color: var(--brand); font-weight: 700; }

.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 14px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 7px 16px; border-radius: 24px; font-size: 12px; font-weight: 600;
  background: var(--surface); color: var(--text-secondary);
  border: 1.5px solid var(--border); transition: all .15s;
}
.chip.active, .chip:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ===== Footer ===== */
.site-footer { display: none; background: #1C1C2E; color: #888; margin-top: 48px; }
@media(min-width:768px) { .site-footer { display: block; } }
.footer-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 44px 20px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 36px;
}
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer-brand .logo-mark { width: 38px; height: 38px; }
.footer-brand span { color: #fff; font-weight: 800; font-size: 17px; }
.footer-copy { text-align: center; padding: 18px; border-top: 1px solid #2A2A40; font-size: 12px; }
.pay-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 16px; }
.pay-tag { background: #2A2A40; padding: 5px 14px; border-radius: var(--radius-sm); font-size: 11px; color: #aaa; }

/* ===== Utilities ===== */
.max-w-form { max-width: 440px; margin: 0 auto; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.page-title { font-size: 22px; font-weight: 800; margin-bottom: 20px; letter-spacing: -.03em; }

/* ===== Promo pill (Grab-style) ===== */
.promo-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--leaf-bg); color: var(--leaf);
  font-size: 11px; font-weight: 700; padding: 5px 12px;
  border-radius: var(--radius-pill); margin-bottom: 12px;
}
.promo-pill svg { width: 14px; height: 14px; }

.logo-img { height: 36px; width: auto; max-width: 120px; object-fit: contain; border-radius: 8px; }
.logo-img-sm { height: 32px; width: auto; max-width: 100px; object-fit: contain; border-radius: 6px; }

.support-page { display: flex; flex-direction: column; min-height: calc(100vh - var(--header-h) - var(--tabbar-h) - 48px); max-width: 720px; margin: 0 auto; }
.support-page .page-head { padding: 8px 0 16px; }
.support-page .page-head h1 { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.support-page .page-head p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.chat-box {
  flex: 1; min-height: 360px; max-height: 58vh;
  background: #fff; border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 16px;
  overflow-y: auto; margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.chat-row { display: flex; margin-bottom: 10px; }
.chat-me { justify-content: flex-end; }
.chat-other { justify-content: flex-start; }
.chat-bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 16px;
  font-size: 14px; line-height: 1.55; word-break: break-word;
}
.chat-me .chat-bubble { background: linear-gradient(135deg, var(--brand), var(--leaf)); color: #fff; border-bottom-right-radius: 4px; }
.chat-other .chat-bubble { background: #f1f5f9; color: var(--text); border-bottom-left-radius: 4px; }
.chat-time { display: block; font-size: 10px; opacity: .65; margin-top: 4px; }
.chat-form {
  display: flex; gap: 8px; padding-bottom: 8px;
  position: sticky; bottom: 0; background: var(--bg);
}
.chat-form input {
  flex: 1; border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 12px 16px; font-size: 14px; background: #fff;
}
.chat-form button {
  background: var(--brand); color: #fff; border: none;
  border-radius: var(--radius-pill); padding: 0 18px; font-weight: 700; font-size: 14px;
}

/* ===== Wallet ===== */
.profile-usdt { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--leaf); }
.wallet-balance-card {
  background: linear-gradient(135deg, var(--brand) 0%, var(--leaf) 100%);
  border-radius: var(--radius-xl); padding: 20px; color: #fff; margin-bottom: 16px;
  box-shadow: var(--shadow-brand);
}
.wallet-label { font-size: 12px; opacity: .85; }
.wallet-amount { font-size: 32px; font-weight: 800; margin: 6px 0; }
.wallet-amount small { font-size: 16px; font-weight: 600; opacity: .9; }
.wallet-available { font-size: 12px; opacity: .88; }
.wallet-tabs {
  display: flex; gap: 6px; margin-bottom: 12px;
  background: var(--surface); padding: 4px; border-radius: var(--radius-pill);
}
.wallet-tab {
  flex: 1; border: none; background: transparent; padding: 10px 8px;
  border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; color: var(--text-muted);
}
.wallet-tab.on { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }
.wallet-panel { display: none; }
.wallet-panel.on { display: block; }
.wallet-address-box {
  background: var(--surface); border-radius: var(--radius-lg); padding: 14px; margin-bottom: 12px;
}
.wallet-tip { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.wallet-network { font-size: 11px; font-weight: 700; color: var(--leaf); margin: 8px 0; }
.wallet-address-row {
  display: flex; gap: 8px; align-items: center; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px;
}
.wallet-address-row code { flex: 1; font-size: 11px; word-break: break-all; }
.btn-copy {
  border: none; background: var(--brand-bg); color: var(--brand);
  font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 8px;
}
.wallet-form { margin-top: 0; }
.wallet-form label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.wallet-records { padding: 0; overflow: hidden; }
.wallet-record { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.wallet-record:last-child { border-bottom: none; }
.wallet-record-main { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.wallet-record-type { font-size: 13px; font-weight: 700; }
.wallet-type-deposit { color: var(--leaf); }
.wallet-type-withdraw { color: #E65100; }
.wallet-type-admin_adjust { color: var(--brand); }
.wallet-record-amount { font-size: 15px; font-weight: 800; color: var(--leaf); }
.wallet-record-amount.minus { color: #E65100; }
.wallet-record-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.wallet-status-pending { color: #F57C00; }
.wallet-status-completed { color: var(--leaf); }
.wallet-status-rejected { color: #D32F2F; }
.wallet-record-extra { font-size: 11px; color: var(--text-muted); margin-top: 4px; word-break: break-all; }
.wallet-alert { margin-bottom: 12px; }
.empty-text { text-align: center; color: var(--text-muted); padding: 24px; font-size: 13px; }

/* ===== Checkout ===== */
.checkout-summary { margin-bottom: 14px; }
.checkout-subtitle { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.checkout-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.checkout-total { display: flex; justify-content: space-between; padding-top: 12px; font-size: 15px; font-weight: 700; }
.checkout-wallet-tip { font-size: 12px; color: var(--text-muted); margin-top: 10px; }
.checkout-alert { margin-bottom: 14px; }
.pay-options { display: flex; flex-direction: column; gap: 10px; }
.pay-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 2px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; transition: border-color .2s; }
.pay-option:has(input:checked) { border-color: var(--brand); background: var(--brand-bg); }
.pay-option.disabled { opacity: .55; cursor: not-allowed; }
.pay-option input { margin-top: 3px; accent-color: var(--brand); }
.pay-option-body { display: flex; flex-direction: column; gap: 2px; }
.pay-option-body strong { font-size: 14px; }
.pay-option-body small { font-size: 11px; color: var(--text-muted); }
.order-pay-method { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
