/* product_search — 검색 결과 전용 */

.item-search-page {
    background: #f7f8fa;
}

.item-search-page .item-search-section {
    padding: 24px 0 48px;
    overflow: visible;
}

.item-search-page .item-search-layout {
    max-width: 1280px;
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    .item-filter-list {
        width: 220px;
        min-width: 220px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 0;
        padding: 20px 16px;
        background: #fff;
        border-radius: 14px;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
        @media (max-width: 991px) {
            position: fixed;
            right: -100%;
            top: 0;
            z-index: 9999;
            width: 100%;
            height: 100%;
            overflow-y: auto;
            transition: right 0.5s;
            border-radius: 0;
            justify-content: flex-start;
            .first-category {
                padding-left: 16px;
                padding-right: 16px;
            }
        }
        form {width: 100%;}
        .filter-search-btn {
            width: 100%;
            text-align: center;
            margin-top: 20px;
            padding: 20px 0 10px;
            border-top: 1px solid #eceef2;
            display: flex;
            flex-direction: row;
            gap: 4px;
            justify-content: center;
            align-items: center;
            .refresh-btn {
                display: none;
                @media (max-width: 991px) {
                    display: block;
                }
            }
        }
        .filter-list-title {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
            gap: 4px;
            margin-bottom: 12px;
            padding: 0 10px 10px 10px;
            border-bottom: 1px solid #eceef2;
            width: 100%;
            span {
                font-size: 18px;
                font-weight: 700;
                color: #1a1d26;
                letter-spacing: -0.02em;
            }
            .refresh-btn {
                display: flex;
                flex-direction: row;
                justify-content: center;
                align-items: center;
                cursor: pointer;
                font-size: 14px;
                font-weight: 500;
                color: #6b7280;
                @media (max-width: 991px) {
                    display: none;
                }
            }
            .mobile-close-btn {
                display: none;
                @media (max-width: 991px) {
                    display: block;
                }
            }
        }
        .filter-choice {
            border-bottom: 1px solid #eceef2;
            padding-bottom: 16px;
            margin-bottom: 16px;
            @media (max-width: 991px) {
                width: 100%;
                padding-left: 16px;
                padding-right: 16px;
            }
            ul {
                display: flex;
                flex-direction: row;
                flex-wrap: wrap;
                gap: 4px;
                li {
                    display: flex;
                    flex-direction: row;
                    flex-wrap: nowrap;
                    gap: 2px;
                    justify-content: center;
                    align-items: center;
                    padding: 4px 4px 4px 10px;
                    background: var(--color-main-bg);
                    color: #fff;
                    border-radius: 50px;
                    width: fit-content;
                    span {
                        cursor: pointer;
                    }
                }
            }
        }
        .search-filter {
            width: 100%;
            .filter-box {
                padding-bottom: 16px;
                margin-bottom: 16px;
                border-bottom: 1px solid #eceef2;
                @media (max-width: 991px) {
                    padding-left: 16px;
                    padding-right: 16px;
                }
                &:last-child {
                    margin-bottom: 0;
                    border-bottom: none;
                }
                .filter-title {
                    font-weight: 600;
                    margin-bottom: 8px;
                }
                ul {
                    display: flex;
                    flex-direction: column;
                    justify-content: flex-start;
                    align-items: flex-start;
                    gap: 4px;
                }
                .filter-range {
                    display: flex;
                    flex-direction: row;
                    justify-content: center;
                    align-items: center;
                    gap: 4px;
                    .input-box {
                        width: calc(50% - 8px);
                        input {
                            height: 30px;
                            padding: 0 10px;
                            -moz-appearance: textfield;
                            &::-webkit-outer-spin-button,
                            &::-webkit-inner-spin-button {
                                -webkit-appearance: none;
                                margin: 0;
                            }
                        }
                    }
                }
                .filter-category {
                    overflow: hidden;
                    padding-top: 10px;
                    ul {
                        gap: 0;
                        height: 0;
                        overflow: hidden;
                    }
                    li {
                        width: 100%;
                        > div {
                            display: flex;
                            flex-direction: row;
                            justify-content: flex-start;
                            align-items: center;
                            gap: 10px;
                            padding: 4px 4px 4px 10px;
                            border-radius: 4px;
                            background: #fff;
                            a {
                                flex: 1;
                            }
                        }
                        > ul > li {
                            width: 100%;
                            div {
                                color: var(--color-gray-600);
                                padding-left: 1.5rem;
                            }
                            > ul > li {
                                width: 100%;
                                div {
                                    color: var(--color-gray-600);
                                    padding-left: 2.5rem;
                                }
                            }
                        }
                        &:has(.active) > div {
                            font-weight: 700;
                        }
                        &.active {
                            > div {
                                font-weight: 600;
                                color: var(--color-main-bg);
                            }
                            > ul {
                                height: fit-content;
                            }
                        }
                        &:hover > div {
                            font-weight: 600;
                            background: var(--color-main-bg-white);
                        }
                        &:hover:has(li:hover) > div {
                            background: #fff;
                        }
                    }
                }
            }
        }
    }
    .search-content {
        width: calc(100% - 240px);
        @media (max-width: 991px) {
            width: 100%;
        }
    }
}
.filter-mobile-box {
    display: none;
    @media (max-width: 991px) {
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        padding: 10px 10px 0;
        .filter-btn {
            display: flex;
            flex-direction: row;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            color: #6B7280;
        }
    }
}

/* ── 검색창 (컴팩트) ── */
.item-search-page .search-box {
    max-width: 560px;
    margin: 0 auto 16px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

@media (min-width: 992px) {
    .item-search-page .search-box {
        position: sticky;
        top: 30px;
        z-index: 100;
    }
}

.item-search-page .search-box form {
    border: 1px solid #e2e5eb;
    border-radius: 10px;
    padding: 0 4px 0 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.item-search-page .search-box form:focus-within {
    border-color: var(--color-main-font);
    box-shadow: 0 0 0 3px var(--color-main-bg-white);
}

.item-search-page .search-box form input {
    height: 40px;
    font-size: 14px;
    color: #1a1d26;
}

.item-search-page .search-box form input::placeholder {
    color: #9ca3af;
}

.item-search-page .search-box form .search {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: var(--color-main-bg-white);
    background-size: 18px;
    transition: background-color 0.2s ease;
}

.item-search-page .search-box form .search:hover {
    background-color: #d6e8ff;
}

.item-search-page .search-box .search-box-component#autocomplete-box {
    top: calc(100% + 6px);
    border-radius: 10px;
    border-color: #eceef2;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    z-index: 200;
    max-height: min(480px, calc(100vh - 120px));
}

/* ── 정렬·개수 ── */
.item-search-page .list-top-box {
    margin: 0 0 20px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.item-search-page .list-top-box p {
    font-size: 14px;
    color: #6b7280;
}

.item-search-page .list-top-box p b {
    color: #1a1d26;
    font-weight: 700;
}

.item-search-page .list-top-box ul li.active > * {
    color: var(--color-main-font);
    font-weight: 700;
}

/* ── 상품 그리드 ── */
.item-search-page #product-list.item-list-box,
.item-search-page #product-list.item-list-box ul {
    margin: 0;
}

.item-search-page #product-list.item-list-box ul {
    margin: 0 -6px -28px;
}

.item-search-page #product-list.item-list-box ul li {
    width: calc(20% - 12px);
    margin: 0 6px 28px;
}

.item-search-page .list-none-box {
    padding: 48px 24px;
    background: #fff;
    border-radius: 14px;
    border: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.item-search-page .list-none-box p {
    color: #6b7280;
    font-size: 15px;
}

/* ── 반응형 ── */
@media (max-width: 991px) {
    .item-search-page {
        background: #fff;
    }

    .item-search-page .item-search-section {
        padding: 16px 0 32px;
    }

    .item-search-page .search-box {
        position: sticky;
        top: 0;
        z-index: 100;
        max-width: none;
        margin-bottom: 12px;
        padding: 10px 12px;
        border-radius: 0;
        box-shadow: 0 1px 0 #eceef2;
        border-bottom: none;
    }

    .item-search-page .search-box form input {
        height: 38px;
        font-size: 14px;
    }

    .item-search-page .search-box form .search {
        width: 34px;
        height: 34px;
    }

    .item-search-page .list-top-box {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        /*border-bottom: 1px solid #eceef2;*/
    }

    .item-search-page #product-list.item-list-box {
        padding: 0 12px;
    }

    .item-search-page #product-list.item-list-box ul {
        margin: 0 -3px -18px;
    }

    .item-search-page #product-list.item-list-box ul li {
        width: calc(33.33% - 6px);
        margin: 0 3px 18px;
    }
}

@media (max-width: 570px) {
    .item-search-page #product-list.item-list-box ul li {
        width: calc(50% - 6px);
    }
}
