:root {
    /* Brand Colors */
    --bs-primary: #2b59a2;
    --bs-primary-rgb: 43, 89, 162;
    --bs-success: #198754;
    --bs-danger: #d9251d;
    --bs-dark: #1d1c14;
    --bs-dark-subtil: #686464;
    --bs-light: #f5f5f5;

    /* Link Colors */
    --bs-link-color: #2b59a2;
    --bs-link-hover-color: #1a3c71;
}

/* Wrapper for button + menu */
.brands-mega-wrapper {
    position: relative;
    width: 100%;

    background-color: var(--bs-dark-subtil) !important;
}

.brands-mega-wrapper-sm {
    position: relative;
    width: 100%;
    background-color: var(--bs-dark-subtil) !important;
}


/* The trigger button */
.find-your-car-btn {
    background: var(--bs-dark-subtil);
    /* width: 320px !important; */
    color: white;
    border: none;
    padding: 10px 16px;
    font-weight: bold;
    font-size: 16px;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.find-your-car-btn::before {
    content: "";
    font-size: 18px;
}

/* Main Menu (Level 0) */
.product-brand-tree.level-0 {
    display: none;
    /* Hidden by default - toggled by JS click */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    /* Matches button width */
    background: #fff;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* --- LOGIC HACKS --- */

/* 1. Permanent visibility on Front Page */
.home-visible .product-brand-tree.level-0 {
    display: block !important;
}

/* 2. Toggle visibility via JS Click Class */
.product-brand-tree.level-0.open-menu {
    display: block !important;
}

/* 3. Sub-level hover visibility via JS '.active' class */
.product-brand-tree li.active>ul {
    display: block !important;
}






/* Initially show on home page via the wrapper class */
.brands-mega-wrapper.home-visible .product-brand-tree.level-0 {
    display: block;
}

/* On other pages OR after the first click on home page, this controls it */
.product-brand-tree.level-0.open-menu {
    display: block !important;
}











/* --- List Items & Links --- */

.product-brand-tree li {
    position: relative;
    margin: 0;
    border-bottom: 1px solid var(--bs-dark);
}

.product-brand-tree a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: background 0.2s;
}

.product-brand-tree a:hover {
    background: #f0f0f0;
}



/* Arrows for items with children using Font Awesome */
.product-brand-tree .has-children>a::after {
    content: "\f054";
    /* Unicode for 'chevron-right' */
    font-family: "Font Awesome 6 Free";
    /* Ensure this matches your FA version */
    font-weight: 900;
    /* Required for Solid icons */
    font-size: 10px;
    /* Icons usually look better slightly smaller than text */
    color: #666;
    margin-left: auto;
    transition: transform 0.2s ease;
    /* Adds a nice effect on hover */
}

/* Optional: Rotate or shift the icon when the menu is active/hovered */
.product-brand-tree li.active>a::after {
    color: var(--bs-primary);
    transform: translateX(3px);
}

/* Sub-levels (Level 1 and 2) */
.product-brand-tree.level-1,
.product-brand-tree.level-2 {
    display: none;
    /* Hidden until parent LI is hovered (.active) */
    position: absolute;
    top: -1px;
    left: 100%;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Count styling */
.count {
    font-size: 0.85em;
    color: #888;
    margin-left: 6px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .product-brand-tree.level-0 {
        position: static;
        width: 100% !important;
    }

    .product-brand-tree.level-1,
    .product-brand-tree.level-2 {
        position: static;
        left: 0;
        border: none;
        box-shadow: none;
    }
}