:root {
  --bg: #f6f5f8;
  --card: #ffffff;
  --text: #1d1b22;
  --muted: #6d6878;
  --line: #e6e3ec;
  --accent: #7a3cff;
  --accent-soft: #efe7ff;
  --promo: #ff4d6d;
  --promo-soft: #ffe8ed;
  --soldout: #a8a3b2;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(30, 20, 60, .07);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
main { max-width: 640px; margin: 0 auto; padding: 0 16px 48px; }

/* 상단 바 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  max-width: 640px; margin: 0 auto;
  padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(246, 245, 248, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar[hidden] { display: none; }
.topbar-title { flex: 1; margin: 0; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--card); font-size: 30px; line-height: 1; box-shadow: var(--shadow); }
.icon-btn[hidden] { visibility: hidden; display: block; }
.lang-btn { height: 44px; padding: 0 14px; border: 0; border-radius: 22px; background: var(--card); font-size: 15px; font-weight: 600; box-shadow: var(--shadow); }

/* 언어 선택 */
.lang-screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 32px 0; }
.lang-screen h1 { margin: 0 0 4px; font-size: 26px; text-align: center; }
.lang-screen p { margin: 0 0 18px; color: var(--muted); text-align: center; font-size: 15px; }
.lang-choice {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 72px; padding: 14px 20px;
  border: 2px solid transparent; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
  font-size: 22px; font-weight: 700; text-align: left;
}
.lang-choice:active { border-color: var(--accent); }
.lang-choice .flag { font-size: 30px; }
.lang-choice small { display: block; font-size: 14px; font-weight: 500; color: var(--muted); }

/* 안내 띠 */
.notice { margin: 14px 0 4px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; color: #3d2a73; }

/* 제품 목록 */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.card {
  display: flex; flex-direction: column;
  padding: 0; border: 0; border-radius: var(--radius); overflow: hidden;
  background: var(--card); box-shadow: var(--shadow); text-align: left;
}
.card .thumb { position: relative; aspect-ratio: 3 / 4; background: #ece9f1; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.card .name { font-size: 15px; font-weight: 800; line-height: 1.25; }
.card .sub { font-size: 12px; color: var(--muted); line-height: 1.3; }
.card .price { margin-top: 4px; font-size: 16px; font-weight: 800; }
.card .approx { font-size: 12px; color: var(--muted); font-weight: 500; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.promo { background: var(--promo); color: #fff; }
.badge.soldout { background: var(--soldout); color: #fff; }
.thumb .badge { position: absolute; top: 8px; left: 8px; }

/* 상세 */
.hero { margin: 14px -16px 0; background: #ece9f1; }
.hero img { width: 100%; height: 42vh; max-height: 360px; object-fit: contain; margin: 0 auto; }
.detail-head { margin-top: 16px; }
.detail-head h2 { margin: 0; font-size: 26px; line-height: 1.2; }
.detail-head .sub { margin-top: 4px; color: var(--muted); }
.price-box { margin-top: 14px; padding: 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.price-box .big { font-size: 28px; font-weight: 800; }
.price-box .approx { margin-left: 6px; color: var(--muted); font-size: 15px; }
.specs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.spec { padding: 6px 12px; border-radius: 999px; background: var(--bg); font-size: 14px; font-weight: 600; }
.promo-box { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--promo-soft); color: #9b1030; font-weight: 700; }
.promo-box .deals { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.promo-box .deal { padding: 4px 10px; border-radius: 8px; background: #fff; font-size: 15px; }
.features { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 15px; }

.section-title { margin: 26px 0 10px; font-size: 19px; }
.section-title small { color: var(--muted); font-weight: 500; font-size: 14px; }
.flavors { display: flex; flex-direction: column; gap: 8px; }
.flavor { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.flavor .no { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.flavor .info { flex: 1; min-width: 0; }
.flavor .fname { font-size: 16px; font-weight: 700; }
.flavor .fdesc { font-size: 14px; color: var(--muted); }
.flavor .ko { font-size: 13px; color: var(--muted); margin-top: 2px; }
.flavor.is-soldout { opacity: .55; }
.flavor.is-soldout .fname { text-decoration: line-through; }
.fsub { font-size: 13px; color: var(--muted); }
.badge.new { background: #19b26b; color: #fff; }
.badge.hot { background: #ff8a00; color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.chip.nic { background: #fff0e6; color: #b5480b; }
.chip.non { background: #e6f7ee; color: #0f7a45; }
.gprice { margin: -2px 0 10px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.gprice .strong, .bundle .strong { font-weight: 800; font-size: 17px; }
.promo-note { margin-top: 6px; font-size: 13px; font-weight: 600; }
.bundles { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.bundle { padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); }
.bundle .btitle { font-size: 14px; font-weight: 700; color: #3d2a73; }
.bundle .was { color: var(--muted); font-size: 13px; }
.card.is-soldout .thumb img { filter: grayscale(.8); opacity: .6; }
.price-box .approx, .card .approx { white-space: nowrap; }
.staff-tip { margin-top: 24px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; color: var(--muted); font-size: 14px; }
.foot { margin-top: 28px; text-align: center; color: var(--muted); font-size: 12px; }

/* 언어 변경 시트 */
.sheet-bg { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 640px; padding: 16px 16px max(24px, env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: var(--bg); display: flex; flex-direction: column; gap: 10px; }
.sheet .lang-choice { min-height: 60px; font-size: 19px; }

@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 맛 목록 2열 (휴대폰에서 스크롤 줄이기) */
.flavors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.flavor { padding: 10px; gap: 8px; }
.flavor .no { width: 22px; height: 22px; font-size: 11px; }
.flavor .fname { font-size: 15px; line-height: 1.3; word-break: break-word; }
.flavor .fname .badge { margin-top: 3px; }
.flavor .fdesc { font-size: 13px; line-height: 1.35; }
.flavor .fsub, .flavor .ko { font-size: 12px; line-height: 1.35; }
.chip { font-size: 11px; padding: 1px 6px; }
