/* 1. Reset CSS để loại bỏ các mặc định của trình duyệt */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 2. Thiết lập font chung cho trang web */
body {
    font-family: Arial, sans-serif;
    background-color: #f2f2f2;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1200px; /* Độ rộng tối đa của trang web */
    margin: 0 auto; /* Canh giữa trang web trên màn hình */
    padding: 20px;
}

/* 3. Container chính */
.container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    flex: 1;
}

/* 4. Phần tiêu đề trang web - Chỉ hiển thị menu */
header {
    background-color: #333;
    color: #fff;
    padding: 15px 0;
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

/* 5. Phần menu điều hướng */
nav {
    background-color: transparent;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 40px;
}

nav ul li {
    display: inline;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 18px;
    padding: 10px 15px;
    transition: background-color 0.3s;
    border-radius: 4px;
}

nav ul li a:hover {
    background-color: #555;
}

/* 6. Phần danh sách sản phẩm */
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    padding: 0;
}

.product-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    /* display: flex; */
    flex-direction: column;
    align-items: center; 
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.product-card img {
    max-width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
}

.product-card h2 {
    color: #333;
    margin: 10px 0;
    font-size: 20px;
}

.product-card p {
    color: #666;
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.4;
    flex-grow: 1;
}

.product-card .price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 18px;
    margin: 10px 0;
}

/* 7. Phần sidebar */
.sidebar {
    background-color: #199cff;
    color: #fff;
    padding: 10px;
    grid-column: ;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.sidebar h3 {
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    padding-bottom: 10px;
}

.social-icons {
    margin-top: 10px;
}

.social-icons a {
    color: #fff;
    text-decoration: none;
    display: block;
    margin-bottom: 15px;
    padding: 12px 15px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 6px;
    transition: background-color 0.3s;
    font-size: 16px;
}

.social-icons a:hover {
    background-color: rgba(255,255,255,0.2);
    transform: translateX(5px);
}

/* 8. Phần footer */
.footer {
    background-color: #333;
    color: #fff;
    padding: 40px 20px;
    margin-top: 40px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Cột trong phần footer */
.footer-item {
    padding: 0;
}

.footer-item h4 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #fff;
    border-bottom: 2px solid #555;
    padding-bottom: 10px;
}

.footer-item p {
    color: #ccc;
    line-height: 1.6;
    font-size: 14px;
}

/* 9. Nút Mua Ngay */
.buy-button {
    background-color: #04AA6D;
    color: white;
    border: none;
    padding: 12px 25px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin-top: 10px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.3s;
    width: 80%;
    max-width: 200px;
}

.buy-button:hover {
    background-color: #038c5a;
}

/* 10. Chỉnh lại bố cục cho màn hình thiết bị di động */
@media (max-width: 992px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
        margin-bottom: 20px;
    }
    
    nav ul {
        gap: 20px;
        flex-wrap: wrap;
    }
    
    nav ul li a {
        padding: 8px 12px;
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .product-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 30px 20px;
    }
    
    .footer-item {
        text-align: center;
    }
    
    .footer-item h4 {
        border-bottom: 1px solid #555;
    }
}

@media (max-width: 576px) {
    .product-list {
        grid-template-columns: 1fr;
    }
    
    body {
        padding: 10px;
    }
    
    nav ul {
        flex-direction: column;
        gap: 10px;
    }
    
    nav ul li a {
        display: block;
        text-align: center;
    }
}

/* 11. Các lớp tiện ích cho Button */
.button {
    background-color: #04AA6D;
    border: none;
    color: white;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
}

.button1 { border-radius: 2px; }
.button3 { border-radius: 8px; }
.button4 { border-radius: 12px; }
.button5 { border-radius: 50%; }
