/* ===== Search Filter Widget - JAM Style Accordion ===== */
:root {
    --sf-primary: #111;
    --sf-accent: #111;
    --sf-bg: #fff;
    --sf-border: #ddd;
    --sf-text: #222;
    --sf-text-sub: #888;
}

/* Floating Button */
.sf-float-btn {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99990;
    writing-mode: vertical-rl;
    background: var(--sf-primary);
    color: #fff;
    border: none;
    border-radius: 10px 0 0 10px;
    padding: 24px 14px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .2em;
    cursor: pointer;
    box-shadow: -2px 2px 16px rgba(0, 0, 0, .3);
    transition: background .2s, padding .2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sf-float-btn:hover {
    background: #333;
    padding: 26px 16px;
}

.sf-float-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Overlay */
.sf-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99991;
    background: rgba(0, 0, 0, .4);
    opacity: 0;
    transition: opacity .3s;
}

.sf-overlay.active {
    display: block;
    opacity: 1;
}

/* Modal */
.sf-modal {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100vw;
    z-index: 99992;
    background: var(--sf-bg);
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    overflow: hidden;
    flex-direction: column;
    font-family: 'Noto Sans JP', -apple-system, sans-serif;
}

.sf-modal.active {
    display: flex;
    transform: translateX(0);
}

@media (max-width: 480px) {
    .sf-modal {
        width: 100vw;
    }

    .sf-float-btn {
        top: auto;
        bottom: 25%;
        transform: none;
    }
}

/* Header */
.sf-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #111;
    color: #fff;
    flex-shrink: 0;
}

.sf-header h2 {
    font-size: 15px;
    margin: 0;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.sf-header-notice {
    flex: 1;
    font-size: 10px;
    line-height: 1.4;
    color: rgba(255, 255, 255, .8);
}

.sf-header-notice b {
    color: #ff4444;
}

.sf-close-x {
    background: none;
    border: none;
    font-size: 24px;
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.sf-close-x:hover {
    color: #fff;
}

/* Scroll Body */
.sf-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== Accordion Sections ===== */
.sf-accordion {
    border-bottom: 1px solid var(--sf-border);
}

/* Gender Static Block */
.sf-gender-block {
    padding: 14px 20px 10px;
    background: #fafafa;
    border-bottom: 4px solid #eee;
}

.sf-gender-label {
    font-size: 13px;
    font-weight: 700;
    color: #d00;
    text-align: center;
    margin-bottom: 10px;
}

.sf-gender-row {
    display: flex;
    justify-content: space-between;
}

.sf-gender-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 6px;
    width: 32%;
    padding: 10px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #555;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.sf-gender-opt svg {
    width: 22px;
    height: 22px;
    color: #444;
}

.sf-gender-opt.active {
    background: #111;
    color: #fff;
    border-color: #111;
}

.sf-gender-opt.active svg {
    color: #fff;
}

/* Locked Accordions (for restricted gender filters) */
.sf-accordion.sf-locked {
    pointer-events: none;
    background: #fafafa;
}

.sf-accordion.sf-locked .sf-accordion-header {
    background: #fafafa;
}

.sf-accordion.sf-locked .sf-accordion-label,
.sf-accordion.sf-locked .sf-accordion-icon {
    color: #ccc;
}

.sf-accordion.sf-locked .sf-accordion-chevron {
    display: none;
}


.sf-accordion-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
    transition: background .15s;
}

.sf-accordion-header:hover {
    background: #f8f8f8;
}

.sf-accordion-icon {
    width: 28px;
    height: 28px;
    color: #222;
    flex-shrink: 0;
}

.sf-accordion-icon svg {
    width: 100%;
    height: 100%;
}

.sf-accordion-label {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--sf-text);
}

.sf-accordion-selected {
    font-size: 11px;
    color: var(--sf-text-sub);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sf-accordion-chevron {
    width: 20px;
    height: 20px;
    color: #999;
    transition: transform .2s;
    flex-shrink: 0;
}

.sf-accordion-chevron svg {
    width: 100%;
    height: 100%;
}

.sf-accordion.open .sf-accordion-chevron {
    transform: rotate(180deg);
}

.sf-accordion-body {
    display: none;
    padding: 0 20px 16px;
}

.sf-accordion.open .sf-accordion-body {
    display: block;
}

/* Buttons inside accordion */
.sf-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sf-opt {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: 1.5px solid var(--sf-border);
    border-radius: 6px;
    background: #fff;
    color: var(--sf-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    user-select: none;
}

.sf-opt:hover {
    border-color: #999;
    background: #f5f5f5;
}

.sf-opt.active {
    background: var(--sf-accent);
    color: #fff;
    border-color: var(--sf-accent);
}

.sf-opt-none {
    border-style: dashed;
    color: var(--sf-text-sub);
}

.sf-opt-none.active {
    background: #555;
    border-color: #555;
    color: #fff;
}

/* Category icon buttons (larger) */
.sf-cat-opt {
    flex: 0 0 calc(33.33% - 6px);
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 10px 4px;
    min-height: 72px;
    font-size: 12px;
    font-weight: 700;
}

.sf-cat-opt .sf-cat-icon {
    display: block;
    width: 32px;
    height: 32px;
    margin: 0 auto 4px;
    color: #111;
}

.sf-cat-opt.active .sf-cat-icon {
    color: #fff;
}

.sf-cat-opt .sf-cat-icon svg {
    width: 100%;
    height: 100%;
}

/* Sub-options (pills) */
.sf-sub-wrap {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--sf-border);
}

.sf-sub-wrap.active {
    display: block;
}

.sf-sub-title {
    font-size: 11px;
    color: var(--sf-text-sub);
    margin-bottom: 6px;
    font-weight: 600;
}

.sf-sub-opt {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 20px;
}

.sf-sub-opt.active {
    background: #111;
    border-color: #111;
    color: #fff;
}

/* cat3 */
.sf-sub3-wrap {
    display: none;
    margin-top: 8px;
    padding-left: 8px;
}

.sf-sub3-wrap.active {
    display: block;
}

.sf-sub3-opt {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 16px;
}

.sf-sub3-opt.active {
    background: #333;
    border-color: #333;
    color: #fff;
}

/* Color dots */
.sf-color-opt {
    gap: 6px;
    padding: 6px 10px;
}

.sf-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #ccc;
    display: inline-block;
}

.sf-color-opt.active {
    background: #f0f0f0;
    border-color: #111;
    border-width: 2px;
    color: #111;
}

/* Brand Tabs */
.sf-brand-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--sf-border);
    margin-bottom: 8px;
    overflow-x: auto;
}

.sf-brand-tab {
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sf-text-sub);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}

.sf-brand-tab:hover {
    color: var(--sf-text);
}

.sf-brand-tab.active {
    color: #111;
    border-bottom-color: #111;
}

.sf-brand-list {
    display: none;
}

.sf-brand-list.active {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ===== Footer ===== */
.sf-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--sf-border);
    background: #fff;
}

.sf-footer-btns {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--sf-border);
}

.sf-footer-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--sf-text);
    cursor: pointer;
    transition: background .15s;
}

.sf-footer-btn:hover {
    background: #f5f5f5;
}

.sf-footer-btn:first-child {
    border-right: 1px solid var(--sf-border);
}

.sf-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border: none;
    background: #111;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .05em;
    cursor: pointer;
    transition: background .2s;
}

.sf-search-btn:hover {
    background: #333;
}

.sf-search-btn.sf-disabled {
    background: #ccc;
    cursor: not-allowed;
    pointer-events: none;
}

.sf-search-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}