/* ================================
   RS Musashi Filter v1.3.0
   ================================ */

.rsmf-sidebar *,
.rsmf-loop-wrapper * {
    box-sizing: border-box;
}

/* ---- 側欄 ---- */
.rsmf-sidebar {
    width: 100%;
    font-family: 'Noto Sans TC', sans-serif;
}

.rsmf-sidebar__inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rsmf-mobile-toggle {
    display: none;
}

/* Filter Section */
.rsmf-filter-section {
    padding-bottom: 32px;
    border-bottom: 1px solid #DDDDDD;
}
.rsmf-filter-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rsmf-filter-section__title {
    height: 80px;
    display: flex;
    align-items: center;
    color: #555555;
    font-size: 18px;
    font-weight: 700;
    line-height: 28.8px;
    letter-spacing: 1.8px;
}
.rsmf-filter-section--search .rsmf-filter-section__title {
    height: 81px;
}

/* 搜尋框 */
.rsmf-search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.rsmf-search-box__input {
    width: 100%;
    height: 46px;
    padding: 11px 46px 11px 16px;
    border: 1px solid #DDDDDD;
    border-radius: 10px;
    outline: none;
    font-size: 14px;
    font-family: 'Noto Sans TC', sans-serif;
    color: #333;
    background: #fff;
    transition: border-color 0.2s;
}
.rsmf-search-box__input:focus {
    border-color: #0A2F86;
}
.rsmf-search-box__icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
}

/* ---- 下拉選單（共用） ---- */
.rsmf-dropdown {
    position: relative;
}
.rsmf-dropdown + .rsmf-dropdown {
    margin-top: 10px;
}

.rsmf-dropdown__selected {
    height: 45px;
    padding: 0 16px;
    background: #EFEFEF;
    border: 1px solid #DDDDDD;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
}
.rsmf-dropdown__selected span:first-child {
    color: #555555;
    font-size: 14px;
    font-weight: 400;
    line-height: 22.4px;
    letter-spacing: 1.4px;
}
.rsmf-dropdown__arrow {
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}
.rsmf-dropdown.is-open .rsmf-dropdown__arrow {
    transform: rotate(180deg);
}
.rsmf-dropdown__list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #DDDDDD;
    border-radius: 10px;
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.rsmf-dropdown__item {
    padding: 10px 16px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    letter-spacing: 1.4px;
    transition: background 0.15s;
}
.rsmf-dropdown__item:hover {
    background: #f5f5f5;
}

/* ★ 子分類 disabled 樣式 */
.rsmf-dropdown.is-disabled .rsmf-dropdown__selected {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Checkbox 群組 */
.rsmf-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rsmf-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    cursor: pointer;
    user-select: none;
}
.rsmf-checkbox input[type="checkbox"] {
    display: none;
}
.rsmf-checkbox__box {
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 1px solid #CACACA;
    border-radius: 2px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.rsmf-checkbox input:checked + .rsmf-checkbox__box {
    background: #0A2F86;
    border-color: #0A2F86;
}
.rsmf-checkbox input:checked + .rsmf-checkbox__box::after {
    content: '';
    width: 8px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
}
.rsmf-checkbox__label {
    color: #222222;
    font-size: 16px;
    font-family: 'Noto Sans CJK TC', 'Noto Sans TC', sans-serif;
    font-weight: 400;
    line-height: 16px;
}

/* ---- LOOP ---- */
.rsmf-loop-wrapper {
    font-family: 'Noto Sans TC', sans-serif;
    width: 100%;
}

.rsmf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px 20px;
}

.rsmf-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-decoration: none;
    color: inherit;
}
.rsmf-card__image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}
.rsmf-card__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.rsmf-card__category {
    display: inline-flex;
    padding: 4px 20px;
    background: #0A2F86;
    border-radius: 17px;
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    line-height: 22.4px;
    letter-spacing: 1.4px;
    width: fit-content;
}
.rsmf-card__title {
    color: #24292A;
    font-size: 16px;
    font-weight: 400;
    line-height: 25.6px;
    letter-spacing: 1.6px;
    margin: 0;
}
.rsmf-card__subtitle {
    color: #24292A;
    font-size: 16px;
    font-weight: 400;
    line-height: 25.6px;
    letter-spacing: 1.6px;
    margin: 0;
}

.rsmf-loading {
    text-align: center;
    font-size: 16px;
    color: #555;
}

.rsmf-no-results {
    text-align: center;
    font-size: 16px;
    color: #777;
}

/* ---- 分頁 ---- */
.rsmf-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.rsmf-pagination__btn {
    width: 42px;
    height: 42px;
    border-radius: 21px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 400;
    line-height: 25.6px;
    letter-spacing: 1.6px;
    color: #0A2F86;
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: 'Noto Sans TC', sans-serif;
    transition: color 0.2s;
    padding: 0;
}
.rsmf-pagination__btn:hover {
    color: #555;
}
.rsmf-pagination__btn.is-active {
    background: #0A2F86;
    color: #FEFDF9;
}
.rsmf-pagination__btn.is-active:hover {
    color: #FEFDF9;
}
.rsmf-pagination__next {
    width: 42px;
    height: 42px;
    border-radius: 21px;
    background: #EFF1F5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    padding: 0;
    transition: opacity 0.2s;
}
.rsmf-pagination__next:hover {
    opacity: 0.8;
}

/* ---- RWD ---- */
@media (max-width: 1024px) {
    .rsmf-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 16px;
    }
}

@media (max-width: 768px) {
    .rsmf-mobile-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        cursor: pointer;
        border-bottom: 1px solid #DDDDDD;
        margin-bottom: 12px;
    }
    .rsmf-mobile-toggle__labels {
        display: flex;
        gap: 4px;
        color: #555;
        font-size: 16px;
        font-weight: 700;
        letter-spacing: 1.6px;
    }
    .rsmf-mobile-toggle__sep { color: #999; }
    .rsmf-mobile-toggle__arrow {
        display: flex;
        align-items: center;
        transition: transform 0.3s;
    }
    .rsmf-mobile-toggle.is-open .rsmf-mobile-toggle__arrow {
        transform: rotate(180deg);
    }

    .rsmf-sidebar__inner { display: none; }
    .rsmf-sidebar__inner.is-open { display: flex; }

    .rsmf-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 12px;
    }
}

@media (max-width: 480px) {
    .rsmf-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px 10px;
    }
    .rsmf-card__category {
        font-size: 12px;
        padding: 3px 14px;
    }
    .rsmf-card__title,
    .rsmf-card__subtitle {
        font-size: 14px;
        line-height: 22px;
    }
}
