/* ==================== PRODUCTS PAGE – Giao diện cũ ==================== */

/* Nền trang: đường chéo mờ */
body.page-products {
    background-color: #fdfbf7;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent 0,
        transparent 6px,
        rgba(45, 90, 39, 0.04) 6px,
        rgba(45, 90, 39, 0.04) 7px
    );
    background-size: 14px 14px;
}

.page-products .page-title {
    text-align: left;
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Nút lọc: inactive xám nhạt, active xanh đậm, bo góc vừa */
.category-filter {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    background: #e8e8e8;
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-btn:hover {
    background: #ddd;
    color: #333;
}

.filter-btn.active {
    background: var(--primary-color);
    color: #fff;
}

/* Nội dung chính: min-height giữ footer luôn dưới cùng khi lọc 0 sản phẩm */
.page-products > .container {
    min-height: 50vh;
}

/* Thông báo khi chọn nhóm không có sản phẩm */
.product-empty-state {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1.05rem;
    margin-bottom: 60px;
}

/* Khung lưới sản phẩm: không nền, chỉ giữ layout (thẻ .product-card tự có nền trắng) */
#product-container {
    margin-bottom: 60px;
}

#product-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 0;
}

#product-container:not(:has(.product-card)) {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #666;
    font-size: 1rem;
}

@media (max-width: 992px) {
    #product-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    #product-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 640px) {
    #product-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Ẩn product-grid khi chưa có thẻ sản phẩm (trang dùng product-container) */
.page-products #product-grid:not(:has(.product-card)) {
    display: none;
}

/* Grid dùng cho product-grid (khi có main.js fill) */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 60px;
}

@media (max-width: 992px) {
    .grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

@media (max-width: 768px) {
    .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

@media (max-width: 640px) {
    .grid { grid-template-columns: 1fr; gap: 16px; }
}

/* Thẻ sản phẩm: bo góc lớn, đổ bóng nhẹ, hover nhẹ */
.product-card {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #eee;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
}

/* Ảnh: với product-image-wrapper (main.js) */
.product-image-wrapper {
    width: 100%;
    height: 220px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
}

/* Ảnh trực tiếp trong .product-card (data.js) */
.product-card > img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    padding: 20px;
    background: #fff;
}

@media (max-width: 768px) {
    .product-image-wrapper { height: 180px; }
    .product-card > img { height: 180px; }
}

@media (max-width: 640px) {
    .product-image-wrapper { height: 160px; }
    .product-card > img { height: 160px; }
}

.product-card h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 700;
    padding: 16px 16px 8px;
    line-height: 1.35;
    text-align: center;
}

.product-desc,
.product-card .desc {
    color: #333;
    font-size: 0.88rem;
    padding: 0 16px;
    line-height: 1.65;
    text-align: center;
    margin: 0 0 12px 0;
    flex-grow: 1;
}

.product-card .price {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1.3rem;
    padding: 0 16px 8px;
    text-align: center;
}

.product-card .product-category {
    display: block;
    color: #888;
    font-size: 0.8rem;
    text-align: center;
    padding: 0 16px 4px;
}

.product-card .btn {
    margin: 12px 16px 20px;
    padding: 12px 24px;
    border-radius: 12px;
    background: var(--primary-color);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    text-decoration: none;
    display: block;
    box-shadow: 0 2px 10px rgba(45, 90, 39, 0.3);
}

.product-card .btn:hover {
    background: #1f3f1b;
    color: #fff;
    box-shadow: 0 4px 14px rgba(45, 90, 39, 0.4);
}

/* Featured links */
.featured-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 60px;
    flex-wrap: wrap;
}

.featured-link {
    text-align: center;
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s;
}

.featured-link img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.featured-link:hover {
    transform: translateY(-5px);
}

.featured-link span {
    display: block;
    margin-top: 12px;
    font-weight: 600;
}
