

/* CSS cho category filters - Ẩn hoàn toàn */
.category-filters {
    display: none !important;
}

/* CSS cho filter links active */
.filter-link.active,
.mobile-filter-link.active {
    background-color: #007cba !important;
    color: white !important;
    border-color: #007cba !important;
}

.filter-link.active:hover,
.mobile-filter-link.active:hover {
    background-color: #005a87 !important;
    color: white !important;
}

/* CSS cho mobile filter button */
.mobile-filter-btn {
    display: none;
    position: relative;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    gap: 8px;
    margin: 20px auto;
    width: fit-content;
}

/* CSS cho mobile filter header với số kết quả */
.mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-filter-header .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-filter-header .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.clear-all-filters {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-all-filters:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.mobile-filter-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.mobile-filter-results {
    font-size: 14px;
    color: #666;
    margin-left: 10px;
}

/* Ẩn mobile filter overlay mặc định */
.mobile-filter-overlay {
    display: none !important;
    pointer-events: none;
}

.mobile-filter-btn:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.mobile-filter-btn .filter-icon {
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23333" stroke-width="2"><line x1="4" y1="6" x2="20" y2="6"/><circle cx="8" cy="6" r="1"/><line x1="4" y1="12" x2="20" y2="12"/><circle cx="16" cy="12" r="1"/><line x1="4" y1="18" x2="20" y2="18"/><circle cx="12" cy="18" r="1"/></svg>') no-repeat center;
    background-size: contain;
}

.mobile-filter-btn .filter-text {
    font-weight: bold;
    color: #ffffff;
    font-size: 14px;
    text-transform: uppercase;
}

/* CSS cho mobile filter overlay */
.mobile-filter-overlay {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
}

.mobile-filter-sidebar {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    height: 85%;
    max-height: 600px;
    background: white;
    transition: bottom 0.3s ease;
    overflow-y: auto;
    border-radius: 20px 20px 0 0;
}

.mobile-filter-sidebar.show {
    bottom: 0;
}

/* Bỏ mobile-filter-header cũ vì đã có CSS mới ở trên */

.mobile-filter-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-filter-content {
    padding: 20px;
    background: #f8f9fa;
    min-height: calc(100% - 80px);
}

.mobile-filter-section {
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.mobile-filter-section-header {
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.mobile-filter-section-header:hover {
    background: #f8f9fa;
}

.mobile-filter-section-title {
    font-weight: bold;
    color: #333;
    font-size: 16px;
    margin: 0;
}

.mobile-filter-section-toggle {
    font-size: 18px;
    color: #666;
    transition: transform 0.3s ease;
    display: inline-block;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
}

.mobile-filter-section-toggle.active {
    transform: rotate(45deg);
}

.mobile-filter-section-content {
    display: none;
    padding: 15px 20px;
    background: white;
    transition: all 0.3s ease;
    border-top: 1px solid #e9ecef;
    min-height: 50px;
}

.mobile-filter-section-content.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.mobile-filter-link {
    display: block;
    padding: 12px 0;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: color 0.3s ease;
}

.mobile-filter-link:last-child {
    border-bottom: none;
}

.mobile-filter-link:hover {
    color: #007cba;
}

.mobile-filter-link.bold {
    font-weight: bold;
}

.mobile-filter-link.special {
    color: #dc3545;
    font-weight: bold;
}

/* Mobile price slider */
.mobile-price-slider {
    padding: 15px 20px;
    background: white;
}

.mobile-price-slider .price-slider {
    width: 100%;
    margin: 10px 0;
}

.mobile-price-slider .price-range {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* CSS cho filter menu tách riêng từng ô */
.filter-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.filter-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
    text-align: center;
    position: relative;
}

.filter-header {
    color: #007cba;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 0px;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.3s ease;
    text-align: center;
}

.filter-header:hover {
    color: #007cba;
}

.filter-header.active {
    color: #007cba;
}

.filter-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    padding: 10px;
    text-align: left;
}

.filter-links.show {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-link {
    color: #000 !important;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 10px;
    transition: color 0.3s ease;
    border-radius: 4px;
}

.filter-link:hover {
    color: #007cba !important;
    text-decoration: none;
    background: #f8f9fa;
}

.filter-link.special {
    color: #dc3545 !important;
    font-weight: bold;
}

.filter-link.special:hover {
    color: #c82333 !important;
}

.filter-link.bold {
    font-weight: bold;
}

/* CSS cho thanh kéo giá */
.price-slider-container {
    display: block;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 10px;
}

.price-slider-container.active {
    display: block;
}

.price-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007cba;
    cursor: pointer;
}

.price-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007cba;
    cursor: pointer;
    border: none;
}

.price-range {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}



.product-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 280px;
    max-width: 280px;
    position: relative;
}

.product-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.product-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.product-item h3 {
    font-size: 14px;
    font-weight: 300;
    margin: 8px 0 4px 0;
    color: #333;
    line-height: 1.3;
    flex-grow: 1;
}

.product-item .product-code {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.product-item .price {
    font-size: 15px;
    font-weight: 300;
    color: #007cba;
    margin: 4px 0;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    /* Ẩn filter desktop trên mobile */
    .filter-container {
        display: none !important;
    }
    
    /* Hiển thị mobile filter button */
    .mobile-filter-btn {
        max-width: 30%;
        display: flex !important;
    }
    
    /* Mobile filter overlay chỉ hiển thị khi có class show */
    .mobile-filter-overlay.show {
        display: block !important;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    .products-container {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 20px;
    }
    
    .product-item {
        min-height: 320px;
        width: 220px;
        max-width: 220px;
        position: relative;
    }
    
    .product-item img {
        width: 100%;
        height: 180px;
    }
    
    .banner-item {
        grid-column: 3 / 5;
        grid-row: 3 / 5;
        max-width: none;
    }
    
    .banner-item img {
        width: 100% !important;
        height: 100% !important;
    }
}

@media (max-width: 480px) {
    .filter-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .products-container {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: 15px;
    }
    
    .product-item {
        min-height: 280px;
        padding: 15px;
        width: 170px;
        max-width: 170px;
        position: relative;
    }
    
    .product-item img {
        width: 100%;
        height: 160px;
    }
    
    .product-item h3 {
        font-size: 13px;
    }
    
    .product-item .price {
        font-size: 13px;
    }
    
    .product-item .product-code {
        font-size: 10px;
    }
    
    .banner-item {
        grid-column: 3 / 5;
        grid-row: 3 / 5;
        max-width: none;
        padding: 0;
        aspect-ratio: 1;
    }
    
    .banner-item img {
        width: 100% !important;
        height: 100% !important;
    }
}

/* Loading animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ẩn các ô trống và làm layout đẹp hơn */
#combined-products:empty {
    display: none;
}

#combined-products:empty::after {
    content: "Đang tải sản phẩm...";
    display: block;
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Đảm bảo container có sản phẩm mới hiển thị */
.products-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    min-height: auto;
    justify-items: center;
}

/* Cải thiện spacing */
.main-content {
    padding: 20px 0;
}

/* Thêm shadow cho filter boxes */
.filter-box {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.filter-box:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* CSS cho banner item */
.banner-item {
    background: white;
    border: 2px solid #007cba;
    border-radius: 8px;
    padding: 0;
    text-align: center;
    transition: all 0.3s ease;
    grid-column: 3 / 5;
    grid-row: 3 / 5;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
}

/* CSS cho STORIES và MOMENTS - ẩn mặc định */
.STORIES, .MOMENTS {
    display: none;
}

/* Bỏ margin-top không mong muốn */
.banner+.row:not(.row-collapse), 
.banner-grid-wrapper+.row:not(.row-collapse), 
.section+.row:not(.row-collapse), 
.slider-wrapper+.row:not(.row-collapse) {
    margin-top: 0 !important;
}

.banner-item:hover {
    box-shadow: 0 4px 12px rgba(0,123,186,0.2);
    transform: translateY(-2px);
}

.banner-item a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CSS cho icon NEW */
.new-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: url('https://cashion.vn/wp-content/uploads/2024/03/new-icon.png') no-repeat center center;
    background-size: contain;
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
}

.new-icon:hover {
    transform: scale(1.1);
}

/* Responsive cho icon NEW */
@media (max-width: 768px) {
    .new-icon {
        width: 30px;
        height: 30px;
        top: 8px;
        right: 8px;
    }
}

@media (max-width: 480px) {
    .new-icon {
        width: 25px;
        height: 25px;
        top: 6px;
        right: 6px;
    }
}
