@charset "utf-8";
/* =========================================================================
   pliki8 테마 — 상품 목록 · 필터 · 정렬 · 무한스크롤 (M4)
   출처: design/pliki-canvas/ListPC.dc.html      (PC 1280 : 필터 200 + 4열)
         design/pliki-canvas/MobileList.dc.html  (모바일 390 : 알약 필터바 + 2열)
         design/pliki-canvas/Components.dc.html  (정렬 드롭다운 · 필터 캡슐 · 로더)
         docs/pliki8-analysis/03-product-list.md §1~§6
   방침: 모바일 퍼스트. 토큰은 css/theme.css(:root)를 그대로 쓴다.
         theme.css 뒤에 로드되므로 M1/M2 규칙을 덮어쓸 수 있다.
   ========================================================================= */

/* -------------------------------------------------------------------------
   0. 공용 버튼 (필터 시트 · 빈 상태)
   ------------------------------------------------------------------------- */
.pk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius-btn);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: none;
}
.pk-btn--line { border: 1px solid var(--c-border); color: var(--c-text); font-weight: 400; }
.pk-btn--fill { background: var(--c-text-strong); color: #fff; }
.pk-btn--fill:hover { color: #fff; }

/* -------------------------------------------------------------------------
   1. 1단계 카테고리 텍스트 탭 (활성 밑줄 2px #21272A)
   ------------------------------------------------------------------------- */
.pk-tabs {
    margin: 0 0 4px;
    border-bottom: 1px solid var(--c-border);
    overflow-x: auto;
    scrollbar-width: none;
}
.pk-tabs::-webkit-scrollbar { display: none; }
.pk-tabs ul {
    display: flex;
    align-items: flex-end;
    gap: 18px;
}
.pk-tabs a {
    display: block;
    padding-bottom: 10px;
    color: var(--c-text-gray);
    font-size: 13px;
    white-space: nowrap;
}
.pk-tabs .is-active > a {
    padding-bottom: 8px;
    border-bottom: 2px solid var(--c-tab-active);
    color: var(--c-text-strong);
    font-weight: 700;
}
.pk-tabs a:hover { color: var(--c-text-strong); }

@media (min-width: 768px) {
    .pk-page.is-list > .pk-inner > .pk-page__title { margin-bottom: 8px; }
    .pk-tabs ul { gap: 20px; }
    .pk-tabs a { font-size: 17px; }
    .pk-tabs .is-active > a { font-weight: 600; }
}

/* -------------------------------------------------------------------------
   2. 하위 분류 이미지 캐러셀 (90×90 원형 · 슬롯 132 · scroll-snap)
   theme.css 의 M1 텍스트 칩 규칙(.pk-subcate a)을 여기서 덮어쓴다.
   ------------------------------------------------------------------------- */
.pk-subcate {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 4px;
}
/* theme.css 의 `.pk-subcate ul`(0,1,1) 보다 강한 선택자로 덮어쓴다 */
.pk-subcate .pk-subcate__track {
    display: flex;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    scroll-snap-type: x proximity;
    scroll-padding-left: 4px;
}
.pk-subcate__slot {
    flex: 0 0 auto;
    width: 84px;
    scroll-snap-align: start;
}
/* M1 캡슐 규칙 무력화 */
.pk-subcate .pk-subcate__slot a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: auto;
    padding: 4px 0 8px;
    border: 0;
    border-radius: 0;
    color: var(--c-text);
    font-size: 13px;
}
.pk-subcate__circle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--c-thumb-bg);
}
.pk-subcate__circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pk-subcate__circle--all span,
.pk-subcate__initial {
    color: var(--c-text-gray);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}
.pk-subcate__label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: var(--c-text);
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pk-subcate__slot.is-active .pk-subcate__label { font-weight: 700; color: var(--c-text-strong); }

.pk-subcate__nav {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 44px;      /* 터치 영역 확보 */
    color: var(--c-text);
    cursor: pointer;
}
.pk-subcate__nav[disabled] { color: #C6C6C8; cursor: default; }

@media (min-width: 1024px) {
    .pk-subcate { gap: 16px; margin: 16px 0 8px; }
    .pk-subcate .pk-subcate__track { gap: 14px; }
    .pk-subcate__slot { width: 132px; }
    .pk-subcate__circle { width: 90px; height: 90px; }
    .pk-subcate__label { font-size: 13px; }
    .pk-subcate__nav { display: flex; }
    .pk-subcate.is-static .pk-subcate__nav { visibility: hidden; }
}

/* -------------------------------------------------------------------------
   3. 상품 수 + 정렬 드롭다운 줄
   ------------------------------------------------------------------------- */
.pk-listbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0 12px;
}
.pk-listbar__count { color: rgba(34, 34, 34, .8); font-size: 12px; }
.pk-listbar__count b { font-weight: 600; }
.pk-listbar--sortonly { justify-content: flex-end; }

@media (min-width: 768px) {
    .pk-listbar { padding: 8px 0 20px; }
    .pk-listbar__count { font-size: 13px; }
}

/* 정렬 드롭다운 — Components.dc.html "정렬 드롭다운 (펼침)" */
.pk-select { position: relative; flex-shrink: 0; }
.pk-select__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0;
    color: var(--c-text);
    font-size: 14px;
    cursor: pointer;
}
.pk-select__arrow { transition: transform .16s ease; }
.pk-select.is-open .pk-select__arrow { transform: rotate(180deg); }

.pk-select__pop {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 60;
    display: none;
    width: 180px;
    overflow: hidden;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
}
.pk-select.is-open .pk-select__pop { display: block; }

.pk-select__menu a {
    display: block;
    padding: 12px 48px 12px 16px;
    color: var(--c-text);
    font-size: 14px;
}
.pk-select__menu a:hover { background: #F6F7F9; }
.pk-select__menu a.is-on { font-weight: 700; color: var(--c-text-strong); }

@media (max-width: 1023px) {
    /* 모바일: 하단 바텀시트 */
    .pk-select--sheet .pk-select__pop {
        position: fixed;
        left: 0; right: 0; bottom: 0; top: auto;
        z-index: 1500;
        width: auto;
        border: 0;
        border-radius: 16px 16px 0 0;
        padding-bottom: var(--safe-b);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, .12);
    }
    .pk-select--sheet::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 1499;
        background: rgba(0, 0, 0, .4);
    }
    .pk-select--sheet .pk-select__menu a { padding: 15px 20px; font-size: 15px; }
}

/* -------------------------------------------------------------------------
   4. 목록 본문 — PC 2단(필터 200 + 20 + 그리드) / 모바일 1단
   ------------------------------------------------------------------------- */
.pk-list__body { display: block; }
.pk-list__main { min-width: 0; }

@media (min-width: 1024px) {
    .pk-list__body { display: flex; align-items: flex-start; }
    .pk-list__main { flex: 1 1 auto; }
}

/* -------------------------------------------------------------------------
   5. 모바일 필터 알약 바 (h32)
   ------------------------------------------------------------------------- */
.pk-mbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
}
.pk-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--c-border);
    border-radius: 16px;
    background: #fff;
    color: var(--c-text-gray);
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}
.pk-pill.is-on { border-color: var(--c-text-strong); color: var(--c-text-strong); font-weight: 600; }
.pk-pill__n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--c-text-strong);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

@media (min-width: 1024px) {
    .pk-mbar { display: none; }
}

/* -------------------------------------------------------------------------
   6. 필터 — PC 좌측 사이드바 200px sticky / 모바일 바텀시트
   같은 DOM 을 CSS 로만 전환한다.
   ------------------------------------------------------------------------- */
.pk-filter__dim {
    position: fixed;
    inset: 0;
    z-index: 1490;
    background: rgba(0, 0, 0, .4);
}

/* --- 모바일: 기본 숨김 → is-open 시 시트 --- */
@media (max-width: 1023px) {
    .pk-filter {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 1500;
        display: none;
    }
    .pk-filter.is-open { display: block; }

    .pk-filter__panel {
        display: flex;
        flex-direction: column;
        max-height: 80vh;
        padding: 10px var(--pad-mobile) calc(12px + var(--safe-b));
        border-radius: 16px 16px 0 0;
        background: #fff;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, .12);
    }
    .pk-filter__handle {
        flex-shrink: 0;
        width: 36px; height: 4px;
        margin: 0 auto 10px;
        border-radius: 2px;
        background: #D9D9D9;
    }
    .pk-filter__body {
        flex: 1 1 auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .pk-filter__foot { display: flex; gap: 8px; flex-shrink: 0; padding-top: 12px; }
    .pk-filter__foot .pk-btn { flex: 1 1 0; }
    .pk-filter__nojs { display: none; }
}

/* --- PC: 좌측 사이드바 --- */
@media (min-width: 1024px) {
    .pk-filter__dim { display: none; }
    .pk-filter {
        flex: 0 0 200px;
        width: 200px;
        margin-right: 20px;
        position: sticky;
        top: calc(var(--h-hdmain) + var(--h-subgnb) + 20px);
        align-self: flex-start;
        max-height: calc(100vh - var(--h-hdmain) - var(--h-subgnb) - 40px);
        overflow-y: auto;
        scrollbar-width: thin;
    }
    .pk-filter__handle,
    .pk-filter__head,
    .pk-filter__foot { display: none; }
    .pk-filter__nojs { padding-top: 12px; }
}

.pk-filter__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 12px;
}
.pk-filter__title { font-size: 15px; font-weight: 700; color: var(--c-text-strong); }
.pk-filter__x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    margin-right: -12px;
    color: var(--c-text);
    cursor: pointer;
}
.pk-filter__n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--c-price-red);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    vertical-align: 1px;
}

.pk-filter__caps { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 18px; }
.pk-cap {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--c-border);
    border-radius: 16px;
    color: var(--c-text-gray);
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}
.pk-cap.is-on { border-color: var(--c-text-strong); color: var(--c-text-strong); font-weight: 600; }

.pk-filter__sec {
    padding: 16px 0;
    border-top: 1px solid var(--c-border);
}
.pk-filter__sub { font-size: 14px; font-weight: 700; color: var(--c-text-strong); }
.pk-filter__sec > .pk-filter__sub { margin-bottom: 12px; }

/* 체크박스 목록 — 16×16, 항목 간격 10px, 라벨 간격 8px */
.pk-chklist { display: flex; flex-direction: column; gap: 10px; }
.pk-chk {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 24px;
    cursor: pointer;
}
.pk-chk__box {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px; height: 16px;
    border: 1px solid #C6C6C8;
    border-radius: 3px;
    background: #fff;
}
.pk-chk__box svg { opacity: 0; }
.pk-chk.is-on .pk-chk__box { border-color: var(--c-text-strong); background: var(--c-text-strong); }
.pk-chk.is-on .pk-chk__box svg { opacity: 1; }
.pk-chk__label { font-size: 13px; color: var(--c-text-strong); }
.pk-chk__label em { color: var(--c-placeholder); font-style: normal; }

/* 체크박스 input 이 .pk-sr 로 시각적으로 잘려 있어 포커스 링을 라벨에 그린다 */
.pk-chk:focus-within .pk-chk__box,
.pk-cap:focus-within { outline: 2px solid var(--c-text-strong); outline-offset: 2px; }

/* 모바일에서는 터치 영역 44px 확보 */
@media (max-width: 1023px) {
    .pk-chk { min-height: 44px; }
    .pk-chk__label { font-size: 14px; }
}

/* 브랜드 아코디언 */
.pk-acc > .pk-filter__sub { margin-bottom: 0; }
.pk-acc__btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 0;
    color: var(--c-text-strong);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.pk-acc__arrow { transition: transform .16s ease; }
.pk-acc.is-open .pk-acc__arrow { transform: rotate(180deg); }
.pk-acc__body { display: none; padding-top: 4px; }
.pk-acc.is-open .pk-acc__body { display: block; }

.pk-brandsearch {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    margin-bottom: 12px;
    padding: 0 12px;
    border-radius: var(--radius-btn);
    background: var(--c-field-bg);
    color: var(--c-placeholder);
}
.pk-brandsearch input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--c-text);
    font-size: 13px;
    outline: none;
}
.pk-acc__body .pk-chklist { max-height: 260px; overflow-y: auto; }

/* -------------------------------------------------------------------------
   7. 무한 스크롤 로더 / 종료 표시 / 페이지네이션 폴백
   ------------------------------------------------------------------------- */
.pk-more { padding: 28px 0 8px; }
.pk-more__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--c-text-gray);
    font-size: 13px;
}
.pk-more__end {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--c-placeholder);
    font-size: 13px;
}
.pk-more__end::before,
.pk-more__end::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--c-border);
}
.pk-more__btn {
    display: block;
    width: 100%;
    max-width: 320px;
    height: 48px;
    margin: 0 auto;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-btn);
    background: #fff;
    color: var(--c-text);
    font-size: 14px;
    cursor: pointer;
}

/* display 를 지정한 요소는 [hidden] 을 다시 눌러줘야 한다 (작성자 규칙이 UA 규칙보다 강하다) */
.pk-more__loading[hidden],
.pk-more__end[hidden],
.pk-more__btn[hidden],
.pk-listbar[hidden],
.pk-mbar[hidden] { display: none; }

.pk-spin { animation: pk-spin 900ms linear infinite; color: var(--c-text-strong); }
@keyframes pk-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .pk-spin { animation: none; }
}

.pk-paging { padding-top: 24px; }

/* -------------------------------------------------------------------------
   8. 상품 그리드 래퍼 — 무한스크롤 append 대상
   ------------------------------------------------------------------------- */
.pk-list__grid { min-height: 40px; }
