/* 
 * CSS dành riêng cho trang Hãng Sản Xuất (Custom Brand Archive)
 * Đã đổi tên class từ algolia-* sang tec-filter-*
 */

.tec-filter-archive-container {
    padding: 20px 0;
}

#tec-filter-results {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.tec-filter-layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    position: relative;
    width: 100%;
}

/* ===== SIDEBAR ===== */
.tec-filter-sidebar {
    width: 288px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    padding: 17px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

/* Custom scrollbar for sidebar */
.tec-filter-sidebar::-webkit-scrollbar {
    width: 5px;
}

.tec-filter-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.tec-filter-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.tec-filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.tec-filter-block {
    padding: 0;
}

.tec-filter-block+.tec-filter-block {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.tec-filter-block--price {
    padding-bottom: 16px;
}

.tec-filter-title {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    color: #364153;
    padding: 13px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.tec-filter-title--heading {
    font-size: 14px;
    font-weight: 600;
    color: #0a0a0a;
    border: none;
    cursor: default;
    justify-content: flex-start;
    padding: 0 0 12px 0;
}

.tec-filter-content {
    padding: 0 0 13px;
}

.tec-filter-toggler {
    cursor: pointer;
    user-select: none;
}

.tec-filter-toggle-arrow {
    transition: transform .2s;
    flex-shrink: 0;
    color: #364153;
    width: 16px;
    height: 16px;
}

.tec-filter-collapsed .tec-filter-content {
    display: none;
}

.tec-filter-collapsed .tec-filter-toggle-arrow {
    transform: rotate(-90deg);
}

.tec-filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tec-filter-list--scrollable {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.tec-filter-list--scrollable::-webkit-scrollbar {
    width: 4px;
}

.tec-filter-list--scrollable::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.tec-filter-list--scrollable::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.tec-filter-list--scrollable::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.tec-filter-list--has-more li.tec-filter-item:nth-child(n+9) {
    display: none;
}

.tec-filter-list--has-more.is-expanded li.tec-filter-item:nth-child(n+9) {
    display: flex;
}

.tec-filter-view-more {
    background: none;
    border: none;
    color: #146eb4;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 0 0;
    cursor: pointer;
    text-transform: uppercase;
    display: block;
    width: auto;
    transition: color 0.15s;
}

.tec-filter-view-more:hover {
    color: #0f5a96;
    text-decoration: underline;
}

.tec-filter-item {
    display: flex;
    align-items: center;
}

.tec-filter-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
    font-size: 14px;
    color: #4a5565;
    transition: color 0.15s;
}

.tec-filter-label:hover {
    color: #146eb4;
}

.tec-filter-cb {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #146eb4;
}

.tec-filter-label-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #0c0a09;
    font-size: 14px;
    font-weight: 400;
}

.tec-filter-count {
    color: #99a1af;
    font-size: 12px;
}

.tec-filter-count::before {
    content: "(";
}

.tec-filter-count::after {
    content: ")";
}

/* ===== PRICE range ===== */
.tec-filter-price-range-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #4a5565;
}

#tec-filter-price-slider {
    margin: 10px 5px 20px;
    height: 6px;
    border: none;
    background: #e2e8f0;
    box-shadow: none;
}

#tec-filter-price-slider .noUi-connect {
    background: #146eb4;
}

#tec-filter-price-slider .noUi-handle {
    width: 18px;
    height: 18px;
    right: -9px;
    top: -6px;
    background: #fff;
    border: 2px solid #146eb4;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

#tec-filter-price-slider .noUi-handle:before,
#tec-filter-price-slider .noUi-handle:after {
    display: none;
}

#tec-filter-price-slider .noUi-handle:hover {
    transform: scale(1.1);
    background-color: #f0f7ff;
}

#tec-filter-price-slider .noUi-touch-area {
    cursor: pointer;
}

/* ===== MAIN CONTENT ===== */
.tec-filter-main {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.tec-filter-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e8edf2;
}

.tec-filter-results-stats {
    font-size: 12.5px;
    color: #146eb4;
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    padding: 5px 13px;
    border-radius: 999px;
}

.tec-filter-btn {
    display: none;
}


/* ===== PRODUCT GRID ===== */
.tec-filter-hits-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* PRODUCT CARD (Final refinement to match image_1) */
.tec-filter-product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    min-width: 0;
    /* Important for ellipsis */
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none !important;
    color: #333;
    background: #fff;
    transition: box-shadow .2s, border-color .2s;
}

.tec-filter-product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
    border-color: #d1d5db;
    color: #333;
}

.tec-filter-product-img {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    aspect-ratio: auto;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.tec-filter-product-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    transition: transform .3s;
}

.tec-filter-product-card:hover .tec-filter-product-img img {
    transform: scale(1.04);
}

.tec-filter-product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 12px 16px 16px;
    min-width: 0;
}

.tec-filter-product-cat {
    font-size: 11px;
    font-weight: 400;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    /* Force width calculation */
    display: block;
}

.tec-filter-product-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: #333;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
    flex: 1;
}

.tec-filter-product-footer {
    margin-top: 8px;
}

.tec-filter-product-sku {
    font-size: 13px;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.5;
}

.tec-filter-product-sku strong {
    color: #1f2937;
    font-weight: 600;
}

.tec-filter-price {
    font-size: 14.4px;
    font-weight: 600;
    color: #146eb4 !important;
    line-height: 1.5;
    margin-top: 4px;
}

.tec-filter-price .amount,
.tec-filter-price .amount bdi,
.tec-filter-price ins .amount {
    color: #146eb4 !important;
}

.tec-filter-price del {
    font-size: 11px;
    color: #9ca3af !important;
    font-weight: 400;
    margin-right: 4px;
}

/* ===== PAGINATION ===== */
#tec-filter-pagination {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

#tec-filter-pagination a,
#tec-filter-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 7px;
    text-decoration: none;
    transition: all .15s;
}

#tec-filter-pagination .current {
    background: #146eb4;
    border-color: #146eb4;
    color: #fff;
    font-weight: 700;
}

#tec-filter-pagination a:hover {
    border-color: #146eb4;
    color: #146eb4;
    background: #f0f7ff;
}

/* ===== NO RESULTS ===== */
.tec-filter-no-results {
    text-align: center;
    padding: 64px 20px;
}

.tec-filter-no-results p {
    font-size: 16px;
    font-weight: 700;
    color: #334155;
}

/* ===== ACTIVE FILTERS PILLS ===== */
.tec-filter-cur-root {
    margin-bottom: 0;
}

.tec-filter-cur-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tec-filter-cur-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 4px 6px 4px 10px;
    font-size: 12px;
    color: #1e40af;
    font-weight: 500;
    line-height: 1;
}

.tec-filter-cur-label {
    font-weight: 400;
    color: #64748b;
    font-size: 12px;
    margin-right: 2px;
}

.tec-filter-cur-cat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tec-filter-cur-cat-label {
    font-weight: 600;
    color: #3b82f6;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-right: 1px;
}

.tec-filter-cur-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #bfdbfe;
    border: none;
    border-radius: 50%;
    color: #1e40af;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    line-height: 1;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}

.tec-filter-cur-delete:hover {
    background: #ef4444;
    color: #fff;
}

/* ===== MOBILE OVERLAYS ===== */
.tec-filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 9998;
}

.tec-filter-overlay.is-visible {
    display: block;
}

.tec-filter-sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #f1f5f9;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    position: absolute;
    top: 12px;
    right: 0px;
    color: #334155;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    padding: 0;
    z-index: 10;
}

.tec-filter-sidebar-close:hover {
    background: #e2e8f0;
    color: #ef4444;
    /* Turn red on hover for close */
    transform: rotate(90deg);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .tec-filter-hits-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .tec-filter-main {
        padding-bottom: 80px;
    }

    .tec-filter-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 300px;
        z-index: 9999;
        border-radius: 0;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform .28s cubic-bezier(.4, 0, .2, 1);
        border: none;
        box-shadow: none;
        padding-bottom: 24px;
        max-height: none;
    }

    .tec-filter-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 4px 0 32px rgba(0, 0, 0, .18);
    }

    .tec-filter-sidebar-close {
        display: flex;
    }

    .tec-filter-btn {
        display: inline-flex;
        position: fixed;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 9990;
        background: #146eb4;
        color: #fff;
        border-radius: 999px;
        padding: 4px 28px;
        font-size: 14px;
        font-weight: 600;
        box-shadow: 0 4px 16px rgba(20, 110, 180, 0.4);
        border: none;
        cursor: pointer;
        transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
        justify-content: center;
        align-items: center;
        gap: 8px;
    }

    .tec-filter-btn:hover {
        transform: translateX(-50%) translateY(-2px);
        box-shadow: 0 6px 20px rgba(20, 110, 180, 0.5);
        background: #0f5a96;
    }

    .tec-filter-hits-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .tec-filter-hits-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .tec-filter-hits-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .tec-filter-hits-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .tec-filter-product-img {
        height: 120px;
    }
}

/* ===== SORTING ===== */
#tec-filter-sort {
    padding: 6px 30px 6px 12px;
    font-size: 13px;
    color: #4a5565;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2214%22%20height%3D%2214%22%20fill%3D%22none%22%20stroke%3D%22%236b7280%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.15s, box-shadow 0.15s;
    height: 36px;
    min-width: 180px;
}

#tec-filter-sort:hover {
    border-color: #cbd5e1;
}

#tec-filter-sort:focus {
    border-color: #146eb4;
    box-shadow: 0 0 0 2px rgba(20, 110, 180, 0.1);
}

@media (max-width: 768px) {
    .tec-filter-sort-wrapper {
        width: 33%;
        flex-shrink: 0;
    }
    #tec-filter-sort {
        min-width: 0;
        width: 100%;
        padding: 6px 22px 6px 8px;
        font-size: 12px;
        background-position: right 5px center;
    }
    .tec-filter-results-stats {
        flex: 1;
        margin-right: 10px;
        font-size: 12px;
        padding: 5px 10px;
    }
}