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 GIAO DIỆN] Trả lại quyền kiểm soát layout cho Tailwind --- */
.bce-shop-controls {
    display: block !important; 
}

.bce-shop-controls .woocommerce-result-count,
.bce-shop-controls .woocommerce-ordering {
    float: none !important;
    margin: 0 !important;
}

.bce-shop-controls p.woocommerce-result-count {
    margin: 0 !important;
}

/* --- [FIX MỚI] LÀM ĐẬM VIỀN CÁC KHỐI CHỨA (WIDGETS, TOP CONTROLS) --- */
/* Đổi màu viền sang slate-300 (#cbd5e1) để khung ô hiển thị rõ nét hơn */
.bce-filter-widget,
.bce-shop-controls {
    border: 1px solid #cbd5e1 !important; 
    box-shadow: 0 1px 4px rgba(0,0,0,0.06) !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;
}

#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 #4f46e5; /* Đổi màu xoay loading sang indigo */
    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); }
}