/* Thiết lập mặc định cơ bản */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

/* Định dạng Menu điều hướng (Yêu cầu 1.1.2) */
nav {
    background-color: #2c3e50;
    padding: 15px 30px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav a {
    color: #ecf0f1;
    text-decoration: none;
    margin: 0 20px;
    font-weight: bold;
    font-size: 1.1em;
    transition: color 0.3s;
}

nav a:hover {
    color: #e74c3c;
}

/* Bố cục chính CSS Grid (Yêu cầu 1.1.1 & 1.1.6) */
.main-layout {
    display: grid;
    grid-template-columns: 3fr 1fr; /* Cột trái (sản phẩm) to hơn cột phải (sidebar) */
    gap: 30px;
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Lưới Danh sách sản phẩm (Yêu cầu 1.1.3) */
.main-content h2 {
    color: #2c3e50;
    border-bottom: 2px solid #e74c3c;
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 20px;
}

.product-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 cột sản phẩm */
    gap: 20px;
}

/* Định dạng Thẻ sản phẩm */
.product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.product-card a {
    text-decoration: none;
    color: #2c3e50;
}

.product-card h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.product-card a:hover h3 {
    color: #e74c3c;
}

.product-card p {
    color: #7f8c8d;
    font-size: 0.95em;
    margin-bottom: 8px;
}

.price {
    color: #e74c3c !important;
    font-weight: bold;
    font-size: 1.3em !important;
}

/* Định dạng Sidebar Cột phải (Yêu cầu 1.1.4) */
.sidebar {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    height: fit-content;
}

.sidebar h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
    display: inline-block;
}

.social-links {
    list-style: none;
    margin-top: 10px;
}

.social-links li {
    margin-bottom: 15px;
}

.social-links a {
    text-decoration: none;
    color: #34495e;
    display: flex;
    align-items: center;
    font-size: 1.1em;
    transition: color 0.3s, transform 0.3s;
}

.social-links a:hover {
    color: #3498db;
    transform: translateX(5px);
}

.social-links i {
    font-size: 1.5em;
    margin-right: 15px;
    width: 25px;
    text-align: center;
}

/* Màu riêng cho từng icon mạng xã hội */
.fa-facebook { color: #1877F2; }
.fa-twitter { color: #1DA1F2; }
.fa-instagram { color: #E1306C; }
.fa-linkedin { color: #0A66C2; }

/* Định dạng Footer (Yêu cầu 1.1.5) */
footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 40px 20px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 cột trên PC */
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid h4 {
    color: #f39c12;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.footer-grid p {
    color: #bdc3c7;
    line-height: 1.8;
}

/* Bố cục Trang Chi tiết sản phẩm (Yêu cầu 1.5.1) */
.detail-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.btn-back {
    display: inline-block;
    padding: 10px 20px;
    background: #ecf0f1;
    text-decoration: none;
    color: #2c3e50;
    border-radius: 5px;
    margin-bottom: 30px;
    font-weight: bold;
    transition: background 0.3s, color 0.3s;
}

.btn-back:hover {
    background: #2c3e50;
    color: #fff;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Chia 2 cột: Ảnh và Thông tin */
    gap: 40px;
    align-items: start;
}

.detail-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.detail-info h1 {
    color: #2c3e50;
    font-size: 2em;
    margin-bottom: 15px;
}

.detail-info h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #34495e;
}

.detail-info p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

/* --- PHẦN BỔ SUNG CHO GIỎ HÀNG VÀ LIÊN HỆ --- */

/* Nút Thêm vào giỏ hàng chung */
.btn-cart {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s, transform 0.2s;
    width: 100%;
    margin-top: 10px;
    font-size: 1em;
}

.btn-cart:hover {
    background-color: #c0392b;
    transform: scale(1.02);
}

.btn-cart i {
    margin-right: 8px;
}

/* Định dạng riêng cho trang Liên hệ */
.contact-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-info h2, .contact-form h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    display: inline-block;
    padding-bottom: 5px;
}

.contact-info p {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.contact-info i {
    color: #3498db;
    width: 25px;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: inherit;
}

.btn-submit {
    background-color: #2c3e50;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.btn-submit:hover {
    background-color: #1a252f;
}

/* Độ phản hồi (Responsive) cho Thiết bị Di động (Yêu cầu 1.1.7) */
@media (max-width: 900px) {
    /* Màn hình Tablet nhỏ */
    .product-list {
        grid-template-columns: 1fr; /* Danh sách sản phẩm 1 cột */
    }
}

@media (max-width: 768px) {
    /* Màn hình Điện thoại */
    .main-layout {
        grid-template-columns: 1fr; /* Bố cục chính gộp thành 1 cột */
        padding: 15px;
    }

    .detail-grid {
        grid-template-columns: 1fr; /* Trang chi tiết gộp thành 1 cột */
    }

    .footer-grid {
        grid-template-columns: 1fr; /* Footer xếp chồng 1 cột */
        text-align: center;
    }

    nav {
        padding: 15px;
    }

    nav a {
        display: block;
        margin: 10px 0; /* Cho menu xuống dòng trên điện thoại */
    }

    .contact-container {
        grid-template-columns: 1fr; /* Trang liên hệ xếp thành 1 cột trên ĐT */
    }
}