/* TrustDeal: only synthetic language entries in Max Mega Menu.
   No CSS is changed for ordinary navigation, the cart, or the category menu.
   Support both raw and prefixed custom menu classes (MMM option).
   CSS is intentionally independent of the native submenu open/close JS. */
#mega-menu-wrap-max_mega_menu_1 .max-mega-menu .tdml-mega-label,
[id^="mega-menu-wrap-"] .max-mega-menu .tdml-mega-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    vertical-align: middle;
    max-width: 100%;
    font-family: inherit;
}
[id^="mega-menu-wrap-"] .max-mega-menu .tdml-mega-label img.tdml-mega-flag {
    display: inline-block;
    width: 23px;
    height: 17px;
    max-width: none;
    flex: none;
    object-fit: cover;
    border-radius: 3px;
    vertical-align: middle;
}

/* Integration items are hidden on desktop by Max Mega Menu itself.
   Style the synthetic LI only; never change standard mobile navigation. */
[id^="mega-menu-wrap-"] ul.max-mega-menu > li:is(.tdml-mega-parent,.mega-tdml-mega-parent) {
    position: relative;
    clear: both;
    box-sizing: border-box;
    margin: 12px 12px 14px !important;
    padding: 0 !important;
    border: 1px solid rgba(255,255,255,.22) !important;
    border-radius: 12px;
    background: #185422 !important;
    box-shadow: 0 8px 24px rgba(9,40,14,.16);
    overflow: hidden;
}
[id^="mega-menu-wrap-"] ul.max-mega-menu > li:is(.tdml-mega-parent,.mega-tdml-mega-parent) > a.mega-menu-link {
    position: relative;
    display: flex !important;
    box-sizing: border-box;
    align-items: center !important;
    gap: 10px;
    min-height: 52px !important;
    height: auto !important;
    padding: 11px 14px 11px 50px !important;
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-decoration: none !important;
    color: #fff !important;
    background: #185422 !important;
    border: 0 !important;
    outline-offset: -3px;
    white-space: normal;
    cursor: pointer;
}
[id^="mega-menu-wrap-"] ul.max-mega-menu > li:is(.tdml-mega-parent,.mega-tdml-mega-parent) > a.mega-menu-link:hover,
[id^="mega-menu-wrap-"] ul.max-mega-menu > li:is(.tdml-mega-parent,.mega-tdml-mega-parent) > a.mega-menu-link:focus-visible,
[id^="mega-menu-wrap-"] ul.max-mega-menu > li:is(.tdml-mega-parent,.mega-tdml-mega-parent).mega-toggle-on > a.mega-menu-link {
    color: #fff !important;
    background: #1f6630 !important;
}
[id^="mega-menu-wrap-"] ul.max-mega-menu > li:is(.tdml-mega-parent,.mega-tdml-mega-parent) > a.mega-menu-link .mega-indicator {
    margin-left: auto !important;
    flex: 0 0 auto;
    color: #e1f0d7 !important;
}

/* A native flyout submenu inherits desktop flyout colors unless overridden.
   This is the source of the unreadable grey-on-green options in the screenshot. */
[id^="mega-menu-wrap-"] ul.max-mega-menu > li:is(.tdml-mega-parent,.mega-tdml-mega-parent) > ul.mega-sub-menu {
    box-sizing: border-box;
    position: static;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100%;
    margin: 0 !important;
    padding: 6px !important;
    border: 0 !important;
    border-top: 1px solid #d9e7d2 !important;
    border-radius: 0 0 11px 11px !important;
    background: #f5f9f2 !important;
    box-shadow: none !important;
}
[id^="mega-menu-wrap-"] ul.max-mega-menu li:is(.tdml-mega-option,.mega-tdml-mega-option) {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
}
[id^="mega-menu-wrap-"] ul.max-mega-menu li:is(.tdml-mega-option,.mega-tdml-mega-option) > a.mega-menu-link {
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box;
    min-height: 46px !important;
    height: auto !important;
    width: 100%;
    padding: 9px 40px 9px 43px !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 7px;
    color: #24394b !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-decoration: none !important;
    white-space: normal;
    transition: background-color .16s ease, color .16s ease;
}
[id^="mega-menu-wrap-"] ul.max-mega-menu li:is(.tdml-mega-option,.mega-tdml-mega-option) > a.mega-menu-link:hover,
[id^="mega-menu-wrap-"] ul.max-mega-menu li:is(.tdml-mega-option,.mega-tdml-mega-option) > a.mega-menu-link:focus-visible {
    background: #e5f0df !important;
    color: #185a28 !important;
}
[id^="mega-menu-wrap-"] ul.max-mega-menu li:is(.tdml-mega-option,.mega-tdml-mega-option):is(.tdml-mega-active,.mega-tdml-mega-active,.mega-current-menu-item,.current-menu-item) > a.mega-menu-link {
    background: #e0f0db !important;
    color: #1c672b !important;
    font-weight: 700 !important;
}
[id^="mega-menu-wrap-"] ul.max-mega-menu li:is(.tdml-mega-option,.mega-tdml-mega-option):is(.tdml-mega-active,.mega-tdml-mega-active,.mega-current-menu-item,.current-menu-item)::after {
    content: '✓';
    position: absolute;
    right: 17px;
    top: 50%;
    transform: translateY(-50%);
    color: #28752e;
    font-size: 15px;
    font-weight: 700;
    pointer-events: none;
}

/* The native walker may not call nav_menu_item_title. Recover canonical
   auto-flag assets from the existing repository without a second JS renderer.
   Do not synthesize flags when they were explicitly disabled or use MEDIA. */
[id^="mega-menu-wrap-"] ul.max-mega-menu li[class*="tdml-mega-flag-"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 14px;
    width: 23px;
    height: 17px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0,0,0,.06);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 1;
    transform: translateY(-50%);
}
[id^="mega-menu-wrap-"] ul.max-mega-menu > li[class*="tdml-mega-parent"][class*="tdml-mega-flag-"]::before {
    top: 26px;
    left: 16px;
}
[id^="mega-menu-wrap-"] ul.max-mega-menu li[class*="tdml-mega-flag-pl"]::before { background-image: url('flags/pl.svg'); }
[id^="mega-menu-wrap-"] ul.max-mega-menu li[class*="tdml-mega-flag-cz"]::before { background-image: url('flags/cz.svg'); }
[id^="mega-menu-wrap-"] ul.max-mega-menu li[class*="tdml-mega-flag-sk"]::before { background-image: url('flags/sk.svg'); }
[id^="mega-menu-wrap-"] ul.max-mega-menu li[class*="tdml-mega-flag-ro"]::before { background-image: url('flags/ro.svg'); }
[id^="mega-menu-wrap-"] ul.max-mega-menu li[class*="tdml-mega-flag-gb"]::before { background-image: url('flags/gb.svg'); }
[id^="mega-menu-wrap-"] ul.max-mega-menu li[class*="tdml-mega-flag-de"]::before { background-image: url('flags/de.svg'); }
[id^="mega-menu-wrap-"] ul.max-mega-menu li[class*="tdml-mega-flag-fr"]::before { background-image: url('flags/fr.svg'); }
[id^="mega-menu-wrap-"] ul.max-mega-menu li[class*="tdml-mega-flag-ru"]::before { background-image: url('flags/ru.svg'); }
/* The walker may call itemTitle() and supply the actual IMG: never show two flags. */
[id^="mega-menu-wrap-"] ul.max-mega-menu li[class*="tdml-mega-flag-"]:has(img.tdml-mega-flag)::before { content: none; }
[id^="mega-menu-wrap-"] ul.max-mega-menu li[class*="tdml-mega-flag-"]:has(img.tdml-mega-flag) > a.mega-menu-link { padding-left: 15px !important; }

/* Respect users with reduced motion, without overriding the native accordion. */
@media (prefers-reduced-motion: reduce) {
    [id^="mega-menu-wrap-"] ul.max-mega-menu li:is(.tdml-mega-option,.mega-tdml-mega-option) > a.mega-menu-link { transition: none; }
}

/* RC.14.23: the dynamically created flyout does not consistently receive
   Max Mega Menu's native mobile click state. Its visual state is therefore
   controlled ONLY by the isolated TDML accordion. Never alter other menus. */
[id^="mega-menu-wrap-"] ul.max-mega-menu > li:is(.tdml-mega-parent,.mega-tdml-mega-parent) > ul.mega-sub-menu,
[id^="mega-menu-wrap-"] ul.max-mega-menu > li:is(.tdml-mega-parent,.mega-tdml-mega-parent) > ul.mega-sub-menu[hidden] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    max-height: 0 !important;
    pointer-events: none !important;
}
[id^="mega-menu-wrap-"] ul.max-mega-menu > li:is(.tdml-mega-parent,.mega-tdml-mega-parent).is-tdml-expanded > ul.mega-sub-menu:not([hidden]) {
    display: block !important;
    position: static !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    pointer-events: auto !important;
    transform: none !important;
}
/* A real, stable visual chevron inserted into the single clickable parent
   link. Avoid ::after: Max Mega Menu theme rules can replace pseudo content. */
[id^="mega-menu-wrap-"] ul.max-mega-menu > li:is(.tdml-mega-parent,.mega-tdml-mega-parent) > a.mega-menu-link .mega-indicator {
    display: none !important;
}
[id^="mega-menu-wrap-"] ul.max-mega-menu > li:is(.tdml-mega-parent,.mega-tdml-mega-parent) > a.mega-menu-link::after {
    content: none !important;
    display: none !important;
}
[id^="mega-menu-wrap-"] ul.max-mega-menu > li:is(.tdml-mega-parent,.mega-tdml-mega-parent) > a.mega-menu-link > .tdml-mega-chevron:not([hidden]) {
    display: inline-block !important;
    position: static !important;
    box-sizing: border-box !important;
    width: 9px !important;
    height: 9px !important;
    min-width: 9px !important;
    margin: -4px 2px 0 auto !important;
    padding: 0 !important;
    flex: 0 0 9px !important;
    border: 0 !important;
    border-right: 2px solid #e1f0d7 !important;
    border-bottom: 2px solid #e1f0d7 !important;
    border-radius: 0 !important;
    background: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: rotate(45deg) !important;
    transition: transform .16s ease !important;
    pointer-events: none !important;
}
[id^="mega-menu-wrap-"] ul.max-mega-menu > li:is(.tdml-mega-parent,.mega-tdml-mega-parent).is-tdml-expanded > a.mega-menu-link > .tdml-mega-chevron:not([hidden]) {
    margin-top: 4px !important;
    transform: rotate(225deg) !important;
}
[id^="mega-menu-wrap-"] ul.max-mega-menu > li:is(.tdml-mega-parent,.mega-tdml-mega-parent) > a.mega-menu-link:focus-visible {
    outline: 2px solid #d7f0c5 !important;
    outline-offset: -4px;
}

/* Explicitly opted-in Divi mobile header instance ONLY; never globally hide shortcodes. */
@media(max-width:767px){.tdml-language-switcher.tdml-hide-mobile-header-instance{display:none!important}}
[id^="mega-menu-wrap-"] li.tdml-mega-no-chevron > a > .tdml-mega-chevron{display:none!important}

/* Presentation switches also apply when Max Mega Menu bypasses nav_menu_item_title. */
[id^="mega-menu-wrap-"] .tdml-mega-no-flag::before,
[id^="mega-menu-wrap-"] .mega-tdml-mega-no-flag::before{display:none!important;content:none!important;background-image:none!important}

/* Max Mega Menu theme-specific walkers may ignore nav_menu_item_title. */
[id^="mega-menu-wrap-"] li:is(.tdml-mega-no-name,.mega-tdml-mega-no-name) > a.mega-menu-link{font-size:0!important}
[id^="mega-menu-wrap-"] li:is(.tdml-mega-no-name,.mega-tdml-mega-no-name) > a.mega-menu-link img.tdml-mega-flag{width:22px;height:16px}
