/* ─────────────────────────────────────────────────────────────
   고객 주문 페이지 — 모바일 우선, 한 화면에 들어오는 단일 페이지
   ───────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg:       #f7f7f8;
  --surface:  #ffffff;
  --primary:  #ff5a1f;     /* 다이소 톤 오렌지 */
  --primary-dark: #e64500;
  --text:     #1f2328;
  --muted:    #6e7681;
  --border:   #e5e7eb;
  --danger:   #d33a2c;
  --warn:     #b58105;
  --success:  #1f7a1f;
  --radius:   10px;
  --shadow:   0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.06);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
               "Malgun Gothic", "맑은 고딕", "Noto Sans KR", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 헤더 */
.brand {
  display: flex; align-items: baseline; gap: 8px;
  padding: 4px 2px 2px;
}
.brand h1 {
  font-size: 18px; margin: 0; font-weight: 700;
}
.brand .sub {
  color: var(--muted); font-size: 12px;
}

/* 카드 */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 14px;
}
.card + .card { margin-top: 0; }
.card h2 {
  font-size: 14px; margin: 0 0 10px; color: var(--muted);
  font-weight: 600; letter-spacing: -0.2px;
}

/* 가격 라인 */
.price-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0;
}
.price-row .label { color: var(--muted); font-size: 13px; }
.price-row .value { font-weight: 600; font-size: 15px; }
.price-row.total .value {
  color: var(--primary); font-size: 22px; font-weight: 800;
}

/* 폼 */
form { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: 12px; color: var(--muted); font-weight: 600;
}
.field input {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;       /* iOS 자동 확대 방지 */
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,90,31,.15);
}

/* 수량 stepper */
.qty {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 6px;
  align-items: stretch;
}
.qty button {
  border: 1px solid var(--border);
  background: #fff;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.qty button:active { background: #f0f0f2; }
.qty input {
  text-align: center;
  font-weight: 700;
}

/* 안내 박스 */
.notice {
  background: #fff8ee;
  border: 1px solid #ffd9a8;
  color: #7a4a00;
  font-size: 12.5px;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.45;
}
.notice strong { color: var(--primary-dark); }

.bank-line {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  word-break: keep-all;
}
.hours {
  font-size: 12px;
  color: var(--muted);
}

/* 알림 */
.alert {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.alert.hidden { display: none; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c2; }
.alert-warn  { background: #fff8e1; color: var(--warn);   border: 1px solid #ffe69c; }
.alert-info  { background: #e7f3ff; color: #0a558c;       border: 1px solid #b3d7f5; }

/* 버튼 */
.btn-primary {
  width: 100%;
  padding: 14px 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover  { background: var(--primary-dark); }
.btn-primary:disabled {
  opacity: .6; cursor: not-allowed;
}

/* 완료 페이지 */
.done-icon {
  width: 56px; height: 56px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: #e8f6ea;
  color: var(--success);
  display: grid; place-items: center;
  font-size: 30px;
}
.done-title {
  text-align: center;
  font-size: 18px; font-weight: 700;
  margin: 0 0 4px;
}
.done-sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px;
}
.kv {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 6px 12px;
  font-size: 14px;
}
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; word-break: break-all; }
.kv .v.amount { color: var(--primary); font-weight: 800; font-size: 16px; }

.contact {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}
.contact a {
  color: var(--text); text-decoration: none;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  flex: 1;
  text-align: center;
}

/* 푸터 */
.footer {
  margin-top: auto;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 8px 0 0;
}

/* ─── 판매 차단 배너 ────────────────────────────── */
.paused-banner {
  background: #fef2f2;
  border: 2px solid var(--danger);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
  color: var(--danger);
}
.paused-banner.hidden { display: none; }
.paused-banner .pb-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 4px;
}
.paused-banner .pb-sub {
  font-size: 13px;
  color: #7a1f1f;
  line-height: 1.5;
  margin-bottom: 8px;
}
.paused-banner .pb-kakao {
  display: inline-block;
  margin-top: 4px;
  padding: 8px 16px;
  background: #fae100;
  color: #3b1e1e;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

/* 카톡 문의 푸터 */
.contact-footer {
  text-align: center;
}
.cf-hours { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.cf-kakao {
  display: inline-block;
  padding: 8px 14px;
  background: #fae100;
  color: #3b1e1e;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.cf-kakao:hover { filter: brightness(1.02); }

/* 비활성화 상태 시각 피드백 */
.field input:disabled,
.qty button:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}
.btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* ─── 자동입력 안내 ──────────────────────────────── */
.autofill-notice {
  background: #e7f3ff;
  border: 1px solid #b3d7f5;
  color: #0a558c;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  display: flex; justify-content: space-between; align-items: center;
}
.autofill-notice.hidden { display: none; }
.link-btn {
  background: transparent; border: none;
  color: #0a558c; text-decoration: underline;
  font-size: 12px; font-weight: 600;
  cursor: pointer; padding: 0;
}

/* ─── 확인 모달 ─────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: grid; place-items: center;
  z-index: 100;
  padding: 16px;
}
.modal-backdrop.hidden { display: none; }
.modal-card {
  background: #fff;
  border-radius: 14px;
  width: min(420px, 100%);
  padding: 22px 22px 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,.2);
  display: flex; flex-direction: column; gap: 14px;
}
.modal-card h2 {
  font-size: 16px; margin: 0;
  text-align: center;
}
.modal-card .kv {
  display: grid;
  grid-template-columns: 80px 1fr;
  row-gap: 6px; column-gap: 12px;
  font-size: 14px;
}
.modal-card .kv .k { color: var(--muted); }
.modal-card .kv .v { font-weight: 600; }
.modal-card .kv .v.amount {
  color: var(--primary); font-weight: 800; font-size: 17px;
}
.modal-card .bank-row {
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.modal-card .notice {
  background: #fff8ee;
  border: 1px solid #ffd9a8;
  color: #7a4a00;
  font-size: 12.5px;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.5;
}
.modal-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 8px;
}
.btn-secondary {
  padding: 12px 14px;
  background: #f0f0f2;
  color: var(--text);
  border: none;
  border-radius: 10px;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
}
.modal-actions .btn-primary {
  padding: 12px 14px;
  font-size: 15px;
}

/* ─── 토스트 (1초) ──────────────────────────────── */
.cust-toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: #1f2328;
  color: #fff;
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 13px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.cust-toast.hidden { display: none; }

/* ─── 복사 버튼 ─────────────────────────────────── */
.copy-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 14px;
  margin-left: 4px;
  border-radius: 4px;
  vertical-align: middle;
}
.copy-btn:hover { background: rgba(0,0,0,.05); }

/* 화면에는 안 보이는 복사 전용 텍스트 */
.hidden-text {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
