/* shop/wizard.css：公開店家頁樣式第 2／4 支「預約精靈、空狀態、載入中、頁尾、Toast、響應式、Safe area、員工排班」（2026-10-12 由 shop.css 第 1194～2030 行逐字切出；依 public/shop.html 的 link 順序串接＝原檔）---- 以下逐字搬自拆分前的 shop.css ---- */
/* ========================================
   預約 Wizard
   ======================================== */

.booking-wizard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.booking-wizard-overlay.active { display: flex; }

.booking-wizard {
    background: var(--shop-card);
    border-radius: var(--shop-radius-lg) var(--shop-radius-lg) 0 0;
    max-width: var(--shop-content-width);
    width: 100%;
    max-height: 90vh;
    /* 手機網址列收合／鍵盤彈出時跟著可視高度走（不支援 dvh 的瀏覽器沿用上一行） */
    max-height: 90dvh;
    overflow-y: auto;
    /* 聚焦欄位時瀏覽器自己的捲動也要讓出 sticky 頁首與底部按鈕列（含提示那一行） */
    scroll-padding-top: 4.5rem;
    scroll-padding-bottom: 7rem;
    animation: slideUp 0.3s var(--shop-ease);
}

.wizard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 0.5px solid var(--shop-border);
    position: sticky;
    top: 0;
    background: var(--shop-card);
    z-index: 2;
    border-radius: var(--shop-radius-lg) var(--shop-radius-lg) 0 0;
}

.wizard-header h5 {
    font-weight: 600;
    margin: 0;
    font-size: 1.0625rem;
    letter-spacing: -0.015em;
}

.wizard-close {
    background: var(--shop-surface);
    border: none;
    font-size: 1.125rem;
    cursor: pointer;
    color: var(--shop-text-secondary);
    padding: 0;
    line-height: 1;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s var(--shop-ease);
}

.wizard-close:hover { background: var(--shop-border); }

.wizard-body { padding: 1.5rem; }

/* 步驟指示器 */
.wizard-steps {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 0;
}

.wizard-step-dot {
    flex: 1;
    height: 3px;
    background: var(--shop-border);
    border-radius: 2px;
    transition: background 0.3s ease;
}

.wizard-step-dot.active { background: var(--shop-accent); }
.wizard-step-dot.completed { background: var(--shop-accent); opacity: 0.5; }

/* 日期選擇 */
.date-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

@media (min-width: 480px) {
    .date-grid { grid-template-columns: repeat(5, 1fr); }
}

.date-btn {
    background: var(--shop-card);
    border: 1px solid var(--shop-border);
    border-radius: var(--shop-radius-sm);
    padding: 0.625rem 0.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s var(--shop-ease);
    font-size: 0.8125rem;
    box-shadow: var(--shop-shadow-xs);
}

.date-btn:hover {
    box-shadow: var(--shop-shadow);
    transform: translateY(-1px);
}

.date-btn.selected {
    background: var(--shop-text);
    border-color: var(--shop-text);
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.date-btn-day {
    font-size: 0.6875rem;
    color: var(--shop-text-muted);
    margin-bottom: 0.125rem;
}

.date-btn.selected .date-btn-day {
    color: rgba(255,255,255,0.65);
}

.date-btn-date {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

/* 員工選擇 */
.staff-option {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: var(--shop-card);
    border: 1px solid var(--shop-border);
    border-radius: var(--shop-card-radius);
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: all 0.2s var(--shop-ease);
    box-shadow: var(--shop-shadow-xs);
}

.staff-option:hover {
    box-shadow: var(--shop-shadow);
    transform: translateY(-1px);
}

.staff-option.selected {
    box-shadow: 0 0 0 2px var(--shop-accent), var(--shop-shadow);
    border-color: transparent;
    background: var(--shop-card);
}

.staff-option.disabled {
    opacity: 0.35;
    pointer-events: none;
}

.staff-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--shop-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 600;
    color: var(--shop-text-secondary);
    font-size: 0.875rem;
    overflow: hidden;
}

.staff-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--shop-text);
}

.staff-slots {
    font-size: 0.75rem;
    color: var(--shop-text-muted);
    margin-top: 0.125rem;
}

/* 時段選擇 */
.time-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

@media (min-width: 480px) {
    .time-grid { grid-template-columns: repeat(4, 1fr); }
}

.time-btn {
    background: var(--shop-card);
    border: 1px solid var(--shop-border);
    border-radius: var(--shop-radius-sm);
    padding: 0.625rem;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s var(--shop-ease);
    color: var(--shop-text);
    box-shadow: var(--shop-shadow-xs);
}

.time-btn:hover {
    box-shadow: var(--shop-shadow);
    transform: translateY(-1px);
}

.time-btn.selected {
    background: var(--shop-text);
    border-color: var(--shop-text);
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 確認畫面 */
.booking-summary {
    background: var(--shop-surface);
    border-radius: var(--shop-radius);
    padding: 1rem 1.25rem;
}

.booking-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6875rem 0;
    font-size: 0.875rem;
}

.booking-summary-row:not(:last-child) {
    border-bottom: 0.5px solid var(--shop-border);
}

.booking-summary-label { color: var(--shop-text-muted); }

.booking-summary-value {
    font-weight: 600;
    text-align: right;
    color: var(--shop-text);
}

/* 填資料那一步的摘要可收合（2026-10-01 UX 第 2 波）：原生 <details>，沒有 CSS／JS 也開得了。
   收合時那一行寫「服務・日期時段・金額」。 */
.booking-summary-fold {
    background: var(--shop-surface);
    border-radius: var(--shop-radius);
}
.booking-summary-fold > .booking-summary { padding-top: 0; }
.booking-summary-toggle {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.25rem;
    min-height: 44px;
    cursor: pointer;
    list-style: none;
    font-size: 0.875rem;
}
.booking-summary-toggle::-webkit-details-marker { display: none; }
.booking-summary-toggle::after {
    content: '';
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 1.5px solid var(--shop-text-muted);
    border-bottom: 1.5px solid var(--shop-text-muted);
    transform: rotate(45deg);
    margin: -0.25rem 0.125rem 0 0;
    transition: transform 0.2s var(--shop-ease);
}
.booking-summary-fold[open] > .booking-summary-toggle::after {
    transform: rotate(-135deg);
    margin-top: 0.25rem;
}
.booking-summary-toggle-label {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--shop-text);
}
.booking-summary-brief {
    flex: 1;
    min-width: 0;
    text-align: right;
    color: var(--shop-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.booking-summary-brief-amount {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--shop-text);
}
/* 打開時明細已經寫了一遍，摘要那一行就不必重複 */
.booking-summary-fold[open] .booking-summary-brief,
.booking-summary-fold[open] .booking-summary-brief-amount { visibility: hidden; }
.booking-summary-toggle:focus-visible {
    outline: none;
    box-shadow: var(--shop-shadow-focus);
    border-radius: var(--shop-radius);
}

/* 表單 */
.wizard-form-group { margin-bottom: 1.25rem; }

.wizard-form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
    color: var(--shop-text-secondary);
}

.wizard-form-group input,
.wizard-form-group textarea {
    width: 100%;
    padding: 0.6875rem 1rem;
    border: 1px solid var(--shop-border);
    border-radius: var(--shop-radius-sm);
    font-size: 0.9375rem;
    font-family: var(--shop-font);
    background: var(--shop-surface);
    color: var(--shop-text);
    outline: none;
    -webkit-appearance: none;
    transition: box-shadow 0.2s var(--shop-ease);
}

.wizard-form-group input::placeholder,
.wizard-form-group textarea::placeholder {
    color: var(--shop-text-muted);
}

.wizard-form-group input:focus,
.wizard-form-group textarea:focus {
    box-shadow: var(--shop-shadow-focus);
}

/* iPhone 對小於 16px 的輸入框一聚焦就整頁放大，放大後底部按鈕列與欄位位置全亂（2026-10-01 UX 第 2 波）。
   手機上精靈的輸入框一律 16px（結帳表單那一組寫在 .detail-modal-form 規則之後，否則會被後面的規則蓋掉）。 */
@media (max-width: 480px) {
    .wizard-form-group input,
    .wizard-form-group textarea {
        font-size: 16px;
    }
}

/* Wizard 按鈕 */
.wizard-footer {
    padding: 1rem 1.5rem 1.25rem;
    border-top: 0.5px solid var(--shop-border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    /* 釘在 wizard 底部，避免長表單把送出鍵推到摺疊線下方（與 .wizard-header 的 sticky top 對稱）*/
    position: sticky;
    bottom: 0;
    background: var(--shop-card);
    z-index: 2;
    box-shadow: 0 -8px 16px -10px rgba(0, 0, 0, 0.12);
}

.btn-wizard {
    flex: 1;
    padding: 0.8125rem;
    border-radius: var(--shop-radius);
    font-weight: 600;
    font-size: 0.9375rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s var(--shop-ease);
    letter-spacing: -0.01em;
}

.btn-wizard-primary {
    background: var(--shop-accent);
    color: var(--shop-accent-text, #fff);
}

.btn-wizard-primary:hover { filter: brightness(1.06); }
.btn-wizard-primary:active { transform: scale(0.98); }

/* 停用＝灰底深灰字（2026-09-30：原本 opacity 0.3 的淡粉底白字對比約 1.5:1，看起來像壞掉），
   為什麼按不了由 #wizardNextHint 那一行說明 */
.btn-wizard-primary:disabled {
    background: #e7e3dc;
    color: #5f5a53;
    opacity: 1;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

/* 進度文字「步驟 2／5」與「還缺什麼」提示 */
.wizard-step-label {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--shop-text-muted);
    font-variant-numeric: tabular-nums;
}
.wizard-next-hint {
    flex-basis: 100%;
    margin: 0;
    font-size: 0.8125rem;
    color: #5f5a53;
    text-align: center;
}
.wizard-next-hint[hidden] { display: none; }

.btn-wizard-secondary {
    background: var(--shop-surface);
    color: var(--shop-text);
}

.btn-wizard-secondary:hover { background: var(--shop-border); }
.btn-wizard-secondary:active { transform: scale(0.98); }

/* 成功 */
.booking-success {
    text-align: center;
    padding: 2.5rem 1rem;
}

.booking-success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(52,199,89,0.1);
    color: #34c759;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
}

.booking-success h4 {
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.375rem;
    letter-spacing: -0.02em;
}

.booking-success p {
    color: var(--shop-text-muted);
    font-size: 0.9375rem;
}

/* ========================================
   空狀態
   ======================================== */

.shop-empty {
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--shop-text-muted);
}

.shop-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--shop-border);
}

.shop-empty div { font-size: 0.9375rem; }
.shop-empty p { font-size: 0.8125rem; margin-top: 0.25rem; color: var(--shop-text-muted); }

/* ========================================
   Loading
   ======================================== */

.shop-loading {
    text-align: center;
    padding: 3rem;
    color: var(--shop-text-muted);
    font-size: 0.875rem;
}

.shop-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--shop-border);
    border-top-color: var(--shop-text-muted);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 0.75rem;
}

/* ========================================
   頁尾
   ======================================== */

.shop-footer {
    text-align: center;
    padding: 2rem 1rem 3rem;
    color: var(--shop-text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.01em;
    background: var(--shop-surface);
    border-top: 0.5px solid var(--shop-border);
}

.shop-footer a {
    color: var(--shop-text-secondary);
    text-decoration: none;
    font-weight: 500;
}

.shop-footer a:hover { color: var(--shop-accent); }

.shop-footer-brand {
    margin-bottom: 0.75rem;
}

.shop-footer-logo {
    height: 22px;
    opacity: 0.6;
    transition: opacity 0.2s;
    margin-bottom: 0.375rem;
}

.shop-footer-logo:hover { opacity: 1; }

.shop-footer-text {
    font-size: 0.75rem;
    color: var(--shop-text-muted);
}

.shop-footer-social {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 0.75rem 0;
    font-size: 1.125rem;
}

.shop-footer-social a {
    color: var(--shop-text-muted);
    transition: color 0.2s, transform 0.2s;
}

.shop-footer-social a:hover {
    color: var(--shop-accent);
    transform: scale(1.15);
}

.shop-footer-cta {
    margin-top: 0.75rem;
}

.shop-footer-cta a {
    display: inline-block;
    padding: 0.4375rem 1.125rem;
    border-radius: 100px;
    background: var(--shop-accent);
    color: var(--shop-accent-text, #fff);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s var(--shop-ease);
}

.shop-footer-cta a:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    color: #fff;
    box-shadow: var(--shop-shadow);
}

/* ========================================
   Toast
   ======================================== */

.shop-toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--shop-text);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 2000;
    box-shadow: var(--shop-shadow-lg);
    animation: fadeInDown 0.3s var(--shop-ease);
    display: none;
    max-width: calc(100vw - 2rem);
    text-align: center;
}

.shop-toast.show { display: block; }
/* 錯誤提示會停住等顧客按 ×（shop.utils.js showShopToast）；底色加深到白字 ≥ 4.5:1 */
.shop-toast.error { background: #c4271d; padding-right: 3rem; border-radius: 14px; }
.shop-toast-close {
    position: absolute;
    top: 50%;
    right: 0.25rem;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.shop-toast-close::before { content: '\00d7'; }
.shop-toast.success { background: #1f7a35; }

/* ========================================
   響應式
   ======================================== */

@media (min-width: 640px) {
    .shop-header { padding: 4.5rem 2rem 3.25rem; }
    .shop-name { font-size: 2.625rem; }
    .shop-header.has-banner { padding-bottom: 2.25rem; }
    .shop-content { padding: var(--shop-space-4) 1.5rem 4rem; }
    .service-card { padding: 1.25rem 1.375rem; }
    .wizard-body { padding: 1.75rem; }
    .products-grid { gap: 1.125rem; }
}

@media (max-width: 360px) {
    .shop-header { padding: 2.25rem 1rem 2rem; }
    .shop-name { font-size: 1.5rem; }
    .shop-content { padding: 1.25rem 1rem; }
    .date-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ========================================
   Safe area
   ======================================== */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .wizard-footer { padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
    .shop-footer { padding-bottom: calc(3rem + env(safe-area-inset-bottom)); }
}

/* ========================================
   員工排班區塊
   ======================================== */

.staff-schedule-section {
    margin-top: var(--shop-space-4);
    padding-top: var(--shop-space-3);
    border-top: 1px solid var(--shop-border);
}

.staff-schedule-title {
    font-family: var(--shop-font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--shop-text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.staff-schedule-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.staff-schedule-card {
    background: var(--shop-card);
    border: 1px solid var(--shop-border);
    border-radius: var(--shop-card-radius);
    padding: 1.25rem;
    box-shadow: var(--shop-shadow-xs);
    transition: transform 0.2s var(--shop-ease), box-shadow 0.2s var(--shop-ease);
}

.staff-schedule-card:hover {
    box-shadow: var(--shop-shadow);
}

.staff-schedule-card:hover {
    transform: translateY(-2px);
}

.staff-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.staff-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--shop-accent);
    color: var(--shop-accent-text, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    overflow: hidden;
}

.staff-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--shop-text);
}

.staff-card-bio {
    font-size: 0.8rem;
    color: var(--shop-text-muted);
    margin-top: 0.15rem;
}

.staff-today-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: auto;
    flex-shrink: 0;
}

.staff-today-badge.working {
    background: #dcfce7;
    color: #166534;
}

.staff-today-badge.off {
    background: #fef2f2;
    color: #991b1b;
}

.staff-today-badge.leave {
    background: #fef9c3;
    color: #854d0e;
}

.staff-today-badge.upcoming {
    background: #dbeafe;
    color: #1e40af;
}

.staff-week-schedule {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.35rem;
}

.staff-day-cell {
    text-align: center;
    padding: 0.4rem 0.15rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
}

.staff-day-cell .day-label {
    font-weight: 600;
    margin-bottom: 0.15rem;
    color: var(--shop-text-secondary);
}

/* 日期／星期固定各一行（2026-09-11 QA B4）：交給瀏覽器自己斷行時，字形窄的那一格（9/11）
   剛好塞得下一行、其他格斷兩行，同一排的時間就上下錯開。兩行都 nowrap、空的星期也保留行高。 */
.staff-day-cell .day-label .day-date,
.staff-day-cell .day-label .day-dow {
    display: block;
    white-space: nowrap;
    min-height: 1.2em;
    line-height: 1.2;
}

.staff-day-cell .day-time {
    color: var(--shop-text-muted);
    font-size: 0.65rem;
    line-height: 1.3;
}

.staff-day-cell.working {
    background: rgba(16, 185, 129, 0.08);
}

.staff-day-cell.off {
    background: var(--shop-surface);
    filter: grayscale(1); /* 原本 opacity:.55 讓日期與「公休」對比只剩 2.1（axe 2026-10-11）；改灰階＋照常字色 */
}

.staff-day-cell.off .day-time {
    font-style: italic;
}

/* 半天假／員工封鎖的時段註記（2026-09-11）：格子仍是上班色，下面多一行
   斷行：只准在「–」之後與空白處斷（keep-all 讓「請假」兩個字不被拆開），
   真的塞不下才退回任意斷。原本 break-all 在桌機窄格會斷成「11:00–1／7:00 請／假」。 */
.staff-day-cell .day-note {
    margin-top: 0.2rem;
    font-size: 0.6rem;
    line-height: 1.25;
    color: #b45309;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

@media (min-width: 640px) {
    .staff-schedule-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

