/* ============================================================
   apM 零售 mini-program — global styles
   韩系电商风 · 中文C端 · 小程序 375x667
   ============================================================ */

@import url('ds/colors_and_type.css');

/* Korean-fashion hot-pink retail palette layered over apM ink */
:root {
  --pink-50:  #FFF5F7;
  --pink-100: #FFE4EA;
  --pink-200: #FFC9D5;
  --pink-300: #FFA3B8;
  --pink-400: #FF6B8A;
  --pink-500: #FF3D6B; /* primary korean retail pink */
  --pink-600: #E11D48;
  --pink-700: #B5183A;

  --peach: #FFD7C2;
  --cream: #FFF8F1;
  --mint:  #C8F0E0;

  /* themable retail brand color — switched by tweaks */
  --brand:        var(--apm-red);
  --brand-deep:   var(--apm-red-deep);
  --brand-soft:   var(--apm-red-soft);
  --brand-on:     #fff;
  --accent:       var(--apm-gold);
}

[data-theme="pink"] {
  --brand:      #FF3D6B;
  --brand-deep: #E11D48;
  --brand-soft: #FFE4EA;
  --brand-on:   #fff;
  --accent:     #FFB7C5;
}
[data-theme="apm"] {
  --brand:      #C8102E;
  --brand-deep: #A50D25;
  --brand-soft: #FCE7EB;
  --brand-on:   #fff;
  --accent:     #C9A36A;
}
[data-theme="luxe"] {
  --brand:      #0B0B0B;
  --brand-deep: #000;
  --brand-soft: #F5F0E6;
  --brand-on:   #FFFFFF;
  --accent:     #C9A36A;
}
[data-night="true"] {
  filter: hue-rotate(-4deg) saturate(0.95);
}
[data-night="true"] body, [data-night="true"] {
  background: #0A0F1F;
}
[data-night="true"] .phone .screen { background: #0B0B0F; }
[data-night="true"] .appbody { background: #0B0B0F !important; color: #EAEAEA; }
[data-night="true"] .app-header { background: rgba(11,11,15,0.92) !important; border-bottom-color: rgba(255,255,255,0.06); }
[data-night="true"] .h-title, [data-night="true"] .appbody div { color: inherit; }
[data-night="true"] .searchbar { background: #1B1B22; color: rgba(255,255,255,0.5); }
[data-night="true"] .searchbar input { color: #fff; }
[data-night="true"] .tabbar { background: rgba(11,11,15,0.94); border-top-color: rgba(255,255,255,0.06); }
[data-night="true"] .curpill { background: rgba(255,255,255,0.1); color: #fff; }
[data-night="true"] .chip.gray { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }

/* Card density */
[data-density="loose"] .prod-grid, [data-density="loose"] .feed-grid { gap: 14px; }

/* H5 desktop browser surface */
.h5-stage {
  width: 100%;
  background: linear-gradient(180deg, #F2F2F4, #E8E8EB);
  padding: 32px 0 64px;
  display: grid;
  place-items: center;
  border-radius: 0 0 12px 12px;
}
.h5-mobile-frame {
  width: 420px; height: 740px;
  background: #fff; border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
  overflow: hidden; position: relative;
  display: flex; flex-direction: column;
  border: 1px solid rgba(0,0,0,0.06);
}
.h5-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  padding: 24px 32px;
  align-items: center;
}
.h5-copy h2 {
  font-family: var(--font-display); font-weight: 800;
  font-size: 38px; letter-spacing: -0.02em; line-height: 1.1;
}
.h5-copy h2 span { color: var(--brand); }
.h5-copy p { font-size: 13px; color: var(--fg-2); margin-top: 12px; line-height: 1.6; max-width: 380px; }
.h5-copy .qr {
  margin-top: 18px; display: inline-flex; gap: 12px; align-items: center;
  padding: 10px 14px; background: #fff; border-radius: 12px;
  border: 1px solid var(--border-1);
}
.h5-copy .qr-img {
  width: 64px; height: 64px; border-radius: 4px;
  background:
    linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%) 0 0/8px 8px,
    linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%) 4px 4px/8px 8px,
    #fff;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-sans-cn);
  background: #EDECE8;
  color: var(--fg-1);
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
  padding: 32px 16px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* ---- TOP NAV (page selector) ---- */
.topbar {
  width: 100%; max-width: 1320px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 4px;
}
.brandmark {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 800; letter-spacing: -0.02em;
  font-size: 18px;
}
.brandmark .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.brandmark .sub { font-size: 11px; color: var(--fg-3); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; margin-left: 4px; }

.page-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  background: #fff; padding: 4px; border-radius: 999px;
  border: 1px solid var(--border-1);
  box-shadow: var(--elev-1);
}
.page-tab {
  font-size: 11px; font-weight: 600;
  padding: 7px 12px; border-radius: 999px;
  color: var(--fg-2); cursor: pointer;
  white-space: nowrap;
  transition: all 150ms var(--ease);
  border: none; background: transparent;
}
.page-tab:hover { color: var(--fg-1); }
.page-tab.active { background: #0B0B0B; color: #fff; }

.flow-hint {
  font-size: 11px; color: var(--fg-3);
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* ---- DEVICE FRAME — WeChat mini-program iPhone SE-ish 375x667 ---- */
.frame-row {
  display: flex; gap: 28px; flex-wrap: wrap; justify-content: center;
  width: 100%;
}

.phone {
  width: 375px;
  height: 667px;
  background: #000;
  border-radius: 38px;
  padding: 8px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.4) inset,
    0 30px 60px -10px rgba(0,0,0,0.25),
    0 18px 36px -18px rgba(0,0,0,0.4);
  position: relative;
  flex-shrink: 0;
}
.phone-label {
  position: absolute; top: -22px; left: 0;
  font-size: 10px; letter-spacing: 0.12em; font-weight: 700;
  text-transform: uppercase; color: var(--fg-3);
}
.phone-label b { color: var(--fg-1); }
.screen {
  width: 100%; height: 100%;
  background: #fff;
  border-radius: 30px;
  overflow: hidden;
  position: relative;
  display: flex; flex-direction: column;
}

/* WeChat mini-program top status + capsule bar */
.statusbar {
  height: 24px; padding: 4px 18px 0;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 600; color: #000;
  flex-shrink: 0; z-index: 30; position: relative;
}
.statusbar .right { display: flex; align-items: center; gap: 5px; font-size: 10px; }
.statusbar .battery { width: 22px; height: 11px; border: 1px solid currentColor; border-radius: 3px; padding: 1px; position: relative; }
.statusbar .battery::after { content: ''; position: absolute; right: -3px; top: 3px; width: 1.5px; height: 4px; background: currentColor; border-radius: 0 1px 1px 0; }
.statusbar .battery i { display: block; width: 100%; height: 100%; background: currentColor; border-radius: 1px; }

.statusbar.light { color: #fff; }

/* WeChat capsule (dot-dot + close) — top-right always */
.wx-capsule {
  position: absolute; top: 28px; right: 14px;
  width: 87px; height: 32px;
  background: rgba(255,255,255,0.65);
  border: 0.5px solid rgba(0,0,0,0.08);
  border-radius: 999px;
  display: grid; grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  backdrop-filter: blur(20px);
  z-index: 25;
}
.wx-capsule.dark {
  background: rgba(0,0,0,0.4);
  border-color: rgba(255,255,255,0.15);
}
.wx-capsule.dark .dots span, .wx-capsule.dark .x { background: #fff; }
.wx-capsule.dark .div { background: rgba(255,255,255,0.2); }
.wx-capsule .dots { display: flex; gap: 3px; justify-content: center; }
.wx-capsule .dots span { width: 3px; height: 3px; background: #000; border-radius: 50%; }
.wx-capsule .div { background: rgba(0,0,0,0.1); width: 1px; height: 14px; }
.wx-capsule .x { width: 9px; height: 9px; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M2 2L14 14M14 2L2 14' stroke='black' stroke-width='1.5'/></svg>") center/contain no-repeat;
  background: #000; margin: 0 auto; }

/* App content scroll region */
.appbody {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.appbody::-webkit-scrollbar { width: 0; }

/* Bottom tab bar */
.tabbar {
  flex-shrink: 0;
  height: 52px;
  border-top: 0.5px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.96);
  display: grid; grid-template-columns: repeat(5, 1fr);
  z-index: 10;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 10px; color: var(--fg-3); font-weight: 500;
  cursor: pointer; transition: color 150ms var(--ease);
  border: none; background: none; padding: 0;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--brand); }
.tab .blob { width: 21px; height: 21px; display: grid; place-items: center; }

/* ---- SHARED COMPONENTS ---- */

.app-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(16px);
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
  padding: 6px 14px 10px;
  display: flex; align-items: center; gap: 10px;
}
.app-header .h-back { width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer; }
.app-header .h-title { font-size: 15px; font-weight: 600; flex: 1; text-align: center; padding-right: 28px; }

/* Currency selector pill */
.curpill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 4px 8px; border-radius: 999px;
  background: rgba(0,0,0,0.06); color: #000;
  cursor: pointer;
}
.curpill .flag { font-size: 12px; }
.curpill .chev { font-size: 8px; opacity: 0.6; }

/* Search input */
.searchbar {
  background: #F2F2F2;
  border-radius: 999px;
  padding: 8px 14px;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--fg-3);
  flex: 1; min-width: 0;
}
.searchbar input { flex: 1; border: none; background: none; outline: none; font-size: 12px; min-width: 0; color: var(--fg-1); }

/* Pricing — Korean-style stacked: original strikethrough on top, brand price below */
.price {
  display: inline-flex; align-items: baseline; gap: 4px;
  font-family: var(--font-display);
  font-weight: 800; color: var(--brand);
  letter-spacing: -0.02em;
}
.price .cur { font-size: 0.7em; font-weight: 700; }
.price .num { font-size: 1em; }
.price .strike { font-size: 0.6em; color: var(--fg-4); text-decoration: line-through; font-weight: 500; margin-left: 4px; font-family: var(--font-sans-cn); }

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 13px; font-weight: 600;
  padding: 11px 20px;
  border-radius: 999px;
  border: none; cursor: pointer;
  transition: all 150ms var(--ease);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn.primary { background: var(--brand); color: var(--brand-on); }
.btn.primary:active { background: var(--brand-deep); }
.btn.dark { background: #0B0B0B; color: #fff; }
.btn.ghost { background: transparent; color: var(--fg-1); border: 1px solid var(--border-2); }
.btn.block { width: 100%; }
.btn.lg { padding: 14px 24px; font-size: 14px; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  letter-spacing: 0.02em;
}
.chip.dk { background: #0B0B0B; color: var(--apm-gold); font-family: var(--font-mono); letter-spacing: 0.06em; padding: 3px 6px; border-radius: 2px; }
.chip.gray { background: rgba(0,0,0,0.06); color: var(--fg-2); }
.chip.outline { background: transparent; border: 0.5px solid var(--border-2); color: var(--fg-2); }
.chip.night { background: linear-gradient(120deg, #0A1634, #1A237E); color: #fff; }

/* ---- SECTION CAPTION (between phones) ---- */
.frame-caption {
  text-align: center; margin-top: 6px;
  font-family: var(--font-display);
  font-size: 11px; color: var(--fg-2);
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700;
}
.frame-caption .num { color: var(--brand); }

/* ---- DRAWER (currency picker overlay) ---- */
.drawer-mask {
  position: absolute; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 40; display: none;
}
.drawer-mask.open { display: block; }
.drawer {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 20px 20px 0 0;
  padding: 18px 18px 24px;
  z-index: 41;
  transform: translateY(100%);
  transition: transform 280ms var(--ease);
}
.drawer.open { transform: translateY(0); }

/* utility */
.ph { background: #EDEAE5; color: #B0AEA8; display: grid; place-items: center; font-size: 10px; font-weight: 500; }
.skel { background: linear-gradient(110deg, #EFEDE8 8%, #F7F5F0 18%, #EFEDE8 33%); }
.divider { height: 1px; background: var(--border-1); margin: 0; }

/* Sinsagom mascot — small inline */
.sinsagom-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
}
.sinsagom-pill .b {
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff url('assets/sinsagom-1.jpg') center/cover;
  border: 1px solid #fff;
}

/* night-mode badge style for 20:00-05:00 */
.nightband {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 600;
  background: #0A1634; color: #fff;
  padding: 3px 7px; border-radius: 2px;
  letter-spacing: 0.08em;
}
.nightband i {
  width: 5px; height: 5px; border-radius: 50%; background: #FFD53D;
  box-shadow: 0 0 6px #FFD53D;
  animation: pulse-night 1.6s var(--ease) infinite;
}
@keyframes pulse-night {
  50% { opacity: 0.4; }
}

/* announcement strip slide-in (HomeScreen) */
@keyframes ann-slide {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 0.85; transform: translateY(0); }
}
