/* HTML Selectors */
body {
    background-color: #f0f0f0;
    font-family: Arial, sans-serif;
    padding: 20px;
    display: flex;
    justify-content: center;
}

h3 {
    font-size: 15px;
    color: #333;
    margin: 10px 0 5px 0;
    line-height: 1.4;
    height: 42px; /* Giữ tiêu đề đều nhau */
    overflow: hidden;
}

p {
    margin: 5px 0;
    font-size: 13px;
}

/* Class Selectors */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 260px); /* Chia 4 cột cố định */
    gap: 15px;
    background-color: #eee;
    padding: 15px;
    border-radius: 5px;
}

.card {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px; /* Bo góc khối */
    border: 1px solid #e0e0e0;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* Đổ bóng khi hover */
}

.image-box {
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.image-box img {
    max-width: 100%;
    height: 180px;
    object-fit: contain;
}

/* Badge (Trả góp, Giảm giá) */
.badge {
    position: absolute;
    bottom: 10px;
    left: 0;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    color: white;
}

.yellow { background-color: #f39c12; }
.red { background-color: #e74c3c; }

.price {
    color: #d0021b; /* Màu đỏ đặc trưng cho giá */
    font-weight: bold;
    font-size: 14px;
}

.rating {
    color: #f1c40f;
    font-size: 12px;
    margin: 5px 0;
}

.rating span {
    color: #999;
    margin-left: 5px;
}

.promo, .promo-text {
    font-size: 12px;
    color: #555;
    line-height: 1.3;
    margin-top: auto; /* Đẩy xuống cuối card */
}

/* Tương thích điện thoại */
@media (max-width: 1100px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}