/* =============================================================================
   VBS Archive - Product Cards Styling
   ========================================================================== */

/* Container */
.vbs-archive-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Archive Header */
.vbs-archive-header {
    text-align: center;
    margin-bottom: 48px;
}

.archive-title {
    font-family: 'Work Sans', sans-serif;
    font-size: 35px;
    font-weight: 600;
    color: #2E3293;
    margin-bottom: 12px;
}

.archive-description {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: rgba(0, 0, 0, 0.6);
    text-align: center;
}

/* Products Grid - ĐÃ SỬA */
.vbs-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 cột trên di động */
    gap: 24px;
    margin-bottom: 48px;
}

@media (min-width: 768px) {
    .vbs-products-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 cột trên tablet */
    }
}

@media (min-width: 1024px) {
    .vbs-products-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 cột trên desktop */
        gap: 28px;
    }
}

@media (min-width: 1280px) { /* Thêm breakpoint cho 5 cột */
    .vbs-products-grid {
        grid-template-columns: repeat(5, 1fr); /* 5 cột trên desktop lớn */
    }
}


/* Product Card */
.vbs-product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    position: relative;
}

.vbs-product-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Image Section - ĐÃ SỬA TỈ LỆ */
.card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 aspect ratio (vuông) */
    background: #f5f5f5;
    overflow: hidden;
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.vbs-product-card:hover .card-image {
    transform: scale(1.05);
}

/* Image Count Badge */
.image-count-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.image-count-badge svg {
    width: 14px;
    height: 14px;
}

/* Wishlist Button */
.wishlist-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ccc;
}

.wishlist-btn:hover {
    background: #fff;
    color: #EA2877;
    transform: scale(1.1);
}

.wishlist-btn svg {
    width: 18px;
    height: 18px;
}

/* Card Content */
.card-content {
    padding: 16px;
}

/* Title */
.card-title {
    font-family: 'Work Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}

/* Subtitle */
.card-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.7);
    margin: 0 0 12px 0;
}

/* Price */
.card-price {
    font-family: 'Work Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #E53E3E;
    margin-bottom: 16px;
}

/* Company Info */
.card-company {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.8);
}

.company-flag {
    font-size: 16px;
}

.company-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Meta Info */
.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #999;
}

.meta-views,
.meta-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-meta svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* Pagination */
.vbs-pagination {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

.vbs-pagination ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
}

.vbs-pagination li {
    margin: 0;
}

.vbs-pagination a,
.vbs-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.vbs-pagination a {
    background: #fff;
    color: #2E3293;
    border: 1px solid #e0e0e0;
}

.vbs-pagination a:hover {
    background: #2E3293;
    color: #fff;
    border-color: #2E3293;
}

.vbs-pagination .current {
    background: #2E3293;
    color: #fff;
    border: 1px solid #2E3293;
}

.vbs-pagination .dots {
    border: none;
    background: transparent;
    color: #999;
}

.vbs-pagination svg {
    width: 20px;
    height: 20px;
}

/* No Results */
.vbs-no-results {
    text-align: center;
    padding: 80px 20px;
}

.vbs-no-results svg {
    color: #ccc;
    margin-bottom: 24px;
}

.vbs-no-results h2 {
    font-family: 'Work Sans', sans-serif;
    font-size: 26px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.vbs-no-results p {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: rgba(0, 0, 0, 0.6);
}

/* Mobile Optimizations */
@media (max-width: 767px) {
    .vbs-archive-container {
        padding: 24px 16px;
    }
    
    .vbs-archive-header {
        margin-bottom: 32px;
    }
    
    .archive-title {
        font-size: 26px;
    }
    
    .archive-description {
        font-size: 14px;
    }
    
    .vbs-products-grid {
        gap: 16px;
    }
    
    .card-title {
        font-size: 15px;
        min-height: 40px;
    }
    
    .card-price {
        font-size: 16px;
    }
}

/* === CODE MỚI BẮT ĐẦU (FIX 11: CARD META ALIGNMENT) === */

/* Biến card content thành flex container */
.vbs-product-card .card-content {
    display: flex;
    flex-direction: column; /* Các thành phần xếp dọc */
    /* Quan trọng: Tính toán chiều cao còn lại sau khi trừ đi padding */
    /* Giả sử padding top/bottom là 16px, tổng là 32px */
    height: calc(100% - 32px); /* Có thể cần điều chỉnh nếu padding khác */
    box-sizing: border-box; /* Đảm bảo padding không làm tăng chiều cao */
}

/* Đẩy phần meta xuống dưới cùng */
.vbs-product-card .card-meta {
    margin-top: auto; /* Quan trọng: Đẩy phần này xuống đáy của flex container */
    padding-top: 12px; /* Giữ lại padding-top đã có */
    border-top: 1px solid #f0f0f0; /* Giữ lại border-top đã có */
}

/* Đảm bảo tiêu đề không bị co lại quá mức */
.vbs-product-card .card-title {
    flex-shrink: 0; /* Ngăn tiêu đề bị co lại */
}

/* ... (Giữ nguyên toàn bộ code cũ) ... */

/* Thêm style cho Giá Thỏa Thuận */
.vbs-product-card .card-price.negotiable-price {
    font-size: 16px;
    font-weight: 500;
}

/* === CODE MỚI BẮT ĐẦU (FIX 11: CARD META ALIGNMENT) === */

/* Biến card content thành flex container */
.vbs-product-card .card-content {
    display: flex;
    flex-direction: column; /* Các thành phần xếp dọc */
    height: calc(100% - 32px); /* Tính chiều cao dựa trên padding 16px*2 */
    box-sizing: border-box; 
}

/* Đẩy phần meta xuống dưới cùng */
.vbs-product-card .card-meta {
    margin-top: auto; 
    padding-top: 12px;
    border-top: 1px solid #f0f0f0; 
}

/* Đảm bảo tiêu đề không bị co lại quá mức */
.vbs-product-card .card-title {
    flex-shrink: 0; 
}

/* === CODE MỚI KẾT THÚC (FIX 11) === */
/* === CODE MỚI BẮT ĐẦU (FIX 52B: STYLE MÃ QUỐC GIA) === */

/* Style cho Mã Quốc gia (Country Code) */
.vbs-product-card .card-company .company-flag {
    font-size: 10px; 
    font-weight: 700;
    background-color: #333; /* Hộp nền đen/xám đậm */
    color: #fff;
    padding: 3px 6px;
    border-radius: 3px;
    line-height: 1;
    text-transform: uppercase;
    margin-right: 8px;
    min-width: 24px;
    text-align: center;
    /* FIX: Ghi đè icon font */
    font-family: monospace, sans-serif !important; 
}

/* === CODE MỚI KẾT THÚC === */
/* === CODE MỚI BẮT ĐẦU (FIX 53: GIÁ THỎA THUẬN CONSISTENCY) === */

/* BƯỚC 1: Đảm bảo giá tiền thật có màu đỏ mạnh */
/* Quy tắc này ghi đè lên màu xanh của "Giá thoả thuận" */
.vbs-product-card .card-price {
    color: #E53E3E !important; /* Đỏ mạnh cho giá trị tiền tệ */
}


/* === CODE MỚI KẾT THÚC === */
/* === CODE MỚI KẾT THÚC === */