/*
 * Tuoteryhmävalikon itsenäiset tyylit.
 * Värit perivät uuden sivupohjan muuttujat ja toimivat myös ilman niitä.
 */

.products-menu {
    display: flex;
    position: relative;
}

.products-menu__toggle {
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 24px;
    border: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-transform: uppercase;
}

.products-menu__toggle span {
    margin-left: 7px;
    color: var(--cyan, #39b7d4);
    transition: transform .2s ease;
}

.products-menu__toggle[aria-expanded="true"] span {
    transform: rotate(180deg);
}

.mega-menu {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    position: fixed;
    z-index: 30000;
    top: var(--kt-mega-menu-top, 178px);
    left: 50%;
    width: min(1500px, calc(100% - 40px));
    max-height: min(590px, calc(100vh - 200px));
    padding: 22px;
    overflow: auto;
    color: var(--ink, #142031);
    background: #fff;
    border: 1px solid var(--line, #d9e2eb);
    border-top: 3px solid var(--blue, #1769d2);
    box-shadow: 0 20px 42px rgba(4, 20, 35, .24);
    transform: translate(-50%, -8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .2s ease, opacity .2s ease, visibility .2s ease;
}

.mega-menu.is-open {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mega-menu section {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mega-menu a {
    padding: 5px 0;
    color: var(--muted, #647386);
    background: transparent;
    font-size: .78rem;
    font-weight: 500;
    line-height: 1.35;
    text-transform: none;
}

.mega-menu a:hover {
    color: var(--blue, #1769d2);
}

.mega-menu .mega-menu__heading {
    min-height: 42px;
    margin-bottom: 5px;
    padding: 0 0 8px;
    color: var(--ink, #142031);
    border-bottom: 1px solid var(--line, #d9e2eb);
    font-size: .98rem;
    font-weight: 700;
    line-height: 1.15;
}

.mega-menu .mega-menu__more {
    margin-top: 3px;
    color: var(--blue, #1769d2);
    font-size: .7rem;
    font-weight: 700;
}

.mega-menu__other {
    display: grid !important;
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line, #d9e2eb);
}

.mega-menu__other .mega-menu__heading {
    grid-column: 1 / -1;
    min-height: 0;
    border: 0;
}

.category-list {
    display: grid;
}

.category-tree__item {
    border-bottom: 1px solid #e7edf2;
}

.category-tree__main {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
}

.category-tree__main > a {
    display: flex;
    align-items: center;
    min-height: 45px;
    padding: 7px 8px 7px 19px;
    color: var(--ink, #142031);
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.28;
}

.category-tree__main > a:hover {
    color: var(--blue, #1769d2);
    background: #f4f8fc;
}

.category-tree__toggle {
    width: 42px;
    border: 0;
    border-left: 1px solid #e7edf2;
    color: #718394;
    background: transparent;
    cursor: pointer;
    font-size: 1.05rem;
}

.category-tree__toggle:hover,
.category-tree__toggle[aria-expanded="true"] {
    color: var(--blue, #1769d2);
    background: #edf5fc;
}

.category-tree__children {
    display: none;
    padding: 5px 0 8px;
    background: #f5f8fb;
    border-top: 1px solid #e5ecf2;
}

.category-tree__item.is-open .category-tree__children {
    display: grid;
}

.category-tree__children a {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: 33px;
    gap: 8px;
    padding: 5px 13px 5px 25px;
    color: #56687a;
    font-size: .72rem;
    line-height: 1.25;
}

.category-tree__children a:hover {
    color: var(--blue, #1769d2);
    background: #eaf2f9;
}

.category-tree__children small {
    min-width: 24px;
    padding: 2px 5px;
    color: #778a9c;
    background: #e1e9f0;
    border-radius: 10px;
    text-align: center;
    font-size: .6rem;
}

.category-tree__all {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: 47px;
    padding: 0 17px 0 19px;
    color: var(--blue, #1769d2);
    font-size: .82rem;
    font-weight: 700;
}

@media (max-width: 1120px) {
    .mega-menu {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mega-menu__other {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 800px) {
    .products-menu {
        display: block;
    }

    .products-menu__toggle {
        justify-content: space-between;
        width: 100%;
        min-height: 42px;
        padding: 0 10px;
    }

    .mega-menu {
        display: none;
        position: static;
        width: 100%;
        max-height: none;
        grid-template-columns: 1fr;
        padding: 12px 14px;
        color: #fff;
        background: #0d2338;
        border: 0;
        border-left: 2px solid var(--blue, #1769d2);
        box-shadow: none;
        transform: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: none;
    }

    .mega-menu.is-open {
        display: grid;
        transform: none;
    }

    .mega-menu a {
        color: #bacbd8;
    }

    .mega-menu .mega-menu__heading {
        min-height: 0;
        color: #fff;
        border-color: #294157;
    }

    .mega-menu__other {
        grid-column: auto;
        grid-template-columns: 1fr;
        border-color: #294157;
    }
}

