.mega-menu {
    position: relative;
    width: 100%;
}

.mega-menu__list {
    display: flex;
    flex-wrap: nowrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-menu__item {
    position: relative;
}

.mega-menu__item--depth-0 {
    padding: 0 1rem;
}

.mega-menu__link {
    display: flex;
    align-items: start;
    padding: 1rem 0.5rem;
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.mega-menu__icon {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

.mega-menu__text {
    display: flex;
    flex-direction: column;
}

.mega-menu__subtitle {
    font-size: 0.8em;
    opacity: 0.7;
    margin-top: 0.2rem;
}

/* Submenu styling */
.mega-menu__submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #E4E7EC;
    border-radius: 0.75rem;
    z-index: 100;
    list-style:none;
    padding: 0rem;
}
@media(min-width: 1024px) {
    .mega-menu__submenu {
        min-width: 336px;
    }
}

/* Column layouts for submenus */
.mega-menu__submenu--columns-1 {
    grid-template-columns: 1fr;
}

.mega-menu__submenu--columns-2 {
    grid-template-columns: repeat(2, 1fr);
    min-width: 668px;
}

.mega-menu__submenu--columns-3 {
    grid-template-columns: repeat(3, 1fr);
    min-width: 1008px;
}

/* Base toggle styles - hidden by default */
.mega-menu__toggle {
    display: none;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.mega-menu__toggle svg {
    width: 12px;
    height: 8px;
    display: block;
}

.mega-menu__toggle.is-active {
    transform: rotate(180deg);
}

/* Mobile styles */
@media (max-width: 1023px) {
    .mega-menu__list {
        flex-direction: column;
    }

    .mega-menu__item--depth-0 {
        padding: 0;
    }

    .mega-menu__submenu {
        position: static;
        padding: 1rem;
        display: none;
    }

    .mega-menu__submenu.is-active {
        display: block;
    }

    /* Override column layouts on mobile */
    .mega-menu__submenu,
    .mega-menu__submenu--columns-1,
    .mega-menu__submenu--columns-2,
    .mega-menu__submenu--columns-3 {
        min-width: 100%;
    }

    .mega-menu__link {
        flex: 1;
        padding: 0.75rem 0 0.75rem 1rem;
    }

    .mega-menu__item--has-children {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    .mega-menu__item--has-children > .mega-menu__link {
        padding-right: 0;
    }

    /* Show toggle ONLY on mobile */
    .mega-menu__item--has-children > .mega-menu__toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.75rem 1rem;
        background: none;

        svg path[stroke] {
            stroke:#667085;
        }
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    .mega-menu__toggle {
        display: none !important; /* Force hide on desktop */
    }
}

/* Active states */
.mega-menu__item--active > .mega-menu__link {
    font-weight: bold;
}

/* Hover effects (desktop only) */
@media (min-width: 1024px) {
    .mega-menu__item--depth-0:hover > .mega-menu__submenu {
        display: grid;
    }
}
