/* ════════════════════════════════════════
   Slowdough — 고객 예약 페이지 스타일
   폰트: Pretendard (고딕 계열)
════════════════════════════════════════ */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

/* ── 변수 ── */
:root {
  --cream: #F5F0E8;
  --warm-white: #FDFAF4;
  --charcoal: #2A2520;
  --espresso: #3D2B1F;
  --rust: #C4622D;
  --rust-light: #E8845A;
  --sage: #7A8B6F;
  --gold: #C8A96A;
  --gold-light: #E8D4A0;
  --border: #D4C9B8;

  --font: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
          'Noto Sans KR', sans-serif;
}

/* ── 리셋 ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
  word-break: keep-all;
}

/* ══════════════════════════════════════
   HEADER / POSTER
══════════════════════════════════════ */
header {
  background: #fff;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid #e8e0d4;
}
.poster-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px;
}

/* 상단 텍스트 */
.poster-top { padding-bottom: 18px; }

.poster-brand-tag {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.poster-title {
  font-size: clamp(34px, 9vw, 66px);
  font-weight: 800;
  color: #1a1a1a;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 14px;
}

.poster-meta {
  display: flex;
  
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid #ddd;
  padding-top: 12px;
}

.poster-slogan {
  font-size: 14px;
  font-weight: 700;
  color: #555;
  letter-spacing: -0.3px;
}

.poster-date {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  text-align: right;
  letter-spacing: -0.1px;
}

.poster-date-sub {
  font-size: 12px;
  font-weight: 400;
  color: #999;
  text-align: right;
  margin-top: 2px;
}

/* 피자 이미지 */
.poster-img-wrap {
  position: relative;
  height: 250px;
  overflow: hidden;
}
.poster-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* 메뉴 소개 */
.poster-menu {
  padding: 20px 0 22px;
  border-bottom: 1px solid #e8e0d4;
}
.poster-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.poster-menu-item:last-child { margin-bottom: 0; }

.pmenu-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 3px;
}
.pmenu-name span {
  font-size: 12px;
  font-weight: 400;
  color: #888;
  margin-left: 4px;
}
.pmenu-desc {
  font-size: 11px;
  font-weight: 400;
  color: #777;
  line-height: 1.7;
}
.pmenu-price { text-align: right; flex-shrink: 0; }
.pmenu-price-tag {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--rust);
  margin-bottom: 2px;
}
.pmenu-price-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--rust);
  letter-spacing: -0.5px;
}
.pmenu-price-slice {
  font-size: 10px;
  font-weight: 400;
  color: #aaa;
  margin-top: 1px;
}

/* 안내문구 */
.poster-notice {
  padding: 12px 0 4px;
  font-size: 11px;
  font-weight: 400;
  color: #888;
  line-height: 1.2;
  text-align: right;
}
.poster-notice p::before { content: '* '; }

/* 예약 진행중 배지 */
.sale-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 -1px;
  background: rgba(196,98,45,0.07);
  border: 1px solid rgba(196,98,45,0.2);
  padding: 8px 16px;
  color: var(--rust);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  width: 100%;
  justify-content: center;
}
.sale-date-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--rust);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(1.5); }
}

/* ══════════════════════════════════════
   MAIN LAYOUT
══════════════════════════════════════ */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* Section label */
.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Step cards */
.step-card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  padding: 32px;
  margin-bottom: 20px;
  position: relative;
  transition: box-shadow .25s;
}
.step-card:hover { box-shadow: 0 4px 24px rgba(42,37,32,0.07); }

.step-num {
  position: absolute;
  top: -14px; left: 28px;
  background: var(--rust);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  letter-spacing: 2px;
}

.step-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--espresso);
}

/* ══════════════════════════════════════
   TIME SLOTS
══════════════════════════════════════ */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.slot-btn {
  border: 1.5px solid var(--border);
  background: transparent;
  padding: 14px 8px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--charcoal);
  transition: all .2s;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.slot-btn .slot-time { font-weight: 700; display: block; }
.slot-btn .slot-remain {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--sage);
  display: block;
  margin-top: 3px;
}
.slot-btn:hover:not(.full):not(.selected) {
  border-color: var(--rust);
  background: rgba(196,98,45,0.04);
}
.slot-btn.selected {
  border-color: var(--rust);
  background: var(--rust);
  color: white;
}
.slot-btn.selected .slot-remain { color: rgba(255,255,255,0.7); }
.slot-btn.full {
  opacity: .45;
  cursor: not-allowed;
  background: #f0ece4;
}

/* ══════════════════════════════════════
   PIZZA PICKER
══════════════════════════════════════ */
.pizza-list { display: flex; flex-direction: column; gap: 12px; }

.pizza-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border: 1.5px solid var(--border);
  background: var(--cream);
  transition: border-color .2s;
  flex-wrap: wrap;
  gap: 10px;
}
.pizza-item:has(.qty-val:not([data-val="0"])) {
  border-color: var(--gold);
}
.pizza-right { display: flex; align-items: center; gap: 16px; }

.pizza-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--espresso);
}
.pizza-price {
  font-size: 12px;
  font-weight: 400;
  color: var(--sage);
  margin-top: 2px;
}

/* 수량 컨트롤 */
.qty-ctrl { display: flex; align-items: center; gap: 12px; }
.qty-btn {
  width: 30px; height: 30px;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: var(--charcoal);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  line-height: 1;
}
.qty-btn:hover { border-color: var(--rust); color: var(--rust); }
.qty-val {
  font-size: 22px;
  font-weight: 800;
  min-width: 20px;
  text-align: center;
  color: var(--espresso);
}

/* ── 포장 옵션 ── */
.takeout-area {
  width: 100%;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .25s ease, opacity .2s ease, margin .2s ease;
  margin-top: 0;
}
.pizza-item.has-qty .takeout-area {
  max-height: 80px;
  opacity: 1;
  margin-top: 10px;
}
.takeout-area-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(196,98,45,0.04);
  border: 1px solid rgba(196,98,45,0.15);
  border-radius: 2px;
  flex-wrap: wrap;
}
.takeout-area-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--sage);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.takeout-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.takeout-opt {
  border: 1.5px solid var(--border);
  background: var(--warm-white);
  color: var(--charcoal);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 13px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  border-radius: 2px;
}
.takeout-opt:hover { border-color: var(--rust); color: var(--rust); }
.takeout-opt.selected { background: var(--rust); border-color: var(--rust); color: white; }
.takeout-fee-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--rust);
  background: rgba(196,98,45,0.08);
  border: 1px solid rgba(196,98,45,0.2);
  padding: 2px 7px;
  border-radius: 2px;
  display: none;
  margin-left: auto;
}
.takeout-fee-tag.show { display: inline; }

/* ══════════════════════════════════════
   FORM
══════════════════════════════════════ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sage);
}
.form-field input {
  padding: 10px 10px;
  border: 1.5px solid var(--border);
  background: var(--cream);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  color: var(--charcoal);
  outline: none;
  transition: border-color .2s;
}
.form-field input:focus { border-color: var(--rust); }

/* ══════════════════════════════════════
   ORDER SUMMARY
══════════════════════════════════════ */
.order-summary {
  background: var(--espresso);
  color: var(--cream);
  padding: 24px 28px;
  margin-top: 24px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 400;
  border-bottom: 1px solid rgba(245,240,232,0.1);
}
.summary-row:last-child { border: none; }
.summary-row.total {
  padding-top: 14px;
  font-size: 18px;
  font-weight: 800;
  color: var(--gold);
}
.summary-label { color: rgba(245,240,232,0.65); }

/* ══════════════════════════════════════
   SUBMIT BUTTON
══════════════════════════════════════ */
.submit-btn {
  width: 100%;
  padding: 18px;
  background: var(--rust);
  color: white;
  border: none;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  margin-top: 16px;
  transition: background .2s, transform .15s;
  position: relative;
  overflow: hidden;
}
.submit-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background .2s;
}
.submit-btn:hover { background: #b35526; }
.submit-btn:active { transform: scale(0.99); }
.submit-btn:disabled { background: var(--border); cursor: not-allowed; }

/* ══════════════════════════════════════
   MISC
══════════════════════════════════════ */
.notice {
  font-size: 11px;
  font-weight: 400;
  color: var(--sage);
  text-align: center;
  margin-top: 12px;
  line-height: 1.8;
}

/*/\* Quota banner \*/
.quota-banner {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rust);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.quota-main { flex-shrink: 0; }
.quota-banner .quota-label {
  font-size: 12px; font-weight: 500; color: var(--sage);
}
.quota-banner .quota-count {
  font-size: 24px; font-weight: 800; color: var(--rust); letter-spacing: -0.5px;
}
.quota-banner .quota-count small { font-size: 13px; font-weight: 400; color: var(--sage); }
.quota-detail {
  font-size: 12px; font-weight: 500; color: var(--charcoal); flex-shrink: 0; display: none;
}
.quota-detail b { color: var(--rust); font-weight: 800; }
.quota-banner .quota-bar-wrap {
  flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; min-width: 80px; align-self: center;
}
.quota-banner .quota-bar {
  height: 100%; background: var(--rust); border-radius: 3px; transition: width .5s cubic-bezier(.16,1,.3,1);
}
.quota-banner.sold-out { border-left-color: var(--sage); }
.quota-banner.sold-out .quota-count { color: var(--sage); }
.pizza-remain {
  display: inline-block; font-size: 10px; font-weight: 600;
  background: rgba(196,98,45,0.1); color: var(--rust); border: 1px solid rgba(196,98,45,0.25);
  padding: 1px 7px; border-radius: 10px; margin-left: 6px; vertical-align: middle;
}
.pizza-remain.zero { background: rgba(122,139,111,0.1); color: var(--sage); border-color: rgba(122,139,111,0.25); }
.pizza-item.sold-out { opacity: .5; pointer-events: none; }

/* Closed state */
.closed-msg {
  text-align: center;
  padding: 60px 24px;
  color: var(--sage);
}
.closed-msg h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--espresso);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(42,37,32,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  backdrop-filter: blur(3px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--warm-white);
  max-width: 420px;
  width: 100%;
  padding: 40px 32px;
  text-align: center;
  animation: slideUp .35s cubic-bezier(.16,1,.3,1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-icon { font-size: 44px; margin-bottom: 16px; }
.modal h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--espresso);
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}
.modal p { font-size: 13px; font-weight: 400; color: var(--sage); line-height: 1.8; }
.modal-detail {
  background: var(--cream);
  border: 1px solid var(--border);
  padding: 16px;
  margin: 20px 0;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  line-height: 2;
}
.modal-close {
  background: var(--espresso);
  color: white;
  border: none;
  padding: 12px 32px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background .2s;
}
.modal-close:hover { background: var(--rust); }

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--sage);
  font-size: 13px;
  font-weight: 400;
}

/* Error */
.error-msg {
  background: #fdf0eb;
  border: 1px solid #e8845a;
  color: #c4622d;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}
.error-msg.show { display: block; }

/* ══════════════════════════════════════
   모바일 반응형
══════════════════════════════════════ */
@media (max-width: 600px) {
  .poster-wrap { padding: 15px; }
  .poster-title { font-size: clamp(28px, 10vw, 46px); }
  .poster-meta { flex-direction: column; gap: 4px; }
  .pmenu-name { font-size: 13px; }
  .pmenu-name span { display: block; margin-left: 0; margin-top: 1px; }
  .pmenu-desc { font-size: 10px; }
  .pmenu-price-val { font-size: 18px; }
  .poster-menu-item { gap: 10px; }

  main { padding: 24px 16px 60px; }
  .step-card { padding: 24px 18px; }
  .slots-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .slot-btn { padding: 12px 6px; font-size: 14px; }
  .pizza-item { padding: 14px; }
  .pizza-right { gap: 10px; }
  .pizza-name { font-size: 14px; }
  .qty-btn { width: 36px; height: 36px; font-size: 20px; }
  .qty-val { font-size: 18px; }
  .takeout-area-inner { padding: 8px 10px; gap: 8px; }
  .takeout-opt { padding: 5px 10px; font-size: 11px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-field input { font-size: 12px; padding: 14px; } /* iOS 줌 방지 */
  .order-summary { padding: 18px; }
  .summary-row.total { font-size: 16px; }
  .submit-btn { padding: 16px; font-size: 14px; }
  .modal { padding: 28px 20px; }
  .modal-detail { font-size: 12px; line-height: 2.1; }
  .quota-banner { padding: 12px 14px; gap: 10px; }
  .quota-banner .quota-count { font-size: 20px; }
  .quota-banner .quota-bar-wrap { min-width: 40px; }
}

@media (max-width: 380px) {
  .poster-title { font-size: 26px; }
  .slots-grid { grid-template-columns: repeat(2, 1fr); }
  .step-card { padding: 20px 14px; }
}
