/* Zigzag-style Category Page CSS - Refined */

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Hide footer on this page to allow full height category view */
[shopby-skin-container]>footer,
[shopby-skin-container]>div>footer,
.footer {
    display: none !important;
}

[shopby-skin-container] {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.category-page-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* Main container should fill available space */
    position: relative;
    overflow: hidden;
    background-color: #fff;
    /* Removing explicit padding-bottom that was pushed by nav, let flex handle it */
    min-height: 0;
    /* Critical for nested flex scrolling */

    /* Layout Constraint from Main Page */
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    border-left: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
}

/* 1. Top Tabs */
.category-top-tabs {
    flex-shrink: 0;
    height: 50px;
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    z-index: 10;
}

.category-top-tabs::-webkit-scrollbar {
    display: none;
}

.category-tabs-list {
    display: inline-flex;
    padding: 0 10px;
    margin: 0;
    height: 100%;
    list-style: none;
    align-items: center;
}

.category-tab-item {
    display: block;
    padding: 0 15px;
    height: 100%;
    line-height: 48px;
    font-size: 15px;
    color: #999;
    font-weight: 400;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.category-tab-item.active {
    color: #000;
    font-weight: 700;
    border-bottom-color: #000;
}

/* 2. Body */
.category-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    height: 100%;
    /* Ensure it fills parent */
    min-height: 0;
    /* Critical for flex scrolling */
}

/* Sidebar */
.category-sidebar {
    width: 90px;
    background-color: #f7f7f7;
    overflow-y: auto;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}

.category-sidebar::-webkit-scrollbar {
    display: none;
}

.category-sidebar-list {
    margin: 0;
    padding: 0 0 50px 0;
    list-style: none;
}

.category-sidebar-item {
    display: block;
    padding: 16px 10px;
    font-size: 13px;
    color: #888;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s;
    line-height: 1.3;
}

.category-sidebar-item.active {
    background-color: #fff;
    color: #000;
    font-weight: 700;
}

/* Right Content Area */
.category-grid-area {
    flex: 1;
    /* Takes remaining width */
    height: 100%;
    /* Fill vertical space */
    background-color: #fff;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 80px 0;
    position: relative;
    scroll-behavior: smooth;
}

/* Sections */
.category-section-wrap {
    padding: 24px 20px;
    /* Optional divider */
    /* border-bottom: 1px solid #f5f5f5; */
    scroll-margin-top: 50px;
    /* Offset for scrolling */
    min-height: 100px;
}

/* Header inside section */
.category-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 8px;
    /* Visual spacing */
    border-bottom: 1px solid #f0f0f0;
    /* Slight line like Zigzag */
}

.category-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Optional Image Icon handling if data existed:
.category-section-title::before {
    content: '';
    display: block; 
    width: 24px; height: 24px;
    background: #ddd; radius: 50%;
}
*/

.category-section-more {
    display: flex;
    align-items: center;
    color: #bbb;
}

/* Text Grid */
.category-section-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns like reference */
    gap: 12px 20px;
    /* Row gap 12, Column gap 20 */
}

.category-text-item {
    display: block;
    font-size: 14px;
    color: #444;
    text-decoration: none;
    /* line-height: 1.4; */
    padding: 4px 0;
}

.category-text-item.emphasize {
    color: #6c5ce7;
    /* Distinct color for 'View All' */
    font-weight: 500;
}