:root {
  --bg: #0d1411;
  --surface: #15201b;
  --surface-2: #1c2a23;
  --line: #2a3a32;
  --text: #eef3ef;
  --muted: #93a59b;
  --felt: #1f7a4d;
  --felt-strong: #27985f;
  --gold: #e7b84a;
  --red: #e0524a;
  --blue: #4c9be8;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  border-radius: 10px; padding: 10px 14px; font-weight: 600; min-height: 42px;
  transition: filter .15s, transform .05s;
}
.btn:active { transform: scale(.98); }
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.primary { background: var(--felt); border-color: var(--felt-strong); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1b1405; }
.btn.danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.lg { min-height: 52px; font-size: 16px; }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }

.input, select.input, textarea.input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; outline: none; min-height: 44px;
}
.input:focus { border-color: var(--felt-strong); box-shadow: 0 0 0 3px rgba(39, 152, 95, .25); }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.row { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.hidden { display: none !important; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.badge.green { color: #7ee0a8; border-color: #2d6b48; background: #143222; }
.badge.gold { color: var(--gold); border-color: #6b5420; background: #2c230d; }
.badge.red { color: #ff8f88; border-color: #6e2a26; background: #2e1311; }
.badge.blue { color: #8fc3f5; border-color: #2b4d70; background: #112233; }

.toast-wrap { position: fixed; left: 0; right: 0; top: calc(14px + env(safe-area-inset-top)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 1000; pointer-events: none; padding: 0 16px; }
.toast { background: #0a0f0c; border: 1px solid var(--line); color: var(--text); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: 480px; pointer-events: auto; animation: pop .2s ease-out; }
.toast.error { border-color: var(--red); }
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 100; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; border: 1px solid var(--line); animation: up .2s ease-out; }
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 20px; max-height: 88vh; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
.sheet-head { position: sticky; top: 0; background: var(--surface); padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; z-index: 2; }
.sheet-head h3 { margin: 0; font-size: 18px; flex: 1; }
.sheet-body { padding: 18px; }
.sheet-foot { position: sticky; bottom: 0; background: var(--surface); padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.x-btn { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--muted); padding: 4px 8px; }

.pts { font-variant-numeric: tabular-nums; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--felt-strong); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.ic { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.18em; }
.icon-btn .ic { width: 16px; height: 16px; vertical-align: middle; }

/* 드롭다운: 브라우저 기본 화살표 대신 여백을 둔 화살표 */
select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a59b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  cursor: pointer;
  text-overflow: ellipsis;
}

/* 매장 로고 이미지 */
.brand-logo { display: block; height: 26px; width: auto; }
.brand-hero { display: block; width: min(300px, 80%); height: auto; margin: 0 auto; }

/* 새로 나타나는 칸: 살짝 아래에서 떠오르기 */
.reveal { animation: reveal .34s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }

/* 바텀시트 닫힘 */
.sheet-backdrop.closing { animation: fade-out .2s ease forwards; pointer-events: none; }
.sheet-backdrop.closing .sheet { animation: sheet-down .2s ease forwards; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-down { to { transform: translateY(28px); opacity: 0; } }
/* 하단 장바구니 바 등장 */
.bar-in .btn { animation: bar-in .36s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes bar-in { from { transform: translateY(24px); opacity: 0; } }
/* 상태가 바뀐 카드 강조 */
.pulse { animation: pulse 1.4s ease-out 1; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(231, 184, 74, .55); } 100% { box-shadow: 0 0 0 14px rgba(231, 184, 74, 0); } }
@media (prefers-reduced-motion: reduce) {
  .sheet-backdrop, .sheet, .sheet-backdrop.closing, .sheet-backdrop.closing .sheet, .bar-in .btn, .pulse { animation: none !important; }
}
