/* ShopLe KR — Premium Korean commerce (local assets only, no CDN) */

:root {
  --bg: #f7f8fc;
  --bg2: #eef1f9;
  --surface: #ffffff;
  --surface2: #f3f5fb;
  --text: #111318;
  --text2: #4b5160;
  --muted: #8b92a1;
  --line: #e8ebf2;
  --primary: #6079ff;
  --primary2: #8b9cff;
  --primary-deep: #4a5fe0;
  --primary-soft: rgba(96, 121, 255, .12);
  --accent: #7c6cf0;
  --accent-soft: rgba(124, 108, 240, .12);
  --sale: #fb3b3b;
  --sale-soft: rgba(251, 59, 59, .1);
  --ok: #1cc100;
  --gold: #f0b429;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(40, 55, 120, .06);
  --shadow-lg: 0 12px 32px rgba(40, 55, 120, .1);
  --grad-primary: linear-gradient(135deg, #6079ff 0%, #8b9cff 55%, #a8b4ff 100%);
  --grad-soft: linear-gradient(160deg, #f7f8fc 0%, #eef1fb 45%, #f9f4ff 100%);
  --grad-card-a: linear-gradient(135deg, #eef2ff 0%, #ffffff 60%);
  --grad-card-b: linear-gradient(135deg, #f5f0ff 0%, #ffffff 60%);
  --container: 1080px;
  --tab-h: 58px;
  --header-h: 54px;
  /* 本地系统韩文字体栈，不依赖 CDN */
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Noto Sans JP", Meiryo, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--grad-soft);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
ul { list-style: none; margin: 0; padding: 0; }

.page {
  min-height: 100vh;
  background: transparent;
  padding-bottom: calc(var(--tab-h) + 12px);
}

.container {
  width: min(100% - 20px, var(--container));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(232, 235, 242, .9);
}
.site-header .inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
}
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--grad-primary);
  box-shadow: 0 4px 12px rgba(96, 121, 255, .35);
}
.nav-pc { display: none; gap: 4px; }
.nav-pc a {
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
}
.nav-pc a:hover { background: var(--bg2); color: var(--text); }
.nav-pc a.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(96, 121, 255, .28);
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text2);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.balance-pill {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
}

/* Tabbar */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  height: var(--tab-h);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #a0a6b4;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: -.04em;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--primary); }

/* Sections */
.section { margin: 16px 0; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.03em;
  background: linear-gradient(90deg, #111318, #4a5fe0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.more { font-size: 12px; color: var(--muted); font-weight: 600; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  background: var(--grad-primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(96, 121, 255, .28);
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: scale(.98); }
.btn.block { width: 100%; }
.btn.ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: none;
}
.btn.dark {
  background: linear-gradient(135deg, #1b1f2a, #2d3344);
  color: #fff;
  box-shadow: none;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  background: var(--bg2);
  color: var(--text2);
}
.tag.hot {
  background: linear-gradient(135deg, rgba(251,59,59,.12), rgba(251,59,59,.06));
  color: var(--sale);
}
.tag.blue {
  background: var(--primary-soft);
  color: var(--primary-deep);
}

/* Banner */
.banner {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 7.2;
  background: linear-gradient(135deg, #dfe6ff, #f0e9ff);
  box-shadow: var(--shadow-lg);
}
.banner-track {
  display: flex;
  height: 100%;
  transition: transform .45s ease;
}
.banner-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  background-size: cover;
  background-position: center;
  text-decoration: none;
}
.banner-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(24, 32, 72, .55) 0%, rgba(24, 32, 72, .18) 50%, transparent 100%);
}
.banner-copy { position: relative; z-index: 1; max-width: 72%; }
.banner-copy h2 {
  margin: 0 0 4px;
  font-size: clamp(16px, 3.8vw, 26px);
  color: #fff;
  font-weight: 800;
  letter-spacing: -.03em;
  text-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.banner-copy p {
  margin: 0;
  color: rgba(255,255,255,.9);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}
.home-intro {
  margin: 14px 0 6px;
  padding: 16px 16px 14px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #ffffff 0%, #f3f5ff 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}
.home-intro h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
}
.home-intro p {
  margin: 0;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.55;
}
.home-intro .home-intro-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.banner-dots {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 5px;
  z-index: 2;
}
.banner-dots button {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.45);
  padding: 0;
  cursor: pointer;
}
.banner-dots button.on {
  background: #fff;
  width: 14px;
  border-radius: 999px;
}

/* Dual promo */
.promo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 4px;
}
.promo-mini {
  position: relative;
  overflow: hidden;
  padding: 14px 12px;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--shadow);
}
.promo-mini h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.promo-mini p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}
.promo-mini .go {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-deep);
}
.promo-mini.lottery {
  background: var(--grad-card-a);
}
.promo-mini.draw {
  background: var(--grad-card-b);
}
.promo-mini .go.blue { color: var(--accent); }
.promo-deco {
  position: absolute;
  right: -10px;
  bottom: -14px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  opacity: .7;
  pointer-events: none;
}
.promo-mini.lottery .promo-deco {
  background: radial-gradient(circle, rgba(96,121,255,.35), transparent 70%);
}
.promo-mini.draw .promo-deco {
  background: radial-gradient(circle, rgba(124,108,240,.32), transparent 70%);
}

/* Products — Mallpie-like cards */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.product-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.product-cover {
  aspect-ratio: 1;
  background: linear-gradient(180deg, #f4f6fb, #eef1f7);
  overflow: hidden;
}
.product-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-body { padding: 10px 10px 12px; }
.product-name {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
  line-height: 1.35;
}
.product-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.price {
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -.02em;
}
.price small { font-size: 11px; font-weight: 700; }
.sold { font-size: 10px; color: var(--muted); font-weight: 600; }
.badge-sale {
  display: inline-block;
  margin-bottom: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  color: var(--sale);
  background: var(--sale-soft);
}

/* Subhead */
.subhead {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
}
.subhead h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  flex: 1;
  letter-spacing: -.02em;
}
.back-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* Buybar */
.buybar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 55;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  align-items: center;
  box-shadow: 0 -8px 24px rgba(40, 55, 120, .08);
}
.buybar .price-box { flex: 1; }
.buybar .price-box .label { font-size: 10px; color: var(--muted); }
.page.has-buybar { padding-bottom: 76px; }
.page.has-buybar .tabbar { display: none; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}
.chip.on {
  color: #fff;
  background: var(--grad-primary);
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(96, 121, 255, .25);
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.qty button {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.qty input {
  width: 42px;
  height: 34px;
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  background: transparent;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(27, 31, 42, .92);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
  z-index: 100;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* CS / Customer support */
.icon-btn.kefu-btn {
  color: var(--primary-deep);
  border-color: rgba(96, 121, 255, .28);
  background: linear-gradient(180deg, #ffffff, #f3f5ff);
  display: none;
}
.icon-btn.kefu-btn.is-on { display: grid; }
.icon-btn.kefu-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}
body.kefu-open { overflow: hidden; }
.kefu-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.kefu-modal.show {
  opacity: 1;
  pointer-events: auto;
}
.kefu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 19, 24, .45);
}
.kefu-sheet {
  position: relative;
  width: min(100%, 420px);
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 28px rgba(20, 30, 70, .18);
  transform: translateY(24px);
  transition: transform .22s ease;
}
.kefu-modal.show .kefu-sheet { transform: translateY(0); }
.kefu-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #d7dbe6;
  margin: 2px auto 10px;
}
.kefu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kefu-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.kefu-x {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--bg2);
  color: var(--text2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.kefu-desc {
  margin: 6px 0 14px;
  font-size: 13px;
  color: var(--muted);
}
.kefu-list { display: grid; gap: 10px; }
.kefu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  transition: background .15s ease, border-color .15s ease;
}
.kefu-item:active { background: var(--surface2); }
.kefu-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #f4f6fb;
  flex-shrink: 0;
}
.kefu-ico svg { width: 26px; height: 26px; }
.kefu-meta { flex: 1; min-width: 0; }
.kefu-meta strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.kefu-meta em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}
.kefu-arrow {
  color: #b0b6c4;
  font-size: 22px;
  line-height: 1;
}
.kefu-empty {
  text-align: center;
  padding: 22px 8px;
  color: var(--muted);
  font-size: 13px;
}
.kefu-item.kefu-line .kefu-ico { background: rgba(6, 199, 85, .12); }
.kefu-item.kefu-whatsapp .kefu-ico { background: rgba(37, 211, 102, .12); }
.kefu-item.kefu-telegram .kefu-ico { background: rgba(42, 171, 238, .12); }

.narrow { max-width: 480px; }

@media (min-width: 768px) {
  .page { padding-bottom: 32px; }
  .tabbar { display: none; }
  .nav-pc { display: flex; }
  .balance-pill { display: inline-flex; }
  .product-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .banner { aspect-ratio: 21 / 7; border-radius: 18px; }
  .promo-row { gap: 12px; margin: 16px 0 8px; }
  .promo-mini { min-height: 88px; padding: 16px; }
  .promo-mini h3 { font-size: 15px; }
  .promo-mini p { font-size: 12px; }
  .buybar {
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, var(--container));
    border-radius: 16px 16px 0 0;
  }
  .page.has-buybar { padding-bottom: 92px; }
  .product-name { font-size: 13px; }
  .price { font-size: 16px; }
}

@media (min-width: 1024px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}
