/* ============ CATEGORY BANNER ============ */
.category-banner {
    position: relative;
    min-height: 360px;
    display: flex;
    align-items: center;
    color: #fff;
    overflow: hidden;
    padding: 50px 0 40px;
}

.banner-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(2px);
    transform: scale(1.05);
    z-index: 1;
}

.banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(78, 31, 107, 0.92) 0%, rgba(107, 45, 142, 0.85) 50%, rgba(142, 79, 184, 0.85) 100%);
    z-index: 2;
}

.banner-content {
    position: relative;
    z-index: 3;
    width: 100%;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: rgba(255,255,255,0.8);
    transition: color .2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb .separator {
    font-size: 9px;
    opacity: .6;
}

.breadcrumb .current {
    color: #fff;
    font-weight: 600;
}

/* Banner text */
.banner-text {
    max-width: 720px;
}

.banner-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 14px;
    backdrop-filter: blur(6px);
}

.banner-tag i {
    color: var(--accent);
}

.banner-text h1 {
    font-family: 'Playfair Display', serif;
    font-size: 56px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 14px;
    letter-spacing: 1px;
    text-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.banner-text > p {
    font-size: 15px;
    line-height: 1.7;
    opacity: .95;
    margin-bottom: 24px;
    max-width: 640px;
}

/* Stats */
.banner-stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-item i {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--accent);
    backdrop-filter: blur(6px);
}

.stat-item div {
    display: flex;
    flex-direction: column;
}

.stat-item strong {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}

.stat-item span {
    font-size: 12px;
    opacity: .85;
    margin-top: 2px;
}

/* ============ SUB CATEGORIES ============ */
.sub-categories {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
    position: sticky;
    top: 132px;
    z-index: 50;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.sub-cat-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sub-cat-list::-webkit-scrollbar { display: none; }

.sub-cat-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    transition: all .25s ease;
    flex-shrink: 0;
}

.sub-cat-item i {
    color: var(--primary);
    font-size: 14px;
}

.sub-cat-item small {
    background: #fff;
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.sub-cat-item:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(107, 45, 142, 0.12);
}

.sub-cat-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(107, 45, 142, 0.3);
}

.sub-cat-item.active i {
    color: var(--accent);
}

.sub-cat-item.active small {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* ============ MAIN LAYOUT ============ */
.category-main {
    padding: 32px 0 60px;
    background: linear-gradient(180deg, #fff 0%, var(--bg-soft) 100%);
}

.category-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
}

/* ============ SIDEBAR ============ */
.cat-sidebar {
    position: sticky;
    top: 224px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.widget {
    background: #fff;
    border-radius: var(--radius);
    padding: 18px 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.widget-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-soft);
    letter-spacing: .5px;
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px;
}

/* Search form */
.search-form {
    display: flex;
    background: var(--bg-soft);
    border-radius: 999px;
    padding: 4px 4px 4px 14px;
    border: 1px solid var(--border);
    transition: all .2s ease;
}

.search-form:focus-within {
    border-color: var(--primary-light);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(107, 45, 142, 0.1);
}

.search-form input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-dark);
}

.search-form button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background .2s ease;
}

.search-form button:hover {
    background: var(--primary-dark);
}

/* Filter list */
.filter-list li {
    margin-bottom: 6px;
}

.filter-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-dark);
    transition: color .2s ease;
}

.filter-list label:hover {
    color: var(--primary);
}

.filter-list label span {
    flex: 1;
}

.filter-list label small {
    background: var(--bg-soft);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.filter-list input[type="checkbox"],
.filter-list input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: all .2s ease;
    flex-shrink: 0;
}

.filter-list input[type="checkbox"] {
    border-radius: 5px;
}

.filter-list input[type="radio"] {
    border-radius: 50%;
}

.filter-list input:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.filter-list input[type="checkbox"]:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #fff;
    font-size: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.filter-list input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

/* Stars in filter */
.rating-list .stars {
    display: inline-flex;
    gap: 2px;
    color: var(--star);
    font-size: 12px;
}

/* Tag cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 5px 11px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-dark);
    transition: all .2s ease;
}

.tag:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Promo widget */
.widget-promo {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    text-align: center;
    border: none;
    padding: 24px 18px;
    position: relative;
    overflow: hidden;
}

.widget-promo::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.promo-content {
    position: relative;
    z-index: 2;
}

.promo-content > i {
    font-size: 36px;
    color: var(--accent);
    margin-bottom: 10px;
}

.promo-content h4 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 6px;
}

.promo-content p {
    font-size: 12.5px;
    opacity: .9;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ============ CONTENT ============ */
.cat-content {
    min-width: 0;
}

/* Toolbar */
.cat-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.result-count {
    font-size: 13px;
    color: var(--text-muted);
}

.result-count strong {
    color: var(--primary);
    font-weight: 700;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sort-by {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.sort-by label {
    color: var(--text-muted);
    font-weight: 500;
}

.sort-by select {
    border: 1px solid var(--border);
    background: var(--bg-soft);
    border-radius: 999px;
    padding: 7px 32px 7px 14px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-dark);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B2D8E' stroke-width='3' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all .2s ease;
}

.sort-by select:hover {
    border-color: var(--primary-light);
}

.view-mode {
    display: flex;
    gap: 4px;
    background: var(--bg-soft);
    border-radius: 999px;
    padding: 4px;
    border: 1px solid var(--border);
}

.view-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .2s ease;
    font-size: 13px;
}

.view-btn:hover {
    color: var(--primary);
}

.view-btn.active {
    background: var(--primary);
    color: #fff;
}

/* ============ FEATURED POST ============ */
.featured-post {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 0;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 28px;
    border: 1px solid var(--border);
}

.featured-post .post-img {
    position: relative;
    height: 100%;
    min-height: 320px;
    overflow: hidden;
}

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

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

.post-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: linear-gradient(135deg, #FF4D4D, #FF7A45);
    color: #fff;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 12px rgba(255, 77, 77, 0.4);
}

.featured-post .post-info {
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

.post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cat-tag {
    background: rgba(107, 45, 142, 0.1);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 11px !important;
}

.featured-post h2 {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
}

.featured-post h2 a {
    color: var(--text-dark);
    transition: color .2s ease;
}

.featured-post h2 a:hover {
    color: var(--primary);
}

.featured-post .post-info > p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-author img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-soft);
}

.post-author strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
}

.post-author span {
    font-size: 11px;
    color: var(--text-muted);
}

.rating.large {
    font-size: 14px;
    background: rgba(255, 180, 0, 0.1);
    padding: 6px 12px;
    border-radius: 999px;
}

/* ============ POSTS GRID ============ */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 32px;
}

.post-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all .3s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

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

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

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

.cat-tag-img {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(6px);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.post-card .post-info {
    padding: 16px 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card h3 {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card h3 a {
    color: var(--text-dark);
    transition: color .2s ease;
}

.post-card h3 a:hover {
    color: var(--primary);
}

.post-loc {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 12px;
}

.post-loc i {
    color: var(--primary);
}

.post-meta-small {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 12px;
}

.post-meta-small .price {
    color: var(--text-muted);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.post-meta-small .price i {
    color: var(--accent);
}

/* ============ LIST VIEW MODE ============ */
.posts-grid.list-view {
    grid-template-columns: 1fr;
}

.posts-grid.list-view .post-card {
    flex-direction: row;
}

.posts-grid.list-view .post-img {
    width: 260px;
    height: auto;
    flex-shrink: 0;
}

.posts-grid.list-view .post-info {
    padding: 18px 22px;
}

.posts-grid.list-view h3 {
    font-size: 17px;
    -webkit-line-clamp: 1;
}

/* ============ PAGINATION ============ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    transition: all .25s ease;
    padding: 0 12px;
}

.page-btn:hover {
    background: var(--bg-soft);
    border-color: var(--primary-light);
    color: var(--primary);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(107, 45, 142, 0.3);
}

.page-btn.disabled {
    opacity: .4;
    pointer-events: none;
}

.page-dots {
    color: var(--text-muted);
    padding: 0 6px;
    font-weight: 700;
}

/* ============ RELATED CATEGORIES ============ */
.related-cats {
    padding: 40px 0 60px;
    background: #fff;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 20px;
}

.related-card {
    position: relative;
    height: 180px;
    border-radius: var(--radius);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    transition: transform .3s ease;
}

.related-card:hover {
    transform: translateY(-4px);
}

.related-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(78, 31, 107, 0.95) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px;
    color: #fff;
    transition: background .3s ease;
}

.related-card:hover .related-overlay {
    background: linear-gradient(180deg, rgba(78, 31, 107, 0.3) 0%, rgba(78, 31, 107, 0.95) 100%);
}

.related-overlay h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
}

.related-overlay span {
    font-size: 12px;
    opacity: .9;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
    .category-layout { grid-template-columns: 240px 1fr; gap: 20px; }
    .banner-text h1 { font-size: 44px; }
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .category-layout { grid-template-columns: 1fr; }
    .cat-sidebar { position: static; }
    .sub-categories { position: static; top: auto; }
    .banner-text h1 { font-size: 36px; }
    .banner-stats { gap: 16px; }
    .stat-item i { width: 38px; height: 38px; font-size: 15px; }
    .stat-item strong { font-size: 17px; }
    .featured-post { grid-template-columns: 1fr; }
    .featured-post .post-img { min-height: 220px; }
    .posts-grid.list-view .post-card { flex-direction: column; }
    .posts-grid.list-view .post-img { width: 100%; height: 200px; }
}

@media (max-width: 600px) {
    .category-banner { min-height: 280px; padding: 30px 0; }
    .banner-text h1 { font-size: 28px; }
    .banner-text > p { font-size: 13px; }
    .banner-stats { gap: 12px; }
    .stat-item { gap: 8px; }
    .posts-grid { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr; }
    .cat-toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-right { justify-content: space-between; }
    .featured-post .post-info { padding: 20px; }
    .featured-post h2 { font-size: 18px; }
    .post-footer { flex-direction: column; align-items: flex-start; }
}
