/* Menu kategorii produktów */
.zamel-tree {
    font-size: 0.875rem; /* odpowiednik var(--zamel-fs-s) */
    list-style: none !important;
    margin: 0 !important;
    /*padding: 0 !important;*/
}


.zamel-tree,
.zamel-tree ul {
    list-style: none !important;
    margin: 0 !important;
    padding-inline-start: 1.5em;
}


.zamel-tree > li::before {
    content: none !important;
    border-left: none !important;
}


/*.zamel-tree li li::before {*/
/*    content: "";*/
/*    position: absolute;*/
/*    left: 0;*/
/*    top: 0;*/
/*    border-left: 1px solid #ddd;*/
/*    height: 100%;*/
/*}*/

/* Główny kontener kategorii */
.zamel-category-item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
}

/* Nagłówek kategorii (przycisk + link) */
.zamel-category-header {
    display: flex;
    align-items: center;
    padding: 0.375em 0;
    position: relative;
}

/* Przycisk rozwijania +/- */
.zamel-category-toggle {
    background: #fff !important;
    border: 1px solid #e6e6e6 !important;
    width: 20px !important;
    height: 20px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-family: monospace !important;
    font-size: 16px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    border-radius: 3px !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    color: #747474 !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

.zamel-category-toggle:hover {
    background-color: #ececec !important;
    border-color: #747474 !important;
    color: #000 !important;
}

.zamel-category-toggle:active {
    background-color: #e6e6e6 !important;
}

/* Przycisk rozwijania dla rozwiniętych kategorii - używamy czerwieni */
.zamel-category-toggle[aria-expanded="true"] {
    background-color: #DE000E !important;
    border-color: #DE000E !important;
    color: #fff !important;

}

.zamel-category-toggle[aria-expanded="true"]:hover {
    background-color: #000 !important;
    border-color: #000 !important;
}

/* Link kategorii - podstawowe style */
.zamel-category-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
    /*padding: 0.375em 0.75em;*/
    margin-left: 0.5em;
    border-radius: 3px;
    transition: background-color 0.2s ease;
    min-height: 28px;
}

.zamel-category-link:hover {
    background-color: #ececec;
    text-decoration: none;
}

/* Style dla kategorii głównych (root) */
.zamel-category-link.zamel-category-root {
    font-weight: normal !important;
    color: #000;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.zamel-category-link.zamel-category-root:hover {
    background-color: #f9faf6;
    border-color: #DE000E;
    color: #DE000E;
}

/* Style dla podkategorii (child) */
.zamel-category-link.zamel-category-child {
    color: #000;
    font-weight: 400;
}

.zamel-category-link.zamel-category-child:hover {
    background-color: #ececec;
    color: #DE000E;
}

/* Aktywna kategoria - zachowujemy czerwone podświetlenie */
.zamel-category-link.zamel-active {
    background-color: #fce4e4;
    color: #DE000E;
    font-weight: 700;
}

.zamel-category-link.zamel-active:hover {
    background-color: #f8d7da;
}

/* Aktywna kategoria główna */
.zamel-category-link.zamel-category-root.zamel-active {
    background-color: #ececec;
    color: #DE000E;
    border-color: #DE000E;
}

.zamel-category-link.zamel-category-root.zamel-active:hover {
    background-color: #e6e6e6;
}

/* Nazwa kategorii */
.zamel-category-name {
    flex: 1;
    padding-right: 0.5em;
}

/* Licznik produktów */
.zamel-category-count {
    color: #747474;
    font-size: 0.875em;
    font-weight: 400;
    white-space: nowrap;
}

.zamel-category-link.zamel-active .zamel-category-count {
    color: #a02b36;
}

.zamel-category-link.zamel-category-root .zamel-category-count {
    color: #747474;
}

/* Kontener dla podkategorii */
.zamel-category-children {
    margin: 0;
    padding: 0;
    margin-left: 20px; /* Wyrównanie do przycisku toggle rodzica */
    padding-left: 20px; /* Dodatkowe wcięcie */
    position: relative;
}


/* Linia łącząca podkategorie */
.zamel-category-children::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 1px !important;
    background-color: red !important;
    border: none !important;
}

/* Pozioma linia dla każdej podkategorii */
.zamel-category-children > .zamel-category-item::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 18px; /* Połowa wysokości przycisku */
    width: 12px !important;
    height: 1px !important;
    background-color: red !important;
    border: none !important;
}

/* Ostatnia podkategoria - skróć linię pionową */
.zamel-category-children > .zamel-category-item:last-child::after {
    content: '';
    position: absolute;
    left: -11px;
    top: 19px;
    bottom: 0;
    width: 1px;
    background-color: #fff;
}

/* Klasa ukrywająca */
.zamel-hidden {
    display: none !important;
}

/* Animacja rozwijania */
.zamel-category-children {
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

.zamel-category-children:not(.zamel-hidden) {
    display: block;
    max-height: 2000px;
    opacity: 1;
}

.zamel-category-children.zamel-hidden {
    max-height: 0;
    opacity: 0;
}

/* Ikona w przycisku */
.zamel-toggle-icon {
    display: inline-block;
    font-style: normal;
}

/* Responsywność */
@media (max-width: 48em) {
    .zamel-category-link {
        padding: 0.5em 0.75em;
        font-size: 0.95em;
    }

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

    .zamel-category-children::before {
        left: 7px;
    }

    .zamel-category-children > .zamel-category-item::before {
        left: -8px;
        width: 8px;
    }
}

/* Hover effect dla całej linii kategorii */
.zamel-category-item:hover > .zamel-category-header .zamel-category-toggle {
    border-color: #747474;
}

/* Focus dla dostępności */
.zamel-category-toggle:focus,
.zamel-category-link:focus {
    outline: 2px solid #DE000E;
    outline-offset: 2px;
}

/* Wyłącz domyślne style przeglądarki */
.zamel-category-toggle::-moz-focus-inner {
    border: 0;
}

/* Styl dla pustych kategorii */
.zamel-category-item.zamel-empty > .zamel-category-header .zamel-category-link {
    opacity: 0.6;
}

/* Wyrównanie w kontenerze */
.zamel-b h3 + .zamel-tree {
    margin-top: 0;
}

/* Wyrównanie pierwszego poziomu kategorii */
.zamel-tree > .zamel-category-item:first-child {
    margin-top: 0;
}

.zamel-tree > .zamel-category-item:last-child {
    margin-bottom: 0;
}

/* Ikona strzałki dla kategorii głównych */
.zamel-category-link.zamel-category-root::before {
    content: '▸';
    margin-right: 0.5em;
    color: #747474;
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

.zamel-category-link.zamel-category-root:hover::before {
    transform: translateX(3px);
    color: #DE000E;
}

/* Subtelna linia separująca kategorie główne */
.zamel-tree > .zamel-category-item + .zamel-category-item {
    margin-top: 0.5em;
    padding-top: 0.5em;
    /*border-top: 1px solid #ececec;*/
}

/* Specjalne style dla stanu bez filtrów */
.zamel-category-item[data-no-children] > .zamel-category-header {
    padding-left: 20px;
}

/* Dodatkowe wyróżnienie dla kategorii z produktami */
.zamel-category-item[data-has-products="true"] > .zamel-category-header .zamel-category-link {
    position: relative;
}

.zamel-category-item[data-has-products="true"] > .zamel-category-header .zamel-category-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background-color: transparent;
    transition: background-color 0.2s ease;
}

.zamel-category-item[data-has-products="true"] > .zamel-category-header .zamel-category-link:hover::after {
    background-color: #DE000E;
}
