/* =========== Container form chính =========== */
/* .custom-woo-filter {
  margin: 10px 0 40px;
  padding: 20px 25px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #ffffff;
} */
form#custom-woo-filter {
    margin-bottom: .5em;
}


/* =========== Nhóm filter =========== */
.custom-woo-filter .filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    margin-bottom: 20px;
    border-bottom: 1px solid #e6e6e685;
    padding-bottom: 20px;
}

.custom-woo-filter .filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.custom-woo-filter .filter-group .dmc,
.custom-woo-filter .filter-brands .lth {
    font-size: 17px;
    font-weight: 900;
    margin-bottom: 10px;
    color: #007db5;
	display: none;
}

/* =========== Danh mục con - Style buttons =========== */

.custom-woo-filter .filter-group .dmc {
    margin-bottom: 18px;
}

.filter-children { 
  width: 100%; 
}

.cat-children {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 0fr));
    gap: 15px;
    width: 100%;
    max-height: 55px;
    overflow-y: auto;
    overflow-x: hidden;
}

.cat-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    text-align: center;
    font-size: 12px;
    font-weight: 400;
    color: #333;
    min-height: 42px;
    margin-bottom: unset;
}

.cat-item span {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-height: 46px;
}

.cat-item:hover {
    border-color: #007db5;
    background: #f0f8ff;
    box-shadow: 0 2px 8px rgba(0,125,181,0.1);
}

.cat-item.selected {
    background: #007db5;
    border-color: #007db5;
    color: #ffffff;
}

.cat-item:active {
    transform: scale(0.98);
}

.cat-item input[type="checkbox"] {
    display: none;
}

/* =========== Thương hiệu - Chỉ hình ảnh =========== */
.filter-brands {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(105px, 0fr));
    gap: 11px;
    width: 100%;
    max-height: 130px;
    overflow-y: auto;
    overflow-x: hidden;
}

.brand-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: unset;
}

.brand-item:hover {
/*     transform: translateY(-2px); */
    box-shadow: 0 4px 12px rgba(0,125,181,0.15);
    border-color: #007db5;
}

.brand-item:active {
    transform: scale(0.98);
}

.brand-item.selected {
  background: #f0f8ff;
  border-color: #007db5;
  box-shadow: 0 0 0 2px rgba(0,124,186,.2);
}

/* .brand-item.selected .brand-thumb {
  border: 1px solid #007db5;
} */

.brand-item input[type="checkbox"] {
  display: none;
}

.brand-thumb {
    border-radius: 6px;
    object-fit: contain;
    background: white;
    padding: 2px;
    max-height: 44px;
}

/* =========== Nhóm nút (chỉ còn reset) =========== */
.custom-woo-filter .filter-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  display: none;
}

.custom-woo-filter .filter-button {
    padding: 6px 42px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    margin: 10px 0px;
}

.filter-button i { 
    font-size: 13px; 
    margin-right: 6px; 
}

.custom-woo-filter .filter-reset {
  background: transparent;
  color: rgb(226, 0, 30);
  border: 1px solid rgb(226, 0, 30);
}

.custom-woo-filter .filter-reset:hover {
  background: rgb(226, 0, 30);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(226,0,30,0.2);
}

/* =========== Overlay Loading =========== */
.filter-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.83);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.filter-overlay.hidden { 
  display: none; 
}

.spinner {
  width: 50px; 
  height: 50px;
  border: 5px solid #eee;
  border-top: 5px solid #007cba;
  border-radius: 50%;
  animation: spin 2.5s linear infinite;
  margin: 0 auto;
}

@keyframes spin { 
  to { transform: rotate(360deg); } 
}

.filter-overlay .filter-loading {
  color: #fff;
  background: none;
  border: none;
  text-shadow: 0 1px 2px #222;
  margin-top: 20px;
  font-size: 1.15em;
}

/* =========== Custom Scrollbar =========== */
.cat-children::-webkit-scrollbar,
.filter-brands::-webkit-scrollbar { 
    width: 6px; 
}

.cat-children::-webkit-scrollbar-track,
.filter-brands::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.cat-children::-webkit-scrollbar-thumb,
.filter-brands::-webkit-scrollbar-thumb { 
    background: #c1c1c1; 
    border-radius: 3px;
}

.cat-children::-webkit-scrollbar-thumb:hover,
.filter-brands::-webkit-scrollbar-thumb:hover { 
    background: #a8a8a8; 
}

/* =========== Mobile =========== */
@media screen and (max-width: 768px) {
    .custom-woo-filter {
        margin: 0 0 30px;
        padding: 15px 20px;
        border-radius: 10px;
    }

    .custom-woo-filter .filter-group .dmc, 
    .custom-woo-filter .filter-brands .lth {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .custom-woo-filter .filter-group {
        margin-bottom: 15px;
        padding-bottom: 15px;
    }

.cat-children {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        max-height: 120px;
        padding-right: 4px;
    }
    
    .cat-item {
        font-size: 12px;
        padding: 6px 12px;
        min-height: 32px;
    }

    .filter-brands { 
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        max-height: 180px;
    }

    .brand-item {
        padding: 4px;
        min-height: 60px;
    }

    .custom-woo-filter .filter-button {
        padding: 8px 16px;
        font-size: 13px;
        width: 100%;
    }

    .custom-woo-filter .filter-actions {
        width: 100%;
        justify-content: center;
        margin-top: 5px;
    }
}

@media screen and (max-width: 480px) {
	    .custom-woo-filter .filter-group .dmc, .custom-woo-filter .filter-brands .lth {
        font-size: 14px;
    }
    .cat-children {
        max-height: 72px;
    }
    
    .cat-item {
        font-size: 10px;
        padding: 7px 7px;
        min-height: 30px;
    }

    .filter-brands {
        grid-template-columns: repeat(4, 1fr);
        max-height: 120px;
        gap: 10px;
        padding-right: 5px !important;
    }

    .brand-item {
        min-height: 32px;
        padding: 0px;
    }

	
    .brand-thumb {
        border-radius: 4px;
        padding: 4px;
        max-height: 30px;
    }

	
	    .custom-woo-filter .filter-button {
        padding: 6px 16px;
        font-size: 12px;
    }

.cat-item span {
    -webkit-line-clamp: 1;
    max-height: 26px;
}
	
	.custom-woo-filter .filter-brands .lth {
        margin-bottom: 4px !important;
}
	
	}