:root {
  color-scheme: light;
  --bg: #e7dccf;
  --paper: #f7f1e8;
  --card: #fffaf4;
  --ink: #241c18;
  --muted: #74685f;
  --line: #e4d5c6;
  --accent: #9c2f1a;
  --accent-dark: #7c2414;
  --good: #1f7a4d;
  --warn: #8a5a12;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; color: inherit; }

button, a.primary, a.secondary { cursor: pointer; }

.wrap {
  width: min(520px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 10px 16px;
  background: rgba(247, 241, 232, 0.96);
  border-bottom: 1px solid var(--line);
}

.brand {
  margin: 0;
  font-family: "Noto Serif KR", "Pretendard Variable", Pretendard, serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0;
}

.top-actions { display: flex; align-items: center; gap: 8px; }

.text-btn, select {
  border: 0;
  background: transparent;
  padding: 8px 2px;
  color: var(--accent);
  font-weight: 700;
}

select {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 8px 10px;
}

.page { padding: 8px 16px 28px; }

.recent { margin: 0 16px 8px; }
.recent a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff1cf;
  color: var(--ink);
  font-weight: 700;
}

.hours {
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--ink);
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
}

.top:has(+ .hours) { border-bottom: 0; }

.photo-note {
  margin: 18px 0 4px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.lang-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 32px 20px 48px;
}

.lang-screen h1 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
}

.lang-screen button, .primary, .secondary, .add {
  border-radius: 14px;
  min-height: 52px;
  padding: 12px 16px;
}

.lang-screen button, .secondary, .add {
  border: 1px solid var(--line);
  background: white;
}

.primary, .add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
  border: 0;
  background: var(--accent);
  color: white;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
  background: white;
  font-weight: 700;
  text-decoration: none;
}

.primary:disabled { opacity: 0.6; }

.chips {
  position: sticky;
  top: 60px;
  z-index: 4;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 12px 16px 14px;
  background: var(--paper);
  cursor: grab;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chips::-webkit-scrollbar { display: none; }

.chips.dragging { cursor: grabbing; }

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 8px 14px;
  white-space: nowrap;
  user-select: none;
}

.chip.on { background: var(--accent); border-color: var(--accent); color: white; }

.card {
  display: grid;
  grid-template-columns: 136px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.card img, .ph {
  width: 136px;
  height: 136px;
  border-radius: 16px;
  object-fit: cover;
  background: #efe2d3;
  color: #8d6b52;
}

.ph { display: grid; place-items: center; }

.ph svg { width: 48px; height: 48px; }

.card-body { min-width: 0; }

.card h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }

.desc {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.price { margin: 0 0 10px; color: var(--muted); }

.price.pending { color: var(--warn); }

.stepper { display: flex; align-items: center; gap: 8px; }

.stepper button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  font-size: 22px;
}

.add, .stepper { width: auto; }
.add { min-height: 40px; width: auto; padding: 8px 16px; margin: 0; }

.cart-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: var(--ink);
  color: white;
  font-weight: 700;
}

.cart-bar button {
  border: 0;
  background: transparent;
  color: white;
  font-weight: 700;
  min-height: 44px;
  padding: 8px 0;
}

.cart-side,
.cart-total {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-side { text-align: left; }

.cart-bar .cart-order {
  background: white;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  white-space: nowrap;
}

.cart-total { text-align: right; }

body.has-cart .wrap { padding-bottom: 84px; }

label, .field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; font-size: 14px; font-weight: 700; }

input, textarea, .field select, form select {
  width: 100%;
  border: 1px solid #d9c9b8;
  border-radius: 12px;
  padding: 12px;
  background: white;
  font-size: 16px;
  font-weight: 500;
}

textarea { resize: vertical; }

fieldset { margin: 16px 0; border: 1px solid var(--line); border-radius: 14px; }
fieldset label { flex-direction: row; align-items: center; gap: 10px; font-size: 16px; }
input[type="radio"] { width: 20px; height: 20px; }

.hint { color: var(--muted); font-weight: 500; }
.error { color: var(--accent); font-weight: 700; }
.eyebrow { margin: 8px 0; color: var(--good); font-weight: 700; }
.big { margin: 0; font-size: 64px; line-height: 1; letter-spacing: -0.04em; }
.empty { padding: 28px 0; color: var(--muted); }

ul.plain { list-style: none; margin: 0; padding: 0; }

.line, .total-row, .meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.total-row { font-size: 18px; font-weight: 700; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 4px; padding: 0; list-style: none; }
.step { text-align: center; color: var(--muted); font-size: 12px; }
.dot { display: block; width: 12px; height: 12px; margin: 0 auto 6px; border-radius: 50%; background: #e0d3c6; }
.step.on, .step.done { color: var(--ink); font-weight: 700; }
.step.on .dot, .step.done .dot { background: var(--accent); }

.map { height: 280px; margin: 12px 0; border-radius: 16px; background: #efe2d3; }

.map-picker {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.map-picker header, .map-picker footer {
  padding: 12px 16px;
}

.map-picker h2 { margin: 0 0 4px; font-size: 20px; }

.map-stage { position: relative; flex: 1; min-height: 0; }

#pick-map { height: 100%; background: #efe2d3; }

.map-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 500;
  width: 22px;
  height: 22px;
  margin: -22px 0 0 -11px;
  border: 3px solid white;
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  transform: rotate(-45deg);
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.map-picker footer { display: grid; gap: 8px; }

.yandex-spot { display: grid; gap: 8px; margin: 8px 0 4px; }
.yandex-spot[hidden] { display: none; }
.yandex-spot iframe {
  width: 100%;
  height: 220px;
  border: 0;
  border-radius: 16px;
  background: #efe2d3;
}
.yandex-spot a {
  color: var(--accent);
  font-weight: 700;
  word-break: break-all;
}
.map[hidden] { display: none; }

.banner { margin: 12px 0; padding: 12px 14px; border-radius: 14px; background: #fff1cf; color: var(--warn); font-weight: 700; }
.share { min-height: 24px; color: var(--good); font-weight: 700; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
