/**
 * 工作室預約頁面樣式
 * 參考 member.php 風格，保留舊版預約介面設計
 */

/* 工作室頁面專屬變數 - 不覆寫全局設計系統變數 */
:root {
    --studio-primary: var(--color-primary);
    --studio-primary-dark: var(--color-primary-dark);
    --studio-bg: var(--bg-body);
    /* 工作室專屬品牌色邊框（比全局 --border-color 更溫暖） */
    --studio-border-color: rgba(170, 145, 119, 0.15);
    --card-shadow: var(--shadow-card, 0 10px 30px rgba(170, 145, 119, 0.08));
}

/* 操作教學按鈕（固定浮動） */
.tour-guide-btn {
    top: 100px;
    right: 20px;
    z-index: 1030;
    border-radius: var(--radius-btn, 50px);
    padding: 8px 16px;
}

/* 禁用按鈕樣式 */
.disabled-state {
    opacity: 0.5;
    cursor: not-allowed !important;
    background: var(--border-color) !important;
    border-color: var(--border-color) !important;
    color: var(--text-muted) !important;
}

body {
    background-color: var(--studio-bg);
}

/* 簡約容器 */
.studio-booking-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

@media (max-width: 991px) {
    .studio-booking-container {
        padding: 20px 15px;
    }
}

/* 麵包屑 - 簡化樣式 */
.breadcrumb-section {
    margin-bottom: 20px;
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.breadcrumb-item a:hover {
    color: var(--studio-primary);
}

.breadcrumb-item.active {
    color: var(--text-main);
    font-size: 0.9rem;
}

/* 步驟指示器 */
.booking-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
    padding: 0 1rem;
}

.booking-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 15%;
    right: 15%;
    height: 2px;
    background: var(--studio-border-color);
    z-index: 1;
    transform: translateY(-50%);
}

.booking-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    padding: 0 1.5rem;
    background: var(--studio-bg);
    flex: 0 0 auto;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(170, 145, 119, 0.1);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid var(--studio-border-color);
    margin-bottom: 0.5rem;
}

.booking-step.active .step-number {
    background: var(--studio-primary);
    color: var(--text-on-primary);
    border-color: var(--studio-primary);
    box-shadow: 0 4px 12px rgba(170, 145, 119, 0.3);
}

.booking-step.completed .step-number {
    background: var(--studio-primary);
    color: var(--text-on-primary);
    border-color: var(--studio-primary);
}

.step-text {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.booking-step.active .step-text {
    color: var(--studio-primary);
    font-weight: 600;
}

.booking-step.completed .step-text {
    color: var(--studio-primary);
}

@media (max-width: 767px) {
    .booking-steps {
        margin-bottom: 30px;
        padding: 0 0.5rem;
    }

    .booking-steps::before {
        left: 10%;
        right: 10%;
    }

    .booking-step {
        padding: 0 0.75rem;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }

    .step-text {
        font-size: 0.75rem;
    }
}

/* 頁面標題 */
.page-title {
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 10px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

/* 預約內容卡片 */
.booking-content-card {
    background: var(--bg-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    padding: 30px;
    margin-bottom: 30px;
}

/* 篩選器卡片 */
.filters-card {
    background: var(--bg-surface);
    border-radius: var(--radius-card, 16px) var(--radius-card, 16px) 0 0;
    box-shadow: var(--card-shadow);
    padding: 30px;
    margin-bottom: 0;
}

.sticky-filters-header {
    position: sticky;
    top: 80px;
    z-index: 1020;
    margin-bottom: 0;
    background: var(--bg-surface);
    border-radius: var(--radius-card, 16px) var(--radius-card, 16px) 0 0;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

/* ── 篩選器折疊：filters-card 加 max-height 動畫 ── */
#filters-card-main {
    overflow: hidden;
    max-height: 1200px;
    transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.sticky-filters-header.filters-collapsed #filters-card-main {
    max-height: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* ── 摘要列（收合時顯示） ── */
.filters-summary-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
}

.sticky-filters-header.filters-collapsed .filters-summary-bar {
    display: flex;
}

.filters-summary-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.filters-summary-info i {
    color: var(--studio-primary, var(--color-primary));
    flex-shrink: 0;
}

.filters-summary-dot {
    color: var(--border-color);
    flex-shrink: 0;
}

.filters-summary-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 6px 14px;
    background: transparent;
    border: 1.5px solid var(--studio-primary, var(--color-primary));
    border-radius: 50px;
    color: var(--studio-primary, var(--color-primary));
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filters-summary-toggle:hover {
    background: rgba(170, 145, 119, 0.08);
}

/* ── 收合按鈕（展開狀態時顯示在 filters-card 底部） ── */
.filters-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px 16px;
    margin-top: 4px;
    background: transparent;
    border: none;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filters-collapse-btn:hover {
    background: rgba(170, 145, 119, 0.05);
    color: var(--studio-primary, var(--color-primary));
}

.filters-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0;
}

/* 篩選器展開/收合按鈕 */
.filter-toggle-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border: 1.5px solid var(--studio-border-color);
    border-radius: 12px;
    background: var(--bg-surface);
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.filter-toggle-btn:hover {
    border-color: var(--studio-primary);
    background: rgba(170, 145, 119, 0.05);
    color: var(--studio-primary);
}

.filter-toggle-btn i {
    transition: transform 0.3s ease;
}

.filter-toggle-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.filter-toggle-btn[aria-expanded="true"] {
    border-color: var(--studio-primary);
    background: rgba(170, 145, 119, 0.05);
}

/* 表單元素優化 */
.form-select-modern {
    border: 1.5px solid var(--studio-border-color);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: var(--bg-surface);
}

.form-select-modern:focus {
    border-color: var(--studio-primary);
    box-shadow: 0 0 0 3px rgba(170, 145, 119, 0.1);
    outline: none;
}

/* 按鈕優化 */
.btn-outline-modern {
    border: 1.5px solid var(--studio-border-color);
    border-radius: 12px;
    padding: 12px 20px;
    font-weight: 500;
    color: var(--text-main);
    background: var(--bg-surface);
    transition: all 0.3s ease;
}

.btn-outline-modern:hover {
    border-color: var(--studio-primary);
    background: rgba(170, 145, 119, 0.05);
    color: var(--studio-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(170, 145, 119, 0.15);
}

.btn-primary-modern {
    background: var(--studio-primary);
    border: none;
    border-radius: var(--radius-btn, 50px);
    padding: 14px 28px;
    font-weight: 500;
    color: var(--text-on-primary);
    transition: all 0.3s ease;
}

.btn-primary-modern:hover:not(:disabled) {
    background: var(--studio-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(170, 145, 119, 0.3);
    color: var(--text-on-primary);
}

.btn-primary-modern:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 日期選擇器 */
/* 日期選擇器 */
.date-scroller {
    display: block;
    /* 改為區塊以容納新的內部結構 */
    width: 100%;
    padding: 0;
    overflow: visible;
    /* 內部自己處理捲動 */
}

.date-picker-wrapper {
    background: var(--bg-surface);
    border-radius: var(--radius-card, 16px);
    overflow: hidden;
    width: 100%;
}

/* 頂部標題列 */
.date-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px 16px;
    margin-bottom: 8px;
}

.date-picker-header .header-left,
.date-picker-header .header-right {
    flex: 0 0 auto;
    width: 60px;
    /* 固寬以確保置中 */
}

.date-picker-header .header-right {
    text-align: right;
}

.date-picker-header .header-center {
    flex: 1;
    text-align: center;
}

.current-month {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn-today {
    background: var(--bg-surface);
    border: 1px solid var(--studio-border-color);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-today:hover {
    border-color: var(--studio-primary);
    color: var(--studio-primary);
}

.btn-today.active {
    background: var(--studio-primary);
    color: var(--text-on-primary);
    border-color: var(--studio-primary);
}

.btn-calendar {
    background: transparent;
    border: none;
    padding: 4px;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
}

.btn-calendar:hover {
    color: var(--studio-primary);
}

/* 日期捲動區域 */
.date-picker-body {
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 8px 12px 8px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    padding: 8px;
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s ease;
    flex: 0 0 30px;
}

.nav-btn:hover {
    color: var(--studio-primary);
}

.date-list {
    flex: 1;
    /* 佔據剩餘空間 */
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    /* 日期之間的間距較小 */
    scroll-behavior: smooth;
    padding: 0 4px;
    width: 100%;
    /* 確保有寬度 */
    /* 確保容器可以被捲動 */
    min-width: 0;
}

.date-list::-webkit-scrollbar {
    display: none;
}

/* 單個日期項目 */
.date-item {
    flex: 0 0 auto;
    width: 44px;
    /* 縮小寬度 */
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 24px;
    /* 圓角膠囊狀 */
    transition: all 0.3s ease;
    gap: 4px;
}

.date-item:hover {
    background-color: rgba(170, 145, 119, 0.05);
}

/* .date-item.active 樣式主要作用於子元素 .day-num */

.day-zh {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 2px;
}

.day-num {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.date-item.active .day-zh {
    color: var(--studio-primary);
    /* 選中時星期也變色？看截圖好像還好，但變色比較明顯 */
    font-weight: 600;
}

.date-item.active .day-num {
    background-color: var(--studio-primary);
    /* 只有數字背景變色 */
    color: var(--text-on-primary);
    box-shadow: 0 2px 8px rgba(170, 145, 119, 0.4);
}

/* 手機版調整 */
@media (max-width: 576px) {
    .date-picker-header {
        padding: 10px 12px 5px 12px;
    }

    .date-item {
        width: 40px;
    }

    .nav-btn {
        display: none;
        /* 手機版隱藏左右箭頭，直接滑動 */
    }
}

/* 時間網格容器 */
.time-grid-container {
    padding: 0;
    min-height: 400px;
    overflow: visible;
}

/* 主要內容卡片 */
.booking-surface {
    background: var(--bg-surface);
    border-radius: 0 0 var(--radius-card, 16px) var(--radius-card, 16px);
    box-shadow: var(--card-shadow);
    padding: 0 24px 24px 24px;
    margin-top: 0;
    border-top: 1px solid var(--studio-border-color);
    position: relative;
}

/* 電腦版左右切換按鈕 */
.scroll-controls {
    position: fixed;
    top: 50vh;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 calc((100vw - min(100vw, 1400px)) / 2 + 20px);
    box-sizing: border-box;
}

.scroll-btn {
    pointer-events: all;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid var(--studio-border-color);
    color: var(--studio-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.scroll-btn:hover {
    background: var(--bg-surface);
    border-color: var(--studio-primary);
    box-shadow: 0 4px 12px rgba(170, 145, 119, 0.2);
    transform: scale(1.1);
}

.scroll-btn:active {
    transform: scale(0.95);
}

.scroll-btn i {
    font-size: 1.2rem;
}

.scroll-btn-left {
    order: 1;
}

.scroll-btn-right {
    order: 2;
}

.scroll-btn:disabled,
.scroll-btn[style*="opacity: 0.3"] {
    opacity: 0.3 !important;
    cursor: not-allowed;
}

.scroll-btn[style*="opacity: 0.3"]:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 包月方案資訊橫幅 - 已移除 */

.specific-bed-grid {
    overflow-x: auto;
    overflow-y: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(170, 145, 119, 0.3) transparent;
    touch-action: pan-x pan-y;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    width: 100%;
    height: auto;
    position: relative;
    /* 確保水平滑動優先 */
    will-change: scroll-position;
}

.specific-bed-grid::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.specific-bed-grid::-webkit-scrollbar-track {
    background: transparent;
}

.specific-bed-grid::-webkit-scrollbar-thumb {
    background: rgba(170, 145, 119, 0.3);
    border-radius: 4px;
}

.specific-bed-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(170, 145, 119, 0.5);
}

/* 垂直滾動條樣式 */
.specific-bed-grid::-webkit-scrollbar:vertical {
    width: 6px;
}

@media (max-width: 991px) {
    .specific-bed-grid {
        overflow-x: scroll !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        touch-action: pan-x pan-y !important;
        /* 確保水平滑動優先 */
        overscroll-behavior-x: contain;
        overscroll-behavior-y: auto;
        /* 強制啟用水平滾動 */
        scroll-behavior: smooth;
    }

    /* 確保在手機上可以水平滑動 */
    .specific-bed-grid-inner {
        touch-action: pan-x pan-y;
    }
}

.specific-bed-grid-inner {
    display: flex;
    gap: 0;
    padding: 0;
    margin: 0;
    width: max-content;
    min-width: 100%;
    height: max-content;
    /* 確保內容寬度足夠觸發水平滾動 */
    flex-wrap: nowrap;
}

.bed-column {
    flex: 0 0 110px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    padding: 0;
    width: 110px;
    box-sizing: border-box;
}

.bed-column .time-slot+.time-slot {
    border-top: none;
}

.bed-header {
    font-weight: bold;
    text-align: center;
    padding: 8px 5px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-main);
}

/* 床位標題可點擊顯示照片 */
.bed-header-cell.bed-photo-trigger {
    transition: all 0.3s ease;
}

.bed-header-cell.bed-photo-trigger:hover {
    background-color: rgba(170, 145, 119, 0.1);
    color: var(--studio-primary);
}

/* 床位表頭選取狀態 */
.bed-header-cell.bed-selected {
    background-color: rgba(170, 145, 119, 0.15) !important;
    border-color: var(--studio-primary) !important;
    border-width: 2px !important;
    color: var(--studio-primary) !important;
    font-weight: 700;
    box-shadow: 0 0 0 2px rgba(170, 145, 119, 0.2);
}

.bed-column .time-slot {
    padding: 12px 8px;
    border-radius: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    font-weight: 500;
    text-align: center;
    border: 1px solid var(--studio-border-color);
    border-right: none;
    border-left: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 65px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 110px;
    margin: 0;
    background: var(--bg-surface);
    box-shadow: none;
    box-sizing: border-box;
}

.bed-column:first-child .time-slot {
    border-left: 1px solid var(--studio-border-color);
}

/* 第一欄的左側圓角 */
.bed-column:first-child .time-slot:first-child {
    border-top-left-radius: 12px;
}

.bed-column:first-child .time-slot:last-child {
    border-bottom-left-radius: 12px;
}

/* 最後一欄的右側圓角和邊框 */
.bed-column:last-child .time-slot {
    border-right: 1px solid var(--studio-border-color);
    border-left: none;
}

.bed-column:last-child .time-slot:first-child {
    border-top-right-radius: 12px;
}

.bed-column:last-child .time-slot:last-child {
    border-bottom-right-radius: 12px;
}

/* 確保時間網格整體有圓角 */
.time-grid-container {
    overflow: hidden;
}

.specific-bed-grid {
    border-radius: 12px;
    overflow: hidden;
}

.bed-column .time-slot.available:hover {
    border-color: var(--studio-primary);
    background: rgba(170, 145, 119, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(170, 145, 119, 0.2);
}

.bed-column .time-slot.booked {
    background-color: var(--bg-body);
    color: var(--text-secondary);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.6;
}

.bed-column .time-slot.selected {
    background-color: var(--studio-primary);
    color: var(--text-on-primary);
    border-color: var(--studio-primary);
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(170, 145, 119, 0.3);
    font-weight: 600;
    z-index: 1;
    position: relative;
}

.bed-column .time-slot.past {
    background-color: var(--bg-body);
    color: var(--text-secondary);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.6;
}

.bed-column .time-slot.closed {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    cursor: not-allowed;
    border: 1.5px solid #ef9a9a;
    font-weight: 600;
}

.bed-column .time-slot.my-booking {
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.15) 0%, rgba(170, 145, 119, 0.08) 100%);
    color: var(--studio-primary-dark, var(--color-primary-dark));
    border-top: none !important;
    border-bottom: none !important;
    cursor: not-allowed;
    font-weight: 600;
    position: relative;
}

/* 保留第一欄和最後一欄的左右邊框 */
.bed-column:first-child .time-slot.my-booking {
    border-left: 1px solid var(--studio-border-color);
}

.bed-column:last-child .time-slot.my-booking {
    border-right: 1px solid var(--studio-border-color);
    border-left: none;
}

.bed-column .time-slot.my-booking::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 8px,
            rgba(170, 145, 119, 0.05) 8px,
            rgba(170, 145, 119, 0.05) 16px);
    pointer-events: none;
    opacity: 0.3;
}

/* 編輯模式樣式 - 使用品牌色調，與整體設計一致 */
.time-slot.editing {
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.18) 0%, rgba(170, 145, 119, 0.1) 100%) !important;
    color: var(--studio-primary-dark, var(--color-primary-dark)) !important;
    border: 2px solid var(--studio-primary, var(--color-primary)) !important;
    border-radius: 12px;
    position: relative;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(170, 145, 119, 0.3), inset 0 0 0 1px rgba(170, 145, 119, 0.1);
    z-index: 2;
}

/* 編輯模式標記點 */
.time-slot.editing::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    background: var(--studio-primary, var(--color-primary));
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 2px 4px rgba(170, 145, 119, 0.3);
    z-index: 3;
}

/* 編輯模式時，如果同時有 selected 類別，優先顯示編輯樣式 */
.time-slot.editing.selected {
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.18) 0%, rgba(170, 145, 119, 0.1) 100%) !important;
    color: var(--studio-primary-dark, var(--color-primary-dark)) !important;
    border: 2px solid var(--studio-primary, var(--color-primary)) !important;
    transform: none;
}

/* 特殊時段樣式 */
.time-slot.off-peak {
    border-color: var(--studio-primary) !important;
    border-width: 2px;
}

.time-slot.peak {
    border-color: var(--color-danger) !important;
    border-width: 2px;
}

/* 床位標題滾動容器 */
.bed-header-scroller {
    overflow-x: auto;
    background-color: var(--bg-surface);
    scrollbar-width: thin;
    scrollbar-color: rgba(170, 145, 119, 0.3) transparent;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    padding: 12px 16px;
    padding-bottom: 0;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 80px;
    z-index: 1019;
    border-top: 1px solid var(--studio-border-color);
    touch-action: pan-x;
    overscroll-behavior-x: contain;
}

.bed-header-scroller::-webkit-scrollbar {
    height: 6px;
}

.bed-header-scroller::-webkit-scrollbar-track {
    background: transparent;
}

.bed-header-scroller::-webkit-scrollbar-thumb {
    background: rgba(170, 145, 119, 0.3);
    border-radius: 4px;
}

.bed-header-scroller::-webkit-scrollbar-thumb:hover {
    background: rgba(170, 145, 119, 0.5);
}

@media (max-width: 991px) {
    .bed-header-scroller {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
}

.bed-header-scroller::-webkit-scrollbar {
    display: none;
}

.bed-header-row {
    display: flex;
    gap: 0;
    padding: 0;
}

.bed-header-cell {
    flex: 0 0 110px;
    flex-shrink: 0;
    font-weight: 600;
    text-align: center;
    padding: 12px 8px;
    font-size: 0.9rem;
    color: var(--text-main);
    background-color: rgba(170, 145, 119, 0.05);
    border-radius: 0;
    border: 1px solid var(--studio-border-color);
    border-right: none;
    border-left: none;
    margin: 0;
    width: 110px;
    box-sizing: border-box;
}

.bed-header-cell:first-child {
    border-top-left-radius: 12px;
    border-left: 1px solid var(--studio-border-color);
}

.bed-header-cell:last-child {
    border-right: 1px solid var(--studio-border-color);
    border-top-right-radius: 12px;
}

/* 確保床位標題容器有圓角 */
.bed-header-scroller .bed-header-row {
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
    width: max-content;
    min-width: 100%;
}

/* 側邊欄 */
.desktop-sidebar {
    display: none;
}

@media (min-width: 992px) {
    .desktop-sidebar {
        display: block;
        width: 360px;
        flex-shrink: 0;
        margin-left: 30px;
        position: sticky;
        top: 100px;
        padding-top: 0;
    }
}

.sidebar-card {
    background: var(--bg-surface);
    border-radius: var(--radius-card, 16px);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.sidebar-header {
    padding: 24px 24px 0;
    border-bottom: 1px solid var(--studio-border-color);
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.sidebar-body {
    padding: 24px;
}

.summary-content {
    min-height: 100px;
}

/* 預約摘要列表 */
.summary-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 預約摘要項目卡片 */
.summary-item-card {
    background: rgba(170, 145, 119, 0.03);
    border: 1.5px solid var(--studio-border-color);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.summary-item-card:hover {
    border-color: var(--studio-primary);
    background: rgba(170, 145, 119, 0.05);
    box-shadow: 0 2px 8px rgba(170, 145, 119, 0.1);
}

.summary-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.summary-item-info {
    flex: 1;
}

.summary-bed-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.summary-date-time {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.summary-time {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}

.summary-delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 12px;
    border: 1.5px solid var(--color-danger);
    color: var(--color-danger);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
}

.summary-delete-btn:hover {
    background: var(--color-danger);
    color: var(--text-on-primary);
    transform: scale(1.1);
}

.summary-delete-btn:active {
    transform: scale(0.95);
}

.summary-delete-btn i {
    font-size: 0.85rem;
}

.summary-item-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--studio-border-color);
}

.summary-price-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.summary-price-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--studio-primary);
}

/* 空狀態 */
.summary-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.summary-empty i {
    font-size: 3rem;
    color: var(--text-secondary);
    opacity: 0.3;
    margin-bottom: 16px;
}

.summary-empty p {
    margin: 0;
    font-size: 0.95rem;
}

.sidebar-divider {
    height: 1px;
    background: var(--studio-border-color);
    margin: 20px 0;
}

.total-price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.total-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-main);
}

.total-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--studio-primary);
}

/* 行動版頁腳 */
#mobile-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1.5px solid var(--studio-border-color);
    z-index: 1030;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

@media (min-width: 992px) {
    #mobile-footer {
        display: none;
    }
}

.footer-content {
    display: none;
}

.footer-content.active-footer {
    display: block;
}

/* 倒數計時器 */
.countdown-timer-wrapper {
    display: none;
    padding: 12px 0;
    margin-bottom: 16px;
}

.countdown-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.countdown-text {
    min-width: 80px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.progress-modern {
    height: 8px;
    border-radius: 50px;
    background-color: rgba(170, 145, 119, 0.1);
    overflow: hidden;
    flex: 1;
}

.progress-modern .progress-bar {
    background-color: var(--studio-primary);
    transition: width 1s linear;
    border-radius: 50px;
}

/* Modal 優化 */
.modal-content-modern {
    border-radius: var(--radius-card);
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header-modern {
    border-bottom: 1px solid var(--studio-border-color);
    padding: 24px;
}

.modal-header-modern .modal-title {
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
}

.modal-header-modern .modal-title i {
    color: var(--studio-primary);
}

.modal-footer-modern {
    border-top: 1px solid var(--studio-border-color);
    padding: 20px 24px;
}

/* 按鈕樣式 */
.btn-modern {
    padding: 12px 24px;
    border-radius: var(--radius-btn);
    font-weight: 500;
    font-size: 0.95rem;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    transform: none !important;
}

/* 載入覆蓋層 */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(249, 248, 246, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

/* 載入內容容器 */
#loading-overlay .loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border-radius: var(--radius-card, 16px);
    padding: 40px 50px;
    box-shadow: var(--card-shadow, 0 10px 30px rgba(170, 145, 119, 0.2));
    border: 1px solid var(--border-color, rgba(170, 145, 119, 0.15));
    min-width: 280px;
}

/* 載入動畫 */
.loader {
    position: relative;
    width: 64px;
    height: 64px;
    margin-bottom: 24px;
}

.loader::before,
.loader::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--studio-primary, var(--color-primary));
    border-right-color: var(--studio-primary, var(--color-primary));
    animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.loader::before {
    width: 64px;
    height: 64px;
    border-width: 4px;
    opacity: 0.3;
}

.loader::after {
    width: 48px;
    height: 48px;
    top: 8px;
    left: 8px;
    border-width: 3px;
    opacity: 0.6;
    animation-duration: 0.8s;
    animation-direction: reverse;
}

/* 載入訊息樣式 */
.loading-message {
    color: var(--text-main, #4A4A4A) !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    margin-top: 0 !important;
    text-align: center;
    letter-spacing: 0.5px;
    font-family: 'Noto Sans TC', sans-serif;
}

/* 載入動畫旋轉 */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 響應式調整 */
@media (max-width: 768px) {
    #loading-overlay .loading-content {
        padding: 30px 40px;
        min-width: 240px;
        margin: 0 20px;
    }

    .loader {
        width: 56px;
        height: 56px;
        margin-bottom: 20px;
    }

    .loader::before {
        width: 56px;
        height: 56px;
    }

    .loader::after {
        width: 42px;
        height: 42px;
        top: 7px;
        left: 7px;
    }

    .loading-message {
        font-size: 1rem !important;
    }
}

/* 確認和付款頁面 */
.view {
    display: none;
}

.view.active-view {
    display: block;
}

/* 視圖內容包裝器 - 統一風格 */
.view-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 991px) {
    .view-content-wrapper {
        padding: 0 15px;
    }
}

/* 確認視圖和付款視圖的卡片樣式 */
#confirmation-view .card,
#payment-view .card {
    background: var(--bg-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    border: none;
    margin-bottom: 20px;
}

#confirmation-view .card-header,
#payment-view .card-header {
    background: transparent;
    border-bottom: 1px solid var(--studio-border-color);
    padding: 20px 24px;
}

#confirmation-view .card-body,
#payment-view .card-body {
    padding: 24px;
}

#confirmation-view .card-title,
#payment-view .card-title {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0;
}

#confirmation-view h5,
#confirmation-view h6,
#payment-view h5,
#payment-view h6 {
    font-weight: 600;
    color: var(--text-main);
}

#confirmation-view .btn,
#payment-view .btn {
    border-radius: var(--radius-btn);
    font-weight: 500;
    padding: 12px 24px;
}

.summary-list-group .list-group-item {
    border: none;
    padding: 0.5rem 0;
}

.payment-option {
    border: 1.5px solid var(--studio-border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--bg-surface);
}

.payment-option:hover {
    border-color: var(--studio-primary);
    background: rgba(170, 145, 119, 0.05);
}

.payment-option.active {
    border-color: var(--studio-primary);
    box-shadow: 0 0 0 3px rgba(170, 145, 119, 0.1);
    background: rgba(170, 145, 119, 0.05);
}

/* 加購項目 */
.addon-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1.5px solid var(--studio-border-color);
}

.addon-item:last-child {
    border-bottom: none;
}

.addon-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 12px;
    margin-right: 1rem;
}

/* 服務項目篩選 */
.service-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.service-check-item {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border: 1.5px solid var(--studio-border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-surface);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

.service-check-item:hover {
    border-color: var(--studio-primary);
    background: rgba(170, 145, 119, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(170, 145, 119, 0.15);
}

.service-check-item input {
    display: none;
}

.service-check-item:has(input:checked) {
    background-color: rgba(170, 145, 119, 0.1);
    border-color: var(--studio-primary);
    font-weight: 600;
    color: var(--studio-primary);
    box-shadow: 0 0 0 3px rgba(170, 145, 119, 0.1);
}

/* 響應式設計 */
@media (max-width: 991px) {
    .filters-card {
        padding: 20px;
        margin-bottom: 20px;
    }

    .filter-section {
        gap: 10px;
    }

    .time-grid-container {
        padding: 20px 0 180px;
        /* 為行動版頁腳預留空間 */
    }

    .date-card {
        flex: 0 0 65px;
        padding: 12px 6px;
    }

    /* 手機版確認視圖和付款視圖的卡片樣式 */
    #confirmation-view .card,
    #payment-view .card {
        margin-bottom: 16px;
    }

    #confirmation-view .card-body,
    #payment-view .card-body {
        padding: 20px;
    }

    #confirmation-view .card-header,
    #payment-view .card-header {
        padding: 16px 20px;
    }

    /* 手機版按鈕樣式 */
    #mobile-footer .btn {
        border-radius: var(--radius-btn);
        font-weight: 500;
    }
}

@media (min-width: 992px) {
    .main-content-wrapper {
        display: flex;
        align-items: flex-start;
    }

    .booking-content {
        flex: 1;
        min-width: 0;
    }
}

/* ========================================
   SweetAlert2 自定義樣式
   ======================================== */

/* 彈窗主體 */
.swal2-popup {
    border-radius: var(--radius-card, 16px) !important;
    box-shadow: var(--card-shadow, 0 10px 30px rgba(170, 145, 119, 0.2)) !important;
    font-family: 'Noto Sans TC', sans-serif !important;
    padding: 2rem !important;
}

/* 標題 */
.swal2-title {
    color: var(--text-main, #4A4A4A) !important;
    font-weight: 600 !important;
    font-size: 1.5rem !important;
    margin-bottom: 1rem !important;
}

/* 內容文字 */
.swal2-html-container {
    color: var(--text-main, #4A4A4A) !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

/* 確認按鈕 - 使用品牌主色 */
.swal2-confirm {
    background-color: var(--studio-primary, var(--color-primary)) !important;
    border-radius: var(--radius-btn, 50px) !important;
    padding: 12px 32px !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(170, 145, 119, 0.3) !important;
}

.swal2-confirm:hover {
    background-color: var(--studio-primary-dark, var(--color-primary-dark)) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(170, 145, 119, 0.4) !important;
}

.swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(170, 145, 119, 0.3) !important;
}

/* 取消按鈕 */
.swal2-cancel {
    background-color: transparent !important;
    border: 2px solid var(--studio-primary, var(--color-primary)) !important;
    color: var(--studio-primary, var(--color-primary)) !important;
    border-radius: var(--radius-btn, 50px) !important;
    padding: 10px 30px !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
}

.swal2-cancel:hover {
    background-color: var(--studio-primary, var(--color-primary)) !important;
    color: var(--text-on-primary) !important;
    transform: translateY(-2px) !important;
}

.swal2-cancel:focus {
    box-shadow: 0 0 0 3px rgba(170, 145, 119, 0.2) !important;
}

/* 按鈕容器 */
.swal2-actions {
    gap: 1rem !important;
    margin-top: 1.5rem !important;
}

/* 成功圖標 - 使用品牌主色 */
.swal2-icon.swal2-success {
    border-color: var(--studio-primary, var(--color-primary)) !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: var(--studio-primary, var(--color-primary)) !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(170, 145, 119, 0.3) !important;
}

/* 錯誤圖標 */
.swal2-icon.swal2-error {
    border-color: #e74c3c !important;
}

/* 警告圖標 */
.swal2-icon.swal2-warning {
    border-color: #f39c12 !important;
    color: #f39c12 !important;
}

/* 資訊圖標 */
.swal2-icon.swal2-info {
    border-color: var(--studio-primary, var(--color-primary)) !important;
    color: var(--studio-primary, var(--color-primary)) !important;
}

/* 問題圖標 */
.swal2-icon.swal2-question {
    border-color: var(--studio-primary, var(--color-primary)) !important;
    color: var(--studio-primary, var(--color-primary)) !important;
}

/* 輸入框樣式 */
.swal2-input,
.swal2-textarea,
.swal2-select {
    border: 1px solid var(--border-color, rgba(170, 145, 119, 0.15)) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    font-family: 'Noto Sans TC', sans-serif !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
}

.swal2-input:focus,
.swal2-textarea:focus,
.swal2-select:focus {
    border-color: var(--studio-primary, var(--color-primary)) !important;
    box-shadow: 0 0 0 3px rgba(170, 145, 119, 0.1) !important;
    outline: none !important;
}

/* 圖片容器 */
.swal2-image {
    border-radius: 12px !important;
    margin: 1rem 0 !important;
}

/* 關閉按鈕 */
.swal2-close {
    color: var(--text-light, #999999) !important;
    font-size: 2rem !important;
    transition: all 0.3s ease !important;
}

.swal2-close:hover {
    color: var(--studio-primary, var(--color-primary)) !important;
}

/* 進度條 */
.swal2-timer-progress-bar {
    background-color: var(--studio-primary, var(--color-primary)) !important;
}

/* 驗證訊息 */
.swal2-validation-message {
    background-color: rgba(231, 76, 60, 0.1) !important;
    color: #e74c3c !important;
    border-radius: 12px !important;
    padding: 8px 12px !important;
}

/* 載入動畫 */
.swal2-loader {
    border-color: var(--studio-primary, var(--color-primary)) transparent var(--studio-primary, var(--color-primary)) transparent !important;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .swal2-popup {
        padding: 1.5rem !important;
        width: calc(100% - 2rem) !important;
        max-width: 400px !important;
    }

    .swal2-title {
        font-size: 1.25rem !important;
    }

    .swal2-html-container {
        font-size: 0.9rem !important;
    }

    .swal2-confirm,
    .swal2-cancel {
        padding: 10px 24px !important;
        font-size: 0.9rem !important;
    }
}
/* Flatpickr 金色主題覆蓋 */
.flatpickr-day.selected, 
.flatpickr-day.startRange, 
.flatpickr-day.endRange, 
.flatpickr-day.selected.inRange, 
.flatpickr-day.startRange.inRange, 
.flatpickr-day.endRange.inRange, 
.flatpickr-day.selected:focus, 
.flatpickr-day.startRange:focus, 
.flatpickr-day.endRange:focus, 
.flatpickr-day.selected:hover, 
.flatpickr-day.startRange:hover, 
.flatpickr-day.endRange:hover, 
.flatpickr-day.selected.prevMonthDay, 
.flatpickr-day.startRange.prevMonthDay, 
.flatpickr-day.endRange.prevMonthDay, 
.flatpickr-day.selected.nextMonthDay, 
.flatpickr-day.startRange.nextMonthDay, 
.flatpickr-day.endRange.nextMonthDay {
    background: var(--studio-primary) !important;
    border-color: var(--studio-primary) !important;
}

.flatpickr-day.today {
    border-color: var(--studio-primary) !important;
}

.flatpickr-day.today:hover,
.flatpickr-day.today:focus {
    background: var(--studio-primary) !important;
    border-color: var(--studio-primary) !important;
    color: var(--text-on-primary) !important;
}

.flatpickr-months .flatpickr-month {
    background: var(--studio-primary) !important;
    color: var(--text-on-primary) !important;
    fill: var(--text-on-primary) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--studio-primary) !important;
}

.flatpickr-weekdays {
    background: var(--studio-primary) !important;
}

span.flatpickr-weekday {
    background: var(--studio-primary) !important;
    color: var(--text-on-primary) !important;
}

.flatpickr-months .flatpickr-prev-month, 
.flatpickr-months .flatpickr-next-month {
    color: var(--text-on-primary) !important;
    fill: var(--text-on-primary) !important;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: #f0f0f0 !important;
}

/* ==========================================================
   偏好分店篩選器樣式
   ========================================================== */

/* 分店 checkbox 網格樣式 */
.store-filter-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    padding: 8px 0;
}

.store-checkbox-item {
    position: relative;
}

.store-checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.store-checkbox-label {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: var(--card-bg);
    border: 2px solid var(--studio-border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    font-size: 13px;
    min-height: 44px;
}

.store-checkbox-label:hover {
    border-color: var(--studio-primary);
    background: rgba(170, 145, 119, 0.05);
}

.store-checkbox-item input[type="checkbox"]:checked + .store-checkbox-label {
    background: linear-gradient(135deg, var(--studio-primary) 0%, var(--studio-primary-dark) 100%);
    border-color: var(--studio-primary);
    color: var(--text-on-primary);
}

.store-checkbox-label .checkbox-icon {
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-radius: 4px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.store-checkbox-item input[type="checkbox"]:checked + .store-checkbox-label .checkbox-icon {
    background: white;
    border-color: var(--text-on-primary);
}

.store-checkbox-item input[type="checkbox"]:checked + .store-checkbox-label .checkbox-icon::after {
    content: '✓';
    color: var(--studio-primary);
    font-weight: bold;
    font-size: 12px;
}

.store-checkbox-label .store-name {
    flex: 1;
    font-weight: 500;
    line-height: 1.2;
}

/* 偏好分店計數徽章 */
#preferred-studios-count {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--studio-primary);
}

/* 清除篩選按鈕 */
#clear-studios-filter {
    border-radius: var(--radius-btn);
    transition: all 0.3s ease;
}

#clear-studios-filter:hover {
    background: var(--color-danger);
    border-color: var(--color-danger);
    color: var(--text-on-primary);
}

/* 記住偏好核取方塊 */
#remember-studios-preference {
    cursor: pointer;
}

#remember-studios-preference + .form-check-label {
    cursor: pointer;
    user-select: none;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .store-filter-checkbox-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   高縮放比例/小視口優化
   當使用者放大頁面或使用小螢幕時的優化
   ========================================================== */

/* 針對視口高度較小的情況（放大或小螢幕） */
@media (max-height: 700px) {
    /* 減少固定頭部的空間佔用 */
    .sticky-filters-header {
        top: 60px;
    }

    .bed-header-scroller {
        top: 60px;
        padding: 8px 0;
    }

    /* 短螢幕下摘要列預設出現（JS 同步加 .filters-collapsed class） */
    .filters-collapse-btn {
        display: none; /* 短螢幕下隱藏收合按鈕（已自動收合） */
    }

    .filter-toggle-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    /* 減少步驟指示器的高度 */
    .booking-steps {
        padding: 12px 0;
        margin-bottom: 12px;
    }

    .booking-step {
        padding: 8px 12px;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    .step-text {
        font-size: 0.85rem;
    }

    /* 減少側邊欄的 sticky 位置 */
    .desktop-sidebar {
        top: 80px;
    }

    /* 調整手機版頁腳的內距 */
    #mobile-footer {
        padding: 12px 16px;
    }

    #mobile-footer .footer-content {
        padding: 12px 0;
    }
}

/* 針對視口高度極小的情況（高度縮放或橫向手機） */
@media (max-height: 500px) {
    /* 將 sticky 元素改為 relative，允許滾動查看 */
    .sticky-filters-header {
        position: relative;
        top: auto;
    }

    .bed-header-scroller {
        position: relative;
        top: auto;
    }

    .desktop-sidebar {
        position: relative;
        top: auto;
        margin-top: 20px;
    }

    /* 大幅減少垂直間距 */
    .booking-steps {
        padding: 8px 0;
        margin-bottom: 8px;
    }

    .breadcrumb-section {
        margin-bottom: 8px;
    }

    .filters-card {
        margin-bottom: 8px;
    }

    /* 手機版頁腳改為較小高度 */
    #mobile-footer {
        padding: 8px 12px;
    }
}

/* 針對寬度較小且高度較小的情況（雙重壓縮） */
@media (max-width: 768px) and (max-height: 600px) {
    /* 簡化佈局，隱藏非必要元素 */
    .breadcrumb-section {
        display: none;
    }

    #tour-guide-btn {
        display: none;
    }

    /* 步驟指示器改為更緊湊的版本 */
    .booking-steps {
        padding: 6px 0;
        margin-bottom: 6px;
    }

    .step-text {
        display: none;
    }

    .booking-step {
        padding: 6px 8px;
    }

    .step-number {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
        margin: 0;
    }

    /* 時間網格使用更緊湊的間距 */
    .time-grid-container {
        padding: 8px;
    }

    .time-label {
        font-size: 0.75rem;
        padding: 4px;
    }

    .time-slot {
        min-height: 32px;
        font-size: 0.75rem;
    }
}

/* 針對極端縮放情況（視口寬度小於 400px） */
@media (max-width: 400px) {
    /* 進一步簡化介面 */
    .filter-toggle-btn {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .booking-step {
        padding: 4px 6px;
    }

    .step-number {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }

    /* 調整字體大小以適應小空間 */
    body {
        font-size: 13px;
    }

    .time-slot {
        font-size: 0.7rem;
        min-height: 28px;
    }

    .bed-name {
        font-size: 0.75rem;
    }

    /* 手機版頁腳使用更緊湊的佈局 */
    #mobile-footer {
        padding: 6px 10px;
    }

    #mobile-total-price {
        font-size: 1.2rem;
    }

    #mobile-next-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* 針對使用 iOS Safari 的縮放檢測 */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) and (max-height: 600px) {
        /* iOS Safari 特定優化 */
        .sticky-filters-header {
            position: -webkit-sticky;
            position: sticky;
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }

        /* 確保固定元素不會因 iOS 縮放而錯位 */
        #mobile-footer {
            position: fixed;
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }
    }
}

/* 改善觸控目標大小（適用於所有縮放情況） */
@media (pointer: coarse) {
    /* 確保觸控目標至少 44x44 像素（Apple 建議） */
    .time-slot {
        min-height: 44px;
        min-width: 44px;
    }

    .store-checkbox-label {
        min-height: 44px;
        padding: 12px;
    }

    .filter-toggle-btn {
        min-height: 44px;
    }

    button, .btn {
        min-height: 44px;
        padding: 10px 16px;
    }
}

/* 為主內容區域添加適當的 padding，避免被固定元素遮擋 */
@media (max-width: 991px) {
    .studio-booking-container {
        padding-bottom: 180px; /* 為手機版頁腳預留空間 */
    }

    .booking-surface {
        min-height: calc(100vh - 400px); /* 確保有足夠的滾動空間 */
    }
}

/* 檢測高 DPI 顯示器並優化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* 在高 DPI 顯示器上使用稍大的字體以提高可讀性 */
    .time-slot {
        font-size: 0.85rem;
    }

    .bed-name {
        font-size: 0.9rem;
    }
}
