.woo-category-menu-wrapper {
    margin-inline: -15px;
}

.woo-category-menu-title {
    margin: 0 0 15px 0;
    letter-spacing: 0.5px;
}

.woo-category-menu, .woo-category-children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.woo-category-children {
    display: none;
    margin-left: 20px;
}

.woo-category-item {
    margin: 0;
    padding: 0;
}

.woo-category-link-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    justify-content: space-between;
}

.woo-category-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 8px;
    margin-right: 10px;
    cursor: pointer;
    transition: transform 0.2s ease;
    color: #333;
    flex-shrink: 0;
}

.woo-category-toggle:hover {
    color: #333;
}

.woo-category-toggle svg {
    width: 12px;
    height: 12px;
}

.woo-category-item.open > .woo-category-link-wrapper .woo-category-toggle {
    transform: rotate(180deg);
}

.woo-category-link {
    color: #333;
    text-decoration: none;
    display: block;
    flex: 1;
    padding: 6px 15px 10px 15px;
    transition: color 0.2s ease;
}

.woo-category-link:hover {
    text-decoration: none;
}

.woo-category-link-wrapper:hover {
    background-color: #faf9f7;
    border-radius: 25px;
}

.woo-category-item.current-cat > .woo-category-link-wrapper .woo-category-link,
.woo-category-item.current-cat-ancestor > .woo-category-link-wrapper .woo-category-link {
    font-weight: 600;
}

.woo-category-item.current-cat > .woo-category-link-wrapper {
    background-color: #faf9f7;
    border-radius: 25px;
}

.woo-category-count {
    opacity: 0.6;
    font-size: 12px;
    margin-left: 5px;
}

.woo-category-children .woo-category-children {
    margin-left: 15px;
}

.woo-category-menu-wrapper.loading {
    opacity: 0.5;
    pointer-events: none;
}

.woo-category-menu-empty {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* Chips mode */
.woo-category-menu-wrapper.chips-mode {
    margin-inline: 0;
}

.woo-category-chips-container {
    display: flex;
    flex-direction: column;
}

.woo-category-chips-row-wrapper {
    position: relative;
}

.woo-category-chips-row {
    display: flex;
    gap: 10px;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.woo-category-chips-row::-webkit-scrollbar {
    display: none;
}

.woo-category-shadow-left, .woo-category-shadow-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2rem;
    z-index: 10;
    pointer-events: none;
    display: none;
}

.woo-category-shadow-left {
    left: 0;
    background: linear-gradient(to right, rgb(255, 255, 255) 0%, rgba(255, 255, 255, 0) 100%);
}

.woo-category-shadow-right {
    right: 0;
    background: linear-gradient(to left, rgb(255, 255, 255) 0%, rgba(255, 255, 255, 0) 100%);
}

.woo-category-chips-row-wrapper.has-scroll-left .woo-category-shadow-left {
    display: block;
}

.woo-category-chips-row-wrapper.has-scroll-right .woo-category-shadow-right {
    display: block;
}

.woo-category-chip {
    display: inline-flex;
    align-items: center;
    background-color: #e8e8ec;
    border-radius: 30px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

.woo-category-chip:hover {
    background-color: #d4d4d8;
}

.woo-category-chip.active {
    background-color: #333;
    color: white;
}

.woo-category-chip.active:hover {
    background-color: #333;
}

.woo-category-chip.has-active-child {
    background-color: #333;
    color: white;
}

.woo-category-chip.has-active-child:hover {
    background-color: #333;
}

.woo-category-chip-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.woo-category-chip.active .woo-category-chip-link {
    color: white;
}

.woo-category-chip-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
    border-radius: 50%;
}

.woo-category-chip-toggle:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.woo-category-chip.active .woo-category-chip-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.woo-category-chip-toggle svg {
    width: 12px;
    height: 12px;
}

.woo-category-chip.open .woo-category-chip-toggle {
    transform: rotate(180deg);
}

.woo-category-chip.child-chip {
    background-color: transparent;
    font-size: 13px;
    padding: 10px 18px;
    border: 1px solid #e5e7eb;
}

.woo-category-chip.child-chip:hover {
    background-color: #e5e7eb;
}

.woo-category-chip.child-chip.active {
    border-color: #333;
}

.woo-category-chip.child-chip.active .woo-category-chip-link {
    color: #333;
    font-weight: 700;
}

.woo-category-chip.grandchild-chip {
    background-color: #fafafa;
    font-size: 12px;
    padding: 5px 12px;
    border: 1px solid #e5e7eb;
}

.woo-category-chip.grandchild-chip:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.woo-category-chip.grandchild-chip.active {
    background-color: #6b7feb;
    border-color: #6b7feb;
}

.woo-category-children-container {
    display: none;
    margin-left: 0;
    position: relative;
}

.woo-category-grandchildren-inline {
    display: none;
    gap: 8px;
    margin-left: 10px;
    align-items: center;
    animation: slideRight 0.3s ease;
}

.children-row {
    margin-top: 4px;
    position: relative;
}

.woo-category-chip.child-chip.open {
    margin-right: 0;
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .woo-category-children {
        margin-left: 15px;
    }

    .woo-category-toggle {
        width: 24px;
        height: 24px;
    }

    .woo-category-menu-wrapper {
        font-size: 16px;
    }

    .woo-category-grandchildren-inline {
        gap: 6px;
        margin-left: 8px;
    }
}

/* Plus icon for parent chips */
.woo-category-chip.has-children {
    position: relative;
    padding-right: 30px !important;
}

.woo-category-chip.has-children > .woo-category-chip-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.woo-category-chip.has-children > .woo-category-chip-toggle svg {
    width: 12px;
    height: 12px;
    transition: opacity 0.2s ease;
    position: absolute;
}

/* Show plus by default, minus when open */
.woo-category-chip.has-children > .woo-category-chip-toggle .plus-icon {
    opacity: 1;
}

.woo-category-chip.has-children > .woo-category-chip-toggle .minus-icon {
    opacity: 0;
}

.woo-category-chip.has-children.open > .woo-category-chip-toggle .plus-icon {
    opacity: 0;
}

.woo-category-chip.has-children.open > .woo-category-chip-toggle .minus-icon {
    opacity: 1;
}