/* ========================================================
   1. SLIDER BANNER 2 CỘT MÁY TÍNH - 1 CỘT ĐIỆN THOẠI
   ======================================================== */
.custom-cat-slider-box {
    margin-bottom: 15px;
    width: 100%;
}

/* Ép link và picture hiển thị dạng khối */
.custom-cat-slider-box .custom-banner-link,
.custom-cat-slider-box picture {
    display: block !important;
    width: 100%;
    line-height: 0;
}

/* Định dạng thẻ ảnh và chống lỗi mất layer khi rê chuột */
.custom-cat-slider-box .custom-banner-img {
    width: 100% !important;
    border-radius: 8px;
    display: block !important;
    object-fit: cover;
    height: auto;
    background-color: #f0f0f0;
    
    /* Chống giật & chống mất hình khi hover */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Máy tính: Giữ tỉ lệ chuẩn */
@media (min-width: 550px) {
    .custom-cat-slider-box .custom-banner-img {
        aspect-ratio: 590 / 160;
    }
}

/* Điện thoại: Giảm chiều cao ảnh banner cho thon gọn (Tỉ lệ 2.2 / 1) */
@media (max-width: 549px) {
    .custom-cat-slider-box .custom-banner-img {
        aspect-ratio: 2.2 / 1;
    }
}

/* ========================================================
   2. BREADCRUMB & TIÊU ĐỀ
   ======================================================== */
.custom-breadcrumb-box {
    margin-bottom: 12px;
    font-size: 13.5px;
}
.custom-breadcrumb-box nav {
    margin: 0;
    color: #666;
}
.custom-cat-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--fs-color-base, #1a4f8b);
    margin: 15px 0 10px 0;
}

/* ========================================================
   3. DANH MỤC CON DẠNG NÚT BẤM (CHỐNG GIẬT - LƯỚT SIÊU MƯỢT)
   ======================================================== */
.custom-subcat-wrapper {
    margin-bottom: 15px;
    width: 100%;
    position: relative;
}
.custom-subcat-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px;
    
    /* Ẩn thanh cuộn trên Firefox & IE/Edge */
    scrollbar-width: none;
    -ms-overflow-style: none;

    /* Tương tác chuột mượt mà, chống bôi đen văn bản khi kéo */
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-overflow-scrolling: touch;
}

/* Biến con trỏ thành bàn tay nắm khi đang giữ chuột kéo */
.custom-subcat-list:active,
.custom-subcat-list.is-dragging {
    cursor: grabbing;
}

/* Ẩn thanh cuộn trên Chrome, Safari, Cốc Cốc, Opera */
.custom-subcat-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.custom-subcat-list .subcat-item {
    display: inline-block;
    padding: 6px 14px;
    background: #f4f6f8;
    color: #333;
    font-size: 13.5px;
    border-radius: 20px;
    border: 1px solid #e1e4e8;
    text-decoration: none;
    flex-shrink: 0; /* Giữ chữ cố định đẹp mắt, không bị co ép méo nút */
    
    /* Chặn trình duyệt kéo ảnh ma của thẻ liên kết gây giật */
    -webkit-user-drag: none;
    user-drag: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.custom-subcat-list .subcat-item:hover,
.custom-subcat-list .subcat-item.active {
    background: var(--primary-color, #0071dc);
    color: #fff;
    border-color: var(--primary-color, #0071dc);
}

/* ========================================================
   4. THANH CÔNG CỤ (CÓ X SẢN PHẨM & Ô SẮP XẾP)
   ======================================================== */
.custom-shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 15px 0 20px 0;
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
}
.custom-result-count {
    font-size: 14.5px;
    color: #333;
}

/* Ô chọn Sắp xếp mặc định */
.custom-shop-toolbar select.orderby {
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    background-color: #fff;
    color: #333;
    outline: none;
    cursor: pointer;
    box-shadow: none;
}

/* KÉO FULL Ô SẮP XẾP TRÊN ĐIỆN THOẠI */
@media (max-width: 549px) {
    .custom-shop-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .custom-shop-toolbar .toolbar-left {
        width: 100%;
    }
    .custom-shop-toolbar .toolbar-right,
    .custom-shop-toolbar .toolbar-right form.woocommerce-ordering,
    .custom-shop-toolbar select.orderby {
        width: 100% !important;
    }
}

/* Ẩn tiêu đề gốc của theme */
.page-title.category-page-title {
    display: none;
}