:root {
  --purple-900: #1E1B4B;
  --purple-700: #4338CA;
  --purple-600: #4F46E5;
  --purple-500: #6366F1;
  --purple-400: #A5B4FC;
  --purple-100: #EEF2FF;
  --pink-500: #7C3AED;
  --pink-100: #F3EEFF;
  --gold-500: #C9A227;
  --gold-100: #FBF3D9;
  --ink-900: #14132B;
  --ink-600: #5B5A78;
  --ink-400: #9795B5;
  --paper: #F6F6FB;
  --white: #FFFFFF;
  --success: #16A34A;
  --warn: #C9A227;
  --danger: #DC2626;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 14px 34px rgba(30, 27, 75, 0.22);
  --shadow-card: 0 4px 16px rgba(20, 19, 43, 0.06);
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--ink-900);
  overscroll-behavior-y: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", "Sarabun", Tahoma, sans-serif;
  color: var(--ink-900);
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view { display: none; flex-direction: column; flex: 1; min-height: 100vh; padding-bottom: 88px; animation: fadeIn .25s ease; }
.view.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none; } }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--white);
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid rgba(26,26,46,0.06);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.topbar .brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(155deg, var(--purple-600), var(--pink-500));
  display: flex; align-items: center; justify-content: center; color: white; font-size: 16px;
}
.topbar .actions { display: flex; gap: 14px; align-items: center; }
.icon-btn { position: relative; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--ink-600); }
.badge-dot {
  position: absolute; top: -4px; right: -6px; background: var(--pink-500); color: white;
  font-size: 10px; font-weight: 700; border-radius: 20px; padding: 1px 5px; min-width: 16px; text-align: center;
}
.back-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--ink-900); padding: 4px 8px 4px 0; }
.topbar-title { font-weight: 700; font-size: 17px; }

/* ---------- Scrollable content ---------- */
.content { padding: 16px 18px 24px; overflow-y: auto; flex: 1; }

/* ---------- Hero card ---------- */
.hero {
  background: linear-gradient(120deg, var(--purple-700), var(--purple-600) 55%, var(--pink-500) 130%);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0, rgba(255,255,255,0.05) 2px, transparent 2px, transparent 14px);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,0.10); right: -60px; top: -70px;
}
.hero .hero-badge {
  position: absolute; top: 14px; right: 14px; background: var(--ink-900); color: #FFD84D;
  font-size: 10.5px; font-weight: 800; padding: 4px 10px; border-radius: 20px; letter-spacing: .3px;
  display: flex; align-items: center; gap: 4px; box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}
.hero h1 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.hero p { margin: 0; font-size: 13.5px; opacity: 0.95; line-height: 1.5; }
.hero .avatar-badge {
  position: absolute; right: 18px; bottom: 14px; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 22px;
  border: 2px solid rgba(255,255,255,0.35);
}

/* ---------- Menu grid ---------- */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.menu-tile {
  background: var(--white); border-radius: var(--radius-md); padding: 16px 14px;
  box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 10px;
  cursor: pointer; border: none; text-align: left; font-family: inherit;
}
.menu-tile.shop-tile { grid-column: 1 / -1; flex-direction: row; align-items: center; background: linear-gradient(120deg, var(--purple-700), var(--pink-500)); }
.menu-tile.shop-tile .ico { width: 48px; height: 48px; font-size: 22px; }
.menu-tile.shop-tile .label { color: white; font-size: 15px; }
.menu-tile.shop-tile small { color: rgba(255,255,255,0.85); }
.menu-tile .ico {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 19px; color: white;
}
.menu-tile span.label { font-weight: 700; font-size: 14px; color: var(--ink-900); }
.menu-tile small { color: var(--ink-400); font-size: 11.5px; }

/* ---------- Shop (Lazmall) ---------- */
.shop-topbar .logo.shop-logo { background: linear-gradient(135deg, var(--purple-700), var(--pink-500)); }
.shop-banner {
  background: radial-gradient(120% 160% at 15% 15%, #FF6A5A 0%, #E11D2E 42%, #A80F1F 100%);
  border-radius: var(--radius-lg); padding: 20px; color: white; position: relative; overflow: hidden;
  box-shadow: var(--shadow-soft); margin-bottom: 6px; display: flex; flex-direction: column; justify-content: center;
}
.shop-banner::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0, rgba(255,255,255,0.05) 2px, transparent 2px, transparent 14px);
}
.shop-banner-badge { display: inline-block; background: var(--gold-500); color: #3A1400; border: 1px solid rgba(255,255,255,0.35); font-size: 10.5px; font-weight: 800; padding: 4px 11px; border-radius: 20px; margin-bottom: 10px; letter-spacing: .2px; position: relative; }
.shop-banner h2 { margin: 0 0 4px; font-size: 22px; font-weight: 900; position: relative; text-shadow: 0 2px 10px rgba(0,0,0,0.25); }
.shop-banner p { margin: 0 0 12px; font-size: 12.5px; opacity: 0.95; position: relative; }
.shop-banner .sb-cta { position: relative; align-self: flex-start; background: var(--ink-900); color: white; font-size: 11.5px; font-weight: 800; padding: 8px 16px; border-radius: 20px; }

/* Floating pill nav — the shop page's nav on both mobile and desktop, replacing
   the old icon bottom-nav bar. Pinned to the bottom edge and always visible,
   so it "follows" as the page scrolls. */
#view-shop .bottom-nav { display: none; }
#view-shop .content { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
#view-shop.view { padding-bottom: 90px; }
.shop-sticky-nav {
  display: block; position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: calc(100% - 32px); max-width: 640px; z-index: 60;
}
.shop-sticky-nav .ssn-inner {
  background: var(--white); border-radius: 999px; box-shadow: var(--shadow-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 2px;
  padding: 5px; overflow-x: auto; scrollbar-width: none;
}
.shop-sticky-nav .ssn-inner::-webkit-scrollbar { display: none; }
.ssn-item {
  flex: 1; background: none; border: none; font-family: inherit; cursor: pointer; white-space: nowrap;
  font-size: 12px; font-weight: 700; color: var(--ink-600); padding: 10px 12px; border-radius: 999px;
  transition: background .15s, color .15s;
}
.ssn-item.active { background: linear-gradient(120deg, #FCE7F0, #FBD5E4); color: #DB2777; }

/* Hero row: main banner + stacked promo cards, mirrors marketplace-style homepage layout */
.hero-row { display: flex; gap: 8px; align-items: stretch; }
.hero-row #home-hero-banner { flex: 2; min-width: 0; }
.hero-row #home-hero-banner .shop-banner { height: 100%; margin-bottom: 0; }
.hero-row #home-hero-banner-link, .hero-row #home-hero-banner-img { display: block; width: 100%; height: 100%; border-radius: var(--radius-lg); object-fit: contain; background: #4a0e18; }
.promo-cards-col { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.promo-card { flex: 1; border-radius: var(--radius-md); padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; gap: 3px; color: white; cursor: pointer; box-shadow: var(--shadow-card); }
.promo-card .pc-title { font-size: 12px; font-weight: 800; }
.promo-card .pc-sub { font-size: 9.5px; opacity: .92; line-height: 1.3; }
.promo-card-a { background: linear-gradient(135deg, var(--purple-700), var(--purple-500)); }
.promo-card-b { background: linear-gradient(135deg, #EA580C, #F59E0B); }

/* Trust badge strip below stats */
.trust-badge-row { display: flex; justify-content: space-between; gap: 4px; padding: 2px 2px 14px; }
.trust-badge { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.trust-badge .tb-ico { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.trust-badge span:last-child { font-size: 9px; font-weight: 700; color: var(--ink-600); line-height: 1.25; }

.cat-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 6px; margin-top: 14px; scrollbar-width: none; }
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-chip { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; width: 64px; }
.cat-chip .cc-ico { width: 52px; height: 52px; border-radius: 16px; background: white; box-shadow: var(--shadow-card); display: flex; align-items: center; justify-content: center; font-size: 24px; border: 2px solid transparent; }
.cat-chip.active .cc-ico { border-color: var(--purple-600); background: var(--purple-100); }
.cat-chip span { font-size: 10.5px; font-weight: 700; text-align: center; color: var(--ink-600); line-height: 1.2; }

.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }

/* Real product photos inside any image container (pc-image, pt-image, pd-image, ci-image, fp-icon).
   Falls back to the emoji icon (.prod-fallback-icon) when no photo is set or it fails to load. */
.prod-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod-fallback-icon { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

.product-card { background: white; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-card); cursor: pointer; }
.product-card .pc-image { height: 110px; display: flex; align-items: center; justify-content: center; font-size: 44px; background: var(--purple-100); position: relative; overflow: hidden; }
.product-card .pc-discount { position: absolute; top: 8px; left: 8px; background: var(--pink-500); color: white; font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 6px; }
.product-card .pc-body { padding: 10px; }
.product-card .pc-name { font-size: 12.5px; font-weight: 600; color: var(--ink-900); line-height: 1.35; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.product-card .pc-price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.product-card .pc-price { font-size: 15px; font-weight: 800; color: var(--pink-500); }
.product-card .pc-compare { font-size: 10.5px; color: var(--ink-400); text-decoration: line-through; }
.product-card .pc-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; font-size: 10px; color: var(--ink-400); }

/* Product detail */
.pd-image { width: 100%; aspect-ratio: 1.3; border-radius: var(--radius-lg); background: var(--purple-100); display: flex; align-items: center; justify-content: center; font-size: 90px; margin-bottom: 16px; overflow: hidden; position: relative; }
.pd-name { font-size: 17px; font-weight: 800; margin: 0 0 8px; }
.pd-price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.pd-price { font-size: 24px; font-weight: 800; color: var(--pink-500); }
.pd-compare { font-size: 14px; color: var(--ink-400); text-decoration: line-through; }
.pd-discount-badge { background: var(--pink-100); color: var(--pink-500); font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; }
.pd-meta-row { display: flex; gap: 16px; font-size: 12px; color: var(--ink-400); margin-bottom: 16px; }
.pd-desc { font-size: 13px; color: var(--ink-600); line-height: 1.7; margin-bottom: 20px; }
.pd-qty-row { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.qty-stepper { display: flex; align-items: center; border: 1.5px solid #E5E5E5; border-radius: 10px; overflow: hidden; }
.qty-stepper button { width: 36px; height: 36px; border: none; background: var(--paper); font-size: 16px; cursor: pointer; }
.qty-stepper span { width: 40px; text-align: center; font-weight: 700; font-size: 14px; }
.pd-actions { display: flex; gap: 10px; position: sticky; bottom: 0; background: var(--paper); padding-top: 10px; }

/* Cart */
.cart-item { display: flex; gap: 12px; background: white; border-radius: var(--radius-md); padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow-card); align-items: center; }
.cart-item .ci-image { width: 56px; height: 56px; min-width: 56px; border-radius: 12px; background: var(--purple-100); display: flex; align-items: center; justify-content: center; font-size: 26px; overflow: hidden; position: relative; }
.cart-item .ci-body { flex: 1; min-width: 0; }
.cart-item .ci-name { font-size: 12.5px; font-weight: 700; margin-bottom: 4px; }
.cart-item .ci-price { font-size: 13px; font-weight: 800; color: var(--pink-500); }
.cart-item .ci-remove { background: none; border: none; color: var(--ink-400); font-size: 16px; cursor: pointer; padding: 4px; }
.cart-summary-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; background: white; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(0,0,0,0.08); display: flex; align-items: center; gap: 14px; }
.cart-summary-bar .cs-total { flex: 1; }
.cart-summary-bar .cs-total .cs-label { font-size: 10.5px; color: var(--ink-400); }
.cart-summary-bar .cs-total .cs-value { font-size: 18px; font-weight: 800; color: var(--pink-500); }
.cart-summary-bar button { flex-shrink: 0; width: auto; padding: 13px 24px; }

/* Checkout */
.checkout-section { background: white; border-radius: var(--radius-md); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-card); }
.checkout-section h3 { margin: 0 0 10px; font-size: 13px; }
.checkout-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; }
.checkout-row.total { font-weight: 800; font-size: 15px; border-top: 1px dashed #E5E5E5; margin-top: 6px; padding-top: 12px; color: var(--pink-500); }
.wallet-mini { display: flex; align-items: center; justify-content: space-between; background: var(--purple-100); border-radius: 12px; padding: 12px 14px; }
.wallet-mini.insufficient { background: var(--pink-100); }

/* Orders */
.order-card { background: white; border-radius: var(--radius-md); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow-card); }
.order-card .oc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-card .oc-id { font-size: 11.5px; color: var(--ink-400); }
.order-card .oc-status { font-size: 10.5px; font-weight: 700; color: var(--success); background: #E4F9EC; padding: 3px 9px; border-radius: 20px; }
.order-card .oc-items { font-size: 12px; color: var(--ink-600); margin-bottom: 6px; }
.order-card .oc-total { font-weight: 800; color: var(--pink-500); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.oc-payment-pending { font-size: 9.5px; font-weight: 700; background: #FFF4DC; color: #B8790C; padding: 2px 8px; border-radius: 20px; }

/* ---------- Coupon ---------- */
.coupon-input-row { display: flex; gap: 8px; }
.coupon-input-row input { flex: 1; border: 1.5px solid #E3DEF7; border-radius: 10px; padding: 10px 12px; font-size: 13px; font-family: inherit; }
.coupon-applied { display: flex; justify-content: space-between; align-items: center; background: var(--purple-100); color: var(--purple-700); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; font-weight: 700; }
.coupon-applied a { color: var(--danger); cursor: pointer; font-size: 11.5px; }

/* ---------- Payment method picker ---------- */
.payment-method-list { display: flex; flex-direction: column; gap: 8px; }
.payment-method-opt { display: flex; justify-content: space-between; align-items: center; border: 1.5px solid #E3DEF7; border-radius: 12px; padding: 12px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.payment-method-opt.selected { border-color: var(--purple-600); background: var(--purple-100); color: var(--purple-700); }

/* ---------- Reviews ---------- */
.reviewable-card { display: flex; justify-content: space-between; align-items: center; background: white; border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px; box-shadow: var(--shadow-card); font-size: 12.5px; font-weight: 600; }
.review-item { background: white; border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px; box-shadow: var(--shadow-card); }
.review-item .ri-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.review-item .ri-name { font-weight: 700; font-size: 12.5px; }
.review-item .ri-stars { color: #F59E0B; font-size: 12px; }
.review-item .ri-comment { font-size: 12px; color: var(--ink-600); line-height: 1.5; }
.review-item .ri-date { font-size: 10px; color: var(--ink-400); margin-top: 4px; }
.review-stars-picker { display: flex; gap: 6px; justify-content: center; margin: 6px 0 16px; }
.review-star { font-size: 32px; cursor: pointer; opacity: 0.3; }
.review-star.selected { opacity: 1; }

/* ---------- Modal (customer) ---------- */
.modal-overlay-c { position: fixed; inset: 0; background: rgba(26,26,46,0.55); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box-c { background: white; border-radius: 20px; padding: 22px; max-width: 400px; width: 100%; max-height: 85vh; overflow-y: auto; }

.system-alert-box { text-align: center; padding: 36px 26px 26px; }
.system-alert-icon {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #BBF7D0; color: #22C55E;
}
.system-alert-icon.error { border-color: #FECACA; color: #DC2626; }
.system-alert-title { font-size: 20px; font-weight: 800; color: #1a1a2e; margin: 0 0 8px; }
.system-alert-message { font-size: 14px; color: var(--ink-600); margin: 0 0 26px; line-height: 1.5; }
.system-alert-box .btn-primary { max-width: 220px; margin: 0 auto; background: var(--purple-500); }

/* ---------- Flash sale ---------- */
.flash-banner { background: linear-gradient(120deg, #FF3B30, #EA580C); border-radius: var(--radius-md) var(--radius-md) 0 0; padding: 14px 16px; color: white; margin: 14px 0 0; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow-soft); }
.flash-banner .fb-left { display: flex; align-items: center; gap: 10px; }
.flash-banner .fb-ico { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,0.22); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.flash-banner .fb-title { font-weight: 800; font-size: 15px; letter-spacing: .3px; }
.flash-banner .fb-sub { font-size: 10px; opacity: .85; margin-top: 2px; }
.fb-view-all { background: rgba(255,255,255,0.22); border: none; color: white; font-size: 11px; font-weight: 700; padding: 7px 14px; border-radius: 20px; cursor: pointer; white-space: nowrap; font-family: inherit; }
.flash-timer { font-size: 12px; font-weight: 700; background: rgba(0,0,0,0.22); border-radius: 20px; padding: 5px 12px; }
.flash-product-row {
  display: flex; gap: 10px; overflow-x: auto; padding: 12px 4px 14px;
  background: var(--white); border-radius: 0 0 var(--radius-md) var(--radius-md); box-shadow: var(--shadow-card);
}
.flash-product-card { min-width: 150px; max-width: 150px; background: white; border-radius: var(--radius-sm); padding: 0 8px 10px; box-shadow: var(--shadow-card); cursor: pointer; }
.flash-product-card .fp-icon { height: 110px; font-size: 34px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; border-radius: 10px; background: var(--paper); overflow: hidden; position: relative; }
.flash-product-card .fp-seller-badge {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 4px;
  background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0)); padding: 5px 6px 12px; font-size: 8px; font-weight: 700; color: white;
}
.flash-product-card .fp-seller-avatar { width: 14px; height: 14px; border-radius: 50%; background: white; color: var(--ink-900); display: flex; align-items: center; justify-content: center; font-size: 8px; flex-shrink: 0; }
.flash-product-card .fp-stock-tag { position: absolute; top: 4px; right: 4px; z-index: 2; background: var(--purple-600); color: white; font-size: 7.5px; font-weight: 700; padding: 2px 6px; border-radius: 20px; }
.flash-product-card .fp-disc-tag { position: absolute; bottom: 4px; left: 4px; z-index: 2; background: #EA580C; color: white; font-size: 8.5px; font-weight: 800; padding: 2px 6px; border-radius: 5px; }
.flash-product-card .fp-ring {
  position: absolute; bottom: -14px; right: -6px; z-index: 3; width: 36px; height: 36px; border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--pct)*1%), #F1EEFB 0); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px white;
}
.flash-product-card .fp-ring::before { content: ""; position: absolute; inset: 3px; background: white; border-radius: 50%; }
.flash-product-card .fp-ring { color: var(--ring-color); font-size: 7.5px; font-weight: 800; }
.flash-product-card .fp-name { font-size: 11.5px; font-weight: 700; color: var(--ink-900); min-height: 30px; padding: 0 1px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.flash-product-card .fp-price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; padding: 0 1px; margin-top: 2px; }
.flash-product-card .fp-price { font-weight: 800; color: #EA580C; font-size: 15px; }
.flash-product-card .fp-old-price { font-size: 10px; color: var(--ink-400); text-decoration: line-through; }
.flash-product-card .fp-bottom-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; padding: 0 1px; }
.flash-product-card .fp-countdown { font-size: 9px; color: var(--ink-400); font-weight: 600; white-space: nowrap; }
.flash-product-card .fp-buy-btn { flex-shrink: 0; background: #EA580C; color: white; border: none; border-radius: 16px; padding: 6px 14px; font-size: 10.5px; font-weight: 800; cursor: pointer; font-family: inherit; }
.pc-flash-badge { position: absolute; top: 6px; left: 6px; background: var(--pink-500); color: white; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 6px; }

/* ---------- Mega menu ---------- */
.mega-menu-overlay { position: fixed; inset: 0; background: rgba(26,26,46,0.5); z-index: 250; display: flex; }
.mega-menu-panel { background: white; width: 82%; max-width: 320px; height: 100%; overflow-y: auto; padding: 18px; }
.mega-cat-item { padding: 12px 8px; border-bottom: 1px solid #F1EEFB; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.mega-subcat-item { padding: 10px 8px 10px 20px; font-size: 12.5px; color: var(--ink-600); cursor: pointer; }

/* ---------- Referral ---------- */
.referral-code-box { background: linear-gradient(120deg, var(--purple-700), var(--pink-500)); border-radius: var(--radius-lg); padding: 24px 20px; text-align: center; color: white; margin-bottom: 16px; }
.referral-code-box .rc-code { font-size: 26px; font-weight: 800; letter-spacing: 2px; background: rgba(255,255,255,0.15); border-radius: 12px; padding: 10px; margin: 10px 0; }
.referral-stat-row { display: flex; gap: 10px; margin-bottom: 16px; }
.referral-stat-card { flex: 1; background: white; border-radius: var(--radius-sm); padding: 14px; text-align: center; box-shadow: var(--shadow-card); }
.referral-stat-card .rs-val { font-size: 20px; font-weight: 800; color: var(--purple-600); }
.referral-stat-card .rs-label { font-size: 10.5px; color: var(--ink-400); }

/* ---------- VIP tier badge ---------- */
.vip-badge-row { margin-bottom: 12px; }
.vip-badge-card { display: flex; align-items: center; justify-content: space-between; background: linear-gradient(120deg, #1A1A2E, #3A2A20); border-radius: var(--radius-md); padding: 14px 16px; color: white; }
.vip-badge-card .vb-tier { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 14px; }
.vip-badge-card .vb-tier .vb-icon { font-size: 26px; }
.vip-badge-card .vb-progress { font-size: 10.5px; color: rgba(255,255,255,0.7); margin-top: 2px; }
.vip-progress-bar { height: 5px; background: rgba(255,255,255,0.15); border-radius: 6px; overflow: hidden; margin-top: 6px; }
.vip-progress-bar-fill { height: 100%; background: linear-gradient(90deg, #F97316, #FFD84D); }

/* ---------- Wallet 4-card stat grid ---------- */
.wallet-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.wallet-stat-card { background: white; border-radius: var(--radius-md); padding: 14px; text-align: center; box-shadow: var(--shadow-card); }
.wallet-stat-card .wsc-ico { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; margin: 0 auto 8px; }
.wallet-stat-card .wsc-val { font-weight: 800; font-size: 15px; }
.wallet-stat-card .wsc-label { font-size: 10.5px; color: var(--ink-400); margin-top: 2px; }

/* ---------- Search bar with camera icon (visual search) ---------- */
.search-bar-row { display: flex; gap: 8px; margin: 14px 0 4px; }
.search-bar-row input { flex: 1; border: 1.5px solid #E3DEF7; border-radius: 22px; padding: 11px 16px; font-size: 13.5px; font-family: inherit; background: white; }
.search-camera-btn { width: 42px; height: 42px; min-width: 42px; border-radius: 50%; border: none; background: linear-gradient(135deg, var(--purple-600), var(--pink-500)); color: white; font-size: 17px; cursor: pointer; }

/* ---------- Popular products row (horizontal thumbnail scroll) ---------- */
.popular-section { margin: 16px 0; }
.popular-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.popular-section-head h3 { margin: 0; font-size: 13.5px; font-weight: 800; }
.popular-section-head a { font-size: 11px; color: var(--purple-600); font-weight: 700; cursor: pointer; }
.cat-pill-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cat-pill-row::-webkit-scrollbar { display: none; }
.cat-pill { flex-shrink: 0; background: white; border: 1.5px solid #E3DEF7; border-radius: 20px; padding: 8px 14px; font-size: 11.5px; font-weight: 700; color: var(--ink-600); cursor: pointer; white-space: nowrap; font-family: inherit; }
.cat-pill:hover, .cat-pill:active { background: var(--purple-100); border-color: var(--purple-400); color: var(--purple-700); }
.popular-thumb-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.popular-thumb-card { min-width: 108px; max-width: 108px; background: white; border-radius: var(--radius-sm); box-shadow: var(--shadow-card); cursor: pointer; overflow: hidden; }
.popular-thumb-card .pt-image { height: 90px; background: var(--paper); display: flex; align-items: center; justify-content: center; font-size: 32px; position: relative; overflow: hidden; }
.popular-thumb-card .pt-badge { position: absolute; top: 4px; left: 4px; background: var(--pink-500); color: white; font-size: 9px; font-weight: 800; padding: 2px 5px; border-radius: 5px; }
.popular-thumb-card .pt-body { padding: 7px 8px 9px; }
.popular-thumb-card .pt-price { font-weight: 800; font-size: 12.5px; color: var(--ink-900); }
.popular-thumb-card .pt-sold { font-size: 9.5px; color: var(--ink-400); margin-top: 2px; }

/* ---------- Help Centre ---------- */
.help-topic-item { background: white; border-radius: var(--radius-sm); padding: 13px 14px; margin-bottom: 8px; box-shadow: var(--shadow-card); }
.help-topic-item h4 { margin: 0 0 4px; font-size: 13px; }
.help-topic-item p { margin: 0; font-size: 12px; color: var(--ink-600); line-height: 1.5; }
.payment-logo-grid, .shipping-logo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.payment-logo-item, .shipping-logo-item { background: white; border-radius: var(--radius-sm); padding: 12px; text-align: center; font-size: 12px; font-weight: 700; box-shadow: var(--shadow-card); }

/* ---------- Bank account / withdraw ---------- */
.bank-account-card { background: white; border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-card); margin-bottom: 16px; }
.bank-account-card .ba-bank { font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.bank-account-card .ba-number { font-size: 13px; color: var(--ink-600); letter-spacing: 1px; }
.bank-account-card .ba-name { font-size: 12px; color: var(--ink-400); margin-top: 2px; }
.withdraw-row { display: flex; justify-content: space-between; align-items: center; background: white; border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow-card); }
.withdraw-row .wr-status { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.wr-status.pending { background: #FFF4DC; color: #B8790C; }
.wr-status.done { background: #E4F9EC; color: #16A34A; }
.wr-status.rejected { background: #FDE8E8; color: #DC2626; }

/* ---------- Category row + mega menu button ---------- */
.cat-scroll-row { display: flex; align-items: center; gap: 8px; }
.cat-scroll-row .cat-scroll { flex: 1; }
.mega-menu-btn { flex-shrink: 0; background: white; border: 1.5px solid #E3DEF7; border-radius: 20px; padding: 8px 12px; font-size: 11px; font-weight: 700; color: var(--ink-600); cursor: pointer; white-space: nowrap; }

/* ---------- Home page: hero banner rotator ---------- */
.home-hero-banner-link { display: block; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-soft); margin-bottom: 6px; }
.home-hero-banner-link img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: contain; background: #4a0e18; }

/* ---------- Home page: stats row ---------- */
.home-stats-row {
  display: flex; justify-content: space-between; gap: 6px;
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: 16px 14px; margin: 14px 0 10px;
}
.home-stat { flex: 1; text-align: left; display: flex; align-items: center; gap: 10px; padding: 0 6px; position: relative; }
.home-stat + .home-stat::before {
  content: ""; position: absolute; left: -3px; top: 50%; transform: translateY(-50%);
  width: 1px; height: 30px; background: var(--purple-100);
}
.home-stat .home-stat-ico {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; background: var(--purple-100);
  display: flex; align-items: center; justify-content: center;
}
.home-stat svg { width: 19px; height: 19px; color: var(--purple-500); }
.home-stat b { display: block; font-size: 17px; font-weight: 800; color: var(--purple-900); line-height: 1.2; }
.home-stat span { font-size: 10.5px; color: var(--ink-400); line-height: 1.3; }

/* ---------- Home page: marketing quick-tabs ---------- */
.home-cat-tabs {
  display: flex; justify-content: space-between; gap: 8px; overflow-x: auto;
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: 18px 14px; margin-bottom: 10px; scrollbar-width: none;
}
.home-cat-tabs::-webkit-scrollbar { display: none; }
.home-cat-tab { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; cursor: pointer; opacity: .65; background: none; border: none; font-family: inherit; }
.home-cat-tab.active { opacity: 1; }
.home-cat-tab-ico {
  width: 56px; height: 56px; border-radius: 50%; background: var(--white);
  border: 1px solid var(--purple-100); box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 24px;
}
.home-cat-tab-ico img { width: 68%; height: 68%; object-fit: contain; }
.home-cat-tab span { font-size: 11px; font-weight: 700; color: var(--ink-600); }
.home-cat-tab.active span { color: #EA580C; }

/* ---------- Home page: CTA banner ---------- */
.home-cta { background: linear-gradient(120deg, var(--purple-700), var(--purple-600) 55%, var(--pink-500) 130%); border-radius: var(--radius-lg); padding: 24px 20px; color: white; text-align: center; margin: 18px 0; box-shadow: var(--shadow-soft); }
.home-cta h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; }
.home-cta p { margin: 0 0 16px; font-size: 12px; opacity: .92; line-height: 1.55; }
.home-cta button { background: white; color: var(--purple-700); border: none; border-radius: 12px; padding: 11px 24px; font-weight: 800; font-size: 13px; cursor: pointer; }

/* Full company / legal footer, mirrors marketplace-style footer layout */
.shop-footer-full { margin: 10px 0 90px; padding-top: 18px; border-top: 1px solid #E3DEF7; text-align: left; }
.sf-about-title { margin: 0 0 12px; font-size: 13.5px; font-weight: 800; color: var(--ink-900); line-height: 1.4; }
.sf-about-section { margin-bottom: 12px; }
.sf-about-section h5 { margin: 0 0 4px; font-size: 11.5px; font-weight: 800; color: var(--ink-900); }
.sf-about-section p { margin: 0; font-size: 10.5px; line-height: 1.7; color: var(--ink-400); }
.sf-campaign-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.sf-campaign-pill { background: var(--purple-100); color: var(--purple-600); font-size: 10.5px; font-weight: 800; padding: 5px 10px; border-radius: 20px; }
.sf-campaign-pill.hl { background: linear-gradient(120deg, #FF3B30, #EA580C); color: white; }
.sf-nav-cols { display: flex; flex-wrap: wrap; gap: 16px; margin: 18px 0; }
.sf-col { flex: 1 1 40%; min-width: 130px; }
.sf-col h4 { margin: 0 0 10px; font-size: 12px; font-weight: 800; color: var(--ink-900); }
.sf-col a { display: block; font-size: 11px; color: var(--ink-600); margin-bottom: 9px; cursor: pointer; text-decoration: none; }
.sf-col a:hover { color: var(--purple-600); }
.sf-payment-block { margin: 6px 0 16px; }
.sf-label { font-size: 11px; font-weight: 700; color: var(--ink-400); margin-bottom: 8px; }
.sf-badge-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.sf-badge { background: white; border: 1px solid #E3DEF7; border-radius: 8px; padding: 6px 10px; font-size: 10.5px; font-weight: 700; color: var(--ink-600); box-shadow: var(--shadow-card); }
.sf-badge-img { width: 64px; height: 40px; padding: 6px; display: flex; align-items: center; justify-content: center; }
.sf-badge-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sf-copyright { margin: 4px 0 0; text-align: center; font-size: 10px; color: var(--ink-400); }

/* ---------- Home page: SEO footer text ---------- */
.home-seo-text { font-size: 11px; color: var(--ink-400); line-height: 1.75; text-align: left; white-space: pre-line; margin: 0 0 16px; padding: 14px; background: white; border-radius: var(--radius-md); box-shadow: var(--shadow-card); }

/* ---------- Store notifications feed ---------- */
.store-notif-card { background: white; border-radius: var(--radius-md); padding: 14px; box-shadow: var(--shadow-card); margin-bottom: 10px; display: flex; gap: 12px; }
.store-notif-card .snc-ico { width: 38px; height: 38px; min-width: 38px; border-radius: 10px; background: var(--purple-100); color: var(--purple-600); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.store-notif-card h4 { margin: 0 0 4px; font-size: 13px; }
.store-notif-card p { margin: 0; font-size: 11.5px; color: var(--ink-600); line-height: 1.45; }
.store-notif-card time { font-size: 10px; color: var(--ink-400); }

/* Wallet */
.wallet-card { background: linear-gradient(120deg, var(--purple-700), var(--pink-500)); border-radius: var(--radius-lg); padding: 20px; color: white; box-shadow: var(--shadow-soft); }
.wallet-bal-row { display: flex; justify-content: space-between; align-items: flex-end; }
.wallet-label { font-size: 11px; opacity: 0.85; margin-bottom: 4px; }
.wallet-amount { font-size: 26px; font-weight: 800; }
.wallet-points-val { font-size: 16px; font-weight: 800; text-align: right; }
.wallet-tx-row { display: flex; justify-content: space-between; align-items: center; background: white; border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow-card); }
.wallet-tx-row .wtx-desc { font-size: 12px; font-weight: 600; }
.wallet-tx-row .wtx-date { font-size: 10.5px; color: var(--ink-400); margin-top: 2px; }
.wallet-tx-row .wtx-amount { font-weight: 800; font-size: 13px; }
.wallet-tx-row .wtx-amount.positive { color: var(--success); }
.wallet-tx-row .wtx-amount.negative { color: var(--pink-500); }

#view-cart .content { padding-bottom: 100px; }

/* ---------- Section header ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.section-head h2 { font-size: 15.5px; margin: 0; font-weight: 800; }
.section-head a { font-size: 12.5px; color: var(--purple-600); text-decoration: none; font-weight: 700; }

/* ---------- Ticket card ---------- */
.ticket-card {
  background: var(--white); border-radius: var(--radius-md); padding: 14px; margin-bottom: 10px;
  box-shadow: var(--shadow-card); display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
}
.ticket-card .ticon {
  width: 38px; height: 38px; min-width: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: white;
}
.ticket-card .tbody { flex: 1; min-width: 0; }
.ticket-card .ttitle { font-weight: 700; font-size: 13.5px; margin-bottom: 3px; }
.ticket-card .tmeta { font-size: 11.5px; color: var(--ink-400); }
.status-chip { font-size: 10.5px; font-weight: 700; padding: 4px 9px; border-radius: 20px; white-space: nowrap; }
.status-progress { background: #FFF4DC; color: #B8790C; }
.status-done { background: #E4F9EC; color: #16A34A; }
.status-wait { background: #FDE8E8; color: #DC2626; }

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--white); border-radius: var(--radius-sm); padding: 13px 14px; margin-bottom: 8px;
  box-shadow: var(--shadow-card); font-size: 13.5px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; cursor: pointer;
}
.faq-item .plus { color: var(--purple-500); font-size: 16px; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: var(--white);
  display: flex; justify-content: space-around; padding: 10px 6px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(26,26,46,0.07); z-index: 30;
}
.nav-btn {
  background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; color: var(--ink-400); font-family: inherit; cursor: pointer; font-weight: 600;
}
.nav-btn .n-ico { font-size: 19px; }
.nav-btn.active { color: var(--purple-600); }

/* ---------- Buttons ---------- */
.btn-primary {
  background: linear-gradient(135deg, var(--purple-600), var(--pink-500));
  color: white; border: none; border-radius: 14px; padding: 14px; font-weight: 700; font-size: 14.5px;
  width: 100%; cursor: pointer; box-shadow: 0 8px 18px rgba(108,60,233,0.28);
}
.btn-secondary {
  background: var(--white); color: var(--purple-600); border: 1.5px solid var(--purple-400);
  border-radius: 14px; padding: 13px; font-weight: 700; font-size: 14px; width: 100%; cursor: pointer;
}
.btn-block-row { display: flex; gap: 10px; }

/* ---------- Form ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-600); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid #E3DEF7; border-radius: 12px; padding: 12px 13px; font-size: 14px;
  font-family: inherit; background: var(--white); color: var(--ink-900);
}
.field textarea { min-height: 100px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--purple-500); }
.chip-select { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-opt {
  padding: 9px 14px; border-radius: 20px; border: 1.5px solid #E3DEF7; font-size: 12.5px; font-weight: 700;
  cursor: pointer; background: white; color: var(--ink-600);
}
.chip-opt.selected { background: var(--purple-600); border-color: var(--purple-600); color: white; }

/* ---------- Login ---------- */
.login-view {
  --login-grad-start: #845EDB;
  --login-grad-end: #CA50AF;
  --login-accent: #7c3aed;
  --login-cta: #FF2F63;
  justify-content: center; padding: 32px 26px; min-height: 100vh; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--login-grad-start), var(--login-grad-end));
}
.login-view .logo-big {
  width: 112px; height: 112px; border-radius: 14px; margin: 0 auto 30px;
  background: #156082; /* placeholder shown until a real logo is uploaded in Admin > Settings */
  border: 2px solid #042433;
  box-shadow: 0 12px 26px rgba(45,10,80,0.35);
  overflow: hidden;
}
.login-view .logo-big.has-logo-img {
  background: none;
  border: none;
}
.login-card {
  background: white; border-radius: 28px; padding: 34px 26px 28px; position: relative; z-index: 1;
  box-shadow: 0 24px 60px -20px rgba(43,12,74,0.55);
}
.login-card-title { font-size: 27px; font-weight: 800; color: #201A2B; margin: 0 0 22px; }
.login-card .field { margin-bottom: 16px; }
.login-card .field input {
  width: 100%; background: #fff; border: 1.5px solid #ECECEC; border-radius: 18px; padding: 17px 20px; font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.login-card .field input:focus { border-color: var(--login-accent); box-shadow: 0 0 0 4px rgba(201,183,247,0.5); }
.login-card .field input::placeholder { color: #8d8a99; font-weight: 400; }
.login-view .btn-primary {
  background: var(--login-cta); border-radius: 14px; padding: 17px; font-size: 16px; font-weight: 700;
  box-shadow: 0 14px 26px -10px rgba(255,47,99,0.55);
  transition: transform .15s ease, filter .15s ease;
}
.login-view .btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.login-divider { text-align: center; margin: 22px 0 18px; color: var(--ink-400); font-size: 13px; }
.login-social-row { display: flex; gap: 12px; }
.login-social-btn {
  flex: 1; height: 56px; border-radius: 16px; border: 1.5px solid #F0F0F0; background: white;
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color .15s, background .15s, transform .1s ease;
}
.login-social-btn:hover { border-color: #d8d8d8; background: #fafafa; transform: translateY(-1px); }
.login-card-footnote { text-align: center; font-size: 13px; color: #6B6878; margin: 22px 0 0; }
.login-card-footnote a { color: var(--login-cta); font-weight: 700; text-decoration: none; cursor: pointer; }
.login-foot-note { color: rgba(255,255,255,0.85); font-size: 11.5px; text-align: center; margin-top: 18px; line-height: 1.7; }
.login-foot-note a { color: white; text-decoration: underline; }

/* ---------- Chat ---------- */
.chat-scroll { flex: 1; overflow-y: auto; padding: 16px 16px 6px; display: flex; flex-direction: column; gap: 10px; }
.msg-row { display: flex; gap: 8px; max-width: 82%; }
.msg-row.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--purple-100); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.msg-bubble { padding: 10px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.5; background: white; box-shadow: var(--shadow-card); }
.msg-row.me .msg-bubble { background: linear-gradient(135deg, var(--purple-600), var(--purple-500)); color: white; border-bottom-right-radius: 4px; }
.msg-row.them .msg-bubble { border-bottom-left-radius: 4px; }
.msg-time { font-size: 9.5px; color: var(--ink-400); margin-top: 3px; display: block; }
.msg-row.me .msg-time { text-align: right; color: rgba(255,255,255,0.7); }
.chat-input-bar { display: flex; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: white; border-top: 1px solid rgba(26,26,46,0.07); align-items: center; }
.chat-input-bar input { flex: 1; border: 1.5px solid #E3DEF7; border-radius: 22px; padding: 11px 16px; font-size: 13.5px; font-family: inherit; }
.round-btn { width: 40px; height: 40px; border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.round-btn.send { background: linear-gradient(135deg, var(--purple-600), var(--pink-500)); color: white; }
.round-btn.call { background: var(--purple-100); color: var(--purple-600); }
.typing-dots span { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-400); margin-right: 3px; animation: blink 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; } .typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- AI Avatar Call ---------- */
.call-view { background: radial-gradient(circle at 50% 20%, #3B2593, #1A1130 75%); color: white; min-height: 100vh; padding-bottom: 0; }
.call-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; position: relative; padding: 0 20px; }
.call-tag { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); background: rgba(255,255,255,0.12); padding: 6px 14px; border-radius: 20px; font-size: 11.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.call-tag .dot { width: 6px; height: 6px; border-radius: 50%; background: #4ADE80; }
.remote-video-frame { width: 240px; height: 240px; border-radius: 28px; overflow: hidden; position: relative; background: linear-gradient(160deg, #3B2E6B, #241a45); box-shadow: 0 10px 30px rgba(0,0,0,0.35); border: 2px solid rgba(255,255,255,0.12); transition: border-radius .3s; }
.remote-video-frame.mode-ai { border-radius: 50%; }
.remote-video-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.remote-video-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: linear-gradient(160deg, var(--purple-700), var(--purple-500)); }
.remote-video-fallback .waiting-avatar { font-size: 56px; }
.remote-video-fallback p { font-size: 11.5px; color: rgba(255,255,255,0.85); margin: 0; }
.real-badge { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.4); color: #fff; font-size: 10px; font-weight: 700; padding: 4px 9px; border-radius: 20px; display: flex; align-items: center; gap: 5px; }
.real-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #EF4444; }
.local-pip { position: absolute; width: 84px; height: 112px; object-fit: cover; border-radius: 14px; border: 2px solid rgba(255,255,255,0.5); top: 70px; right: 22px; background: #1A1130; transform: scaleX(-1); box-shadow: 0 6px 16px rgba(0,0,0,0.35); }
.call-name { font-weight: 800; font-size: 17px; margin-top: 6px; }
.call-sub { font-size: 12.5px; color: rgba(255,255,255,0.6); }
.call-controls { display: flex; justify-content: center; gap: 20px; padding: 30px 20px calc(30px + env(safe-area-inset-bottom)); }
.call-ctrl-btn { width: 56px; height: 56px; border-radius: 50%; border: none; background: rgba(255,255,255,0.14); color: white; font-size: 20px; cursor: pointer; }
.call-ctrl-btn.end { background: var(--danger); }
.wave-bars { display: flex; align-items: center; gap: 3px; height: 22px; }
.wave-bars span { width: 3px; background: rgba(255,255,255,0.6); border-radius: 2px; animation: wave 1s ease-in-out infinite; }
.wave-bars span:nth-child(1){height:8px;animation-delay:0s} .wave-bars span:nth-child(2){height:16px;animation-delay:.1s}
.wave-bars span:nth-child(3){height:22px;animation-delay:.2s} .wave-bars span:nth-child(4){height:14px;animation-delay:.3s}
.wave-bars span:nth-child(5){height:9px;animation-delay:.4s}
@keyframes wave { 0%,100% { transform: scaleY(0.5); } 50% { transform: scaleY(1); } }

/* ---------- KB article ---------- */
.kb-card { background: white; border-radius: var(--radius-md); padding: 15px; box-shadow: var(--shadow-card); margin-bottom: 10px; }
.kb-card h3 { margin: 0 0 6px; font-size: 14px; }
.kb-card p { margin: 0; font-size: 12.5px; color: var(--ink-600); line-height: 1.5; }
.kb-tag { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--purple-600); background: var(--purple-100); padding: 3px 9px; border-radius: 20px; margin-bottom: 8px; }

/* ---------- Announcement ---------- */
.ann-card { background: white; border-radius: var(--radius-md); padding: 14px; box-shadow: var(--shadow-card); margin-bottom: 10px; display: flex; gap: 12px; }
.ann-ico { width: 38px; height: 38px; min-width:38px; border-radius: 10px; background: var(--pink-100); color: var(--pink-500); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.ann-card h4 { margin: 0 0 4px; font-size: 13.5px; }
.ann-card p { margin: 0; font-size: 12px; color: var(--ink-600); line-height: 1.45; }
.ann-card time { font-size: 10.5px; color: var(--ink-400); }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); background: var(--ink-900); color: white; padding: 11px 18px; border-radius: 30px; font-size: 12.5px; font-weight: 600; z-index: 100; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

/* Utility */
.incoming-call-banner-c { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); width: calc(100% - 28px); max-width: 452px; z-index: 200; background: white; border-radius: 16px; box-shadow: 0 12px 34px rgba(26,26,46,0.25); padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; animation: pulseInC .3s ease; }
@keyframes pulseInC { from { transform: translateX(-50%) translateY(-14px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
.icbc-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.icbc-avatar { width: 38px; height: 38px; min-width: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--purple-600), var(--pink-500)); color: white; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.icbc-name { font-weight: 800; font-size: 13px; }
.icbc-sub { font-size: 10.5px; color: var(--ink-400); }
.icbc-actions { display: flex; gap: 8px; flex-shrink: 0; }
.icbc-btn { width: 40px; height: 40px; border-radius: 50%; border: none; font-size: 16px; cursor: pointer; }
.icbc-btn.accept { background: var(--success); color: white; }
.icbc-btn.reject { background: #F1EEFB; color: var(--ink-600); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-400); }
.empty-state .e-ico { font-size: 40px; margin-bottom: 10px; }
.rating-row { display: flex; gap: 6px; font-size: 22px; }
.profile-card { background: white; border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-card); display: flex; align-items: center; gap: 14px; }
.profile-gradient-topbar { background: linear-gradient(120deg, var(--purple-700), var(--pink-500)); border-bottom: none; }
.pf-vip-chip { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.5); border-radius: 20px; padding: 6px 12px; font-size: 12px; font-weight: 700; }
.pi-avatar-wrap { display: flex; flex-direction: column; align-items: center; margin: 10px 0 22px; }
.pi-avatar-circle { width: 84px; height: 84px; border-radius: 50%; background: linear-gradient(135deg, var(--purple-600), var(--pink-500)); color: white; font-size: 30px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-soft); }
.pi-vip-tag { margin-top: 8px; background: var(--gold-100); color: var(--gold-500); font-weight: 800; font-size: 11.5px; padding: 4px 12px; border-radius: 20px; }
.pi-field { background: white; border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 14px 16px; margin-bottom: 10px; }
.pi-label { font-size: 11.5px; color: var(--ink-400); margin-bottom: 4px; }
.pi-value { font-size: 14px; font-weight: 700; color: var(--ink-900); }
.profile-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--purple-100); display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--purple-600); }
.settings-list { margin-top: 16px; background: white; border-radius: var(--radius-md); box-shadow: var(--shadow-card); overflow: hidden; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-size: 13.5px; font-weight: 600; border-bottom: 1px solid #F1EEFB; cursor: pointer; }
.settings-row:last-child { border-bottom: none; }
.settings-row .left { display: flex; align-items: center; gap: 10px; }

/* =====================================================================
   DESKTOP LAYOUT — Lazmall (shop view only)
   The rest of the app (support/chat/tickets) stays the original
   phone-width (480px) layout intentionally; only the shop view widens
   into a marketplace-style desktop layout above 960px.
   ===================================================================== */
.shop-nav-links { display: none; }

/* Mobile shop header: logo | search pill (flex) | TH lang toggle | bell | cart.
   Wallet stays reachable from the sticky bottom nav ("ถอนเงิน") and Profile on
   mobile, so the header row itself stays compact like a typical marketplace app. */
#view-shop .shop-topbar { gap: 8px; padding: 10px 12px; }
#view-shop .shop-topbar .brand { flex-shrink: 0; gap: 6px; }
#view-shop .shop-topbar .brand .logo.shop-logo { width: 28px; height: 28px; }
#view-shop .shop-topbar .brand .brand-name-dynamic { font-size: 14px; white-space: nowrap; }
.shop-search-top-wrap {
  display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0;
  background: var(--paper); border: 1px solid #E3DEF7; border-radius: 20px; padding: 7px 6px 7px 12px;
}
.ssw-search-ico { flex-shrink: 0; color: var(--ink-400); }
#shop-search-top { flex: 1; min-width: 0; border: none; background: none; outline: none; font-size: 12.5px; font-family: inherit; color: var(--ink-900); }
.shop-search-top-wrap .search-camera-btn {
  background: var(--purple-600); color: white; border: none; border-radius: 50%;
  width: 26px; height: 26px; font-size: 11px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 0;
}
.lang-toggle-btn {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid #E3DEF7; background: var(--white);
  color: var(--ink-600); font-size: 10.5px; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
#view-shop .shop-topbar .actions { gap: 12px; flex-shrink: 0; }
#view-shop .shop-topbar .wallet-topbar-btn { display: none; }

/* Mobile hero: single full-width banner (no side promo cards, matching a typical
   marketplace app's home banner carousel) — the side promo cards return on desktop. */
.promo-cards-col { display: none; }
.hero-row #home-hero-banner { flex: 1; }

/* Mobile stats card: 2-column grid (icon + number/label per cell) instead of one
   cramped row of four, so numbers stay legible on narrow phones. */
.home-stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 8px; }
.home-stat + .home-stat::before { display: none; }
.home-stat:nth-child(odd)::after {
  content: ""; position: absolute; right: -7px; top: 50%; transform: translateY(-50%);
  width: 1px; height: 28px; background: var(--purple-100);
}

@media (min-width: 960px) {
  #app:has(#view-shop.active) {
    max-width: 1280px;
    box-shadow: 0 0 60px rgba(0,0,0,0.12);
  }

  /* ---- Top nav bar: logo | nav links | search | icons ---- */
  #view-shop .shop-topbar {
    padding: 14px 32px;
    gap: 28px;
    justify-content: flex-start;
  }
  #view-shop .shop-topbar .brand { flex-shrink: 0; }
  #view-shop .shop-topbar .brand .logo.shop-logo { width: 34px; height: 34px; }
  #view-shop .shop-topbar .brand .brand-name-dynamic { font-size: 16px; }
  .shop-nav-links {
    display: flex; align-items: center; gap: 24px; flex-shrink: 0;
  }
  .shop-nav-links a {
    font-size: 13.5px; font-weight: 700; color: var(--ink-600); cursor: pointer; white-space: nowrap;
  }
  .shop-nav-links a:hover { color: var(--purple-600); }
  .shop-search-top-wrap {
    gap: 8px; flex: 1; max-width: 420px;
    border: 1.5px solid #E3DEF7; border-radius: 22px; padding: 4px 6px 4px 16px;
  }
  #shop-search-top { font-size: 13px; }
  .shop-search-top-wrap .search-camera-btn {
    width: 30px; height: 30px; font-size: 13px;
  }
  /* The language toggle is a mobile-header affordance (matches the compact
     marketplace-app header); desktop already has full nav text, so hide it there. */
  .lang-toggle-btn { display: none; }
  #view-shop .shop-topbar .actions { flex-shrink: 0; gap: 14px; }
  #view-shop .shop-topbar .wallet-topbar-btn { display: inline-flex; }

  /* ---- Content gets desktop gutters ---- */
  #view-shop .content { padding: 28px 32px 100px; }

  /* ---- Hero row: taller banner + side promo cards return ---- */
  .hero-row { gap: 20px; }
  .hero-row #home-hero-banner { flex: 2; }
  .hero-row #home-hero-banner .shop-banner { min-height: 260px; padding: 32px; }
  .shop-banner h2 { font-size: 30px; }
  .shop-banner p { font-size: 14px; }
  .promo-cards-col { display: flex; gap: 12px; }
  .promo-card { padding: 18px 20px; }
  .promo-card .pc-title { font-size: 15px; }
  .promo-card .pc-sub { font-size: 11.5px; }

  /* ---- Stats & trust badges: back to one row, breathing room ---- */
  .home-stats-row { display: flex; padding: 26px 4px 14px; }
  .home-stat + .home-stat::before { display: block; }
  .home-stat:nth-child(odd)::after { display: none; }
  .trust-badge-row { padding: 4px 4px 22px; }

  /* ---- Hide the secondary mobile search bar (replaced by topbar search) ---- */
  #view-shop .search-bar-row { display: none; }

  /* ---- Flash sale: grid instead of horizontal scroll ---- */
  .flash-product-row {
    flex-wrap: wrap; overflow: visible; gap: 16px;
  }
  .flash-product-card { min-width: 0; max-width: none; flex: 1 1 calc(16.6% - 14px); padding: 0 10px 12px; }
  .flash-product-card .fp-icon { height: 150px; }
  .flash-product-card .fp-name { font-size: 12.5px; min-height: 32px; }

  /* ---- Popular products: grid instead of horizontal scroll ---- */
  .popular-thumb-row { flex-wrap: wrap; overflow: visible; gap: 16px; }
  .popular-thumb-card { min-width: 0; max-width: none; flex: 1 1 calc(12.5% - 14px); }
  .popular-thumb-card .pt-image { height: 130px; }

  /* ---- Main product grid: multi-column ---- */
  .product-grid { grid-template-columns: repeat(5, 1fr); gap: 20px; }
  .product-card .pc-image { height: 160px; }

  /* ---- Footer: nav columns side by side with more breathing room ---- */
  .shop-footer-full { margin: 24px 0 40px; padding-top: 28px; }
  .sf-nav-cols { flex-wrap: nowrap; gap: 48px; margin: 24px 0; }
  .sf-col { min-width: 0; }
  .sf-payment-block { margin: 10px 0 20px; }

  /* ---- Floating pill nav: a bit roomier on desktop ---- */
  .shop-sticky-nav { bottom: calc(20px + env(safe-area-inset-bottom)); width: calc(100% - 48px); }
  .ssn-item { font-size: 12.5px; padding: 10px 16px; }
}
