/* =========================
   LAYOUT TỔNG – CATEGORY (KHÔI PHỤC)
========================= */

.category-page {
    background-attachment: fixed;
    background-position: center top;
    background-repeat: no-repeat;
    background-size: cover;
}

.category-wrapper {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px 20px 60px;
    box-shadow: 2px 3px 20px rgba(0, 0, 0, 0.2); /* Shadow gốc của bạn */
    background: #ffffff; 
}

/* =========================
   GRID CATEGORY - GIỮ NGUYÊN AREA
========================= */

.category-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px; /* Trả về 360px như cũ */
    grid-template-areas:
        "banner banner"
        "breadcrumb breadcrumb"
        "title title"
        "metadesc metadesc"
        "posts sidebar";
    gap: 0 40px; /* Giữ nguyên gap gốc */
    align-items: start;
}

/* =========================
   MAP GRID - KHÔI PHỤC KHOẢNG CÁCH GỐC
========================= */

.category-banner {
    grid-area: banner;
    margin-bottom: 24px; /* Trả về 24px */
}

.category-banner img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
}

.mimo-breadcrumb {
    grid-area: breadcrumb;
}

.category-title {
    grid-area: title;
    font-size: 28px; 
    font-weight: 700; 
    color: #002D5B;
    padding: 0 50px; 
    text-transform: capitalize;
}

.mimo-description {
    grid-area: metadesc;
    margin: 5px 20px 0 40px; /* Khôi phục margin lệch đặc trưng của bạn */
    font-size: 16px;
    line-height: 1.6;
}

.category-posts {
    grid-area: posts;
    padding-left: 20px; /* Trả về padding-left 20px */
    padding-bottom: 50px;
}

/* =========================
   SIDEBAR STICKY - PHẲNG HÓA NHƯNG GIỮ VỊ TRÍ
========================= */

.category-sidebar {
    grid-area: sidebar;
    position: -webkit-sticky;
    position: sticky;
    top: 150px; /* Trả về 150px */
    align-self: start;
}

.category-sidebar .widget {
    background: transparent; /* Loại bỏ nền theo ý bạn */
    padding: 0; /* Phẳng hóa */
    margin-bottom: 24px; /* Giữ margin 24px gốc */
    border: none;
    box-shadow: none;
}

/* =========================
   RESPONSIVE - KHÔI PHỤC GỐC
========================= */

@media (max-width: 1024px) {
    .category-main {
        grid-template-columns: 1fr;
        grid-template-areas:
            "banner"
            "breadcrumb"
            "title"
            "metadesc"
            "posts"
            "sidebar";
        padding: 0px;
    }
    
    .category-wrapper {
        padding: 70px 20px; 
    }

    .category-title {
        font-size: 20px;
        padding: 0;
    }

    .mimo-description {
        margin: auto;
    }

    .category-posts {
        padding: 20px 0;
    }

    .category-sidebar {
        position: relative;
        top: unset;
    }
}