﻿/* =========================================================
   STYLE DÀNH RIÊNG CHO TRANG CHỦ (DEFAULT.ASPX)
   File path: Content/css/DefaultPage.css
   ========================================================= */

/* ---------------------------------------------------------
   1. KHỐI TÍNH NĂNG / GIÁ TRỊ (FEATURES BAR)
   --------------------------------------------------------- */
.features-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.feature-card {
    background: #ffffff;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

    .feature-card:hover {
        transform: translateY(-2px);
    }

.feature-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

/* ---------------------------------------------------------
   2. TIÊU ĐỀ KHỐI & LINK XEM TẤT CẢ
   --------------------------------------------------------- */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 15px 0;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

    .section-title h2 {
        font-size: 1.2rem;
        color: var(--primary-dark);
        text-transform: uppercase;
        display: flex;
        align-items: center;
        gap: 8px;
    }

.see-all-link {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .see-all-link:hover {
        color: var(--primary-dark);
    }

/* ---------------------------------------------------------
   3. DANH SÁCH SẢN PHẨM DẠNG GRID (PRODUCT GRID)
   --------------------------------------------------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

    .product-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
    }

.product-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.product-body {
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-tag {
    align-self: flex-start;
    background: #e8f5e9;
    color: var(--primary-dark);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.product-title {
    font-size: 0.98rem;
    font-weight: 700;
    margin: 8px 0;
    line-height: 1.35;
}

    .product-title a {
        color: var(--text-color);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

        .product-title a:hover {
            color: var(--primary-color);
        }

.product-price {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1.05rem;
    margin-top: auto;
}

.product-location {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ---------------------------------------------------------
   4. DANH SÁCH TIN CHÀO GIAO THƯƠNG (TRADE NEWS)
   --------------------------------------------------------- */
.trade-news-section {
    margin-bottom: 30px;
}

.trade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.trade-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .trade-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
    }

    .trade-card.vip-border {
        border-left: 4px solid var(--primary-color);
    }

.trade-img-link {
    flex-shrink: 0;
}

.trade-img {
    width: 95px;
    height: 85px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.trade-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
}

.trade-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 6px;
}

    .trade-title a {
        color: var(--text-color);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

        .trade-title a:hover {
            color: var(--primary-color);
        }

.trade-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.trade-badge {
    background-color: #f1f8e9;
    color: var(--primary-dark);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.75rem;
}

    .trade-badge.vip {
        background-color: #fff3e0;
        color: var(--accent-hover);
    }

/* ---------------------------------------------------------
   5. DARK MODE OVERRIDES CHO TRANG CHỦ
   --------------------------------------------------------- */
body.dark-mode .section-title h2 {
    color: #81c784;
}

body.dark-mode .product-card,
body.dark-mode .trade-card {
    background-color: #1e1e1e;
    border-color: #333333;
}

body.dark-mode .product-title a,
body.dark-mode .trade-title a {
    color: #ffffff;
}

body.dark-mode .product-tag,
body.dark-mode .trade-badge {
    background-color: #1b381e;
    color: #81c784;
}

body.dark-mode .trade-badge.vip {
    background-color: #3e2723;
    color: #ffb74d;
}

/* =========================================================
   STYLE CHO USER CONTROL DOANH NGHIỆP UY TÍN (DQDNVip)
   ========================================================= */

.vip-enterprise-section {
    margin-bottom: 35px;
}

/* Lưới hiển thị Logo linh hoạt */
.enterprise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

/* Khung chứa Logo từng doanh nghiệp */
.enterprise-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

    .enterprise-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
        border-color: var(--primary-color);
    }

    .enterprise-card a {
        text-decoration: none;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

/* Khung giới hạn ảnh Logo */
.enterprise-logo-wrapper {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

/* Tối ưu ảnh Logo: Giữ nguyên tỷ lệ, không bị co móp */
.enterprise-logo {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
    filter: grayscale(15%);
    transition: filter 0.3s ease;
}

.enterprise-card:hover .enterprise-logo {
    filter: grayscale(0%);
}

/* Tên doanh nghiệp */
.enterprise-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.6em; /* Cố định độ cao 2 dòng */
}

.enterprise-card:hover .enterprise-name {
    color: var(--primary-color);
}

/* Responsive cho màn hình nhỏ (Mobile) */
@media (max-width: 576px) {
    .enterprise-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 cột trên điện thoại */
        gap: 10px;
    }

    .enterprise-card {
        padding: 8px 6px;
    }

    .enterprise-logo-wrapper {
        height: 60px;
    }

    .enterprise-logo {
        max-height: 60px;
    }

    .enterprise-name {
        font-size: 0.75rem;
    }
}

/* Dark Mode Support */
body.dark-mode .enterprise-card {
    background-color: #1e1e1e;
    border-color: #333333;
}

body.dark-mode .enterprise-name {
    color: #e0e0e0;
}

body.dark-mode .enterprise-card:hover {
    border-color: #81c784;
}

    body.dark-mode .enterprise-card:hover .enterprise-name {
        color: #81c784;
    }
