/*
 * pl-nav-menu-brands: brands panel next to a category's subcategories in the desktop dropdown.
 * Sizes come from the widget's style controls as CSS variables (the fallbacks are the defaults).
 */
.elementor-nav--main .sub-menu.pl-has-brands {
    /* SmartMenus writes min-width / max-width inline on every submenu */
    width: calc(var(--pl-menu-list-width, 292px) + var(--pl-brands-width, 270px)) !important;
    max-width: none !important;
    /* never shorter than the (absolutely positioned) panel: rows of logos + gaps + padding */
    min-height: calc(var(--pl-brands-rows, 1) * var(--pl-brands-logo-h, 36px)
        + (var(--pl-brands-rows, 1) - 1) * var(--pl-brands-gap, 22px) + 2 * var(--pl-brands-pad-v, 24px));
    padding-inline-end: var(--pl-brands-width, 270px);
    box-sizing: border-box;
}

.elementor-nav--main .pl-has-brands > .pl-menu-brands {
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-end: 0;
    display: flex;
    align-items: center;
    width: var(--pl-brands-width, 270px);
    padding: var(--pl-brands-pad-v, 24px) var(--pl-brands-pad-h, 30px);
    border-inline-start: 1px solid var(--pl-brands-divider, #E2E8F0);
    box-sizing: border-box;
}

/* the dropdown's item divider (li:not(:last-child)) must not draw under the panel or the last subcategory */
.pl-has-brands > .pl-menu-brands,
.pl-has-brands > li:nth-last-child(2) {
    border-bottom-width: 0 !important;
}

.pl-menu-brands__grid {
    display: grid;
    grid-template-columns: repeat(var(--pl-brands-cols, 2), minmax(0, 1fr));
    gap: var(--pl-brands-gap, 22px);
    align-items: center;
    width: 100%;
}

/* reset the dropdown link styles (padding, hover background) the menu applies to every link */
.elementor-nav--dropdown a.pl-menu-brands__item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--pl-brands-logo-h, 36px);
    padding: 0 !important;
    background: none !important;
    border: 0;
}

.pl-menu-brands__logo {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: var(--pl-brands-logo-h, 36px);
    object-fit: contain;
    transition: opacity 0.2s;
}

.pl-menu-brands__item:hover .pl-menu-brands__logo {
    opacity: 0.7;
}

.pl-menu-brands__name {
    font-weight: 700;
    text-align: center;
}

/* the collapsed (burger) menu keeps only the subcategories */
.elementor-nav__container.elementor-nav--dropdown .pl-menu-brands {
    display: none;
}
