.filter-body::-webkit-scrollbar {
    width: 0.25rem;
}

.filter-body::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.25);
    border-radius: 0.625rem;
}

/* ===== HEADER FILTER BAR ===== */
.filter {
    position: sticky;
    top: 0;
    z-index: 8;

    display: flex;
    justify-content: space-between;
    align-items: center;

    font-size: 0.875rem;
    padding: 0.75rem 1.25rem;

    background: #fff;
    /* border-bottom: 1px solid #eee; */
}
.filter.is-stuck {
  border-bottom: 1px solid #eee;
}
.data-filter{
    display: flex;
    justify-content: start;
    align-items: center;
    font-size: 1rem;
    flex-wrap: wrap;
    display: none;
    gap: 1rem;
    padding: 0.25rem 1.25rem;
    /* border-bottom: 1px solid #eee; */
}
.no-items{
    font-family: 'NTJSans-Medium', sans-serif;
    font-weight: 400;
    /* text-transform: uppercase; */
    margin: 0 1.5rem;
    grid-column: span 4;
    text-align: center;
    /* letter-spacing: 1.5px; */
    font-size: 1.25rem;
    color: #3c3c41;
}
.dulieu{
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    text-align: center;
    min-width: 6rem;
    font-size: 0.875rem;
    background-color: #fdfaf2;
    position: relative;
}
.dulieu::after{
    font-family: 'icomoon-mobile', sans-serif !important;
    display: inline-block;
    content: '\e907';
    cursor: pointer;
    color: #3e3d42;
    font-size: 0.75rem;
    padding-left: 0.5rem;
}
.clear-all{
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    background-color: #f6f6f6;
}
/* .span-icon div{
    margin-top: 0.25rem;
} */
.span-icon{
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}
.clear-filter{
    text-decoration:underline;
    cursor: pointer;
}
.span-icon svg{
    width: 1.5rem;
    height: 1.5rem;
    margin-top: -0.25rem;
}

.sort-section{
    position: relative;
}

.sort-btn{
    cursor: pointer;
    font-weight: 500;
}

/* ===== OVERLAY ===== */
.filter-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 1000;
}

.filter-overlay.active{
    opacity: 1;
    visibility: visible;
}

/* ===== FILTER PANEL ===== */
.filter-panel{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 27.5rem;
    height: 100%;
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.35s ease;
    z-index: 1000;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
}

.filter-panel.active{
    transform: translateX(0);
}

.filter-header{
    display: flex;
    justify-content: space-between;
    border-top: 0.125rem solid #A2041B;
    align-items: center;
    padding: 3.125rem 2rem 0.75rem 2rem;
    position: relative;
    /* border-bottom: 1px solid #eee; */
}

.filter-header button{
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

.filter-body{
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem 1rem 2rem;
    margin-right: 0.5rem;
    /* Firefox */
    scrollbar-width: none;

    /* IE, Edge cũ */
    -ms-overflow-style: none;
}
/* Chrome, Safari, Edge Chromium */
.filter-body::-webkit-scrollbar{
    width: 0;
    height: 0;
    display: none;
}
.filter-group{
    /* margin-bottom: 1.5rem; */
    border-bottom: 1px solid #cac7d4;
    /* padding-bottom: 0.5rem; */
}

.filter-group h4{
    margin-bottom: 0.5rem;
}

.filter-group label{
    display: block;
    padding: 0.125rem 0 0.25rem 0;
    cursor: pointer;
}
.content-properties .item:last-of-type label{
    padding: 0.125rem 0 0.75rem 0;

}
.filter-footer{
    font-family: 'NTJSans-Bold',sans-serif;
    padding: 0.75rem;
    margin: 0 2rem 2rem 2rem;
    color: #f8c883;
    font-size: 0.875rem;
    cursor: pointer;
    background-color: #A2041B;
    text-align: center;
    text-transform: uppercase;

    border: 1px solid #A2041B;
}
.filter-footer:hover{
    border: 1px solid #A2041B;
    background-color: #FFF4E8;
    color: #A2041B;
}
.filter-footer button{
    flex: 1;
    padding: 0.6rem;
    cursor: pointer;
    border: 1px solid #ccc;
}

.btn-apply{
    background: #111;
    color: #fff;
    border-color: #111;
}

/* ===== SORT DROPDOWN ===== */
.sort-dropdown{
    position: absolute;
    top: 120%;
    right: 0;
    min-width: 11.25rem;
    background: #fff;
    border: 1px solid #ddd;
    display: none;
    z-index: 50;
}

.sort-dropdown.active{
    display: block;
}

.sort-item{
    padding: 0.6rem 0.8rem;
    cursor: pointer;
}

.sort-item:hover{
    background: #f5f5f5;
}
.properties-right{
    /* position: relative; */
    display: inline-block;
    /* right: 1rem; */
}

.sort-by{
    cursor: pointer;
    font-weight: 500;
}

.sort-options{
    position: absolute;
    top: 120%;
    right: 0;
    min-width: 12.5rem;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 0.375rem 1rem rgba(0,0,0,0.08);
    display: none;
    z-index: 20;
}

.sort-options.active{
    display: block;
}

.sort-options .item{
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}

.sort-options .item:hover{
    color: #FFFFFF;
    background-color: #61b1e7;

}
.filter-header span{
    text-transform: uppercase;
    font-family: 'NTJSans-Bold',sans-serif;
    color: #A2041B;
}
.sort-options .item.selected{
    color: #FFFFFF;
    background-color: #61b1e7;
}
.sort-options .item.selected::before{
    position: absolute;
    left: 0.125rem;
    top: 20%;
    content: "✓";
    color: #FFFFFF;
}
.filter-group .name-properties{
    position: relative;
    cursor: pointer;
    /* text-transform: capitalize; */
    /* line-height: 2.5; */
    padding: 0.75rem 0;
    font-family: 'NTJSans-Bold',sans-serif;
}
.filter-group .name-properties::after{
    font-family: 'icomoon' !important;
    speak: none;
    font-style: normal;
    font-weight: 400;
    font-variant: normal;
    text-transform: none;
    line-height: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #3e3d42;
    position: absolute;
    top: 50%;
    transform: rotate(90deg);
    right: 0.375rem;
    content: '\e902';
    display: inline-block;
    transform: translateY(-50%) rotate(0);
    transition: transform 0.3s ease;
}

.closeFilter::after{
    font-family: 'icomoon-mobile', sans-serif !important;
    display: inline-block;
    content: '\e907';
    cursor: pointer;
    color: #A2041B;
    font-size: 1rem;
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
}
.content-properties {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: max-height 0.35s ease, opacity 0.25s ease,transform 0.25s ease;
}
.filter-group.active .content-properties {
    max-height: 31.25rem; /* đủ lớn */
    opacity: 1;
    transform: translateY(0);
}
.filter-group.active .name-properties::after {
    transform: translateY(-50%) rotate(90deg);
}
.name-properties .count {
    font-weight: 400;
    color: #777;
    margin-left: 0.25rem;
}
/*Input css*/
.filter-group .item input{
    /* margin-right: 0.313rem; */
    appearance: none;
    width: 0.875rem !important;
    height: 0.875rem !important;
    border-radius: 0 !important;
    border: 1px solid #A2041B;
    display: inline-block;
    position: relative;
    top: 0;
    cursor: pointer;
}
.filter-checkbox:checked + span {
    transition: color 0.3s ease;
    color: #A2041B;
}
.item input:checked{
    background-color: #A2041B;
}
.item.selected{
    color: #A2041B;
}
.content-properties .item span{
    padding-left: 0.5rem;
}
/*Màu sắc vàng*/
.filter-group .content-properties.color-div{
    display: flex;
    justify-content: center;
    gap: 2rem;
}
.filter-group.active .content-properties.color-div{
    margin: 0.75rem 0;

}
.filter-group .item .colorArea {
    display: flex;
    align-items: center;
    text-align: center;
    flex-direction: column;
    gap: 0.25rem;
}
.filter-group .item .colorArea span{
    padding-left: 0;
}
.filter-group .item .btn_color {
    background-color: transparent;
    border-radius: 50%;
    width: 1.75rem;
    height: 1.75rem;
    cursor: pointer;
    /* border: 1px solid transparent; */
}
.filter-group .item .btn_color.active{
    border: 1px solid #3e3d42;
}
.filter-group .item .btn_color.mautrang{
    /* background: linear-gradient(216.3deg, #8C8C8C -21.85%, #F2F2F2 41.39%, #8C8C8C 84.72%); */
    background-image: url('../images/icon-vangtrang.png');
    background-size: cover;
}
.filter-group .item .btn_color.diamond {
    background: linear-gradient(216.3deg, #8CC7E6 -20%, #E6F5FF 35%, #6DA8CF 85%);
}
.filter-group .item .btn_color.mauvang {
    /* background: linear-gradient(214.7deg, #FFD747 -2.46%, #FFFCF1 44.89%, #FFD84F 92.23%); */
    background-image: url('../images/icon-vangvang.png');
    background-size: cover;
}

.filter-group .item .btn_color.mauhong{
    /* background: linear-gradient(218.05deg, #FFA48F 4.74%, #FFFCFC 48.09%, #FFA48F 91.43%); */
    background-image: url('../images/icon-vanghong.png');
    background-size: cover;
}
.select-wrap {
    position: relative;
    display: inline-block;
    width: 11.75rem;
}

.select-wrap select {
    width: 100%;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-family: 'NTJSans-Medium',sans-serif !important;
    border: none !important;
    background: #fff;
    appearance: none;
    z-index: 1;
    font-weight: 500 !important;
    -webkit-appearance: none;
    color: #3e3d42;
    -moz-appearance: none;
    cursor: pointer;
    background: transparent;
    position: relative;
}

/* Mũi tên */

.properties-right .select-wrap::after{
    font-family: 'icomoon' !important;
    speak: none;
    font-style: normal;
    font-weight: 400;
    font-variant: normal;
    text-transform: none;
    line-height: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #3e3d42;
    position: absolute;
    top: 50%;
    right: 1rem;
    content: '\e902';
    display: inline-block;
    transform: rotate(90deg);
    transition: transform .3s ease-in, -webkit-transform .3s ease-in, -moz-transform .3s ease-in, -o-transform .3s ease-in;
}
.filter-group .name-properties.active::after,.properties-right .select-wrap-by.active::after{
    transform: rotate(-90deg);
}
.select-wrap select:focus {
    outline: none;
    border-color: transparent;
    box-shadow: none;
}
.sort-label-wrap .span-content::after{
    content: ':';
}
/* ===== RESPONSIVE ===== */
@media(max-width: 1024px){
    .filter-group.active .content-properties.color-div{
        margin: 0 0 0.75rem 0;
    }
}
@media(max-width: 768px){
    .filter-panel{
        width: 90%;
    }
    .select-wrap {
        position: relative;
        display: inline-block;
        width: 9.75rem;
    }
    .filter-group.active .content-properties {
        max-height: 100vh;
        gap: 1rem;
    }
    .sort-options{
        min-width: 9.875rem;
    }
    .filter{
        top: 3rem;
        padding: 0.625rem 1rem;
    }
    .data-filter{
        padding: 0.25rem 1rem;
        row-gap: 0.5rem;
    }
    .no-items {
        padding-top: 1.5rem;
        font-size: 1rem;
    }
    .filter-group .name-properties,.content-properties .item span{
        font-size: 0.875rem;
    }
    .select-wrap {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        z-index: 2;
    }
    .sort-label-wrap .span-content::after{
        font-family: 'icomoon' !important;
        speak: none;
        font-style: normal;
        font-weight: 400;
        font-variant: normal;
        text-transform: none;
        line-height: 0;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        color: #3e3d42;
        position: absolute;
        top: 50%;
        left: 4rem;
        font-size: 0.75rem;
        content: '\e902';
        display: inline-block;
        transform: rotate(90deg);
        transition: transform .3s ease-in, -webkit-transform .3s ease-in, -moz-transform .3s ease-in, -o-transform .3s ease-in;
    }
    .select-wrap select {
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
    }

    /* chỉ hiển thị chữ "Sắp xếp" */
    .sort-label-wrap {
        position: relative;
        display: inline-flex;
        right: 1.5rem;
        align-items: center;
        cursor: pointer;
    }
}