.category-tab-widget {
    width: 100%;
    box-sizing: border-box;
}

.ctw-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ctw-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    flex-shrink: 0;
    text-decoration: none;
}

.ctw-title:hover {
    color: #5b5fc7;
}

.ctw-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}

.ctw-tab {
    padding: 6px 16px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ctw-tab:hover {
    color: #333;
    background-color: #f0f0f0;
}

.ctw-tab.active {
    color: #333;
    background-color: #f5f5f5;
    font-weight: 500;
}

.ctw-content {
    position: relative;
    min-height: 100px;
}

.ctw-panel {
    display: none;
}

.ctw-panel.active {
    display: block;
}

.ctw-grid {
    display: grid;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

.ctw-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ctw-cols-4 { grid-template-columns: repeat(4, 1fr); }
.ctw-cols-5 { grid-template-columns: repeat(5, 1fr); }
.ctw-cols-6 { grid-template-columns: repeat(6, 1fr); }

.ctw-item {
    display: block;
    text-decoration: none;
    border-radius: 12px;
    overflow: hidden;
}

.ctw-thumb {
    width: 100%;
    padding-bottom: 100%;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.ctw-item:hover .ctw-thumb {
    transform: scale(1.05);
}

.ctw-item-title {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    color: #333;
    text-align: center;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1024px) {
    .ctw-cols-5,
    .ctw-cols-6 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    .ctw-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ctw-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .ctw-tabs::-webkit-scrollbar {
        display: none;
    }

    .ctw-more-btn {
        position: absolute;
        top: 0;
        right: 0;
    }

    .ctw-cols-3,
    .ctw-cols-4,
    .ctw-cols-5,
    .ctw-cols-6 { grid-template-columns: repeat(2, 1fr); }

    .ctw-title {
        font-size: 18px;
    }

    .ctw-tab {
        padding: 5px 12px;
        font-size: 13px;
    }
}
