/* ==========================================
   找大師列表頁 - 專屬樣式
   ========================================== */

body {
    background-color: var(--light-bg);
    color: #333;
}

/* ── Filter Sidebar ──────────────────────── */
.filter-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

.filter-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark-bg);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--secondary-color);
}

.checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-item label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
    line-height: 1.4;
}

.price-range-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.price-range-inputs input {
    flex: 1;
    min-width: 0;
}

input[type="number"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Noto Sans TC', sans-serif;
    transition: border-color 0.2s;
    background: white;
    box-sizing: border-box;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ── Sort Bar ────────────────────────────── */
.sort-bar {
    padding: 0 0 14px 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: wrap;
}
.sort-bar::-webkit-scrollbar { display: none; }

.sort-bar-label {
    font-size: 12px;
    font-weight: 600;
    color: #bbb;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    padding-right: 4px;
    border-right: 1.5px solid #e8e8e8;
    margin-right: 4px;
    line-height: 1.8;
}

.sort-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1.5px solid #e0e0e0;
    background: transparent;
    color: #888;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Noto Sans TC', sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}

.sort-btn:hover {
    border-color: var(--primary-color);
    color: var(--accent-gold);
    background: rgba(244, 208, 184, 0.12);
}

.sort-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(234, 176, 135, 0.35);
}

/* ── Master Card ─────────────────────────── */
.master-card {
    background: white;
    border-radius: 16px;
    border: 2px solid rgba(244, 208, 184, 0.6);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.master-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(234, 176, 135, 0.2);
    transform: translateY(-4px);
}

.master-avatar {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: top;
    display: block;
    flex-shrink: 0;
}

.master-card-body {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.master-name {
    font-size: 17px;
    font-weight: 800;
    color: var(--dark-bg);
    margin-bottom: 3px;
    letter-spacing: 0.3px;
}

.master-title {
    font-size: 12px;
    color: var(--accent-gold);
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

.master-rating-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.rating-stars {
    color: var(--accent-gold);
    font-size: 14px;
    letter-spacing: 1.5px;
}

.rating-text {
    font-size: 12px;
    color: #aaa;
}

.master-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
}

.service-tag {
    display: inline-block;
    padding: 4px 11px;
    background: var(--secondary-color);
    color: var(--accent-gold);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid rgba(234, 176, 135, 0.3);
    letter-spacing: 0.3px;
}

.master-desc {
    font-size: 13px;
    color: #777;
    line-height: 1.7;
    margin-bottom: 14px;
    flex: 1;
    /* 限制行數，手機不撐高卡片 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.master-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(244, 208, 184, 0.15) 0%, rgba(244, 208, 184, 0.05) 100%);
    border-radius: 10px;
    border: 1px solid rgba(244, 208, 184, 0.4);
}

.master-price-label {
    font-size: 12px;
    color: #aaa;
    white-space: nowrap;
    font-weight: 500;
}

.master-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    letter-spacing: -0.5px;
}

.master-btns {
    display: flex;
    gap: 8px;
}

.master-btns .btn-secondary,
.master-btns .btn-primary {
    flex: 1;
    font-size: 13px;
    padding: 11px 8px;
    text-align: center;
    border-radius: 10px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}

/* ── Pagination ──────────────────────────── */
.pagination-wrap {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1.5px solid #e5e5e5;
    background: white;
    color: #666;
    font-size: 14px;
    font-family: 'Noto Sans TC', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.page-btn.active { background: var(--primary-color); color: white; border-color: var(--primary-color); font-weight: 700; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Mobile Sidebar (slide-in) ───────────── */
@media (max-width: 1023px) {
    .sidebar {
        position: fixed;
        left: -320px;
        top: 0;
        height: 100dvh;
        width: 300px;
        background: white;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 24px 16px;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    }

    .sidebar.open { left: 0; }

    .mobile-filter-btn { display: flex !important; }
}

@media (min-width: 1024px) {
    .mobile-filter-btn { display: none !important; }
}

/* ── 手機版補強 ───────────────────────────── */
@media (max-width: 767px) {
    .master-desc { -webkit-line-clamp: 2; }
    .master-price { font-size: 18px; }
}

/* ── 超小螢幕（≤ 375px）補強 ─────────────── */
@media (max-width: 375px) {
    .master-price { font-size: 16px; }
    .master-name  { font-size: 15px; }
    .master-btns .btn-secondary,
    .master-btns .btn-primary { font-size: 12px; padding: 9px 6px; }
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    -webkit-tap-highlight-color: transparent;
}
.sidebar-overlay.show { display: block; }
