/* DOMASTER Modern Menu v2.1 Hover Safe.0
   Dedicated override loaded AFTER stylesheet.css.
   Desktop: clean two-level catalog with balanced columns.
   Mobile: slide-in accordion, no broken long labels.
*/

/* ---------- shared ---------- */
#menu,
#menu .container,
#menu .navbar-nav,
#menu .sidebar,
#menu .dropdown,
#menu .dropdown-menu {
    overflow: visible !important;
}

#menu .domaster-main-nav {
    align-items: stretch;
}

#menu .category-dropdown a,
#menu .category-dropdown a:hover,
#menu .category-dropdown a:focus,
#menu .category-dropdown a:active {
    outline: none !important;
    text-decoration: none !important;
}

/* ---------- desktop/tablet ---------- */
@media (min-width: 768px) {
    #menu .domaster-main-nav {
        display: flex;
        flex-wrap: nowrap;
        width: 100%;
    }

    #menu .li-category {
        position: relative;
        flex: 0 0 270px;
        width: 270px;
    }

    #menu .btn-category {
        box-sizing: border-box;
        width: 270px !important;
        height: 56px !important;
        padding: 0 48px 0 22px !important;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        border: 0 !important;
        border-radius: 0 !important;
        background: #d43703 !important;
        color: #fff !important;
        font-size: 18px !important;
        line-height: 1.2 !important;
        font-weight: 700 !important;
        box-shadow: none !important;
    }

    #menu .btn-category:before {
        right: 18px !important;
        top: 50% !important;
        transform: translateY(-50%);
    }

    #menu .category-dropdown {
        box-sizing: border-box;
        width: 270px !important;
        margin: 0 !important;
        padding: 8px !important;
        border: 1px solid #e5eaf0 !important;
        border-top: 0 !important;
        border-radius: 0 0 14px 14px !important;
        background: #fff !important;
        box-shadow: 0 16px 34px rgba(22, 34, 51, .12) !important;
    }

    #menu .category-dropdown > li {
        position: relative;
        margin: 0 0 2px;
        padding: 0;
        list-style: none;
    }

    #menu .category-dropdown > li > a,
    #menu .category-dropdown > li > a.menu-root-link {
        box-sizing: border-box;
        width: 100% !important;
        min-height: 48px !important;
        padding: 11px 38px 11px 14px !important;
        display: flex !important;
        align-items: center;
        border: 0 !important;
        border-radius: 10px !important;
        background: transparent !important;
        box-shadow: none !important;
        color: #172434 !important;
        font-size: 15px !important;
        line-height: 1.3 !important;
        font-weight: 650 !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
        transition: background .16s ease, color .16s ease, transform .16s ease;
    }

    #menu .category-dropdown > li > a:hover,
    #menu .category-dropdown > li > a:focus,
    #menu .category-dropdown > li:hover > a {
        background: #f4f7fa !important;
        color: #d43703 !important;
        box-shadow: none !important;
    }

    #menu .menu-link-label {
        display: block;
        min-width: 0;
        white-space: normal !important;
        overflow-wrap: break-word;
    }

    #menu .category-dropdown > li.dropdown-submenu > a:before {
        right: 13px !important;
        top: 50% !important;
        transform: translateY(-50%);
        color: #8190a3 !important;
        font-size: 15px !important;
    }


    /* Hover-safe bridge between level 1 and level 2.
       Prevents submenu from closing while the pointer moves to the right. */
    #menu .category-dropdown > li.dropdown-submenu::after {
        content: "";
        position: absolute;
        z-index: 9998;
        left: 100%;
        top: -8px;
        width: 18px;
        height: calc(100% + 16px);
        background: transparent;
        pointer-events: auto;
    }

    #menu .category-dropdown > li.dropdown-submenu > .dropdown-menu {
        z-index: 9999 !important;
    }

    /* second level: width follows number of generated <ul> columns */
    #menu .category-dropdown > li > .dropdown-menu {
        box-sizing: border-box;
        left: calc(100% - 2px) !important;
        top: -9px !important;
        width: max-content !important;
        min-width: 270px !important;
        max-width: min(720px, calc(100vw - 305px)) !important;
        margin: 0 !important;
        padding: 12px !important;
        border: 1px solid #e5eaf0 !important;
        border-radius: 16px !important;
        background: #fff !important;
        box-shadow: 0 18px 42px rgba(22, 34, 51, .14) !important;
    }

    #menu .category-dropdown .dropdown-inner {
        display: grid !important;
        grid-auto-flow: column;
        grid-auto-columns: minmax(205px, 235px);
        column-gap: 10px;
        width: max-content;
        max-width: 690px;
    }

    #menu .category-dropdown .dropdown-inner > ul,
    #menu .category-dropdown .dropdown-inner ul.list-unstyled {
        display: block !important;
        box-sizing: border-box;
        width: 225px !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #menu .category-dropdown .dropdown-inner li {
        margin: 0 0 2px;
        padding: 0;
        list-style: none;
    }

    #menu .category-dropdown .dropdown-inner a,
    #menu .category-dropdown .dropdown-menu li a,
    #menu .category-dropdown .menu-child-link {
        box-sizing: border-box;
        display: flex !important;
        align-items: center;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 40px !important;
        margin: 0 !important;
        padding: 8px 11px !important;
        border: 0 !important;
        border-radius: 9px !important;
        background: transparent !important;
        box-shadow: none !important;
        color: #172434 !important;
        font-size: 14px !important;
        line-height: 1.28 !important;
        font-weight: 600 !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
        transition: background .15s ease, color .15s ease;
    }

    /* hard reset of the old inset 3px hover frame */
    #menu .category-dropdown .dropdown-inner li a:hover,
    #menu .category-dropdown .dropdown-inner li a:focus,
    #menu .category-dropdown .dropdown-menu li a:hover,
    #menu .category-dropdown .dropdown-menu li a:focus {
        border: 0 !important;
        outline: 0 !important;
        background: #f4f7fa !important;
        color: #d43703 !important;
        box-shadow: none !important;
    }

    #menu .category-dropdown .menu-see-all,
    #menu .category-dropdown .see-all {
        box-sizing: border-box;
        display: block !important;
        width: 100% !important;
        margin: 8px 0 0 !important;
        padding: 10px 10px 2px !important;
        border: 0 !important;
        border-top: 1px solid #e9edf2 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        color: #58697c !important;
        font-size: 12px !important;
        line-height: 1.3 !important;
        font-weight: 700 !important;
        white-space: normal !important;
    }

    /* top navigation items: compact enough to keep the right edge from being cut */
    #menu .menu-static-item {
        position: relative;
        display: flex;
        align-items: stretch;
        flex: 0 1 auto;
        min-width: 0;
    }

    #menu .menu-static-item > .dropbtn,
    #menu .menu-static-item > a.dropbtn,
    #menu .menu-static-item > button.dropbtn {
        box-sizing: border-box;
        min-height: 56px !important;
        height: 56px !important;
        margin: 0 !important;
        padding: 0 16px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        color: #fff !important;
        box-shadow: none !important;
        font-size: 15px !important;
        line-height: 1.15 !important;
        font-weight: 650 !important;
        white-space: nowrap !important;
        text-decoration: none !important;
    }

    #menu .menu-static-item:hover > .dropbtn,
    #menu .menu-static-item > .dropbtn:hover,
    #menu .menu-static-item > .dropbtn:focus {
        background: rgba(255,255,255,.08) !important;
        color: #fff !important;
    }

    #menu .menu-static-item.has-dropdown > .dropdown-content {
        display: none;
        position: absolute !important;
        left: 0 !important;
        top: calc(100% + 1px) !important;
        min-width: 280px !important;
        padding: 9px !important;
        border: 1px solid #e5eaf0 !important;
        border-radius: 14px !important;
        background: #fff !important;
        box-shadow: 0 18px 42px rgba(22,34,51,.14) !important;
        z-index: 99999 !important;
    }

    #menu .menu-static-item.has-dropdown:hover > .dropdown-content {
        display: block !important;
    }

    #menu .menu-static-item.has-dropdown > .dropdown-content a {
        display: block !important;
        padding: 9px 11px !important;
        border-radius: 9px !important;
        color: #172434 !important;
        background: transparent !important;
        box-shadow: none !important;
        font-size: 14px !important;
        line-height: 1.3 !important;
        white-space: normal !important;
    }

    #menu .menu-static-item.has-dropdown > .dropdown-content a:hover {
        background: #f4f7fa !important;
        color: #d43703 !important;
    }
}

/* slightly tighter desktop between Bootstrap breakpoints */
@media (min-width: 768px) and (max-width: 1199px) {
    #menu .menu-static-item > .dropbtn,
    #menu .menu-static-item > a.dropbtn,
    #menu .menu-static-item > button.dropbtn {
        padding-left: 11px !important;
        padding-right: 11px !important;
        font-size: 14px !important;
    }
}

/* ---------- mobile ---------- */
@media (max-width: 767px) {
    body.open-sidebar:after {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 1000;
        background: rgba(20, 30, 44, .42);
    }

    #menu .sidebar {
        box-sizing: border-box;
        width: min(92vw, 390px) !important;
        left: 0 !important;
        top: 50px !important;
        bottom: 0 !important;
        margin-left: 0 !important;
        padding: 0 0 24px !important;
        background: #fff !important;
        box-shadow: 18px 0 44px rgba(18, 30, 45, .18) !important;
        transform: translateX(-105%);
        transition: transform .25s ease !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        z-index: 1002 !important;
    }

    body.open-sidebar #menu .sidebar {
        transform: translateX(0);
    }

    #menu .domaster-main-nav,
    #menu .navbar-nav,
    #menu .li-category,
    #menu .category-dropdown {
        box-sizing: border-box;
        display: block !important;
        width: 100% !important;
        float: none !important;
        margin: 0 !important;
    }

    #menu .category-dropdown {
        position: relative !important;
        padding: 10px 14px 4px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    #menu .category-dropdown > li,
    #menu .menu-static-item {
        box-sizing: border-box;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 0 8px !important;
        text-align: left !important;
    }

    /* reset the old blue mobile buttons */
    #menu .category-dropdown > li > a,
    #menu .category-dropdown > li > a.menu-root-link,
    #menu .menu-static-item > .dropbtn,
    #menu .menu-static-item > a.dropbtn,
    #menu .menu-static-item > button.dropbtn {
        box-sizing: border-box;
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        width: 100% !important;
        min-height: 52px !important;
        margin: 0 !important;
        padding: 12px 42px 12px 14px !important;
        border: 1px solid #e6ebf0 !important;
        border-radius: 12px !important;
        background: #f7f9fb !important;
        box-shadow: none !important;
        color: #172434 !important;
        font-size: 15px !important;
        line-height: 1.28 !important;
        font-weight: 650 !important;
        text-align: left !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }

    #menu .category-dropdown > li > a:hover,
    #menu .category-dropdown > li > a:focus,
    #menu .menu-static-item > .dropbtn:hover,
    #menu .menu-static-item > .dropbtn:focus {
        background: #eef3f7 !important;
        color: #d43703 !important;
    }

    #menu .category-dropdown > li.dropdown-submenu > a:before {
        right: 14px !important;
        top: 50% !important;
        transform: translateY(-50%);
        color: #77889b !important;
        transition: transform .18s ease;
    }

    #menu .category-dropdown > li.dropdown-submenu.open > a:before {
        transform: translateY(-50%) rotate(90deg) !important;
    }

    #menu .menu-static-item.has-dropdown > .menu-static-toggle:after {
        content: '\f105';
        font-family: FontAwesome;
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: #77889b;
        transition: transform .18s ease;
    }

    #menu .menu-static-item.has-dropdown.open > .menu-static-toggle:after {
        transform: translateY(-50%) rotate(90deg);
    }

    #menu .category-dropdown > li > .dropdown-menu,
    #menu .menu-static-item.has-dropdown > .dropdown-content {
        box-sizing: border-box;
        display: none;
        position: static !important;
        float: none !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 7px 0 0 !important;
        padding: 7px !important;
        border: 1px solid #e6ebf0 !important;
        border-radius: 12px !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    #menu .category-dropdown > li.open > .dropdown-menu,
    #menu .menu-static-item.has-dropdown.open > .dropdown-content {
        display: block;
    }

    #menu .category-dropdown .dropdown-inner,
    #menu .category-dropdown .dropdown-inner > ul,
    #menu .category-dropdown .dropdown-inner ul.list-unstyled {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #menu .category-dropdown .dropdown-inner a,
    #menu .category-dropdown .dropdown-menu li a,
    #menu .menu-static-item.has-dropdown > .dropdown-content a {
        box-sizing: border-box;
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 10px 11px !important;
        border: 0 !important;
        border-radius: 9px !important;
        background: transparent !important;
        box-shadow: none !important;
        color: #253448 !important;
        font-size: 14px !important;
        line-height: 1.3 !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
    }

    #menu .category-dropdown .dropdown-inner a:hover,
    #menu .category-dropdown .dropdown-inner a:focus,
    #menu .menu-static-item.has-dropdown > .dropdown-content a:hover {
        background: #f3f6f9 !important;
        color: #d43703 !important;
        box-shadow: none !important;
    }

    #menu .category-dropdown .menu-see-all,
    #menu .category-dropdown .see-all {
        margin: 5px 0 0 !important;
        padding: 10px !important;
        border-top: 1px solid #e9edf2 !important;
        color: #58697c !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        white-space: normal !important;
    }
}
