.pfs-wrapper{display:flex;gap:30px}
.pfs-sidebar{width:250px}
.pfs-sidebar ul{list-style:none;padding:0}
.pfs-sidebar li{padding:3px;border-bottom:1px solid #eee;cursor:pointer}

/* ===== SIDEBAR FILTER ===== */

/* Category cha */
.pfs-parent{
    background:#fff;
    border-bottom:1px solid #eee;
}
.pfs-parent-header{
    display:flex;
    align-items:center;
    justify-content:space-between; /* đẩy 2 phần tử ra 2 bên */
    cursor:pointer;
    padding: 0px 8px;
    height: 40px;
}

/* Thanh tiêu đề cha */
.pfs-parent-toggle{
    display:flex;
    justify-content:space-between;
    align-items:center;
    cursor:pointer;
    font-weight:600;
    padding:12px 8px;
}

/* Hover cha */
.pfs-parent-toggle:hover{
    background:#f5f5f5;
}

/* Mũi tên */
.arrow{
    transition:0.3s;
    font-size:12px;
    padding: 20px;
}

/* Xoay mũi tên khi mở */
.pfs-parent.open .arrow{
    transform:rotate(180deg);
    transition:0.3s;
}

/* Category con (ẩn mặc định) */
.pfs-children{
    display:none;
    list-style:none;
    padding-left:28px;
    margin:0;
    background:#fafafa;
}


/* Khi mở thì hiện */
.pfs-parent.open > .pfs-children{
    display:block;
}

/* Item con */
.pfs-children li{
    padding:5px 20px;
    font-weight:500;
    border-bottom:1px dashed #eee;
    cursor:pointer;
}

/* Hover con */
.pfs-children li:hover{
    background:#f0f0f0;
}

/* ===== ACTIVE STATE ===== */
.pfs-cat-list-all.active {
    background:#ff4d4f;
    color:#fff;
}
/* CHA active → chỉ đỏ thanh tiêu đề */
.pfs-parent.active > .pfs-parent-header{
    background:#ff4d4f;
    color:#fff;
}
/* CON active → đỏ riêng nó */
.pfs-children li.active{
    background:#ff4d4f;
    color:#fff;
}

/* Tất cả active */
/*.pfs-sidebar > ul > li.active{*/
/*    background:#ff4d4f;*/
/*    color:#fff;*/
/*}*/


.pfs-content{flex:1}
.pfs-content{
    position: relative;
    min-height: 300px;
}

.pfs-loading{
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #e60023;
    z-index: 10;
}
.pfs-loading::after{
    content: "";
    width: 26px;
    height: 26px;
    border: 3px solid #ddd;
    border-top: 3px solid #e60023;
    border-radius: 50%;
    margin-left: 12px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin{
    to{ transform: rotate(360deg); }
}

.pfs-loading.active{
    display: flex;
}

/* GRID */
.pfs-grid{
    display: grid;
    gap: 20px;
    /*grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));*/
}

.pfs-grid.columns-6{ grid-template-columns: repeat(6,1fr); }
.pfs-grid.columns-5{ grid-template-columns: repeat(5,1fr); }
.pfs-grid.columns-4{ grid-template-columns: repeat(4,1fr); }
.pfs-grid.columns-3{ grid-template-columns: repeat(3,1fr); }
.pfs-grid.columns-2{ grid-template-columns: repeat(2,1fr); }

/* ITEM */
.pfs-item{
    border: 1px solid #eee;
    background: #fff;
    padding: 12px;
    text-align: center;
    transition: 0.2s;
}

.pfs-item:hover{
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-5px);
}

/* IMAGE */
.pfs-item img{
    width: 100%;
    height: 180px;          /* giảm chiều cao ảnh */
    object-fit: contain;    /* giữ tỷ lệ ảnh */
    margin-bottom: 10px;
}

/* TITLE */
.pfs-item-name{
    font-size: 14px !important;        /* nhỏ lại */
    font-weight: 600;
    margin: 6px 0;
    min-height: 38px;       /* tránh vỡ layout */
    color: #ea282b !important;
}

/* LINK */
.pfs-item a{
    text-decoration: none;
    color: #222;
}


/* FIX PAGINATION */
.pfs-pagination{
    margin-top:30px;
    text-align:center;
}

.pfs-pagination ul{
    list-style:none !important;
    display:flex !important;
    justify-content:center;
    gap:8px;
    padding:0;
    margin:0;
}

.pfs-pagination li{
    list-style:none !important;
    display:inline-block !important;
}

.pfs-pagination a,
.pfs-pagination span{
    display:inline-block;
    padding: 10px 16px !important;
    border:1px solid #ddd;
    background:#fff;
    font-size:16px !important;
    text-decoration:none;
}

.pfs-pagination a:hover{
    background:#ff4d4f;
    color:#fff;
    border-color:#ff4d4f;
}

.pfs-pagination .current{
    background:#ff4d4f;
    color:#fff;
    border-color:#ff4d4f;
}


/* ===== MOBILE ===== */
@media (max-width: 768px){

    /* Ẩn filter */
    .pfs-sidebar{
        display:none;
    }

    /* Layout full width */
    .pfs-wrapper{
        flex-direction: column;
    }

    .pfs-content{
        width:100%;
    }

}

@media (max-width:768px){

    .pfs-grid{
        grid-template-columns: repeat(2,1fr) !important;
        gap:12px;
        padding: 0px 15px;
    }
    
    .pfs-item{
        padding:8px !important;
    }

    .pfs-item img{
        height:140px !important;
    }

    .pfs-item-name{
        font-size:13px !important;
        min-height:auto;
    }

}