/* ==========================
   DRZEWO KATEGORII W KATALOGU
   ========================== */

/* Kontener drzewa */
.category-tree {
    padding: 0.5rem 0;
}

/* Form-check (każda kategoria) - BEZ PADDINGU */
.category-tree .form-check {
    padding: 0 !important;
    margin-bottom: 0.5rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.category-tree .form-check:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* UKRYJ PRAWDZIWY RADIO BUTTON - CAŁKOWICIE I AGRESYWNIE */
.category-tree .form-check-input,
.category-tree input[type="radio"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* LABEL - podstawowy styl BEZ PADDINGU */
.category-tree .form-check-label {
    cursor: pointer;
    user-select: none;
    width: 100%;
    position: relative;
    padding: 0.2em;
    margin: 0 !important;
    font-size: 0.9375rem;
    color: #495057;
    font-weight: 400;
    line-height: 1.2;
    display: block;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

/* KATEGORIA GŁÓWNA (bez subcategory) - pogrubiona */
.category-tree .form-check:not(.subcategory) .form-check-label {
    font-weight: 600 !important;
    color: #212529;
}

/* PODKATEGORIA - znak └ przez ::before jako ABSOLUTE */
.category-tree .form-check.subcategory .form-check-label {
    padding-left: 3rem !important;
}

.category-tree .form-check.subcategory .form-check-label::before {
    content: '└';
    position: absolute;
    left: 1.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1;
}

/* Przesunięcie radio buttona dla podkategorii */
.category-tree .form-check.subcategory .form-check-label::after {
    left: 1rem;
}

/* AKTYWNA KATEGORIA - pogrubiona i w kolorze primary */
.category-tree .form-check.active .form-check-label {
    color: var(--primary) !important;
    font-weight: 700 !important;
    background-color: rgba(229, 84, 84, 0.05);
}

.category-tree .form-check.active .form-check-label::after {
    border-color: var(--primary) !important;
    background: var(--primary) !important;
}

/* Hover - zmiana koloru na primary */
.category-tree .form-check:hover .form-check-label {
    color: var(--primary);
    background-color: rgba(229, 84, 84, 0.03);
}

.category-tree .form-check:hover .form-check-label::after {
    border-color: var(--primary);
}

/* Dodatkowe wcięcia dla poziomów ps-3, ps-6, ps-9 */
.category-tree .ps-3.subcategory .form-check-label {
    padding-left: 1.5em !important;
    position: relative;
}

.category-tree .ps-3.subcategory .form-check-label::before {
    left: 0;
    top: 0.8em;
}

.category-tree .ps-6.subcategory .form-check-label {
    padding-left: calc(3rem + 2rem) !important;
}

.category-tree .ps-6.subcategory .form-check-label::before {
    left: calc(1.75rem + 2rem);
}

.category-tree .ps-9.subcategory .form-check-label {
    padding-left: calc(3rem + 3rem) !important;
}

.category-tree .ps-9.subcategory .form-check-label::before {
    left: calc(1.75rem + 3rem);
}

.category-tree .ps-9.subcategory .form-check-label::after {
    left: calc(1rem + 3rem);
}
