/* Flokker Catalog Hidden Categories & Sidebar Accordion */
/* 14. E-POOD: Peida "Uncategorized" / "Määramata" / "Ootel" kategooriad täielikult */
.product-cat-uncategorized,
.cat-item-uncategorized,
.product-cat-unorganized,
.cat-item-unorganized,
.product-cat-unorganised,
.cat-item-unorganised,
.cat-item-maaramata,
.product-cat-maaramata,
.product-cat-ilma-kategooriata,
.cat-item-ilma-kategooriata,
.product-cat-ootel,
.cat-item-ootel,
.product-cat-ootel-tooted,
.cat-item-ootel-tooted,
.cat-item-16,
.cat-item-27,
li[class*="uncategorized"],
li[class*="unorganized"],
li[class*="unorganised"],
li[class*="maaramata"],
li[class*="ilma-kategooriata"],
li[class*="ootel-tooted"],
li[class*="product-cat-ootel"],
li[class*="cat-item-ootel"],
li:has(> a[href*="/maaramata/"]),
li:has(> a[href*="/m%c3%a4%c3%a4ramata/" i]),
li:has(> a[href*="/määramata/"]),
li:has(> a[href*="/uncategorized/"]),
li:has(> a[href*="/unorganized/"]),
li:has(> a[href*="/unorganised/"]),
li:has(> a[href*="/ilma-kategooriata/"]),
li:has(> a[href*="/ootel/"]),
li:has(> a[href$="/ootel"]),
li:has(> a[href*="product_cat=ootel"]),
li:has(> a[href*="/ootel-tooted/"]),
li:has(> a[href*="maaramata"]),
li:has(> a[href*="uncategorized"]),
li:has(> a[href*="unorganized"]),
li:has(> a[href*="unorganised"]),
li:has(> a[href*="ilma-kategooriata"]),
li:has(> a[href*="ootel-tooted"]) {
    display: none !important;
}

/* ==========================================================================
   15. KÜLGERIBA (SIDEBAR) KATEGOORIAPUU HIERARHIA & VISUAALNE STRUKTUUR
   Puhas, õhuline ja minimalistlik disain (ilma liigsete kastide ja joonteta)
   ========================================================================== */

/* Külgriba kategooriaplokk tervikuna - eemaldame kastid ja taustad */
.ast-woo-sidebar-widget,
.widget.widget_block,
.wp-block-woocommerce-product-categories,
.widget_product_categories {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 0 24px 0 !important;
    margin-bottom: 24px !important;
    box-shadow: none !important;
}

/* Külgriba pealkiri - lihtne joon alla */
.ast-woo-sidebar-widget .wp-block-heading,
.widget-area .widget-title,
.widget_product_categories .widget-title {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #14261C !important;
    letter-spacing: 0 !important;
    padding-bottom: 12px !important;
    margin-bottom: 20px !important;
    border-bottom: 1px solid #E1E7E2 !important;
    text-transform: none !important;
}

/* Nimekirjade üldseaded */
.wp-block-woocommerce-product-categories ul,
.widget_product_categories ul,
.wc-block-product-categories-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.wp-block-woocommerce-product-categories li,
.widget_product_categories li,
.wc-block-product-categories-list-item {
    list-style: none !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* --- TASE 0: PEAKATEGOORIA (PARENT CATEGORY) --- */
.wc-block-product-categories-list--depth-0 > .wc-block-product-categories-list-item,
.product-categories > .cat-item {
    margin-bottom: 14px !important;
}

.wc-block-product-categories-list--depth-0 > .wc-block-product-categories-list-item > a,
.product-categories > .cat-item > a {
    display: inline-block !important;
    padding: 4px 0 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #14261C !important;
    text-decoration: none !important;
    background: transparent !important;
    border: none !important;
    transition: color 0.2s ease !important;
}

.wc-block-product-categories-list--depth-0 > .wc-block-product-categories-list-item > a:hover,
.product-categories > .cat-item > a:hover {
    color: #00AC97 !important;
    background: transparent !important;
    transform: none !important;
}

/* --- TASE 1: ALAMKATEGOORIA (CHILD CATEGORY) --- */
.wc-block-product-categories-list--depth-1,
.product-categories .children {
    margin-left: 14px !important;
    padding-left: 0 !important;
    border-left: none !important;
    margin-top: 6px !important;
    margin-bottom: 12px !important;
}

.wc-block-product-categories-list--depth-1 > .wc-block-product-categories-list-item,
.product-categories .children > .cat-item {
    margin-bottom: 8px !important;
}

.wc-block-product-categories-list--depth-1 > .wc-block-product-categories-list-item > a,
.product-categories .children > .cat-item > a {
    display: inline-block !important;
    padding: 2px 0 !important;
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    color: #4F5655 !important;
    text-decoration: none !important;
    background: transparent !important;
    transition: color 0.15s ease !important;
}

.wc-block-product-categories-list--depth-1 > .wc-block-product-categories-list-item > a:hover,
.product-categories .children > .cat-item > a:hover {
    color: #00AC97 !important;
    background: transparent !important;
}

/* --- TASE 2+: ALAM-ALAMKATEGOORIA (GRANDCHILD CATEGORY) --- */
.wc-block-product-categories-list--depth-2,
.product-categories .children .children {
    margin-left: 16px !important;
    padding-left: 0 !important;
    border-left: none !important;
    margin-top: 6px !important;
    margin-bottom: 8px !important;
}

.wc-block-product-categories-list--depth-2 > .wc-block-product-categories-list-item > a,
.product-categories .children .children > .cat-item > a {
    display: inline-block !important;
    padding: 2px 0 !important;
    font-size: 0.88rem !important;
    font-weight: 400 !important;
    color: #7C8580 !important;
    text-decoration: none !important;
    transition: color 0.15s ease !important;
}

.wc-block-product-categories-list--depth-2 > .wc-block-product-categories-list-item > a:hover,
.product-categories .children .children > .cat-item > a:hover {
    color: #00AC97 !important;
    background: transparent !important;
}

/* Peida eelmise disaini pseudo-elemendid igaks juhuks */
.wc-block-product-categories-list--depth-1 > .wc-block-product-categories-list-item > a::before,
.product-categories .children > .cat-item > a::before,
.wc-block-product-categories-list--depth-2 > .wc-block-product-categories-list-item > a::before,
.product-categories .children .children > .cat-item > a::before {
    display: none !important;
}

/* --- AKTIIVNE KATEGOORIA (CURRENT ACTIVE CATEGORY HIGHLIGHT) --- */
.wc-block-product-categories-list-item a[aria-current="page"],
.product-categories li.current-cat > a,
.ast-woo-sidebar-widget a.active,
.wc-block-product-categories-list-item.is-active > a {
    color: #00AC97 !important;
    font-weight: 600 !important;
    background: transparent !important;
    border: none !important;
    padding-left: 0 !important;
    box-shadow: none !important;
}

/* --- KATEGOORIAPUU AKORDION (Peida mitteaktiivsed alamkategooriad) --- */
/* Vaikimisi peidame KÕIK alamkategooriad (tase 1 ja tase 2) */
.wc-block-product-categories-list--depth-1,
.wc-block-product-categories-list--depth-2,
.product-categories .children {
    display: none !important;
}

/* 1. NÄITA klassikalise WooCommerce vidina puhul (kui on aktiivne või aktiivse vanem) */
.product-categories .current-cat > .children,
.product-categories .current-cat-parent > .children,
.product-categories .current-cat-ancestor > .children,
.product-categories .current-cat-ancestor .current-cat-parent > .children {
    display: block !important;
}

/* 2. NÄITA Gutenberg WooCommerce ploki puhul */
/* Kui see LI on ISE aktiivne, siis näita tema otseseid alamkategooriaid */
.wc-block-product-categories-list-item.is-active > .wc-block-product-categories-list {
    display: block !important;
}

/* Kui see LI SISALDAB aktiivset kategooriat (on vanem või vanavanem), siis näita tema otseseid alamkategooriaid */
.wc-block-product-categories-list-item:has(.is-active) > .wc-block-product-categories-list {
    display: block !important;
}

/* Peida külgriba "Uusimad tooted" plokk (#block-47) täielikult */
#block-47,
.ast-woo-sidebar-widget #block-47,
.widget_block:has(.wc-block-product-new),
.widget_block:has(.wp-block-woocommerce-product-new),
.wc-block-grid.wp-block-product-new,
.wc-block-product-new,
.wp-block-woocommerce-product-new {
    display: none !important;
}

