﻿/* Shared product category tree: one frame, bounded indentation even for deep branches. */
.usersite-product-tree-compact .usersite-location-municipality-item {
    position: relative;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.usersite-product-tree-compact .usersite-location-settlement-list {
    padding: 0;
    margin: 0;
}

.usersite-product-tree-compact .usersite-location-municipality-header {
    position: relative;
    min-height: 40px;
    padding: 7px 0 7px var(--product-indent, 0px);
    gap: 4px;
}

.usersite-product-tree-compact .usersite-location-municipality-row {
    font-weight: 500;
    flex: 1;
    min-width: 0;
    align-items: flex-start;
    font-size: .9rem;
    gap: 7px;
}

.usersite-product-tree-compact .usersite-location-municipality-row span {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.usersite-product-tree-compact .usersite-location-municipality-row input {
    margin-top: 3px;
}

.usersite-product-tree-compact .usersite-location-municipality-header:has(input:checked) {
    background: #f1f5f9;
}

/* Draw the parent/child connection without consuming additional row width. */
.usersite-product-tree-compact .product-tree-child::before {
    content: "";
    position: absolute;
    left: calc(var(--product-indent) - 8px);
    top: 0;
    bottom: 0;
    border-left: 1px solid #b8c4d2;
    pointer-events: none;
}

.usersite-product-tree-compact .product-tree-child:last-child::before {
    bottom: auto;
    height: 22px;
}

.usersite-product-tree-compact .product-tree-child > .usersite-location-municipality-header::before {
    content: "";
    position: absolute;
    left: calc(var(--product-indent) - 8px);
    top: 22px;
    width: 7px;
    border-top: 1px solid #b8c4d2;
    pointer-events: none;
}

.usersite-product-tree-compact .product-tree-root {
    margin-top: 8px;
    padding-top: 4px;
    border-top: 1px solid #e5e7eb;
}

.usersite-product-tree-compact .product-tree-branch > .usersite-location-municipality-header .usersite-location-municipality-row {
    font-weight: 600;
}

.usersite-product-tree-compact .product-tree-root > .usersite-location-municipality-header .usersite-location-municipality-row {
    font-weight: 800;
}

.usersite-product-tree-compact .usersite-location-municipality-row:has(input:checked) {
    font-weight: 800;
}

.usersite-product-tree-compact .usersite-location-collapse-toggle {
    width: 28px;
    height: 32px;
    flex: 0 0 28px;
    background: transparent;
    color: #111827;
    border-radius: 0;
}

.usersite-product-tree-compact .usersite-location-collapse-toggle span::before {
    left: 9px;
    right: auto;
    top: 11px;
    width: 7px;
    height: 7px;
    background: transparent;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    border-radius: 0;
    transform: rotate(-45deg);
}

.usersite-product-tree-compact .usersite-location-collapse-toggle.is-open span::before {
    transform: rotate(45deg);
}

.usersite-product-tree-compact .usersite-location-collapse-toggle span::after {
    display: none;
}
