

/* 
   === GENERAL STYLES ===
   Các quy tắc chung cho toàn bộ trang, áp dụng ở đầu để tránh override.
*/

body {
    font-family: Arial, sans-serif;  /* Font chữ mặc định */
    line-height: 1.6;  /* Khoảng cách dòng chữ */
    color: #333;  /* Màu chữ xám đậm */
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;  /* Nền xám nhạt */
}

.container {
    max-width: 1200px;  /* Chiều rộng tối đa cho nội dung chính */
    margin: 0 auto;  /* Căn giữa container */
    padding: 20px;  /* Khoảng cách bên trong */
}

a {
    text-decoration: none;  /* Bỏ gạch chân tất cả link */
    color: inherit;  /* Kế thừa màu từ parent */
}

/* 
   === CONTENT & GRID LAYOUT ===
   Phần này quản lý layout nội dung chính, bao gồm grid cho sản phẩm và sidebar.
   Có lặp lại code cũ, nhưng giữ nguyên để tương thích.
*/

.main-content {
    display: flex;
    gap: 20px;
    flex-direction: column; /* Mặc định xếp dọc trên mobile */
}

.content {
    flex: 1;  /* Nội dung chính chiếm hết không gian còn lại */
}

.content h2 {
    border-left: 5px solid #007bff;  /* Viền trái xanh dương cho tiêu đề */
    padding-left: 10px;
    margin-top: 10px;
}

.grid-container {
    display: grid;
    gap: 15px;  /* Khoảng cách giữa các item */
    padding-bottom: 20px;
    grid-template-columns: repeat(2, 1fr); /* 2 cột mặc định (mobile) */
}
.read-btn {
  margin-left: 8px; /* cách chữ 8px */
}
.read-btn1 {
  margin-left: 20px; /* cách chữ 8px */
}

.grid-item {
    background: #fff;  /* Nền trắng */
    border: 1px solid #ddd;  /* Viền nhẹ */
    border-radius: 8px;  /* Bo góc */
    padding: 10px;
    text-align: center;  /* Căn giữa nội dung item */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);  /* Bóng đổ nhẹ */
}

.grid-item img {
    width: 100%;  /* Hình ảnh full width */
    aspect-ratio: 1 / 1;  /* Tỷ lệ vuông */
    object-fit: cover;  /* Crop hình để vừa khung */
    border-radius: 8px;
    margin-bottom: 10px;
}

.grid-item h3 {
    margin-top: 0;  /* Bỏ margin trên tiêu đề item */
}

.two-line-title {
    overflow: hidden;  /* Ẩn phần thừa */
    display: -webkit-box;
    -webkit-line-clamp: 2;  /* Giới hạn 2 dòng */
    -webkit-box-orient: vertical;
}

/* --- Sidebar Styles --- */
.sidebar {
    width: 300px;  /* Chiều rộng cố định cho sidebar */
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.sidebar h3 {
    border-bottom: 2px solid #333;  /* Viền dưới cho tiêu đề sidebar */
    padding-bottom: 10px;
    margin-top: 10px;
}

.related-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-post-item {
    margin-bottom: 15px;  /* Khoảng cách giữa các item liên quan */
}

.related-post-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
}

.related-post-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;  /* Không co hình ảnh */
}

.related-post-item h4 {
    margin: 0;
    font-size: 1em;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 
   === POST DETAIL STYLES ===
   Quy tắc cho trang chi tiết bài viết/sản phẩm.
*/

.post-content {
    overflow-x: hidden;  /* Ẩn scroll ngang nếu nội dung dài */
    word-wrap: break-word;  /* Ngắt từ dài */
}

.post-details-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    align-items: flex-start;  /* Căn đầu cho hình và info */
}

.post-header-image {
    flex: 1 1 50%;  /* Chiếm 50% không gian, co giãn được */
}

.post-header-image h1 {
    width: 100%;
    margin-top: 0;
    margin-bottom: 20px;
}



.product-info-buttons {
    flex: 1 1 40%;  /* Chiếm 40% cho phần nút mua hàng */
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: center;
}

.product-info-buttons a,
.product-info-buttons button {
    display: block;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: center;
    text-decoration: none;
}


.sub-categories {
    margin-bottom: 20px;
}

.horizontal-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.horizontal-list li a {
    text-decoration: none;
    color: #007bff;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    white-space: nowrap;  /* Không ngắt dòng */
    transition: background-color 0.3s ease;
}

.horizontal-list li a:hover {
    background-color: #f0f0f0;
}

/* 
   === FOOTER STYLES ===
   Phần footer với các cột linh hoạt và responsive.
*/

.main-footer {
    background-color: #2c3e50; /* Nền tối sang trọng */
    color: #ecf0f1; /* Chữ sáng */
    padding: 40px 20px;
    font-size: 14px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}

.footer-col {
    flex: 1;
    min-width: 200px;
    margin-bottom: 20px;
}

.footer-heading {
    font-size: 1.2em;
    font-weight: bold;
    color: #ff9900; /* Cam nổi bật */
    margin-bottom: 15px;
    border-bottom: 2px solid #ff9900;
    padding-bottom: 5px;
}

.footer-about-text {
    line-height: 1.8;
    color: #bdc3c7;
}

.read-more-link {
    display: inline-block;
    margin-top: 10px;
    color: #ff9900;
    font-weight: bold;
    transition: color 0.3s ease;
}

.read-more-link:hover {
    color: #e68a00;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col a {
    color: #ecf0f1;
    transition: color 0.3s ease;
}

.footer-col a:hover {
    color: #ff9900;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links li {
    margin-bottom: 0;
}

.social-links svg {
    width: 24px;
    height: 24px;
    fill: #ecf0f1;
    transition: fill 0.3s ease;
}

.social-links a:hover svg {
    fill: #ff9900;
}

.copyright {
    margin-top: 25px;
    text-align: center;
    width: 100%;
    color: #95a5a6;
    border-top: 1px solid #4a657e;
    padding-top: 20px;
}

/* === REVIEWS SECTION STYLES (FINAL & SIMPLIFIED FIX) === */

.reviews-section {
    margin-top: 40px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.reviews-section h2 {
    border-bottom: 2px solid #ccc;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-item {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    /* Áp dụng padding cho khối ngoài cùng */
    padding: 20px; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* === REVIEWS SECTION STYLES (FINAL & WORKING FIX) === */

.reviews-section {
    margin-top: 40px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

/* ... (Giữ nguyên reviews-section h2, reviews-list) ... */

.review-item {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px; /* Dùng lại padding 20px ở đây */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    /* KHÔNG CẦN display: flex/flex-direction: column */
}

/* REVIEW HEADER - Hàng 1 (Avatar, Tên, Sao) */
.review-header {
    display: flex;
    align-items: center; 
    gap: 15px;
    margin-bottom: 10px; /* Khoảng cách giữa Header và Nội dung */
    border-bottom: none; 
    padding-bottom: 0; 
}

.review-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.review-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

/* Tên và Sao nằm ngang */
.review-author-and-rating {
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-author {
    font-weight: bold;
    color: #333;
}

.review-rating {
    color: #ccc;
    font-size: 1.2em;
}

.review-rating .star.filled {
    color: #ffc107;
}

.rating-text {
    font-size: 0.8em;
    color: #888;
    margin-left: 5px;
}


/* KHỐI NỘI DUNG LỚN (review-content-full) */

.review-content-full {
    color: #555;
    line-height: 1.5;
}

/* Định dạng Tiêu đề (Không in đậm) */
.review-title-text {
    font-weight: normal; 
    font-size: 1.1em;
    margin-top: 5px; 
    margin-bottom: 10px; /* Khoảng cách giữa Tiêu đề và Nội dung chính */
}

/* Định dạng Ngày tháng (Đã được gộp vào review-content-full) */
.review-date-text {
    font-size: 0.9em;
    color: #aaa;
    margin-top: 15px;
    margin-bottom: 0;
}

/* ... (Giữ nguyên show-more-button) ... */

.show-more-button {
    display: block;
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    background-color: #007bff;
    color: #000; /* Xem xét đổi thành #fff cho tương phản tốt hơn */
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.show-more-button:hover {
    background-color: #0056b3;
}
/* 
   === MAIN CONTENT WRAPPER ===
   Quy tắc bổ sung cho layout chính với sidebar (để định vị lại thanh bên).
*/

.main-content-wrapper {
    display: flex;
    gap: 20px;
}

.main-content-column {
    flex: 1;  /* Cột chính giãn ra */
}

.sidebar {
    width: 300px;
    flex-shrink: 0;  /* Sidebar không co lại */
}

/* 
   === COMMENT SECTION STYLES ===
   Phần bình luận và form gửi comment.
*/

.comments-section {
    margin-top: 40px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.comments-section h2, .comments-section h3 {
    border-bottom: 2px solid #ccc;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.comment-form .form-group {
    margin-bottom: 15px;
}

.comment-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.comment-form input[type="text"],
.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;  /* Bao gồm padding trong width */
}

.captcha-group .captcha-flex {
    display: flex;
    align-items: center;
    gap: 10px;
}

#captcha-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    padding: 5px 10px;
    background-color: #e9e9e9;
    border-radius: 4px;
    user-select: none;  /* Không chọn text captcha */
}

#reload-captcha {
    cursor: pointer;
    font-size: 1.2em;
    color: #555;
    transition: color 0.3s;
}

#reload-captcha:hover {
    color: #007bff;
}

.submit-button {
    background-color: #007bff;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s;
}

.submit-button:hover {
    background-color: #0056b3;
}

#form-message {
    margin-top: 15px;
    font-weight: bold;
}

.success-message {
    color: #28a745;  /* Xanh thành công */
}

.error-message {
    color: #dc3545;  /* Đỏ lỗi */
}

.comment-list {
    margin-top: 20px;
}

.comment {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.comment-author {
    font-weight: bold;
    color: #333;
}

.comment-date {
    font-size: 0.8em;
    color: #aaa;
}

.comment-text {
    color: #555;
}

/* 
   === POST META STYLES ===
   Quy tắc cho metadata bài viết (tác giả, ngày, category).
*/

.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 20px;
}

.post-meta .post-author,
.post-meta .post-date,
.post-meta .post-category {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-meta .separator {
    margin: 0 8px;
    color: #999;
}

.post-meta .author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.post-meta .author-name,
.post-meta .post-category a {
    color: #007bff;
    text-decoration: none;
}

.post-meta .author-name:hover,
.post-meta .post-category a:hover {
    text-decoration: underline;
}

.post-summary {
    font-size: 1.1em;
    font-style: italic;
    color: #333;
    margin-bottom: 20px;
    padding-left: 10px;
    border-left: 3px solid #007bff;
}
.centered-image {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}


/* 
   === RESPONSIVE ADJUSTMENTS ===
   Các quy tắc responsive cho toàn bộ trang (mobile first).
   Mobile: @media (max-width: 767px)
   Desktop: @media (min-width: 768px)
*/

/* --- Mobile Responsive (max-width: 767px) --- */
@media (max-width: 767px) {
    body {
        font-size: 12px;  /* Giảm font cho mobile */
    }
.product-info-buttons {
        padding: 10px; /* Giảm padding để có thêm không gian */
        margin: 0; /* Xóa bỏ margin không cần thiết */
        box-sizing: border-box; /* Đảm bảo padding không làm tăng chiều rộng vượt quá 100% */
        width: 100%; /* Đảm bảo nó chiếm đủ chiều rộng */
    }

    .product-info-buttons .post-summary {
        font-size: 0.9em; /* Giảm kích thước chữ nếu cần */
        line-height: 1.4; /* Điều chỉnh khoảng cách dòng */
        padding: 5px 0; /* Giảm padding cho summary */
    }

    .product-info-buttons .buttons-row {
        flex-direction: column; /* Xếp các nút theo chiều dọc trên mobile */
        gap: 10px; /* Tạo khoảng cách giữa các nút */
        width: 100%; /* Đảm bảo hàng nút chiếm hết chiều rộng */
        display: flex; /* Dùng flexbox để xếp dọc */
    }

    .product-info-buttons .buy-now-button,
    .product-info-buttons .add-to-cart-button {
        width: 100%; /* Nút chiếm toàn bộ chiều rộng có thể */
        padding: 12px 15px; /* Điều chỉnh padding cho nút */
        font-size: 1em; /* Điều chỉnh kích thước font nút */
        white-space: normal; /* Cho phép văn bản trong nút xuống dòng */
    }
    h1, h2, h3 {
        font-size: 1.2em;
    }

    .container {
        padding: 10px;  /* Giảm padding */
    }
    
    .site-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .top-header {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;  /* Trên mobile: logo trái, search phải */
        align-items: center;
        width: 100%;
        padding: 10px;
    }
    
    .search-bar {
        flex-grow: 1;
        margin-left: 10px;  /* Khoảng cách nhỏ trên mobile */
    }

    .main-nav {
        padding: 5px 20px;
    }
    
    .content h2, .sidebar h3 {
        margin-top: 5px;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .two-line-title {
        font-size: 1.1em;
    }

    .sidebar {
        display: none;  /* Ẩn sidebar trên mobile */
    }
    
    /* Post detail on mobile */
    .post-details-container {
        flex-direction: column;
        justify-content: center;
    }

    .post-header-image {
        order: 1; /* Hình ảnh lên trên */
        flex: 1 1 100%;
        text-align: center;
    }

    .product-info-buttons {
        order: 2; /* Nút xuống dưới */
        flex: 1 1 100%;
        margin: 10px 0;
        padding: 0 10px;
    }

    .buttons-row {
        display: flex;
        flex-direction: row;
        gap: 10px;
        width: 100%;
    }

    

    .main-body {
        padding: 0 10px;
    }

    .main-body img {
        max-width: 100%;
        height: auto;
        display: block;
        margin: 15px auto;
    }

    .main-body table {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        display: block;
        border-collapse: collapse;
    }

    .main-body pre {
        white-space: pre-wrap;
        word-wrap: break-word;
        overflow: auto;
    }

    /* Footer mobile */
    .footer-container {
        flex-direction: column;
        gap: 20px;
    }

    .footer-col {
        min-width: 100%;
    }

    .footer-heading {
        text-align: center;
        border-bottom: none;
    }

    .footer-col.about-col,
    .footer-col.legal-col,
    .footer-col.social-col {
        text-align: center;
    }

    .footer-col ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        margin-top: 10px;
    }

    .social-links {
        justify-content: center;
        margin-top: 10px;
    }

    .copyright {
        margin-top: 20px;
    }

    /* Main content wrapper mobile */
    .main-content-wrapper {
        flex-direction: column;
    }

    .main-content-column {
        flex: auto;
    }
}

.social-share-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    z-index: 1000;
}

.social-share-bar .share-title {
    font-weight: bold;
    margin-right: 15px;
    color: #333;
    font-size: 16px;
}

.social-share-bar .share-buttons {
    display: flex;
    gap: 15px;
}

.social-share-bar .share-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px; /* Kích thước vùng bấm */
    height: 40px;
    border-radius: 50%;
    transition: transform 0.3s;
}

.social-share-bar .share-button:hover {
    transform: scale(1.1);
}

.social-share-bar .share-button img {
    display: block;
    width: 36px; /* Kích thước ảnh icon */
    height: 36px;
}


/* Kiểu dáng cho hàng nút chung trên đầu bài viết */
.buttons-row {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* Kiểu dáng cho các nút trong hàng .buttons-row */
/* Kiểu dáng chung cho cả hai loại nút để đảm bảo nhất quán */
.buttons-row .buy-now-button,
.buttons-row .add-to-cart-button,
.product-inline-buttons .buy-now-button,
.product-inline-buttons .add-to-cart-button {
    font-size: 16px;
    font-weight: bold;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    border: none;
    outline: none;
    
    /* Vấn đề chiều cao */
    height: 48px; /* Đặt chiều cao cố định */
    line-height: 24px; /* Đặt line-height bằng với kích thước font + padding */

    /* Sử dụng flexbox để căn giữa nội dung bên trong */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Kiểu dáng cho container của các nút trên đầu bài viết */
.buttons-row {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* Kiểu dáng cho container của các nút trong nội dung */
.product-inline-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Màu và hiệu ứng hover cho tất cả các nút Buy Now */
.buttons-row .buy-now-button,
.product-inline-buttons .buy-now-button {
    background-color: #ff9900;
}
.buttons-row .buy-now-button:hover,
.product-inline-buttons .buy-now-button:hover {
    background-color: #e68a00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Màu và hiệu ứng hover cho tất cả các nút Add to Cart */
.buttons-row .add-to-cart-button,
.product-inline-buttons .add-to-cart-button {
    background-color: #28a745;
}
.buttons-row .add-to-cart-button:hover,
.product-inline-buttons .add-to-cart-button:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Kiểu dáng cho các nút chèn bên trong nội dung bài viết */
.product-inline-buttons {
    display: flex;
    justify-content: center; /* Căn giữa theo chiều ngang */
    align-items: center;
    gap: 10px; /* Tạo khoảng cách giữa các nút */
    margin-top: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Kiểu dáng chung cho các nút .product-inline-buttons */
.product-inline-buttons .buy-now-button,
.product-inline-buttons .add-to-cart-button {
    font-size: 16px;
    font-weight: bold;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    border: none;
    outline: none;
    display: inline-block; /* Sử dụng inline-block để đảm bảo căn chỉnh đúng */
}

/* Màu và hiệu ứng hover cho tất cả các nút Buy Now */
a.buy-now-button, button.buy-now-button {
    background-color: #ff9900;
}
a.buy-now-button:hover, button.buy-now-button:hover {
    background-color: #e68a00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Màu và hiệu ứng hover cho tất cả các nút Add to Cart */
a.add-to-cart-button, button.add-to-cart-button {
    background-color: #28a745;
}
a.add-to-cart-button:hover, button.add-to-cart-button:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}





/* --- Desktop Responsive (min-width: 768px) --- */
@media (min-width: 768px) {
    .main-content {
        flex-direction: row;  /* Xếp ngang nội dung và sidebar */
    }
    /* Áp dụng cho ảnh header */
.post-header-image img {
    /* Đảm bảo ảnh luôn đầy đủ chiều rộng của khung chứa */
    width: 100%;
    
    /* Thiết lập chiều cao cứng bằng với chiều cao đã khai báo trong HTML (375px) 
       để duy trì khung chứa 4:3 */
    height: 375px; 
    
    /* Cực kỳ quan trọng: Ép ảnh vừa khung chứa bằng cách cắt ảnh */
    object-fit: cover; 
}
    .sidebar {
        display: block;  /* Hiện sidebar trên desktop */
    }

    .grid-container.four-columns {
        grid-template-columns: repeat(4, 1fr);  /* 4 cột trên desktop */
    }
    
    .grid-item h3 {
        font-size: 1em;
    }

    .top-header {
        flex-direction: row;
        max-width: 960px; /* Giới hạn chiều rộng header trên desktop */
        margin: 0 auto; /* Căn giữa */
        justify-content: space-between; /* Logo trái, search cách xa */
        padding: 15px 20px;
    }

    .search-bar {
        width: 350px; /* Chiều rộng cố định gọn hơn */
        margin-left: 20px;  /* Khoảng cách từ logo */
    }
    
    .main-nav ul li a {
        padding: 10px 15px;  /* Giảm padding ngang trên desktop */
    }
    
    .grid-container {
        grid-template-columns: repeat(4, 1fr); /* 4 cột */
    }
}