/**
 * FacetWP Category Navigation - Hierarchy Tree (Bubble/Pill Style)
 *
 * Unified bubble format matching FacetWP radio/checkbox pills:
 * - Dark transparent background pills
 * - Border: rgba(255,255,255,0.22)
 * - Hover: #9fe7ff
 * - Active: #6fe3ff
 * - Hierarchy via padding-left indentation + font-size + opacity
 */

/* ============================================================================
   Category Navigation Container
   ============================================================================ */

.lgdc-category-nav {
    margin-bottom: 28px;
}

/* Section title - matches FacetWP facet titles */
.lgdc-category-nav-title {
    display: block;
    margin: 0 0 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ============================================================================
   Tree Structure - Flex column with gaps (like radio buttons)
   ============================================================================ */

.lgdc-cat-tree {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.lgdc-cat-tree:last-child {
    margin-bottom: 0;
}

/* Subcategory indentation */
.lgdc-cat-subtree {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    padding: 8px 0 0 16px;
    margin: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 0;
}

.lgdc-cat-item.expanded > .lgdc-cat-subtree {
    max-height: 1200px;
    opacity: 1;
}

/* Level 2: further indent */
.lgdc-cat-subtree .lgdc-cat-subtree {
    padding-left: 16px;
}

/* ============================================================================
   Category Links - Unified Pill/Bubble Button
   ============================================================================ */

.lgdc-cat-item {
    position: relative;
}

/* All category links → pill shape */
.lgdc-category-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 0 16px;
    box-sizing: border-box;

    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    background-image: none !important;
    box-shadow: none !important;

    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Hover */
.lgdc-category-link:hover {
    border-color: #9fe7ff;
    background: rgba(159, 231, 255, 0.10);
    color: #9fe7ff;
}

/* Active / checked state */
.lgdc-category-link.active {
    border-color: #6fe3ff;
    background: rgba(111, 227, 255, 0.16);
    color: #6fe3ff;
}

/* Parent with active child - subtle highlight */
.lgdc-cat-item.active-parent > .lgdc-category-link {
    border-color: rgba(255, 255, 255, 0.30);
    color: #ffffff;
}

/* ============================================================================
   Level 1 Subcategories - Slightly smaller, same pill format
   ============================================================================ */

.lgdc-cat-subtree > .lgdc-cat-item > .lgdc-category-link {
    font-size: 13px;
    min-height: 44px;
    opacity: 0.92;
}

/* ============================================================================
   Level 2 Subcategories - Even smaller
   ============================================================================ */

.lgdc-cat-subtree .lgdc-cat-subtree > .lgdc-cat-item > .lgdc-category-link {
    font-size: 12px;
    min-height: 42px;
    opacity: 0.82;
}

/* ============================================================================
   Toggle Arrow (expand/collapse) - Right side of pill
   ============================================================================ */

.lgdc-category-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.50);
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
    z-index: 1;
}

.lgdc-category-toggle:hover {
    color: #9fe7ff;
}

/* Expand toggle position for pill items with has-children */
.lgdc-cat-item.has-children > .lgdc-category-link {
    padding-right: 36px;  /* Make room for toggle arrow */
}

/* Top-level items with children get bolder text */
.lgdc-cat-tree > .lgdc-cat-item.has-children > .lgdc-category-link {
    font-weight: 700;
}

/* ============================================================================
   Group Separators
   ============================================================================ */

.lgdc-category-group {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lgdc-category-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ============================================================================
   Responsive - Tablet
   ============================================================================ */

@media (max-width: 1024px) {
    .lgdc-category-link {
        min-height: 46px;
        padding: 0 14px;
        font-size: 13px;
    }

    .lgdc-cat-subtree > .lgdc-cat-item > .lgdc-category-link {
        min-height: 44px;
        font-size: 12px;
    }

    .lgdc-cat-subtree .lgdc-cat-subtree > .lgdc-cat-item > .lgdc-category-link {
        min-height: 42px;
        font-size: 12px;
    }
}

/* ============================================================================
   Responsive - Mobile
   ============================================================================ */

@media (max-width: 767px) {
    .lgdc-category-nav {
        margin-bottom: 20px;
    }

    .lgdc-category-nav-title {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .lgdc-cat-tree {
        gap: 8px;
    }

    .lgdc-category-link {
        min-height: 44px;
        padding: 0 10px;
        font-size: 13px;
    }

    .lgdc-cat-subtree {
        padding-left: 12px;
        gap: 8px;
    }

    .lgdc-cat-subtree .lgdc-cat-subtree {
        padding-left: 12px;
    }

    .lgdc-cat-subtree > .lgdc-cat-item > .lgdc-category-link {
        min-height: 42px;
        font-size: 12px;
    }

    .lgdc-cat-subtree .lgdc-cat-subtree > .lgdc-cat-item > .lgdc-category-link {
        min-height: 40px;
        font-size: 12px;
    }

    .lgdc-category-group {
        margin-bottom: 15px;
        padding-bottom: 15px;
    }
}
