/* Filter System Styles */
.filter-container {
    margin: 0 0 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Brand filter styles */
.brands-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.brand-item {
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    transition: all 0.3s ease;
}

.brand-item:hover {
    border-color: #30a115;
    box-shadow: 0 0 5px rgba(48, 161, 21, 0.5);
}

/* Active brand styling - more prominent */
.brand-item.active {
    border: 2px solid #30a115 !important;
    background-color: #f0fff0;
    box-shadow: 0 6px 16px rgba(48, 161, 21, 0.4);
    transform: scale(1.05);
}

.brand-item.active:hover {
    border: 2px solid #2d8f13 !important;
    box-shadow: 0 8px 20px rgba(48, 161, 21, 0.5);
    transform: scale(1.06);
}

.brand-item img {
    height: 30px;
    max-width: 100%;
}

/* Brand name text fallback styling */
.brand-name-text {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.2;
    padding: 4px 8px;
    background-color: #fff;
    border-radius: 3px;
    transition: all 0.3s ease;
    min-height: 30px;
    word-break: break-word;
    hyphens: auto;
}

/* Brand name text in active state */
.brand-item.active .brand-name-text {
    color: #30a115;
    background-color: #fff;
}

/* Brand name text on hover */
.brand-item:hover .brand-name-text {
    color: #30a115;
    background-color: #fff;
}

/* Filter criteria styles */
.filter-criteria h4, .sort-options h4, .active-filters h4, .brand-filter h4 {
    margin-bottom: 15px;
    font-weight: 600;
    color: #333;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-btn {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #333;
}

.filter-btn:hover, .filter-btn.active {
    background-color: #30a115;
    border-color: #30a115;
    color: #fff;
}

/* Filter dropdown styles */
.filter-dropdown {
    display: none;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.price-options, .other-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Ensure custom price range section takes full width and breaks to new line */
.price-options .custom-price-range-section {
    flex-basis: 100%;
    order: 999;
}

.price-option, .filter-option, .sort-option {
    display: inline-block;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.price-option:hover, .price-option.active,
.filter-option:hover, .filter-option.active,
.sort-option:hover, .sort-option.active {
    background-color: #30a115;
    color: #fff;
    border-color: #30a115;
}

/* Active filters section */
.active-filters {
    margin: 20px 0;
}

.active-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background-color: #f1f8ef;
    border: 1px solid #30a115;
    border-radius: 20px;
    color: #333;
    font-size: 13px;
}

.filter-tag i {
    color: #30a115;
    cursor: pointer;
}

.clear-all-filters {
    color: #30a115;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
}

/* Sort options styles */
.sort-options {
    margin-top: 20px;
}

.sort-option {
    display: inline-block;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sort-option:hover, .sort-option.active {
    background-color: #30a115;
    color: #fff;
    border-color: #30a115;
    text-decoration: none; /* Bỏ gạch chân khi hover */
}



/* Price range slider */
#price-range-slider {
    margin: 15px 10px 25px 10px;
}

#price-range {
    text-align: center;
    font-weight: bold;
    color: #30a115;
}

.ui-slider-handle {
    outline: none !important;
    background: #30a115 !important;
    border-color: #248c10 !important;
}

.ui-slider-range {
    background: #30a115 !important;
}

/* Custom price range slider section */
.custom-price-range-section {
    width: 100%;
    clear: both;
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    display: block;
}

.price-range-slider-container {
    padding: 0 5px;
}

.price-slider {
    margin: 15px 0 20px 0;
    height: 6px;
}

.price-range-display {
    text-align: center;
    font-weight: bold;
    color: #30a115;
    margin-bottom: 15px;
    font-size: 16px;
}

.apply-custom-price {
    border-color: #30a115 !important;
    color: #30a115 !important;
    transition: all 0.3s ease;
}

.apply-custom-price:hover {
    background-color: #30a115 !important;
    border-color: #30a115 !important;
    color: white !important;
}

.apply-custom-price:focus {
    box-shadow: 0 0 0 2px rgba(48, 161, 21, 0.25) !important;
}

/* Custom price option styling when active */
.price-option.custom-range {
    background-color: #30a115;
    color: white;
    border-color: #30a115;
}

/* Product display styles */
.product-results {
    margin-top: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.result-summary {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    text-align: center;
}

.product-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
    height: 100%;
}

.product-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.promotion-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.product-info {
    padding: 15px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    height: 48px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    margin-bottom: 15px;
}

.sale-price {
    color: #dc3545;
    font-weight: bold;
    font-size: 18px;
    margin-right: 10px;
}

.original-price {
    color: #333;
    font-weight: bold;
    font-size: 16px;
}

.original-price.crossed {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
}

.product-specs {
    margin-bottom: 15px;
}

.spec {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 3px;
}

.view-product {
    background-color: #30a115;
    border-color: #30a115;
    font-size: 14px;
    padding: 8px 16px;
}

.view-product:hover {
    background-color: #248c10;
    border-color: #248c10;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results h3 {
    color: #333;
    margin-bottom: 15px;
}

/* Loading indicator */
#loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 20px;
    border-radius: 5px;
    z-index: 9999;
    display: none;
}

/* Error message */
#error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 15px;
    border-radius: 5px;
    z-index: 9999;
    max-width: 300px;
    display: none;
}

/* Pagination styles */
.pagination-wrapper {
    margin-top: 30px;
    text-align: center;
}

.pagination .page-link {
    color: #30a115;
    border-color: #ddd;
}

.pagination .page-item.active .page-link {
    background-color: #30a115;
    border-color: #30a115;
}

.pagination .page-link:hover {
    color: #248c10;
    background-color: #f8f9fa;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .filter-buttons {
        flex-wrap: wrap;
    }

    .filter-btn {
        margin-bottom: 5px;
        width: calc(50% - 5px);
    }

    .price-options, .other-options {
        flex-direction: column;
    }

    .brand-item {
        width: calc(33.33% - 10px);
    }

    .sort-option {
        display: block;
        margin-bottom: 10px;
    }



    .product-card {
        margin-bottom: 20px;
    }

    .product-image {
        height: 180px;
    }
}

/* View more brands button inline with h4 */
.brand-view-more-button {
    display: inline;
    margin-left: 10px;
}

.brand-view-more-button .view-more-brands,
.brand-view-more-button .show-less-brands {
    border: 1px solid #30a115;
    background: transparent;
    color: #30a115;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.3s ease;
    font-size: 11px;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1;
}

.brand-view-more-button .view-more-brands:hover,
.brand-view-more-button .show-less-brands:hover {
    background: #30a115;
    color: white;
    transform: translateY(-1px);
}

.brand-view-more-button .view-more-brands:focus,
.brand-view-more-button .show-less-brands:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(48, 161, 21, 0.25);
}

/* Brand tag styling (non-removable, shows current brand page) */
.filter-tag.brand-tag {
    background: #30a115;
    color: white;
    border: 1px solid #30a115;
}

.filter-tag.brand-tag .brand-indicator {
    margin-left: 8px;
    opacity: 0.8;
}

.filter-tag.brand-tag:hover .brand-indicator {
    opacity: 1;
}

/* Legacy view more brands button (for backward compatibility) */
.view-more-brands-wrapper {
    width: 100%;
    text-align: center;
    margin: 15px 0;
}

.view-more-brands-wrapper .view-more-brands,
.view-more-brands-wrapper .show-less-brands {
    border: 2px dashed #30a115;
    background: transparent;
    color: #30a115;
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.view-more-brands-wrapper .view-more-brands:hover,
.view-more-brands-wrapper .show-less-brands:hover {
    background: #30a115;
    color: white;
    border-style: solid;
    transform: translateY(-1px);
}
