/* Danh mục sản phẩm - Styles riêng */

/* Main content layout */
#main-content {
    min-height: 400px;
    background: #f8f9fa;
    padding: 20px 0;
}

/* Products section */
.products-section {
    padding: 0;
}

.products-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Sidebar styles */
.products-sidebar {
    flex: 0 0 250px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 20px 15px;
    position: sticky;
    top: 160px; /* Account for fixed header */
    margin-bottom: 32px;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.sidebar-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border-radius: 2px;
}

.category-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    text-decoration: none;
    color: #666;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    font-weight: 500;
    font-size: 0.9rem;
}

.category-item:hover {
    background: #f8f9fa;
    color: #0d6efd;
    border-color: #0d6efd;
    transform: translateX(5px);
}

.category-item.active {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border-color: #0d6efd;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.category-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.category-item.active i {
    color: white;
}

/* Content area styles */
.products-content {
    flex: 1;
    min-height: 500px;
}

.category-content {
    display: none;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 25px;
    margin-bottom: 20px;
    scroll-margin-top: 0; /* Ngăn scroll khi active */
}

.category-content.active {
    display: block;
}

/* Ngăn scroll behavior mặc định khi hash thay đổi */
html {
    scroll-behavior: auto; /* Tắt smooth scroll mặc định */
}

.category-content:target {
    scroll-margin-top: 0;
}

.content-header {
    margin-bottom: 25px;
    text-align: center;
}

.content-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    position: relative;
}

.content-header h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border-radius: 2px;
}

.content-description {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
}

/* Product grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.product-card {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.product-image {
    height: 160px;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.03);
}

.product-info {
    padding: 18px;
}

.product-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.product-info p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.btn-view-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-view-more:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0954a5 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

/* Log (blog/news) style for category content - dạng bài viết dọc */
.log-list {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.log-item {
    display: block;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0;
    margin: 0;
}

.log-item:last-child {
    border-bottom: none;
}

.log-thumb {
    width: 100%;
    height: auto;
    margin-bottom: 28px;
    border-radius: 0 !important;
    overflow: hidden;
    background: none !important;
    display: block;
    padding: 0;
    text-align: left;
}

.log-thumb img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    display: block;
    object-fit: cover;
    border-radius: 0 !important;
    margin: 0 auto;
    transition: none !important;
}

.log-body {
    width: 100%;
    font-size: 1.01rem;
    color: #222;
    line-height: 1.65;
    background: none;
    padding: 0;
    border: none;
    box-shadow: none;
}

.log-body h2, .log-body h3 {
    font-size: 1.09rem;
    font-weight: 700;
    margin: 24px 0 12px 0;
    color: #0d6efd;
    line-height: 1.3;
}

.log-body ul {
    margin: 18px 0 18px 24px;
    padding: 0;
    font-size: 0.98rem;
}

.log-body li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.log-body p {
    margin: 0 0 18px 0;
    font-size: 1.01rem;
    color: #222;
}

.log-body img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    display: block;
    object-fit: cover;
    border-radius: 0 !important;
    margin: 24px 0 !important;
    float: none !important;
    box-shadow: none !important;
}

.category-content .log-list {
    max-width: 98vw;
    margin: 0 auto;
    padding: 0 0 24px 0;
    gap: 36px;
}

:root {
    --cdimex-blue: #0d6efd;
}

.category-content .seo-article {
    max-width: 820px;
    margin: 0 auto;
    padding: 32px 18px 36px 18px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px 0 rgba(13, 71, 161, 0.06);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 1.08rem;
    color: #222;
    line-height: 1.8;
}

.category-content .seo-article header h1 {
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--cdimex-blue);
    line-height: 1.2;
    text-align: center;
}

.category-content .seo-article header p {
    font-size: 1.13rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 18px;
    text-align: center;
}

.category-content .seo-article h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cdimex-blue);
    margin: 32px 0 16px 0;
    line-height: 1.3;
}

.category-content .seo-article hr {
    border: none;
    border-top: 1.5px solid #e3e8f0;
    margin: 28px 0 24px 0;
}

.category-content .seo-article p {
    margin: 0 0 18px 0;
    font-size: 1.08rem;
    color: #222;
}

.category-content .seo-article ol, .category-content .seo-article ul {
    margin: 0 0 18px 24px;
    padding: 0;
    font-size: 1.05rem;
}

.category-content .seo-article li {
    margin-bottom: 10px;
    line-height: 1.7;
}

.category-content .seo-article ol > li {
    color: #222;
    font-weight: 400;
    margin-bottom: 18px;
}

.category-content .seo-article ol > li > strong {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
    color: #222;
}

.category-content .seo-article ol > li br {
    display: none;
}

.category-content .seo-article ol > li > ul,
.category-content .seo-article ol > li > p {
    font-weight: 400;
    color: #222;
    margin: 0 0 0 0;
}

.category-content .seo-article strong {
    color: #222;
    font-weight: 700;
}

.category-content .seo-article a {
    color: var(--cdimex-blue);
    text-decoration: underline;
}

@media (max-width: 1024px) {
    .products-layout {
        gap: 20px;
    }

    .products-sidebar {
        flex: 0 0 220px;
    }

    .content-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 900px) {
    .products-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box;
        padding: 0 !important;
    }
    .products-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 12px !important;
        left: auto !important;
        right: auto !important;
        box-sizing: border-box;
        margin-bottom: 20px !important;
    }
    .category-content .seo-article {
        max-width: 98vw;
        padding: 18px 4vw 24px 4vw;
        font-size: 1rem;
    }
    .category-content .seo-article header h1 {
        font-size: 1.3rem;
    }
    .category-content .seo-article h2 {
        font-size: 1.08rem;
        margin: 20px 0 10px 0;
    }
}

@media (max-width: 768px) {
    #main-content {
        padding: 15px 0;
    }

    .products-layout {
        flex-direction: column;
        gap: 15px;
    }

    .products-sidebar {
        position: static;
        flex: none;
        padding: 15px;
        margin-bottom: 20px;
    }

    .sidebar-title {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .category-item {
        padding: 10px 12px;
        font-size: 13px;
    }

    .category-item span {
        font-size: 13px;
    }

    .products-content {
        min-height: auto;
    }

    .category-content {
        padding: 20px 15px;
    }

    .content-header h1 {
        font-size: 1.5rem;
    }

    .content-description {
        font-size: 0.9rem;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 20px;
    }

    .product-card {
        max-width: 100%;
    }

    .product-info {
        padding: 15px;
    }

    .product-info h3 {
        font-size: 1rem;
    }
}

@media (max-width: 600px) {
    .products-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box;
        padding: 0 !important;
    }
    .products-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 8px !important;
        left: auto !important;
        right: auto !important;
        box-sizing: border-box;
        margin-bottom: 14px !important;
    }

    .category-content {
        padding: 15px 12px;
    }

    .content-header h1 {
        font-size: 1.3rem;
    }

    .product-info {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .products-sidebar {
        padding: 12px;
    }

    .category-item {
        padding: 8px 10px;
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }

    .category-item i {
        font-size: 14px;
    }

    .category-content {
        padding: 15px 12px;
    }

    .content-header h1 {
        font-size: 1.3rem;
    }

    .product-info {
        padding: 12px;
    }
}

@media (min-width: 1100px) {
    .products-sidebar {
        position: sticky;
        top: 32px;
        align-self: flex-start;
        z-index: 2;
    }
}

.log-item,
.log-item:hover,
.log-item:focus {
    transform: none !important;
    box-shadow: none !important;
    transition: none !important;
    z-index: auto !important;
}