/* Category Layout - Modern Design with #f2490b theme */

* {
    box-sizing: border-box;
}

.category-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    min-height: 600px;
}

/* Sidebar bên trái */
.category-sidebar {
    flex: 0 0 300px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(242, 73, 11, 0.1);
    overflow: hidden;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.sidebar-widget {
    margin-bottom: 30px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 20px;
}

.sidebar-widget:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.widget-title {
    background: linear-gradient(135deg, #f2490b, #ff6b35);
    color: white;
    margin: 0;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.widget-title i {
    font-size: 18px;
}

/* Sản phẩm bán chạy */
.bestseller-products,
.latest-news,
.related-categories {
    padding: 20px;
}

/* Related Categories */
.related-categories {
    padding: 15px;
}

.related-categories .category-item {
    margin-bottom: 8px;
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

.related-categories .category-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(242, 73, 11, 0.15);
}

.related-categories .category-item:last-child {
    margin-bottom: 0;
}

.related-categories .category-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #333;
    text-decoration: none;
    padding: 12px 15px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border-left: 3px solid transparent;
}

.related-categories .category-item a:hover {
    color: #f2490b;
    background: linear-gradient(135deg, #fff5f2, #ffffff);
    border-left-color: #f2490b;
}

.related-categories .category-item a i {
    color: #f2490b;
    font-size: 14px;
    width: 16px;
    text-align: center;
    transition: transform 0.3s ease;
}

.related-categories .category-item a:hover i {
    transform: scale(1.1);
}

.related-categories .category-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-categories .post-count {
    margin-left: auto;
    color: white;
    font-size: 11px;
    background: linear-gradient(135deg, #f2490b, #ff6b35);
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(242, 73, 11, 0.3);
    transition: all 0.3s ease;
}

.related-categories .category-item a:hover .post-count {
    background: linear-gradient(135deg, #d63d09, #e55a2b);
    transform: scale(1.05);
}

.sidebar-product-item,
.sidebar-news-item {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.sidebar-product-item:hover,
.sidebar-news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(242, 73, 11, 0.15);
}

.sidebar-product-item:last-child,
.sidebar-news-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.product-thumb,
.news-thumb {
    flex: 0 0 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
}

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

.product-thumb:hover img,
.news-thumb:hover img {
    transform: scale(1.1);
}

.product-info,
.news-info {
    flex: 1;
    min-width: 0;
}

.product-info h4,
.news-info h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    line-height: 1.3;
}

.product-info h4 a,
.news-info h4 a {
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    transition: color 0.3s ease;
}

.product-info h4 a:hover,
.news-info h4 a:hover {
    color: #f2490b;
}

.price {
    color: #f2490b;
    font-weight: 600;
    font-size: 14px;
}

.news-date {
    color: #999;
    font-size: 12px;
}

/* Quảng cáo */
.sidebar-ads {
    padding: 20px;
}

.ad-item {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    position: relative;
}

.ad-item:hover {
    transform: translateY(-2px);
}

.ad-item:last-child {
    margin-bottom: 0;
}

.ad-item a {
    display: block;
    text-decoration: none;
    position: relative;
}

.ad-item img {
    width: 100%;
    height: auto;
    display: block;
}

.ad-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 20px 15px 15px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* Nội dung chính bên phải */
.category-content {
    flex: 1;
    min-width: 0;
}

.category-header {
    background: linear-gradient(135deg, #f2490b, #ff6b35);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}

.category-title {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
}

.category-description {
    opacity: 0.9;
    line-height: 1.6;
}

/* Grid bài viết */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(242, 73, 11, 0.15);
}

.post-thumbnail {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-date {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(242, 73, 11, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.post-date span {
    display: block;
}

.post-content {
    padding: 25px;
}

.post-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    line-height: 1.4;
}

.post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: #f2490b;
}

.post-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.post-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #999;
}

.post-meta i {
    margin-right: 5px;
    color: #f2490b;
}

.post-author,
.post-modified {
    display: flex;
    align-items: center;
}

.read-more-btn {
    background: linear-gradient(135deg, #f2490b, #ff6b35);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    background: linear-gradient(135deg, #d63d09, #e55a2b);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(242, 73, 11, 0.3);
}

.read-more-btn i {
    transition: transform 0.3s ease;
}

.read-more-btn:hover i {
    transform: translateX(3px);
}

/* Phân trang */
.pagination-wrapper {
    text-align: center;
    margin-top: 40px;
}

.pagination-wrapper .page-numbers {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    gap: 5px;
}

.pagination-wrapper .page-numbers li {
    display: inline-block;
}

.pagination-wrapper .page-numbers a,
.pagination-wrapper .page-numbers span {
    display: block;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination-wrapper .page-numbers a {
    background: white;
    color: #666;
    border: 2px solid #f0f0f0;
}

.pagination-wrapper .page-numbers a:hover {
    background: #f2490b;
    color: white;
    border-color: #f2490b;
}

.pagination-wrapper .page-numbers .current {
    background: #f2490b;
    color: white;
    border: 2px solid #f2490b;
}

/* No posts */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 12px;
}

.no-posts h3 {
    color: #666;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .category-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .category-sidebar {
        flex: none;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .category-header {
        padding: 20px;
    }
    
    .category-title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .post-content {
        padding: 20px;
    }
    
    .widget-title {
        padding: 12px 15px;
        font-size: 15px;
    }
    
    .bestseller-products,
    .latest-news,
    .sidebar-ads {
        padding: 15px;
    }
}
