/* product_list — 상품 목록 전용 */

.item-list-page {
    background: #f7f8fa;
}

.item-list-page .item-list-section {
    padding: 24px 0 48px;
}

.item-list-page .item-list-layout {
    align-items: flex-start;
    gap: 24px;
    max-width: 1280px;
    @media (max-width: 991px) {
        gap: 2px;
    }
}

/* ── 사이드바 카테고리 (sticky) ── */
@media (min-width: 992px) {
    .item-list-page .item-list-category {
        /*position: sticky;*/
        /*top: 30px;*/
        align-self: flex-start;
        max-height: calc(100vh - 30px);
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: #d1d5db transparent;
    }

    .item-list-page .item-list-category::-webkit-scrollbar {
        width: 4px;
    }

    .item-list-page .item-list-category::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 4px;
    }
}
.item-list-page .item-filter-layout {
    width: 220px !important;
    min-width: 220px !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
    @media (max-width: 991px) {
        width: 100% !important;
    }
    .item-filter-list {
        @media (max-width: 991px) {
            position: fixed;
            right: -100%;
            top: 0;
            z-index: 9999;
            height: 100%;
            overflow-y: auto;
            transition: right 0.5s;
            .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;
                        }
                    }
                }
            }
            input[type="text"] {
                height: 30px;
                text-align: left;
                font-size: 14px;
                padding: 0 10px;
            }
        }
    }
}
.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-list-page .item-list-category {
    width: 220px;
    min-width: 220px;
    margin-bottom: 0;
    padding: 20px 16px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.item-list-page .item-list-category .first-category {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eceef2;
    color: #1a1d26;
    letter-spacing: -0.02em;
    width: 100%;
}

.item-list-page .item-list-category .second-category li a {
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
    display: block;
    @media (max-width: 991px) {
        border-radius: 0;
    }
}

.item-list-page .item-list-category .second-category li.active > a,
.item-list-page .item-list-category .second-category li:hover > a {
    background: var(--color-main-bg-white);
}

.item-list-page .item-list-category .third-category.pc {
    margin-top: 4px;
    margin-bottom: 8px;
    background: #f7f8fa;
    border-radius: 10px;
    padding: 8px;
}

.item-list-page .item-list-category .third-category.pc li a {
    padding: 8px 16px;
    font-size: 13px;
}

.item-list-page .item-list-category .third-category.pc li.active > a {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* ── 메인 콘텐츠 ── */
.item-list-page .item-list-main {
    min-width: 0;
    flex: 1;
}

.item-list-page .location-box {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 20px;
    margin: 0 0 20px;
    padding: 20px 24px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.item-list-page .location-box .category-name h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #1a1d26;
    line-height: 1.3;
    margin: 0;
}

.item-list-page .location-box ul {
    justify-content: flex-end;
}

.item-list-page .location-box ul li > * {
    font-size: 13px;
    color: #6b7280;
}

.item-list-page .location-box ul li:last-child > * {
    color: #1a1d26;
    font-weight: 600;
}

/* ── 추천 상품 ── */
.item-list-page .recommend-product {
    margin-bottom: 20px;
    padding: 24px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    .item-list-box {
        padding: 0 0 0 12px !important;
    }
}

.item-list-page .recommend-product .recomment-title h3 {
    font-size: 17px;
    font-weight: 700;
    color: #1a1d26;
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}

.item-list-page .recommend-product .item-list-box .five-swiper {
    padding: 0 8px;
}

/* ── 정렬·개수 ── */
.item-list-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-list-page .list-top-box p {
    font-size: 14px;
    color: #6b7280;
}

.item-list-page .list-top-box p b {
    color: #1a1d26;
    font-weight: 700;
}

.item-list-page .container:has(> div > .recommend-product) > div > .list-top-box {
    border-top: none;
    padding-top: 16px;
    @media (max-width: 991px) {
        padding-bottom: 20px;
    }
}

/* ── 상품 그리드 ── */
.item-list-page #product-list.item-list-box,
.item-list-page #product-list.item-list-box ul {
    margin: 0;
}

.item-list-page #product-list.item-list-box ul {
    margin: 0 -6px -28px;
}

.item-list-page #product-list.item-list-box ul li {
    width: calc(20% - 12px);
    margin: 0 6px 28px;
}

.item-list-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-list-page .list-none-box p {
    color: #6b7280;
    font-size: 15px;
}

/* ── 추천 스와이퍼 화살표 (PC, 섹션 가장자리 반쯤 걸침) ── */
@media (min-width: 992px) {
    .item-list-page .recommend-product {
        overflow: visible;
    }

    .item-list-page .recommend-product .item-list-box,
    .item-list-page .recommend-product .item-list-box .wrapper {
        overflow: visible;
    }

    .item-list-page .recommend-product .item-list-box .swiper-button-prev,
    .item-list-page .recommend-product .item-list-box .swiper-button-next {
        top: 50% !important;
        margin-top: 0 !important;
        width: 44px !important;
        height: 44px !important;
        background-color: #fff !important;
        box-shadow: 0 2px 12px rgba(15, 23, 42, 0.14);
        border-radius: 50%;
        z-index: 20;
    }

    .item-list-page .recommend-product .item-list-box .swiper-button-prev {
        left: -12px !important;
        right: auto !important;
        transform: translate(-50%, -50%);
    }

    .item-list-page .recommend-product .item-list-box .swiper-button-next {
        right: -12px !important;
        left: auto !important;
        transform: translate(50%, -50%);
    }
}

/* ── 반응형 ── */
@media (max-width: 991px) {
    .item-list-page {
        background: #fff;
    }

    .item-list-page .item-list-section {
        padding: 0 0 32px;
    }
    .item-list-page .item-list-section .container:has( > div > .recommend-product) {
        padding: 20px 0 0;
        > .item-list-category {
            padding: 0;
        }
        .item-filter-layout {
            padding: 0 12px 0 12px;
        }
        .location-box {
            margin-left: 12px;
            margin-right: 12px;
        }
        .item-list-box {
            padding: 0 12px;
        }
    }

    .item-list-page .item-list-category {
        width: 100%;
        min-width: 0;
        padding: 16px 0;
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid #eceef2;
        position: relative;
        top: auto;
        max-height: none;
        overflow: visible;
    }

    .item-list-page .item-list-category .first-category {
        font-size: 16px;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .item-list-page .recommend-product {
        margin-bottom: 0;
        padding: 20px 0;
        border-radius: 0;
        box-shadow: none;
        border-bottom: 8px solid #f7f8fa;
    }

    .item-list-page .list-top-box {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 16px 3px;
        /*border-bottom: 1px solid #eceef2;*/
    }

    .item-list-page #product-list.item-list-box ul {
        margin: 0 -3px -18px;
    }

    .item-list-page #product-list.item-list-box ul li {
        width: calc(33.33% - 6px);
        margin: 0 3px 18px;
    }
}

@media (max-width: 570px) {
    .item-list-page #product-list.item-list-box ul li {
        width: calc(50% - 6px);
    }
}
