html {
    scroll-behavior: smooth;
}

.bce-filters-wrapper {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* --- CẤU TRÚC LAYOUT CHUNG--- */
.bce-content-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 20px 0;
}

#bce-filters-sidebar {
    flex: 0 0 260px;
    max-width: 260px;
}

#bce-main-content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Khoảng cách mặc định cho PC */
.bce-shortcode-block,
.bce-icon-slider-container,
.bce-shop-controls {
    margin-bottom: 25px;
}

/* [SỬA LỖI] Ép buộc khối điều khiển trên PC căn lề */
.bce-shop-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

/* [SỬA LỖI] Biện pháp mạnh nhất để đẩy ô sắp xếp sang phải */
.bce-shop-controls .woocommerce-ordering {
    margin-left: auto !important;
}

.woocommerce-ordering select {
    font-size: 12px;
    border-radius: 4px;
    padding: 8px 12px;
}

.bce-mobile-filter-triggers,
.bce-slider-nav {
    display: none;
}
/* --- AJAX Loading State --- */
#bce-main-content-wrapper {
    position: relative;
    transition: opacity 0.3s ease;
}

#bce-main-content-wrapper.is-loading > * {
    opacity: 0.4;
    pointer-events: none; /* Ngăn người dùng click vào nội dung đang tải */
}

#bce-main-content-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
}

#bce-main-content-wrapper.is-loading::after {
    opacity: 1;
    visibility: visible;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}