/* DoDo Product Filter Styles */
.dodo-product-filter {
    display: grid;
    grid-template-columns: 4.5fr 2.5fr 3fr;
    gap: 25px;
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

/* Điều chỉnh bố cục khi ẩn bộ lọc thương hiệu */
.tax-product_brand .dodo-product-filter {
    grid-template-columns: 1fr 1fr;
}

/* Loading state */
.dodo-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.dodo-loading span {
    background: #fff;
    color: #333;
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-weight: 500;
}

/* Product count message */
.product-count-message {
    margin-bottom: 15px;
    padding: 8px 12px;
    background: #f7f7f7;
    border-radius: 4px;
    border-left: 3px solid #2271b1;
    font-size: 14px;
    color: #333;
}

/* Filter Sections */
.filter-section {
    min-width: 0;
}

.filter-section h4 {
    font-size: 15px;
    font-weight: 600;
    color: #2c3338;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Brand List */
.brand-list {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    max-height: 220px;
    overflow-y: auto;
    padding: 5px;
}

.brand-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0px;
    background: #fff;
    border: 2px solid #e2e4e7;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: center;
    aspect-ratio: 14 / 10;
}

.brand-item:hover {
    border-color: #c8ccd0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

.brand-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.brand-item input[type="checkbox"]:checked + img {
    transform: scale(1.05);
}

.brand-item input[type="checkbox"]:checked ~ span {
    color: #2271b1;
}

.brand-item:has(input[type="checkbox"]:checked) {
    border-color: #2271b1;
    background: #f0f6fc;
}

.brand-item img {
    width: 100%;
    height: 35px;
    object-fit: contain;
    transition: transform 0.2s ease;
    padding: 3px;
}

.brand-item span {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #2c3338;
    margin-top: 3px;
    transition: color 0.2s ease;
    line-height: 1.2;
}

/* Categories Select */
.categories-filter select {
    width: 100%;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    font-size: 14px;
    color: #2c3338;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 35px;
}

.categories-filter select:hover,
.categories-filter select:focus {
    background-color: #fff;
    border-color: #c8ccd0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Price Ranges */
.price-ranges {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding: 5px;
}

.price-range-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.price-range-item:hover {
    background: #fff;
    border-color: #c8ccd0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

.price-range-item input[type="radio"] {
    margin: 0;
}

/* Scrollbar Styles */
.brand-list::-webkit-scrollbar,
.price-ranges::-webkit-scrollbar {
    width: 6px;
}

.brand-list::-webkit-scrollbar-track,
.price-ranges::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 6px;
}

.brand-list::-webkit-scrollbar-thumb,
.price-ranges::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 6px;
}

.brand-list::-webkit-scrollbar-thumb:hover,
.price-ranges::-webkit-scrollbar-thumb:hover {
    background: #c8ccd0;
}

/* Pagination Container */
.pagination-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 30px 0;
    clear: both;
}

/* Pagination */
.dodo-pagination {
    text-align: center;
    margin: 0 auto;
    clear: both;
    display: flex;
    justify-content: center;
}

.dodo-pagination ul {
    display: inline-flex;
    margin: 0;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    list-style: none;
}

.dodo-pagination li {
    margin: 0;
    border-right: 1px solid #ddd;
}

.dodo-pagination li:last-child {
    border: none;
}

.dodo-pagination a,
.dodo-pagination span {
    display: block;
    padding: 8px 12px;
    background: #fff;
    color: #666;
    text-decoration: none;
    min-width: 40px;
    font-size: 14px;
    line-height: 1.4;
}

.dodo-pagination span.current {
    background: #f7f7f7;
    color: #333;
    font-weight: 500;
}

.dodo-pagination a:hover {
    background: #f7f7f7;
}

/* Responsive */
@media (max-width: 1200px) {
    .dodo-product-filter {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        padding: 20px;
    }

    .brand-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .dodo-product-filter {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }

    .brand-list {
        grid-template-columns: repeat(2, 1fr);
        max-height: 180px;
    }
}

/* Mobile filter */
.mobile-filter {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.mobile-filter select {
    flex: 1;
    min-width: 0;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

@media (max-width: 768px) {
    .dodo-product-filter {
        display: none;
    }
    
    .mobile-filter {
        display: flex;
    }
}

/* Product Grid */
.woocommerce ul.products {
    display: grid !important; /* Force grid display */
    grid-template-columns: repeat(var(--products-per-row, 4), 1fr) !important;
    margin: 0 !important;
    padding: 0;
    list-style: none;
    width: 100% !important;
    clear: both;
    position: relative;
}

.woocommerce ul.products.loading {
    min-height: 200px;
}

.woocommerce ul.products .col{
    margin-bottom: 0;
    padding: 0 9.8px 19.6px;
}

.woocommerce ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
}

@media (max-width: 768px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Ensure filter is visible on brand pages too */
.tax-product_brand .dodo-filter-container {
    display: block !important;
} 