/* Reset CSS để loại bỏ các mặc định của trình duyệt */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Thiết lập font chung cho trang web */
body {
    font-family: Arial, sans-serif;
    background-color: #f2f2f2;
    display: grid;
    grid-template-columns: 70% 30%;
    /* Chia trang thành hai cột */
    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 */
}

/* Phần tiêu đề trang web */
header {
    background-color: #c7cc19;
    color: #fff;
    padding: 20px;
    text-align: center;
    grid-column: 1 / span 2;
    /* Trải đều qua cả hai cột */
}

/* Phần menu điều hướng */
nav {
    background-color: #ffa486;
    color: #fff;
    text-align: center;
    padding: 10px;
    grid-column: 1 / span 2;
    /* Trải đều qua cả hai cột */
}

nav ul {
    list-style: none;
}

nav ul li {
    display: inline;
    margin-right: 20px;
}

/* Phần danh sách sản phẩm */
.product-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Hiển thị 3 sản phẩm trên mỗi hàng */
    gap: 20px;
    /* Khoảng cách giữa các sản phẩm */
    padding: 20px;
    grid-column: 1;
    /* Chỉ nằm ở cột đầu tiên */
}

.product-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    width: 100%;
    text-align: center; /* Căn giữa nội dung trong sản phẩm */
}

.product-card img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
    margin-bottom: 15px;
}

/* Nút Xem Chi Tiết trên trang chủ */
.buy {
    display: inline-block;
    background-color: transparent;
    color: #00bfff; /* Màu chữ sanh */
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    border: 2px solid #00bfff; /* Viền màu sanh */
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

/* Hiệu ứng hover cho nút Xem Chi Tiết */
.buy:hover {
    background-color: #00bfff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 191, 255, 0.3);
}

/* Hiệu ứng active */
.buy:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 191, 255, 0.3);
}

/* Đảm bảo nút có khoảng cách với các phần tử khác */
.product-card p:last-of-type {
    margin-bottom: 15px;
}

/* Phần sidebar */
.sidebar {
    background-color: #199cff;
    color: #ffffff;
    padding: 10px;
    grid-column: 2;
    /* Chỉ nằm ở cột thứ hai */
}

.social-icons {
    margin-top: 20px;
}

.social-icons a {
    color: #ffffff;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
}

/* Chính lại bố cục cho màn hình thiết bị di động */
@media (max-width: 576px) {
    body {
        grid-template-columns: 1fr;
    }
    
    .product-list {
        grid-template-columns: 1fr;
        /* Hiển thị một sản phẩm trên mỗi hàng */
        grid-column: 1;
    }
    
    .product-card {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .sidebar {
        grid-column: 1;
        /* Trải đều qua cả hai cột */
        order: 3;
        margin-top: 20px;
    }
    
    /* Chính lại bố cục cho phần footer */
    .footer {
        grid-template-columns: 1fr;
        /* 1 cột xếp chồng lên nhau trên màn hình di động */
    }
}

.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px;
    grid-column: 1 / span 2;
    /* Trải đều qua cả hai cột */
    display: grid;
}

/* Cột trong phần footer */
.footer-item {
    padding: 10px;
}

/* Chỉnh layout cho máy tính */
@media (min-width: 768px) {
    .footer {
        grid-template-columns: repeat(3, 1fr);
        /* 3 cột trên máy tính */
    }
}

/* Button styles */
.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;
    cursor: pointer;
}

.button1 {
    border-radius: 2px;
}

.button3 {
    border-radius: 8px;
}

.button4 {
    border-radius: 12px;
}

.button5 {
    border-radius: 50%;
}

/* Button có khung màu sanh (xanh ngọc) với viền */
.btn {
    display: inline-block;
    background-color: #00bfff; /* Màu sanh/xanh ngọc */
    color: white;
    padding: 12px 24px;
    text-align: center;
    text-decoration: none;
    border: 2px solid #0080ff; /* Viền đậm hơn một chút */
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px 5px;
}

/* Hiệu ứng hover */
.btn:hover {
    background-color: #0080ff;
    border-color: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Hiệu ứng active */
.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Button thứ cấp (secondary) - nền trong suốt với viền màu sanh */
.btn.secondary {
    background-color: transparent;
    color: #00bfff;
    border: 2px solid #00bfff;
}

.btn.secondary:hover {
    background-color: #00bfff;
    color: white;
}

/* Container cho trang chi tiết */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    grid-column: 1 / span 2;
}

/* Header cho trang chi tiết */
.header {
    background-color: #c7cc19;
    color: #fff;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 5px;
    grid-column: 1 / span 2;
}

/* Phần chính cho trang chi tiết */
main {
    background-color: #fff;
    border-radius: 5px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    grid-column: 1 / span 2;
}

/* Product card trong trang chi tiết */
.container .product-card {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    background-color: #fff;
    border: none;
    padding: 0;
}

.container .product-card img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 20px;
}

.container .product-card h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: 28px;
}

.container .product-card .price {
    font-size: 24px;
    color: #04AA6D;
    font-weight: bold;
    margin-bottom: 20px;
}

.container .product-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
    text-align: left;
}

/* Container cho các button */
.buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

/* Responsive cho trang chi tiết */
@media (max-width: 768px) {
    .buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .container .product-card h1 {
        font-size: 24px;
    }
    
    .container .product-card .price {
        font-size: 20px;
    }
    
    main {
        padding: 20px;
    }
}

/* Đảm bảo footer luôn nằm ở dưới cùng trên trang chi tiết */
.container .footer {
    margin-top: 20px;
}

/* Style cho danh sách trong mô tả sản phẩm */
.product-card ul {
    text-align: left;
    margin-left: 20px;
    margin-bottom: 20px;
}

.product-card ul li {
    margin-bottom: 8px;
    color: #666;
}

/* Cập nhật responsive cho body trong trang chi tiết */
body:has(.container) {
    display: block;
}