/* Каталог в шапке — две отдельные desktop-панели */
.header .header__menu .menu-item--catalog {
    position: relative;
}

.header .header__menu .menu-item--catalog > a {
    display: flex;
    align-items: center;
    gap: 5px;
}

.header .header__menu .menu-item--catalog.is-open > a,
.header .header__menu .menu-item--catalog:hover > a {
    color: #8200db;
}

.header .header__menu .menu-item--catalog > a::after {
    content: "";
    display: block;
    width: 1rem;
    height: 1rem;
    background: url("/wp-content/themes/brilliantal/assets/images/chev.png") no-repeat;
    background-size: contain;
    filter: brightness(0);
    transition: transform 0.2s ease;
}

.header .header__menu .menu-item--catalog.is-open > a::after,
.header .header__menu .menu-item--catalog:hover > a::after {
    transform: rotate(180deg);
}

.header .header__menu .menu-item--catalog .lv-catalog-menu__panel {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 200;
    padding-top: 10px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
}

.header .header__menu .menu-item--catalog.is-open .lv-catalog-menu__panel,
.header .header__menu .menu-item--catalog:hover .lv-catalog-menu__panel,
.header .header__menu .menu-item--catalog .lv-catalog-menu__panel:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.header .header__menu .menu-item--catalog .lv-catalog-menu__panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
}

.header .header__menu .menu-item--catalog .lv-catalog-menu__columns {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
    gap: 4px;
    width: max-content;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.header .header__menu .menu-item--catalog .lv-catalog-menu__sections {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 5.5rem;
    flex: 0 0 auto;
    margin: 0;
    padding: 8px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.header .header__menu .menu-item--catalog .lv-catalog-menu__section {
    display: block;
    padding: 4px 8px;
    border-radius: 8px;
    color: #111827;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.header .header__menu .menu-item--catalog .lv-catalog-menu__section:hover,
.header .header__menu .menu-item--catalog .lv-catalog-menu__section.is-active {
    color: #c084fc;
}

.header .header__menu .menu-item--catalog .lv-catalog-menu__flyouts {
    position: relative;
    min-width: 15rem;
    max-width: 22rem;
    flex: 1 1 auto;
    padding: 8px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    display: none;
}

.header .header__menu .menu-item--catalog.has-flyout .lv-catalog-menu__flyouts {
    display: block;
}

@media (min-width: 1025px) {
    .header .header__menu .menu-item--catalog .lv-catalog-menu__columns:has(
        .lv-catalog-menu__section[data-lv-catalog-section="models"]:hover
    ) .lv-catalog-menu__flyouts,
    .header .header__menu .menu-item--catalog .lv-catalog-menu__columns:has(
        .lv-catalog-menu__section[data-lv-catalog-section="tasks"]:hover
    ) .lv-catalog-menu__flyouts,
    .header .header__menu .menu-item--catalog .lv-catalog-menu__columns:has(
        .lv-catalog-menu__flyouts:hover
    ) .lv-catalog-menu__flyouts {
        display: block;
    }

    .header .header__menu .menu-item--catalog .lv-catalog-menu__columns:has(
        .lv-catalog-menu__section[data-lv-catalog-section="models"]:hover
    ) .lv-catalog-menu__list[data-lv-catalog-flyout="models"],
    .header .header__menu .menu-item--catalog .lv-catalog-menu__columns:has(
        .lv-catalog-menu__section[data-lv-catalog-section="tasks"]:hover
    ) .lv-catalog-menu__list[data-lv-catalog-flyout="tasks"],
    .header .header__menu .menu-item--catalog.has-flyout .lv-catalog-menu__list.is-active {
        display: block;
    }
}

.header .header__menu .menu-item--catalog .lv-catalog-menu__list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    display: none;
}

.header .header__menu .menu-item--catalog .lv-catalog-menu__list.is-active {
    display: block;
}

.header .header__menu .menu-item--catalog .lv-catalog-menu__list > .menu-item {
    margin: 0;
    padding-block: 2px;
}

.header .header__menu .menu-item--catalog .lv-catalog-menu__list > .menu-item:first-of-type {
    padding-top: 0;
}

.header .header__menu .menu-item--catalog .lv-catalog-menu__list > .menu-item > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px;
    border-radius: 8px;
    color: #111827;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.header .header__menu .menu-item--catalog .lv-catalog-menu__list > .menu-item > a:hover {
    color: #c084fc;
}

.header .header__menu .menu-item--catalog .lv-catalog-menu__list > .menu-item > a:hover > span:not(.menu-item-icon) {
    color: #c084fc;
}

.header .header__menu .menu-item--catalog .lv-catalog-menu__list .menu-item-icon svg,
.header .header__menu .menu-item--catalog .lv-catalog-menu__list .menu-item-icon svg path {
    stroke: #000;
}

.header .header__menu .menu-item--catalog .lv-catalog-menu__list > .menu-item > a:hover .menu-item-icon svg,
.header .header__menu .menu-item--catalog .lv-catalog-menu__list > .menu-item > a:hover .menu-item-icon svg path {
    stroke: #c084fc;
}

.lv-catalog-menu__mobile-groups {
    display: none;
}

@media (max-width: 1024px) {
    .header__mobile .header__menu .menu-item--catalog {
        position: relative;
    }

    .header__mobile .header__menu .menu-item--catalog > a::after {
        width: 0.55rem;
        height: 0.55rem;
        margin-left: 0.75rem;
        border-right: 2px solid #6b7280;
        border-bottom: 2px solid #6b7280;
        background: none;
        filter: none;
        transform: rotate(45deg);
    }

    .header__mobile .header__menu .menu-item--catalog.is-open > a::after {
        transform: rotate(-135deg);
    }

    .header__mobile .header__menu .menu-item--catalog .lv-catalog-menu__panel {
        position: static;
        display: none;
        width: 100%;
        margin: 0 0 0.5rem;
        padding-left: 0.75rem;
        border-left: 2px solid rgba(128, 128, 128, 0.16);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        transition: none;
    }

    .header__mobile .header__menu .menu-item--catalog.is-open .lv-catalog-menu__panel {
        display: block;
    }

    .header__mobile .header__menu .menu-item--catalog .lv-catalog-menu__panel::before {
        content: none;
    }

    .header__mobile .header__menu .menu-item--catalog .lv-catalog-menu__columns {
        display: none !important;
    }

    .header__mobile .header__menu .menu-item--catalog .lv-catalog-menu__mobile-groups {
        display: block;
        width: 100%;
    }

    .header__mobile .header__menu .menu-item--catalog .lv-catalog-menu__mobile-group {
        width: 100%;
        border-bottom: 1px solid rgba(128, 128, 128, 0.12);
    }

    .header__mobile .header__menu .menu-item--catalog .lv-catalog-menu__mobile-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0.7rem 0;
        color: #374151;
        font-family: inherit;
        font-size: 1rem;
        font-weight: 600;
        text-align: left;
        background: transparent;
        cursor: pointer;
    }

    .header__mobile .header__menu .menu-item--catalog .lv-catalog-menu__mobile-trigger::after {
        content: "";
        width: 0.5rem;
        height: 0.5rem;
        margin-right: 0.25rem;
        border-right: 2px solid #6b7280;
        border-bottom: 2px solid #6b7280;
        transform: rotate(45deg);
        transition: transform 0.2s ease;
    }

    .header__mobile .header__menu .menu-item--catalog .lv-catalog-menu__mobile-group.is-open > .lv-catalog-menu__mobile-trigger {
        color: #6b21a8;
    }

    .header__mobile .header__menu .menu-item--catalog .lv-catalog-menu__mobile-group.is-open > .lv-catalog-menu__mobile-trigger::after {
        transform: rotate(-135deg);
    }

    .header__mobile .header__menu .menu-item--catalog .lv-catalog-menu__list {
        width: 100% !important;
    }

    .header__mobile .header__menu .menu-item--catalog .lv-catalog-menu__mobile-list {
        display: none;
        padding: 0 0 0.5rem 0.75rem;
    }

    .header__mobile .header__menu .menu-item--catalog .lv-catalog-menu__mobile-group.is-open > .lv-catalog-menu__mobile-list {
        display: block;
    }

    .header__mobile .header__menu .menu-item--catalog .lv-catalog-menu__list > .menu-item {
        padding: 0;
        border: 0;
    }

    .header__mobile .header__menu .menu-item--catalog .lv-catalog-menu__list > .menu-item > a {
        padding: 0.55rem 0;
        font-size: 0.95rem;
        font-weight: 500;
        color: #374151 !important;
    }
}
