/* Nixo Mega Menu — touch / focus support.
 *
 * The default reveal is hover-based via `group-hover/li:` (Tailwind v4
 * variant). On touch devices and for keyboard users, we need a JS-driven
 * fallback. The walker adds the class `nixo-megamenu-item` to the parent
 * <li> when the mega menu is enabled; Alpine toggles the
 * `nixo-megamenu-open` class to force-show the dropdown.
 */
.nixo-has-mega-menu.nixo-megamenu-open > .nixo-megamenu,
.nixo-has-mega-menu:focus-within > .nixo-megamenu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(3rem) !important;
    pointer-events: auto !important;
}

/* Make the mega menu itself a stacking context so the absolutely
 * positioned tab content (transforms, etc.) is contained. */
.nixo-megamenu {
    isolation: isolate;
}

/* Ensure the mega menu sits above adjacent nav items / dropdowns. */
.nixo-has-mega-menu {
    z-index: 60;
}

/* Chevron arrow for top-level mega-menu links. Rendered as a CSS-only
 * pseudo-element so it picks up the link's hover state automatically and
 * doesn't require any markup change in the walker. The arrow rotates
 * 180° when the parent <li> is hovered, the mega menu is open, or the
 * link is focused — matching the static design. */
.nixo-has-mega-menu > a::after,
.nixo-has-mega-menu > span > a::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 4px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") center / 14px 14px no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") center / 14px 14px no-repeat;
    transition: transform 300ms ease;
    flex-shrink: 0;
    opacity: 0.7;
}

.nixo-has-mega-menu:hover > a::after,
.nixo-has-mega-menu:hover > span > a::after,
.nixo-has-mega-menu:focus-within > a::after,
.nixo-has-mega-menu:focus-within > span > a::after,
.nixo-has-mega-menu.nixo-megamenu-open > a::after,
.nixo-has-mega-menu.nixo-megamenu-open > span > a::after {
    transform: rotate(180deg);
    opacity: 1;
}

