/* ================= AH FILTER WRAPPER ================= */
.ah-filter{
    background:#fff;
    border:1px solid #eee;
    border-radius:14px;
    padding:16px 14px;
    margin-bottom:24px;
    box-shadow:0 6px 18px rgba(0,0,0,.05);
    position:relative;
    font-size:14px;
}

/* trạng thái đang lọc */
.ah-filter.is-filtering{
    opacity:.6;
    pointer-events:none;
}
.ah-filter.is-filtering:after{
    content:"Đang lọc sản phẩm…";
    position:absolute;
    top:10px;
    right:14px;
    background:#c40000;
    color:#fff;
    font-size:12px;
    padding:4px 10px;
    border-radius:20px;
}

/* ================= TITLE ================= */
.ah-filter .ah-filter-h{
   font-size: 15px;
    font-weight: 600;
    margin: 14px 0 8px;
    background: #2196F3;
    border-radius: 12px;
    color: #fff;
    padding: 5px;
    padding-bottom: 6px;
    padding-left: 16px;
    border-bottom: 1px dashed #eee;
}
.ah-filter h4:first-child{
    margin-top:0;
}

/* ================= LABEL ================= */
.ah-filter label{
    display:flex;
    align-items:center;
    gap:8px;
    margin-bottom:8px;
    padding:6px 8px;
    border-radius:8px;
    cursor:pointer;
    transition:.2s;
}
.ah-filter label:hover{
    background:#f7f7f7;
}

/* ================= CUSTOM CHECKBOX ================= */
.ah-filter input[type="checkbox"]{
    appearance:none;
    -webkit-appearance:none;
    width:18px;
    height:18px;
    border-radius:5px;
    border:1.5px solid #bbb;
    background:#fff;
    position:relative;
    cursor:pointer;
    transition:.2s;
}

/* checked */
.ah-filter input[type="checkbox"]:checked{
    background:#c40000;
    border-color:#c40000;
}
.ah-filter input[type="checkbox"]:checked:after{
    content:"";
    position:absolute;
    top:3px;
    left:6px;
    width:4px;
    height:8px;
    border:2px solid #fff;
    border-top:none;
    border-left:none;
    transform:rotate(45deg);
}

/* ================= COUNT ================= */
.ah-filter small{
    margin-left:auto;
    font-size:12px;
    color:#777;
}

/* ================= DISABLED ================= */
.ah-filter label.is-disabled{
    opacity:.4;
    cursor:not-allowed;
}
.ah-filter label.is-disabled input{
    cursor:not-allowed;
    background:#eee;
    border-color:#ccc;
}

/* ================= ACTIVE STATE ================= */
.ah-filter input:checked + span,
.ah-filter label:has(input:checked){
    background:#fff5f5;
    border:1px solid #f2c1c1;
}

/* ================= MOBILE ================= */
@media(max-width:768px){
    .ah-filter{
        border-radius:10px;
        padding:14px;
    }
}


/* ===== FILTER MOBILE ===== */
.ah-filter-mobile {
    padding: 10px;
}

.ah-filter-mobile-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* ===== DROPDOWN ===== */
.ah-dropdown {
    position: relative;
}

.ah-dropdown-toggle {
    width: 100%;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ah-dropdown-toggle::after {
    content: "▾";
    font-size: 14px;
    transition: transform .25s ease;
}

.ah-dropdown.active .ah-dropdown-toggle::after {
    transform: rotate(180deg);
}

/* ===== MENU ===== */
.ah-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
    padding: 10px;
    display: none;
    z-index: 99;
    max-height: 260px;
    overflow-y: auto;
}

.ah-dropdown.active .ah-dropdown-menu {
    display: block;
}

/* ===== TAG ITEM ===== */
.ah-tag-item {
    margin-bottom: 6px;
}

.ah-tag-input {
    display: none;
}

.ah-tag-label {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    background: #f7f7f7;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}

.ah-tag-input:checked + .ah-tag-label {
    background: #e53935;
    color: #fff;
    font-weight: 600;
}

.ah-tag-label.is-disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ===== TEXT ===== */
.ah-coming-soon {
    font-size: 13px;
    padding: 10px;
    color: #777;
}



/* ===== SELECTED FILTERS ===== */
.ah-selected-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    background: #fafafa;
    border: 1px dashed #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
}

.ah-selected-title {
    font-weight: 600;
    margin-right: 5px;
}

.ah-selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ah-selected-item {
    background: #e53935;
    color: #fff;
    padding: 5px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.ah-selected-item button {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.ah-clear-all {
    margin-left: auto;
    background: none;
    border: none;
    color: #e53935;
    cursor: pointer;
    font-weight: 600;
}
