.hv-tgdd-wrapper {
    margin-bottom: 20px;
    width: 100%;
    font-family: Arial, Helvetica, sans-serif;
}

.hv-tgdd-filter-group {
    margin-bottom: 8px; /* Thu hẹp khoảng cách giữa các hàng */
}

/* --- XỬ LÝ HÀNG NGANG CHUNG --- */
.hv-tgdd-scroll-row,
.hv-tgdd-parents-wrap {
    display: flex;
    flex-wrap: wrap; /* Cho phép rớt dòng trên PC */
    align-items: center;
    gap: 8px; /* Thu hẹp khoảng cách các nút */
}

.hv-tgdd-scroll-row {
    margin-bottom: 8px;
}

.hv-tgdd-child-row {
    padding-top: 8px;
    border-top: 1px dashed #e0e0e0; /* Đường viền nhẹ cho hàng con */
}

/* --- TỐI ƯU KÍCH THƯỚC NÚT NHỎ GỌN --- */
.hv-tgdd-item,
.hv-tgdd-btn-main,
.hv-tgdd-active-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px; /* Khoảng cách ảnh và chữ hẹp hơn */
    white-space: nowrap;
    flex: 0 0 auto;
    border-radius: 4px;
    
    /* Thu nhỏ padding và chiều cao */
    padding: 4px 10px;
    min-height: 30px; /* Giảm từ 34px xuống 30px */
    font-size: 13px;
    line-height: 1.2;
}

/* Nút bình thường (Hãng/Danh mục cha) */
.hv-tgdd-item {
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #f3f4f6;
    background: #f3f4f6;
}

/* Nút Lọc Chính */
.hv-tgdd-btn-main {
    border: 1px solid #288ad6 !important;
    background-color: #fff !important;
    color: #288ad6;
    cursor: pointer;
    font-weight: 500;
}

/* Nút Hãng/Danh mục Con (Nền trắng viền xám) */
.hv-tgdd-item.hv-tgdd-child {
    background: #fff;
    border: 1px solid #e0e0e0;
}

/* Chip Đang Chọn (Màu xanh, có nút X) */
.hv-tgdd-active-chip {
    background-color: #f1f8fe !important;
    border: 1px solid #288ad6 !important;
    color: #288ad6;
    cursor: pointer;
    font-weight: bold;
}
.hv-tgdd-chip-remove { font-size: 15px; font-weight: bold; line-height: 1; margin-left: 2px;}

.hv-tgdd-item:hover, .hv-tgdd-item.active {
    border-color: #288ad6 !important;
    color: #288ad6;
    background: #fff;
}

/* Thu nhỏ Logo Hãng */
.hv-tgdd-item img {
    max-height: 14px; /* Giảm từ 16px xuống 14px */
    max-width: 50px;
    object-fit: contain; margin: 0;
}

/* --- THANH SẮP XẾP --- */
.hv-tgdd-sort-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    border-top: 1px solid #f1f1f1;
    padding-top: 10px;
    margin-top: 5px;
}

.hv-tgdd-sort-label {
    font-size: 14px;
    color: #333;
    font-weight: bold;
    margin-right: 15px;
}

.hv-tgdd-sort-btn {
    background: none; border: none;
    padding: 5px 0; margin: 0;
    font-size: 13px; /* Thu nhỏ text sắp xếp */
    color: #4a4a4a;
    cursor: pointer;
    display: flex; align-items: center;
}
.hv-tgdd-sort-btn.active, .hv-tgdd-sort-btn:hover { color: #288ad6; font-weight: bold; }

/* Dấu chấm mờ giữa các nút */
.hv-tgdd-sort-btn::after {
    content: "•"; color: #e0e0e0; font-weight: normal;
    margin: 0 10px; font-size: 12px;
}
.hv-tgdd-sort-bar > div > .hv-tgdd-sort-btn::after,
.hv-tgdd-sort-btn:last-child::after { display: none; }

/* Dropdown Giá */
.hv-tgdd-dropdown-wrap { position: relative; }
.hv-tgdd-dropdown-content {
    display: none; position: absolute;
    top: 100%; right: 0;
    background: #fff; min-width: 140px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #eee; border-radius: 6px;
    z-index: 99; padding: 5px 0; margin-top: 5px;
}
.hv-tgdd-sort-sub {
    width: 100%; text-align: left;
    background: none; border: none; padding: 8px 15px;
    font-size: 13px; color: #333; cursor: pointer;
}
.hv-tgdd-sort-sub:hover { color: #288ad6; background: #f9f9f9; }

/* Hiệu ứng load AJAX */
#hv-filter-results.processing { opacity: 0.5; pointer-events: none; }
body.hv-filtering-active .shop-container > .products,
body.hv-filtering-active .shop-container > .woocommerce-pagination { display: none !important; }

/* --- RESPONSIVE CHO MOBILE (ÉP CUỘN NGANG) --- */
@media (max-width: 768px) {
    .hv-tgdd-scroll-row, .hv-tgdd-parents-wrap {
        flex-wrap: nowrap; /* Bắt buộc cuộn ngang trên ĐT */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .hv-tgdd-scroll-row::-webkit-scrollbar, .hv-tgdd-parents-wrap::-webkit-scrollbar {
        display: none;
    }
    .hv-tgdd-sort-label { display: none; } /* Ẩn chữ Sắp xếp theo */
    .hv-tgdd-sort-btn::after { margin: 0 8px; }
}