/* ============================================================
   Product list - left Filter sidebar + 2-column layout
   (frontend-only enhancement; data comes from existing
    /product/getDataProduct endpoint)
   ============================================================ */

.krc-list-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-top: 30px;
    padding: 0 10px;
}

.krc-filter-sidebar {
    flex: 0 0 260px;
    width: 260px;
}

.krc-product-main {
    flex: 1 1 auto;
    min-width: 0;
}

/* ---- Filter sidebar ---- */
.krc-filter-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.01em;
    padding-bottom: 18px;
    border-bottom: 1px solid #ededed;
}

.krc-filter-group {
    border-bottom: 1px solid #ededed;
    padding: 20px 0;
}

.krc-filter-group-head {
    width: 100%;
    background: none;
    border: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    letter-spacing: -0.01em;
}

.krc-filter-group-head svg {
    transition: transform 0.2s ease;
    flex: 0 0 auto;
    color: #555;
}

.krc-filter-group.is-collapsed .krc-filter-group-head svg {
    transform: rotate(180deg);
}

.krc-filter-options {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.krc-filter-group.is-collapsed .krc-filter-options {
    display: none;
}

.krc-filter-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 15px;
    color: #333;
    margin: 0;
    padding: 11px 12px;
    border-radius: 8px;
    user-select: none;
    transition: background 0.15s ease;
}

.krc-filter-option:hover:not(.is-checked) {
    background: #f5f7fa;
}

/* 체크된 옵션 행 활성 배경 */
.krc-filter-option.is-checked {
    background: #e9f1fc;
}

.krc-filter-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.krc-checkbox {
    width: 20px;
    height: 20px;
    border: 1.5px solid #cfcfcf;
    border-radius: 4px;
    flex: 0 0 20px;
    position: relative;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.krc-filter-option:hover .krc-checkbox {
    border-color: #0d2845;
}

.krc-filter-option input:checked + .krc-checkbox {
    background: #0d2845;
    border-color: #0d2845;
}

.krc-filter-option input:checked + .krc-checkbox::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.krc-filter-option input:focus + .krc-checkbox {
    box-shadow: 0 0 0 3px rgba(13, 40, 69, 0.15);
}

.krc-filter-option-label {
    line-height: 1.3;
}

.krc-filter-empty {
    font-size: 14px;
    color: #999;
    padding: 16px 0;
}

/* ---- Toolbar (result count) ---- */
.krc-toolbar {
    position: relative;
    min-height: 28px;
    margin-bottom: 18px;
}

/* keep the existing search-count layout readable in the new column */
.krc-toolbar .popup-second-category-container-son {
    display: flex;
    align-items: center;
}

/* ---- Product grid (3-column minimal cards) ---- */
#list-product {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 24px;
    margin-top: 18px !important;
}

.krc-pcard {
    width: 100%;
}

.krc-pcard__link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease;
}

.krc-pcard__link:hover {
    transform: translateY(-2px);
}

.krc-pcard__image {
    background: #f4f4f6;
    border-radius: 12px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    overflow: hidden;
    box-sizing: border-box;
    transition: background 0.15s ease;
}

.krc-pcard__link:hover .krc-pcard__image {
    background: #eeeef1;
}

.krc-pcard__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.krc-pcard__body {
    padding: 18px 4px 0;
}

.krc-pcard__name {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
    line-height: 1.35;
    letter-spacing: -0.01em;
    word-break: break-word;
}

.krc-pcard__meta {
    font-size: 13.5px;
    color: #9b9ba2;
    margin: 0;
    line-height: 1.4;
}

/* ---- Slim pagination (덮어쓰기) ---- */
#paging.pagination {
    margin-top: 36px;
    gap: 4px;
}

#paging .page-item .page-link {
    border: 1px solid #ececef !important;
    background: #fff;
    color: #1a1a1a;
    border-radius: 6px !important;
    width: auto !important;
    min-width: 36px;
    height: 36px;
    line-height: 22px;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#paging .page-item .page-link.curentPage {
    background: #fff !important;
    border-color: #cfd3da !important;
    color: #1a1a1a !important;
    font-weight: 700;
}

#paging .page-item .page-link:hover {
    background: #f7f7f9;
}

/* ---- Responsive ---- */
@media screen and (max-width: 1200px) {
    #list-product { grid-template-columns: repeat(3, 1fr); gap: 22px 18px; }
    .krc-pcard__image { padding: 22px; }
}

@media screen and (max-width: 900px) {
    .krc-list-layout {
        flex-direction: column;
        gap: 24px;
    }
    .krc-filter-sidebar {
        flex-basis: auto;
        width: 100%;
    }
    #list-product { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 560px) {
    #list-product { grid-template-columns: 1fr; gap: 18px; }
}
