@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;700&family=Nunito+Sans:wght@400;700&display=swap');

:root {
  --pink: #ffb1d8;
  --pink-deep: #d6699f;
  --pink-light: #ffecf6;
  --pink-pale: #fed7ea;
  --blue: #b1d7ff;
  --blue-mid: #8fc6ff;
  --blue-deep: #4a86c8;
  --blue-light: #ebf5ff;
  --bg: #faf8ff;
  --ink: #2c3041;
  --gray: #5b6075;
  --muted: #9aa0b4;
  --line: #e6e8f0;
  --white: #ffffff;
  --ok: #2f9e6f;
  --danger: #c2415d;
  --radius: 16px;
  --font-head: 'Quicksand', system-ui, sans-serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; margin: 0; line-height: 1.25; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Shell ---------- */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding: 76px 16px 112px;
}
@media (min-width: 520px) {
  body { background: #f1eef9; }
  .app { box-shadow: 0 0 0 1px var(--line); }
}

.topbar {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--pink-pale);
}
.topbar .grow { flex: 1; min-width: 0; }
.logo {
  font-family: var(--font-head); font-weight: 700; font-size: 20px;
  color: var(--pink-deep); letter-spacing: .02em; line-height: 1;
}
.logo small { display: block; font-size: 10px; color: var(--blue-mid); letter-spacing: .12em; margin-top: 2px; }
.topbar-title { font-family: var(--font-head); font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: 999px; border: 2px solid var(--pink); background: var(--white);
  color: var(--pink-deep); cursor: pointer; position: relative;
}
.icon-btn.soft { border: 0; background: var(--pink-light); }
.icon-btn.blue { border: 0; background: var(--blue-light); color: var(--blue-deep); }
.icon-btn .badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--blue); color: var(--white);
  font: 700 10px/18px var(--font-head); text-align: center;
}
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.sm { width: 16px; height: 16px; }

.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 20;
  display: flex; justify-content: space-around;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
  background: var(--white); border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 16px rgba(44, 48, 65, .08);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 14px; border-radius: 999px;
  color: var(--pink-deep); font: 700 11px var(--font-head); letter-spacing: .03em;
}
.bottom-nav a .icon { color: var(--blue-mid); }
.bottom-nav a.active { background: var(--pink-light); color: var(--ink); }
.bottom-nav a.active .icon { color: var(--ink); }

.action-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--white); border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 16px rgba(44, 48, 65, .08);
}
.action-bar .total small { display: block; font-size: 11px; color: var(--gray); }
.action-bar .total b { font: 700 18px var(--font-head); letter-spacing: .02em; }
.action-bar .btn { flex: 1; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.sm { gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- Type ---------- */
.h-section { font-size: 20px; }
.h-card { font-size: 16px; }
.eyebrow { font: 700 11px var(--font-head); color: var(--blue-mid); letter-spacing: .04em; }
.link { font: 700 11px var(--font-head); color: var(--pink-deep); letter-spacing: .03em; cursor: pointer; background: none; border: 0; padding: 0; }
.muted { color: var(--gray); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.center { text-align: center; }
.price { font: 700 14px var(--font-head); letter-spacing: .03em; }

/* ---------- Surfaces ---------- */
.card {
  background: var(--white); border: 2px solid var(--blue-mid); border-radius: var(--radius);
  padding: 16px; box-shadow: 0 6px 0 var(--blue);
}
.card.pink { border-color: var(--pink); box-shadow: 0 6px 0 var(--pink); }
.card.flat { box-shadow: none; border-color: var(--pink-pale); }
.card.flat.blue { border-color: var(--blue); }
.card.tight { padding: 12px; }
.note {
  border: 2px dashed var(--pink); background: var(--pink-light);
  border-radius: 12px; padding: 14px; font-size: 12px;
}
.note.blue { border-color: var(--blue); background: var(--blue-light); }
.note h4 { font-size: 12px; color: var(--pink-deep); display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.note.blue h4 { color: var(--blue-deep); }
.note ul { margin: 4px 0 0; padding-left: 18px; }

.title-box {
  background: var(--pink-light); border: 2px solid var(--pink); border-radius: 12px;
  padding: 12px; box-shadow: 0 4px 0 var(--pink); font: 700 18px var(--font-head);
}

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--pink); color: var(--white);
  font: 700 14px var(--font-head); letter-spacing: .03em;
  text-shadow: 0 1px 1px rgba(150, 50, 100, .55);
  box-shadow: 0 3px 0 var(--pink-deep);
  transition: transform .08s, box-shadow .08s, opacity .15s;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--pink-deep); }
.btn.secondary { background: var(--white); color: var(--ink); text-shadow: none; border: 2px solid var(--blue); box-shadow: 0 3px 0 var(--blue); }
.btn.blue { background: var(--blue); box-shadow: 0 3px 0 var(--blue-mid); text-shadow: 0 1px 1px rgba(40, 90, 150, .55); }
.btn.ghost { background: var(--pink-light); color: var(--pink-deep); box-shadow: none; text-shadow: none; }
.btn.danger { background: var(--white); color: var(--danger); text-shadow: none; border: 2px solid #f3b9c6; box-shadow: none; }
.btn.small { min-height: 34px; padding: 6px 14px; font-size: 12px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--pink-light); border: 1.5px solid var(--pink);
  color: var(--pink-deep); font: 700 11px var(--font-head); letter-spacing: .03em;
  cursor: pointer; white-space: nowrap;
}
.chip {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font: 700 10px var(--font-head); letter-spacing: .03em; white-space: nowrap;
  background: var(--pink); color: var(--white); text-shadow: 0 1px 1px rgba(150, 50, 100, .45);
}
.chip.blue { text-shadow: none; background: var(--blue-light); color: var(--blue-deep); border: 1.5px solid var(--blue); }
.chip.soft { text-shadow: none; background: var(--pink-light); color: var(--pink-deep); border: 1.5px solid var(--pink-pale); }
.chip.gray { text-shadow: none; background: var(--line); color: var(--gray); }
.chip.ok { text-shadow: none; background: #e3f6ee; color: var(--ok); }
.chip.warn { text-shadow: none; background: #fff4d6; color: #8a6400; }
.chip.bad { text-shadow: none; background: #fde7ec; color: var(--danger); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font: 700 11px var(--font-head); letter-spacing: .03em; }
.input {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 2px solid var(--pink-pale); border-radius: 999px;
  padding: 0 14px; min-height: 44px; color: var(--blue-mid);
}
.input:focus-within { border-color: var(--pink); }
.input input, .input select { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); min-width: 0; padding: 10px 0; font-size: 14px; }
.input input::placeholder { color: var(--blue-mid); font-family: var(--font-head); font-weight: 700; font-size: 12px; letter-spacing: .03em; }
textarea.textarea, input.text, select.text {
  width: 100%; border: 2px solid var(--pink-pale); border-radius: 12px; background: var(--white);
  padding: 10px 12px; outline: 0; font-size: 14px;
}
textarea.textarea:focus, input.text:focus, select.text:focus { border-color: var(--pink); }
textarea.textarea { min-height: 84px; resize: vertical; }
.help { font-size: 11px; color: var(--gray); }
.error-text { color: var(--danger); font-size: 12px; font-weight: 700; }

.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 12px; }
.check input { appearance: none; width: 20px; height: 20px; flex: none; border-radius: 6px; border: 2px solid var(--pink); background: var(--white); margin: 0; display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--pink); }
.check input:checked::after { content: ''; width: 5px; height: 10px; border: solid var(--white); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }

.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 6px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 7px 16px; border-radius: 999px; cursor: pointer;
  background: var(--blue-light); border: 2px solid var(--blue); color: var(--ink);
  font: 700 12px var(--font-head); letter-spacing: .03em;
}
.tab.active { background: var(--pink-light); border-color: var(--pink); box-shadow: 0 3px 0 var(--pink); }
.tab .count { margin-left: 6px; font-size: 10px; color: var(--pink-deep); }

/* ---------- Product card ---------- */
.product-card { display: flex; flex-direction: column; gap: 12px; }
.product-card .thumb { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 3 / 1; background: var(--pink-light); }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .thumb .chip { position: absolute; top: 8px; left: 8px; }
.product-card h3 { font-size: 18px; }
.product-card .actions { display: flex; align-items: center; gap: 8px; }
.round {
  width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; border: 0; cursor: pointer;
  background: var(--pink); color: var(--white);
}
.round.blue { background: var(--blue-light); color: var(--blue-mid); }
.placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--pink-light), var(--blue-light));
  color: var(--pink-deep); font: 700 15px var(--font-head); letter-spacing: .04em; text-align: center; padding: 8px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Category cards ---------- */
.cat-card { display: flex; flex-direction: column; gap: 10px; }
.cat-card .btn { width: 100%; }
.cat-card.blue { border-color: var(--blue-mid); box-shadow: 0 6px 0 var(--blue); }
.cat-card h3 { font-size: 20px; }

/* ---------- Product page ---------- */
.gallery-main { border-radius: 10px; overflow: hidden; aspect-ratio: 3 / 1; background: var(--pink-light); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; }
.thumbs button { flex: 1 0 30%; max-width: 33%; border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.thumbs img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 8px; opacity: .7; border: 2px solid transparent; }
.thumbs button.active img { opacity: 1; border-color: var(--pink); }
.thumbs span { font: 700 10px var(--font-head); color: var(--blue-mid); }
.thumbs button.active span { color: var(--pink-deep); }

.option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  padding: 14px; border-radius: 14px; border: 2px solid var(--pink-pale); background: var(--white);
}
.option.selected { background: var(--pink-light); border-color: var(--pink); box-shadow: 0 4px 0 var(--pink); }
.radio { width: 20px; height: 20px; flex: none; border-radius: 999px; border: 2px solid #d9dbe6; background: var(--white); display: grid; place-items: center; }
.option.selected .radio { border-color: var(--pink); }
.option.selected .radio::after { content: ''; width: 10px; height: 10px; border-radius: 999px; background: var(--pink); }
.option .name { font: 700 15px var(--font-head); }
.option .price { white-space: nowrap; }
.option.selected .price { color: var(--pink-deep); }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.checklist li::before {
  content: ''; flex: none; width: 20px; height: 20px; border-radius: 999px; margin-top: 1px;
  background: var(--blue-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a86c8' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ---------- Steps ---------- */
.steps { display: flex; align-items: center; gap: 8px; background: var(--white); border: 2px solid var(--pink-pale); border-radius: 999px; padding: 10px 16px; }
.step { display: flex; align-items: center; gap: 6px; font: 700 11px var(--font-head); color: var(--muted); white-space: nowrap; }
.step i { width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; font-style: normal; border: 2px solid #d9dbe6; background: var(--white); }
.step.current { color: var(--ink); }
.step.current i, .step.done i { background: var(--pink); border-color: var(--pink); color: var(--white); }
.step.done { color: var(--pink-deep); }
.step-line { flex: 1; height: 2px; border-radius: 2px; background: var(--line); }
.step-line.done { background: var(--pink); }

/* ---------- Summary rows ---------- */
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.kv span:first-child { color: var(--gray); }
.kv b { font-family: var(--font-head); letter-spacing: .02em; }
.divider { border-top: 1.5px dashed var(--pink-pale); margin: 2px 0; }

/* ---------- Payment ---------- */
.timer { display: flex; align-items: center; gap: 12px; }
.timer .count { font: 700 24px var(--font-head); color: var(--pink-deep); letter-spacing: .06em; }
.qr-frame { background: var(--white); border: 2px solid var(--pink-pale); border-radius: 16px; padding: 14px; width: min(260px, 100%); margin: 0 auto; }
.qr-frame svg, .qr-frame img { width: 100%; height: auto; display: block; }
.amount-box { background: var(--bg); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.amount-box b { font: 700 24px var(--font-head); color: var(--pink-deep); letter-spacing: .03em; }
.numbered { list-style: none; counter-reset: s; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.numbered li { counter-increment: s; display: flex; gap: 10px; font-size: 13px; }
.numbered li::before { content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 999px; background: var(--pink); color: var(--white); display: grid; place-items: center; font: 700 11px var(--font-head); }

/* ---------- Success ---------- */
.success-icon { width: 72px; height: 72px; border-radius: 999px; background: var(--pink-light); display: grid; place-items: center; margin: 0 auto; }
.success-icon span { width: 48px; height: 48px; border-radius: 999px; background: var(--pink); display: grid; place-items: center; color: var(--white); box-shadow: 0 3px 0 var(--pink-deep); }
.file-row { display: flex; align-items: center; gap: 12px; }
.file-row .ficon { width: 40px; height: 40px; border-radius: 10px; background: var(--blue-light); color: var(--blue-deep); display: grid; place-items: center; flex: none; }
.file-row .name { font: 700 13px var(--font-head); word-break: break-all; }

/* ---------- Misc ---------- */
.skeleton { background: linear-gradient(90deg, #f1eef9, #fbf9ff, #f1eef9); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { text-align: center; color: var(--gray); padding: 32px 12px; }
.empty b { display: block; font-family: var(--font-head); color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); top: 72px; z-index: 60; width: min(448px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; background: var(--white); border: 2px solid var(--pink); border-radius: 14px; box-shadow: 0 4px 0 var(--pink);
  padding: 12px 14px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; animation: pop .2s ease-out;
}
.toast.error { border-color: #f3b9c6; box-shadow: 0 4px 0 #f3b9c6; }
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } }

.spinner { width: 18px; height: 18px; border-radius: 999px; border: 2.5px solid var(--pink-pale); border-top-color: var(--pink-deep); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.search { margin-bottom: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
