/* ===== 預約流程樣式 ===== */

/* ── 頁面佈局 ────────────────────────────────────────────────────── */
.booking-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2rem 0 4rem;
  align-items: start;
}
@media (max-width: 900px) {
  .booking-layout { grid-template-columns: 1fr; }
}

/* ── 步驟指示器 ──────────────────────────────────────────────────── */
.step-indicator {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.25rem 0;
  overflow-x: auto;
  gap: 0;
}
.step-indicator__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  position: relative;
  flex: 1;
  min-width: 60px;
}
.step-indicator__item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 2px;
  background: var(--color-border);
  z-index: 0;
}
.step-indicator__item.completed::after { background: var(--color-accent); }

.step-indicator__num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  background: var(--color-surface);
  position: relative;
  z-index: 1;
  transition: all var(--transition);
}
.step-indicator__item.active .step-indicator__num {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.step-indicator__item.completed .step-indicator__num {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.step-indicator__label {
  font-size: .7rem;
  color: var(--color-text-muted);
  text-align: center;
  white-space: nowrap;
}
.step-indicator__item.active .step-indicator__label { color: var(--color-primary); font-weight: 600; }

/* ── Step 通用 ───────────────────────────────────────────────────── */
.step-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--color-text);
}

.step-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: flex-end;
}

/* ── 場地卡片 ────────────────────────────────────────────────────── */
.venue-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 700px) {
  .venue-cards { grid-template-columns: 1fr; }
}

.venue-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  text-align: center;
  user-select: none;
}
.venue-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.venue-card.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(44,36,32,.15);
}
.venue-card__icon {
  width: 60px;
  height: 60px;
  margin: 0 auto .75rem;
  border-radius: 50%;
  background: var(--color-accent-light);
}
.venue-card__icon--rehearsal_hall { background: linear-gradient(135deg, #f5ebe0, #e8c99a); }
.venue-card__icon--chamber_studio { background: linear-gradient(135deg, #e8f0f5, #a8c4d8); }
.venue-card__icon--practice_room  { background: linear-gradient(135deg, #e8f5ea, #a8d0b0); }

.venue-card__name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .5rem;
}
.venue-card__info {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .82rem;
  color: var(--color-text-secondary);
  margin-bottom: .75rem;
}
.venue-card__price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-accent);
}
.venue-card__tag {
  display: inline-block;
  margin-top: .5rem;
  font-size: .72rem;
  background: var(--color-accent-light);
  color: var(--color-accent);
  padding: .15rem .5rem;
  border-radius: 99px;
}

/* ── 樂器切換 ────────────────────────────────────────────────────── */
.instrument-toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--color-accent-light);
  border-radius: var(--radius-md);
  padding: .75rem 1.25rem;
  margin-bottom: 1rem;
}
.instrument-toggle__label {
  font-weight: 600;
  font-size: .95rem;
}
.toggle-group {
  display: flex;
  gap: .4rem;
}
.toggle-btn {
  padding: .35rem .9rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: .9rem;
  transition: all var(--transition);
}
.toggle-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ── Step2 日曆布局 ──────────────────────────────────────────────── */
.step2-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 700px) {
  .step2-layout { grid-template-columns: 1fr; }
}
.calendar-wrap {
  min-width: 280px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
}
.timeslot-wrap { flex: 1; }
.timeslot-hint { color: var(--color-text-muted); }
.timeslot-date {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.timeslot-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: .9rem 1.2rem;
  margin-bottom: .5rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  transition: all var(--transition);
}
.timeslot-btn:hover:not(:disabled) {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}
.timeslot-btn--selected {
  border-color: var(--color-primary) !important;
  background: var(--color-primary) !important;
  color: #fff !important;
}
.timeslot-btn--occupied {
  background: var(--color-border);
  color: var(--color-text-muted);
  cursor: not-allowed;
}
.timeslot-btn__status {
  font-size: .78rem;
  background: var(--color-text-muted);
  color: #fff;
  padding: .15rem .5rem;
  border-radius: 99px;
}

/* ── 小排練室時段選擇 ─────────────────────────────────────────────── */
.practice-slot-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.practice-slot-form label {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  font-weight: 600;
  font-size: .9rem;
}
.practice-slot-form select {
  padding: .6rem .8rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: .95rem;
  background: #fff;
  cursor: pointer;
}
.practice-slot-info { font-size: .9rem; font-weight: 600; }
.practice-slot-info--ok    { color: var(--color-success); }
.practice-slot-info--error { color: var(--color-error); }

/* ── Step3 加購 ──────────────────────────────────────────────────── */
.recording-package-section {
  background: var(--color-accent-light);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 700;
}
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: 12px;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}
.toggle-switch input:checked + .toggle-slider { background: var(--color-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }
.recording-note {
  font-size: .82rem;
  color: var(--color-text-secondary);
  margin-top: .4rem;
}

.addons-section { margin-bottom: 1rem; }
.addon-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: .4rem;
  cursor: pointer;
  transition: background var(--transition);
}
.addon-item:hover { background: var(--color-accent-light); }
.addon-item input[type=checkbox] { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--color-primary); }
.addon-item__name { flex: 1; font-weight: 600; }
.addon-item__price { color: var(--color-accent); font-weight: 700; font-size: .9rem; }
.addon-item__price em { font-style: italic; color: var(--color-warning); }

.no-addons { color: var(--color-text-muted); font-style: italic; }

.tbd-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  padding: .75rem 1rem;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 600;
  margin: 1rem 0;
  border: 1px solid #fcd39a;
}

.package-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1.5rem;
}
.package-card h3 { font-size: 1rem; margin-bottom: 1rem; }
.package-plans { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.package-plan {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: .1rem .75rem;
  padding: .6rem .8rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}
.package-plan__name  { font-weight: 700; font-size: .9rem; }
.package-plan__price { font-weight: 800; color: var(--color-accent); grid-row: span 2; align-self: center; }
.package-plan__desc  { font-size: .78rem; color: var(--color-text-secondary); }

.interested-check {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-size: .9rem;
}
.interested-check input { accent-color: var(--color-primary); }

/* ── Step4 表單 ──────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.2rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .4rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: .95rem;
  font-family: var(--font-sans);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}
.form-group input.field--error,
.form-group textarea.field--error { border-color: var(--color-error); }
.field-error-msg { display: block; color: var(--color-error); font-size: .8rem; margin-top: .3rem; }

.required { color: var(--color-error); }

.captcha-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
#captcha-canvas {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
#f-captcha { width: 140px; letter-spacing: .1em; text-transform: uppercase; }

/* ── Step5 確認摘要 ──────────────────────────────────────────────── */
.summary-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.summary-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .9rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--color-border);
}
.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.summary-table td {
  padding: .45rem .2rem;
  vertical-align: top;
}
.summary-table td:first-child {
  width: 110px;
  color: var(--color-text-secondary);
  font-weight: 600;
  padding-right: .75rem;
}
.summary-total td {
  font-weight: 800;
  font-size: 1.05rem;
  border-top: 2px solid var(--color-border);
  padding-top: .6rem;
}
.summary-total td:last-child { color: var(--color-accent); }
.tbd-note { color: var(--color-warning); font-size: .82rem; margin-top: .5rem; }
.tax-note  { color: var(--color-text-muted); font-size: .78rem; margin-top: .4rem; }

/* ── 右側報價面板 ────────────────────────────────────────────────── */
.price-panel {
  position: sticky;
  top: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
}
.price-panel__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .75rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: .5rem;
}
.price-panel__venue { font-weight: 700; margin-bottom: .3rem; }
.price-panel__venue--empty { color: var(--color-text-muted); font-style: italic; font-weight: normal; }
.price-panel__date { font-size: .85rem; color: var(--color-text-secondary); margin-bottom: .75rem; }
.price-panel__breakdown { margin-bottom: .75rem; }
.price-panel__item {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  padding: .2rem 0;
  color: var(--color-text-secondary);
}
.price-panel__total {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 1.05rem;
  border-top: 2px solid var(--color-border);
  padding-top: .5rem;
  color: var(--color-accent);
}
.price-panel__empty { color: var(--color-text-muted); font-size: .88rem; text-align: center; padding: 1rem 0; }
.price-panel__note { font-size: .75rem; color: var(--color-text-muted); margin-top: .5rem; }

/* ── 購物車清單 ──────────────────────────────────────────────────── */
.empty-list-hint {
  color: var(--color-text-muted);
  font-style: italic;
  padding: 1rem 0;
}

#btn-add-item {
  margin-bottom: 1.5rem;
}

.booking-item-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
}
.booking-item-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .4rem;
}
.booking-item-card__venue {
  font-weight: 700;
  font-size: 1rem;
}
.booking-item-card__detail {
  display: flex;
  gap: 1rem;
  font-size: .88rem;
  color: var(--color-text-secondary);
  margin-bottom: .4rem;
  flex-wrap: wrap;
}
.booking-item-card__price {
  font-weight: 800;
  color: var(--color-accent);
  font-size: .95rem;
}

/* ── Draft 表單 ──────────────────────────────────────────────────── */
.draft-form {
  background: var(--color-bg);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.draft-form__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}
.draft-form__actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

.draft-price-line {
  background: var(--color-accent-light);
  border-radius: var(--radius-md);
  padding: .75rem 1rem;
  margin-top: 1rem;
  font-size: .9rem;
}
.draft-price-line__detail {
  color: var(--color-text-secondary);
  margin-bottom: .25rem;
}
.draft-price-line__total {
  font-weight: 800;
  color: var(--color-accent);
  font-size: 1rem;
}

#draft-addons-wrap h4 {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: .6rem;
}

/* 手機：底部摺疊面板 */
@media (max-width: 900px) {
  /* 無項目時：隱藏面板（不遮擋內容）*/
  .price-panel {
    display: none;
  }

  /* 有項目時才顯示，固定在底部 */
  .price-panel.has-items {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0,0,0,.15);
    max-height: 50vh;
    overflow-y: auto;
    /* 預設只露出 header 約 52px */
    transform: translateY(calc(100% - 52px));
    transition: transform .3s ease;
  }
  .price-panel.has-items.open {
    transform: translateY(0);
  }

  /* 讓 header 看起來像一個 tab */
  .price-panel.has-items .price-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: .5rem;
  }
  .price-panel.has-items .price-panel__header::after {
    content: '▲';
    font-size: .85rem;
    color: var(--color-text-muted);
    transition: transform .3s ease;
  }
  .price-panel.has-items.open .price-panel__header::after {
    transform: rotate(180deg);
  }

  /* 底部內容區域留出空間（避免被面板遮住）*/
  .booking-main {
    padding-bottom: 4rem;
  }
}
