.topmenu-links {
   float: right;
   margin-top: 14px;
}

.topmenu-links ul {
    padding-left: 0;
    margin-top: auto;
    margin-bottom: auto;
    list-style-type: none;
}

.topmenu-links li {
    display: inline-block;
    margin: 3px;
}

.topmenu-links a {
    padding-left: 10px;
    padding-right: 11px;
    color: var(--mc-topmenu-link-color, #303030) !important;
}

.topmenu-links a:hover {
    color: var(--mc-topmenu-link-hover-color, #00468e) !important;
    text-decoration: none;
    border-bottom: 2px solid var(--mc-topmenu-link-hover-color, #00468e);
}

.topmenu-links a:not(:last-child) {
    border-right: 1px solid #dad9d6;
}

.navbar #arrow {
    margin-left: 5px;
    align-content: center;
    display: inline-block;
    border-right: 0.2em solid var(--mc-topmenu-nav-color, #252525);
    border-top: 0.2em solid var(--mc-topmenu-nav-color, #252525);
}

.navbar-arrow-down {
    position: relative;
    top: -5px;
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    transform: rotate(135deg);
    margin-right: 0.5em;
    margin-left: 1em;
    transition: all 0.5s ease;
}

.rotate180 {
    transform: rotate(315deg);
}

.topmenu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 900;
}

.topmenu-overlay.is-active {
    opacity: 1;
}

.topmenu-cats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, max-content));
    justify-items: start;
    justify-content: center;
    gap: 8px 24px;
    padding: 10px 24px;
    box-sizing: border-box;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.topmenu-cat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0;
    align-items: flex-start;
    pointer-events: none;
}

.navigation-custom .topmenu-cats .topmenu-cat-link {
    font-weight: 600;
    text-decoration: none;
    color: inherit;
    display: inline-block !important;
    width: auto !important;
    padding: 0 !important;
    pointer-events: auto;
    white-space: normal;
    word-break: break-word;
}

.topmenu-sublist {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    pointer-events: none;
}

.navigation-custom .topmenu-cats .topmenu-sub-link {
    text-decoration: none;
    color: #666666 !important;
    font-weight: 400;
    display: inline-block !important;
    width: auto !important;
    padding: 0 !important;
    pointer-events: auto;
    white-space: normal;
    word-break: break-word;
}

.navigation-custom .topmenu-cats .topmenu-cat-link:hover,
.navigation-custom .topmenu-cats .topmenu-sub-link:hover {
    opacity: 0.7;
}

@media only screen and (max-width: 1600px) {
    .topmenu-cats {
        grid-template-columns: repeat(auto-fit, minmax(180px, max-content));
    }
}

@media only screen and (max-width: 1200px) {
    .navigation-custom .dropdown-content {
        position: fixed;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        transform: none !important;
    }

    .topmenu-cats {
        width: 100%;
        max-width: none;
    }
}

@media only screen and (max-width: 1024px) {
    .navigation-custom .row a {
        width: calc(100% * (1 / 4) - 10px - 1px);
    }

    .navigation-custom .dropdown-content {
        width: 100%;
    }

    .topmenu-links {
        width: 100%;
        margin: auto;
        text-align: center;
        margin-bottom: 10px;
    }
}

@media only screen and (min-width: 768px) and (max-width: 1024px) {
    .navigation-custom .dropdown-content {
        width: 100% !important;
    }
}

@media only screen and (max-width: 900px) {
    .topmenu-cats {
        grid-template-columns: repeat(auto-fit, minmax(160px, max-content));
        gap: 8px 20px;
    }
}

@media only screen and (max-width: 767px) {
    .nav-sections,
    .navigation-custom {
        background: #252525;
        z-index: 100;
    }

    .navigation-custom {
        display: none;
    }
}

@media only screen and (min-width: 768px) {
    .nav-sections,
    .navigation-custom {
        background-color: var(--mc-topmenu-nav-background, #ffffff);
    }

    .navigation-custom {
        margin-bottom: 30px;
    }

    .navigation-custom .dropdown-content {
        border-color: var(--mc-topmenu-nav-background, #ffffff);
        background-color: #ffffff;
    }

    .navigation-custom .dropdown-content,
    .navigation-custom .dropdown-content a {
        color: #333333 !important;
    }

    .navigation-custom .navbar > a,
    .navigation-custom .navbar .dropdown > a {
        color: var(--mc-topmenu-nav-color, #252525) !important;
    }

    .nav-sections {
        display: none !important;
    }

    .navbar {
        display: flex;
        justify-content: center;
        gap: 8px;
        align-items: center;
    }

    .navbar > a,
    .navigation-custom .dropdown {
        padding: 10px;
    }

    .navigation-custom .row {
        width: 100%;
        padding: 10px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .navigation-custom .row a {
        margin: 10px 0 0 2%;
        padding: 6px;
        width: calc(100% * (1 / 5) - 10px - 1px);
        color: rgb(96, 96, 96);
        font-size: 14px;
        border-bottom: 1px solid #ebeded;
    }

    .navigation-custom .row a:hover {
        box-shadow: 0 8px 10px 0 rgba(0, 0, 0, 0.2);
        text-decoration: none;
    }

    .navigation-custom .dropdown:hover .dropdown-content {
        opacity: 1;
        height: auto;
        pointer-events: auto;
    }

    .navigation-custom .dropdown-content {
        transition: opacity 0.3s ease-out;
        opacity: 0;
        height: 0;
        overflow-x: visible;
        overflow-y: hidden;
        position: absolute;
        width: min(90vw, 1400px);
        min-width: 900px;
        left: 50%;
        right: 50%;
        margin-top: 10px;
        transform: translateX(-50%);
        pointer-events: none;
        z-index: 1000;
        border: 2px solid #e9eef2;
        border-top: 0;
    }
}
