
.custom-woo-category-widget {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
}

.custom-cat-title {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 15px;
    font-family: inherit;
}

.custom-cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.custom-cat-item {
    margin-bottom: 5px;
}

.cat-item-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f1f1f1;
}

.custom-cat-item:last-child .cat-item-link {
    border-bottom: none;
}
.cat-item-link:hover {
    border-bottom-color: transparent;
}

.cat-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    margin-right: 15px;
    font-size: 20px;
}

.cat-item-icon svg {
    width: 24px;
    height: auto;
}

.cat-item-text {
    flex-grow: 1;
    font-size: 16px;
    font-weight: 500;
}

.cat-item-arrow {
    font-size: 14px;
    opacity: 0.8;
}

/* Scoped layout prevents theme list rules from breaking narrow columns. */
.custom-woo-category-widget,
.custom-woo-category-widget * { box-sizing: border-box; }
.custom-woo-category-widget { width: 100%; min-width: 0; }
.custom-woo-category-widget .custom-cat-title { margin-top: 0; overflow-wrap: anywhere; line-height: 1.4; }
.custom-woo-category-widget .custom-cat-list {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px;
    list-style: none; padding: 0; margin: 0;
}
.custom-woo-category-widget .custom-cat-item { min-width: 0; margin: 0; padding: 0; list-style: none; }
.custom-woo-category-widget .cat-item-link {
    width: 100%; min-width: 0; min-height: 48px; gap: 15px;
    color: #174733; line-height: 1.5;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.custom-woo-category-widget .cat-item-icon { flex: 0 0 24px; width: 24px; margin: 0; }
.custom-woo-category-widget .cat-item-icon svg { max-width: 100%; }
.custom-woo-category-widget .cat-item-text { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.custom-woo-category-widget .cat-item-arrow { display: flex; flex: 0 0 14px; align-items: center; }
.custom-woo-category-widget .cat-item-link:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (max-width: 1024px) {
    .custom-woo-category-widget { padding: 16px; }
    .custom-woo-category-widget .cat-item-link { padding: 12px; gap: 12px; }
}
@media (max-width: 767px) {
    .custom-woo-category-widget { padding: 12px; border-radius: 10px; }
    .custom-woo-category-widget .custom-cat-title { font-size: 16px; margin-bottom: 12px; }
    .custom-woo-category-widget .cat-item-link { padding: 11px 10px; gap: 10px; }
    .custom-woo-category-widget .cat-item-text { font-size: 15px; }
    .custom-woo-category-widget .cat-item-icon { flex-basis: 22px; width: 22px; font-size: 19px; }
    .custom-woo-category-widget .cat-item-icon svg { width: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    .custom-woo-category-widget .cat-item-link { transition: none; }
}

/* Keep the sidebar from collapsing when the product widget grows. */
.elementor-widget-auto_woo_categories {
    min-width: 210px;
    flex-shrink: 0;
}
.elementor-widget-auto_woo_categories .cat-item-text {
    flex: 1 1 auto;
    word-break: normal;
    overflow-wrap: break-word;
}
.elementor-widget-auto_woo_categories .custom-cat-title {
    word-break: normal;
    overflow-wrap: break-word;
}
@media (min-width: 768px) {
    .e-con:has(> .elementor-widget-auto_woo_categories) > .elementor-widget-auto_woo_categories,
    .e-con-inner:has(> .elementor-widget-auto_woo_categories) > .elementor-widget-auto_woo_categories {
        width: 240px;
        flex: 0 0 240px;
    }
    .e-con:has(> .elementor-widget-auto_woo_categories) > :not(.elementor-widget-auto_woo_categories),
    .e-con-inner:has(> .elementor-widget-auto_woo_categories) > :not(.elementor-widget-auto_woo_categories) {
        min-width: 0;
        flex: 1 1 0;
        width: auto;
    }
    .elementor-widget-auto_woo_categories .cat-item-link { padding: 12px 10px; gap: 10px; }
}
@media (max-width: 767px) {
    .elementor-widget-auto_woo_categories {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        flex: 0 0 100% !important;
    }
    .e-con:has(> .elementor-widget-auto_woo_categories),
    .e-con-inner:has(> .elementor-widget-auto_woo_categories),
    .elementor-container:has(> .elementor-column .elementor-widget-auto_woo_categories) {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch;
    }
    .e-con:has(> .elementor-widget-auto_woo_categories) > *,
    .e-con-inner:has(> .elementor-widget-auto_woo_categories) > *,
    .elementor-container:has(> .elementor-column .elementor-widget-auto_woo_categories) > .elementor-column {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        flex-basis: auto !important;
    }
    /* A sidebar wrapped in its own Elementor container. */
    .e-con:has(> .e-con > .elementor-widget-auto_woo_categories),
    .e-con-inner:has(> .e-con > .elementor-widget-auto_woo_categories) {
        flex-direction: column !important;
        align-items: stretch;
    }
    .e-con:has(> .e-con > .elementor-widget-auto_woo_categories) > *,
    .e-con-inner:has(> .e-con > .elementor-widget-auto_woo_categories) > * {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        flex-basis: auto !important;
    }
}
.custom-woo-category-widget .cat-item-link.cwgw-active { background: #174733; color: #fff; }
.custom-woo-category-widget .cat-item-link.cwgw-active svg,
.custom-woo-category-widget .cat-item-link.cwgw-active i { color: #fff; fill: #fff; }
.cwgw-filter-region[aria-busy="true"] { opacity: .55; pointer-events: none; }
.cwgw-filter-status:empty { display: none; }
.cwgw-filter-status { font-size: 13px; }

/* Active category must win over Elementor's generated primary-color rules. */
.elementor-widget-auto_woo_categories .custom-woo-category-widget .cat-item-link.cwgw-active,
.elementor-widget-auto_woo_categories .custom-woo-category-widget .cat-item-link.cwgw-active .cat-item-text,
.elementor-widget-auto_woo_categories .custom-woo-category-widget .cat-item-link.cwgw-active .cat-item-icon,
.elementor-widget-auto_woo_categories .custom-woo-category-widget .cat-item-link.cwgw-active .cat-item-arrow,
.elementor-widget-auto_woo_categories .custom-woo-category-widget .cat-item-link.cwgw-active i {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1;
}
.elementor-widget-auto_woo_categories .custom-woo-category-widget .cat-item-link.cwgw-active .cat-item-icon svg,
.elementor-widget-auto_woo_categories .custom-woo-category-widget .cat-item-link.cwgw-active .cat-item-icon svg *:not([fill="none"]) {
    fill: #ffffff !important;
}
.elementor-widget-auto_woo_categories .custom-woo-category-widget .cat-item-link.cwgw-active .cat-item-icon svg [stroke]:not([stroke="none"]),
.elementor-widget-auto_woo_categories .custom-woo-category-widget .cat-item-link.cwgw-active .cat-item-arrow svg path {
    stroke: #ffffff !important;
}
.elementor-widget-auto_woo_categories .custom-woo-category-widget .cat-item-link.cwgw-active .cat-item-arrow svg,
.elementor-widget-auto_woo_categories .custom-woo-category-widget .cat-item-link.cwgw-active .cat-item-arrow svg path {
    fill: none !important;
}
