/*
Plugin Style: Professional Category Widget (Minimal & Hierarchical)
*/

:root {
    --pcw-accent: #3b82f6;       /* رنگ اصلی */
    --pcw-text: #444;            /* رنگ متن */
    --pcw-border: #eee;          /* رنگ خطوط */
    --pcw-hover-bg: #fffbf5;     /* رنگ پس زمینه هاور بسیار ملایم */
    --pcw-badge-bg: #f3f3f3;     /* رنگ بج */
    --pcw-badge-text: #777;
}

/* 1. Reset & Container */
.pcw-nav-container ul.pcw-list,
.pcw-nav-container ul.children {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 2. List Item Structure */
.pcw-nav-container li.pcw-item {
    margin: 0;
    padding: 0;
    position: relative;
}

/* 3. The Row Wrapper (Flexbox is applied HERE, not on LI) */
.pcw-nav-container .pcw-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0; /* فاصله مینیمال عمودی */
    border-bottom: 1px solid var(--pcw-border);
    transition: all 0.2s ease;
}

/* Remove border for the very last item in the main list */
.pcw-nav-container > ul.pcw-list > li:last-child > .pcw-row {
    border-bottom: none;
}

/* 4. Link Styles */
.pcw-nav-container a.pcw-link {
    text-decoration: none !important;
    color: var(--pcw-text);
    font-size: 13px; /* فونت مینیمال */
    font-weight: 500;
    flex-grow: 1;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    line-height: 1.4;
}

/* 5. Badge Styles (Minimal Pill) */
.pcw-nav-container .pcw-badge {
    background: var(--pcw-badge-bg);
    color: var(--pcw-badge-text);
    font-size: 11px;
    font-weight: 400; /* وزن فونت سبک */
    padding: 1px 8px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    margin-inline-start: 8px;
    transition: all 0.2s;
    height: 18px;
    line-height: 18px;
    display: inline-block;
}

/* 6. Hover Effects */
.pcw-nav-container .pcw-row:hover {
    background-color: transparent; /* تغییر رنگ پس زمینه کل ردیف (اختیاری) */
}

.pcw-nav-container .pcw-row:hover a.pcw-link {
    color: var(--pcw-accent);
    padding-inline-start: 3px; /* حرکت بسیار ریز */
}

.pcw-nav-container .pcw-row:hover .pcw-badge {
    background: var(--pcw-accent);
    color: #fff;
}

/* 7. HIERARCHY & NESTING (Tree View Logic) */

/* استایل کلی لیست فرزندان */
.pcw-nav-container ul.children {
    /* فاصله از سمت راست برای ایجاد پله */
    margin-right: 18px !important; 
    
    /* خط راهنمای عمودی (Tree Line) */
    border-right: 1px solid var(--pcw-border);
    
    /* کمی فاصله برای جدا شدن از خط */
    padding-right: 12px !important;
}

/* استایل فرزندان */
.pcw-nav-container ul.children .pcw-row {
    padding: 5px 0; /* فرزندان کمی فشرده تر */
    border-bottom: 1px dashed #f5f5f5; /* خط جداکننده فرزندان کمرنگ تر */
}

.pcw-nav-container ul.children .pcw-row:last-child {
    border-bottom: none;
}

/* فونت فرزندان کمی کوچک تر و خاکستری تر */
.pcw-nav-container ul.children a.pcw-link {
    font-size: 12.5px;
    color: #666;
}

/* مدیریت عمق های بیشتر (سطح 3 و 4 و ...) */
/* این کد به صورت خودکار برای عمق های بیشتر اعمال میشود چون ul.children تکرار میشود */
/* نیازی به نوشتن کلاس جداگانه برای نوه و نتیجه نیست */