/* ==========================================================================
   SUPPLIER / BRAND PAGE STYLES (Pure CSS - Fully Responsive)
   ========================================================================== */

/* Main Page Wrapper */
.supplier-detail-page {
    background-color: #f7f9fa;
    padding-bottom: 50px;
}

/* --- Brand Hero Header Card --- */
.supplier-header-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e8ecf1;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    padding: 24px 28px;
    margin: 18px 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    position: relative;
    overflow: hidden;
}

.supplier-header-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-1, #042a8d) 0%, var(--color-3, #d9a05b) 100%);
}

.supplier-header-main {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.supplier-header-logo {
    width: 90px;
    height: 90px;
    min-width: 90px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    color: var(--color-1, #042a8d);
    flex-shrink: 0;
}

.supplier-header-logo svg {
    width: 100%;
    height: 100%;
    max-width: 65px;
    max-height: 65px;
    display: block;
}

.supplier-header-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.supplier-logo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #042a8d 0%, #1742a7 100%);
    color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 700;
}

.supplier-header-info {
    flex: 1;
    min-width: 0;
}

.supplier-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #042a8d;
    background: #edf2ff;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 6px;
}

.supplier-header-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 6px 0;
    line-height: 1.25;
    word-break: break-word;
}

.supplier-header-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
    max-width: 700px;
}

.supplier-header-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.supplier-meta-stat {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 18px;
    text-align: center;
    min-width: 130px;
}

.supplier-meta-stat .stat-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 2px;
    white-space: nowrap;
}

.supplier-meta-stat .stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #042a8d;
    white-space: nowrap;
}

.supplier-meta-stat .stat-value.link {
    font-size: 16px;
    color: #d9a05b;
    text-decoration: none;
}

/* ==========================================================================
   9 / 3 LAYOUT CONTAINER
   ========================================================================== */
.supplier-main-layout {
    /* display: grid;
    grid-template-columns: minmax(0, 9fr) minmax(0, 3fr);
    gap: 28px;
    align-items: start; */
    padding-top: 30px;
}

.supplier-title {
    font-size: clamp(24px, 2.5vw, 32px);
    margin: 0 0 25px 0;
    font-weight: 700;
    text-align: center;
}

/* ==========================================================================
   LEFT COLUMN: 9 PARTS (PRODUCTS)
   ========================================================================== */
.supplier-content-col {
    min-width: 0;
}

.supplier-products-toolbar {
    background: #ffffff;
    border: 1px solid #e8ecf1;
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.toolbar-title-wrap {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.toolbar-count {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

/* Products Grid */
.supplier-products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}

.supplier-product-item {
    display: flex;
    height: 100%;
}

.supplier-product-item>article,
.supplier-product-item>.product_card {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Product Card Improvements inside Grid */
.supplier-products-grid .product_card .news-card-img-wrap {
    aspect-ratio: 1;
    background: #f8fafc;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.supplier-products-grid .product_card .news-card-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.35s ease;
}

.supplier-products-grid .product_card:hover .news-card-img-wrap img {
    transform: scale(1.06);
}

/* Empty State */
.supplier-empty-state {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    color: #64748b;
}

.supplier-empty-state svg {
    margin-bottom: 12px;
    stroke: #94a3b8;
}

.supplier-empty-state p {
    font-size: 15px;
    margin: 0;
}

/* Pagination Styling */
.supplier-pagination {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

.supplier-pagination .pagination {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.supplier-pagination .page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.supplier-pagination .page-item.active .page-link {
    background: var(--color-1, #042a8d);
    color: #ffffff;
    border-color: var(--color-1, #042a8d);
}

.supplier-pagination .page-item:not(.active):not(.disabled) .page-link:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--color-1, #042a8d);
}

.supplier-pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   RIGHT COLUMN: 3 PARTS (STICKY SIDEBAR - OTHER BRANDS)
   ========================================================================== */
.supplier-sidebar-col {
    position: relative;
    min-width: 0;
}

/* Sticky Container */
.supplier-sticky-sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 85px;
    /* Sticky offset from top */
    max-height: calc(100vh - 105px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.supplier-sticky-sidebar::-webkit-scrollbar {
    width: 5px;
}

.supplier-sticky-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.supplier-sticky-sidebar::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.supplier-sticky-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* Sidebar Card */
.sidebar-brand-block {
    background: #ffffff;
    border: 1px solid #e8ecf1;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    padding: 18px;
}

.sidebar-brand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-brand-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-brand-title .brand-title-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-1, #042a8d);
}

.sidebar-brand-badge {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Brand List */
.sidebar-brand-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-brand-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.22s ease-in-out;
}

.sidebar-brand-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sidebar-brand-item.is-current {
    background: #eff6ff;
    border-color: #3b82f6;
}

.sidebar-brand-img {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--color-1, #042a8d);
    flex-shrink: 0;
}

.sidebar-brand-img svg {
    width: 100%;
    height: 100%;
    max-width: 32px;
    max-height: 32px;
    display: block;
}

.sidebar-brand-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.sidebar-brand-placeholder {
    width: 100%;
    height: 100%;
    background: #e2e8f0;
    color: #475569;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.sidebar-brand-info {
    flex: 1;
    min-width: 0;
}

.sidebar-brand-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.sidebar-brand-item:hover .sidebar-brand-name,
.sidebar-brand-item.is-current .sidebar-brand-name {
    color: #042a8d;
}

.sidebar-brand-sub {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand-arrow {
    color: #cbd5e1;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.sidebar-brand-item:hover .sidebar-brand-arrow {
    color: #042a8d;
    transform: translateX(2px);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Laptop / iPad Pro Landscape (992px - 1199px) */
@media (max-width: 1199px) {
    /* .supplier-main-layout {
        grid-template-columns: minmax(0, 8.5fr) minmax(0, 3.5fr);
        gap: 20px;
    } */

    .supplier-header-card {
        padding: 20px 24px;
    }
}

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    .supplier-header-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .supplier-header-meta {
        width: 100%;
        justify-content: flex-start;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .supplier-meta-stat {
        min-width: 0;
        width: 100%;
    }

    /* .supplier-main-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    } */

    /* Ở tablet/mobile sidebar không cần sticky nữa để tránh che khuất */
    .supplier-sticky-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .supplier-sidebar-col {
        order: 2;
    }

    /* Hiển thị danh sách thương hiệu dạng lưới 3 cột ở tablet thay vì 1 cột dọc dài */
    .sidebar-brand-list {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .sidebar-brand-item:hover {
        transform: translateY(-2px);
    }

    .supplier-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
}

/* Mobile Landscape & Medium Mobile (576px - 767px) */
@media (max-width: 767px) {


    .sidebar-brand-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Small Mobile (< 576px) */
@media (max-width: 575px) {
    .supplier-header-card {
        padding: 16px;
        margin: 12px 0 18px;
        border-radius: 10px;
    }

    .supplier-header-main {
        flex-direction: row;
        align-items: center;
        gap: 14px;
        width: 100%;
    }

    .supplier-header-logo {
        width: 65px;
        height: 65px;
        min-width: 65px;
        padding: 6px;
        border-radius: 10px;
    }

    .supplier-header-logo svg {
        max-width: 45px;
        max-height: 45px;
    }

    .supplier-header-title {
        font-size: 20px;
        margin-bottom: 2px;
    }

    .supplier-header-badge {
        font-size: 11px;
        padding: 2px 8px;
        margin-bottom: 4px;
    }

    .supplier-header-meta {
        gap: 8px;
    }

    .supplier-meta-stat {
        padding: 10px 12px;
        border-radius: 8px;
    }

    .supplier-meta-stat .stat-label {
        font-size: 11px;
    }

    .supplier-meta-stat .stat-value {
        font-size: 17px;
    }

    .supplier-meta-stat .stat-value.link {
        font-size: 14px;
    }

    .supplier-products-toolbar {
        padding: 10px 14px;
        margin-bottom: 14px;
    }

    .toolbar-title {
        font-size: 16px;
    }

    /* Products Grid trên điện thoại: 2 cột gọn gàng */
    .supplier-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .supplier-product-item .product_card {
        padding: 8px;
        border-radius: 6px;
    }

    .supplier-products-grid .product_card .news-card-title {
        height: 38px;
        margin-top: 6px;
    }

    .supplier-products-grid .product_card .news-card-title a {
        font-size: 13px;
        line-height: 1.35;
    }

    .supplier-products-grid .product_card .product-price .compare-price {
        font-size: 14px;
    }

    .supplier-products-grid .product_card .product-price .price {
        font-size: 12px;
    }

    .supplier-products-grid .product_card .product-button button,
    .supplier-products-grid .product_card .product-button a {
        height: 34px !important;
        font-size: 12px !important;
    }

    /* Danh sách thương hiệu khác trên mobile */
    .sidebar-brand-block {
        padding: 14px;
        border-radius: 10px;
    }

    .sidebar-brand-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .sidebar-brand-item {
        padding: 8px 10px;
        gap: 8px;
    }

    .sidebar-brand-img {
        width: 36px;
        height: 36px;
        min-width: 36px;
        padding: 4px;
    }

    .sidebar-brand-name {
        font-size: 13px;
    }

    .sidebar-brand-sub {
        font-size: 11px;
    }

    .sidebar-brand-arrow {
        display: none;
        /* Ẩn mũi tên trên màn hình nhỏ để chừa không gian cho tên hãng */
    }
}

/* Very Small Mobile (< 380px) */
@media (max-width: 380px) {
    .supplier-products-grid {
        /* grid-template-columns: 1fr; */
        gap: 12px;
    }

    .sidebar-brand-list {
        grid-template-columns: 1fr;
    }
}