/* =============================================
   Category Browser Layout
============================================= */
.cb-wrapper {
    display: flex;
    gap: 0;
    min-height: 600px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    font-family: inherit;
}

/* ---- SIDEBAR ---- */
.cb-sidebar {
    width: 220px;
    min-width: 220px;
    background: #f5f5f5;
    border-right: 1px solid #e0e0e0;
}

.cb-main-cats {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cb-main-cat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid #e8e8e8;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: background 0.2s, color 0.2s;
    border-left: 3px solid transparent;
}

.cb-main-cat-item:hover {
    background: #ebebeb;
    color: #111;
}

.cb-main-cat-item.active {
    background: #fff;
    color: #e44d26;
    border-left-color: #e44d26;
    font-weight: 700;
}

.cb-cat-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

/* ---- RIGHT CONTENT ---- */
.cb-content {
    flex: 1;
    background: #fff;
    overflow-y: auto;
}

.cb-cat-panel {
    display: none;
    padding: 28px 28px 20px;
}

.cb-cat-panel.active {
    display: block;
}

.cb-main-cat-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e44d26;
    color: #111;
}

/* ---- SUB CATEGORIES ---- */
.cb-sub-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 30px;
}

.cb-sub-cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 110px;
    padding: 12px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    background: #fafafa;
}

.cb-sub-cat-item:hover {
    border-color: #e44d26;
    background: #fff5f3;
    box-shadow: 0 2px 8px rgba(228, 77, 38, 0.12);
    color: #e44d26;
}

.cb-sub-cat-item.selected {
    border-color: #e44d26;
    background: #fff5f3;
    color: #e44d26;
}

.cb-sub-cat-item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
}

.cb-sub-cat-item span {
    line-height: 1.3;
}

/* ---- PRODUCTS AREA ---- */
.cb-products-area {
    margin-top: 10px;
}

.cb-products-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    color: #222;
}

.cb-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* ---- PRODUCT CARD ---- */
.cb-product-card {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    background: #fff;
}

.cb-product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.cb-product-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.cb-product-img img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.cb-product-info {
    padding: 12px;
}

.cb-product-info h4 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 6px;
    color: #222;
    line-height: 1.4;
}

.cb-price {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #e44d26;
    margin-bottom: 10px;
}

.cb-btn {
    display: inline-block;
    padding: 6px 14px;
    background: #e44d26;
    color: #fff !important;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;
}

.cb-btn:hover {
    background: #c93d1c;
}

/* ---- LOADING ---- */
.cb-loading {
    padding: 20px;
    color: #888;
    font-style: italic;
}

.cb-no-products {
    color: #888;
    font-style: italic;
    padding: 10px 0;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .cb-wrapper {
        flex-direction: column;
    }
    .cb-sidebar {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    .cb-main-cats {
        display: flex;
        overflow-x: auto;
    }
    .cb-main-cat-item {
        border-bottom: none;
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .cb-main-cat-item.active {
        border-bottom-color: #e44d26;
        border-left-color: transparent;
    }
    .cb-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}