/* ============================================
   Megamenu mobile – slide navigation (< 768px)
   ============================================ */

@media (max-width: 767px) {
    /* no scroll on html/body when menu open at any level */
    html:has(.mm_menus_ul.active),
    html:has(.mm_columns_ul.active),
    html:has(.mm_columns_contents_ul.active),
    html:has(.mm_columns_contents_ul .ets_mm_categories.active) {
        overflow: hidden !important;
        height: 100% !important;
    }
    body.noscroll,
    html:has(.mm_menus_ul.active) body,
    html:has(.mm_columns_ul.active) body,
    html:has(.mm_columns_contents_ul.active) body {
        overflow: hidden !important;
        height: 100% !important;
        overscroll-behavior: none !important;
    }

    /* mm_menus_ul.active – full viewport when main overlay open */
    .mm_menus_ul.active {
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        height: 100dvh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain !important;
    }

    /* ets_mm_megamenu – no overflow from parent when submenu open */
    .ets_mm_megamenu:has(.mm_menus_ul.active),
    .ets_mm_megamenu:has(.mm_columns_ul.active),
    .ets_mm_megamenu:has(.mm_columns_contents_ul.active) {
        overflow: visible !important;
    }

    /* wszystkie poziomy – 100dvh, scroll tylko wewnątrz panela */
    .mm_menus_li.mm_has_sub:not(.producenci_menu) ul {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100dvw !important;
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
        z-index: 10001 !important;
        background: white !important;
        transition: transform 0.5s ease !important;
        overflow: visible !important;
        -webkit-overflow-scrolling: touch;
        transform: translateX(0%) !important;
        overscroll-behavior: contain !important;
    }
    .mm_menus_li.mm_has_sub  > ul{
        background: transparent !important;
   
    }
    .ets_mm_megamenu .ets_mm_megamenu_content .ets_mm_megamenu_content_content *{
        visibility: visible!important;
    }

    .mm_menus_li.mm_has_sub > ul.mm-slide-open {
        transform: translateX(0%) !important;
    }
    li a:not(:has(.mm_menu_content_title)){
        border-bottom: 1px solid #e5e5e5!important;
    }

    .mm_menus_ul.active ul{
        transform: translateX(0%)!important;
    }
  
    .mm_menus_ul.active ul.active{
        overflow: visible!important;
        transform: translateX(-100%)!important;
    }
    .mm_menus_ul .mm_menus_li.mm_has_sub:not(.producenci_menu) > .mm_columns_ul{
        transform: translateX(-100%)!important;
    }
    .mm_menus_ul.active > .mm_menus_li > .mm_columns_ul{
        transform: translateX(-100%)!important;
    }
      .mm_menus_ul.active > .mm_menus_li > .mm_columns_ul .mm_blocks_ul{
        transform: translateX(0%)!important;
    }
    .mm_menus_ul.active > .mm_columns_li.mm_has_sub > ul{
        transform: translateX(0%)!important;  
    }
    .mm_columns_ul.active > .mm_columns_li.mm_has_sub > ul >ul{
        transform: translateX(0%)!important;
       
    }
    .mm_columns_ul.active > .mm_columns_li.mm_has_sub > ul > .mm_blocks_li .mm_block_type_category >.ets_mm_block_content > ul.ets_mm_categories{
        transform: translateX(0%)!important;
     
    }
    .mm_menus_li.mm_has_sub:not(.producenci_menu) ul.ets_mm_categories:not(.active) .ets_mm_categories{
        transform: translateX(-100%)!important;
    }
    .mm_columns_ul.active > .mm_columns_li.mm_has_sub > ul > .mm_blocks_li ul.ets_mm_categories.active{
        transform: translateX(0%)!important;
     
    }
    .mm_columns_ul > li > .mm_blocks_ul,
    .mm_columns_ul.active > li > .mm_blocks_ul{
        transform: translateX(0%)!important;
    }
    li:not(.producenci_menu) .mm_columns_ul.active > .mm_columns_li.mm_has_sub > ul > .mm_blocks_li .mm_block_type_category >.ets_mm_block_content > ul.ets_mm_categories,
    .mm_columns_ul.active > li:not(.producenci_menu) > .mm_blocks_ul > .mm_blocks_li .mm_block_type_category >.ets_mm_block_content > ul.ets_mm_categories{
        transform: translateX(100%)!important;
    }  

    li.producenci_menu .mm_columns_ul.active > .mm_columns_li.mm_has_sub > ul > .mm_blocks_li .mm_block_type_category >.ets_mm_block_content > ul.ets_mm_categories,
    .mm_columns_ul.active > li.producenci_menu > .mm_blocks_ul > .mm_blocks_li .mm_block_type_category >.ets_mm_block_content > ul.ets_mm_categories{
        transform: translateX(0%)!important;
    }
 

    /* mm_blocks_ul – tylko content w mm_columns_ul, nie osobny panel; jedzie z parentem przy zamykaniu level 1 */
    .mm_columns_ul .mm_blocks_ul,
    .mm_columns_contents_ul .mm_blocks_ul {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        min-height: auto !important;
        max-height: none !important;
        height: auto !important;
        transform: none !important;
        transition: none !important;
    }

    .ets_mm_megamenu .ets_mm_megamenu_content .ets_mm_megamenu_content_content .mm_menus_ul .mm_menus_li .mm_columns_ul .mm_columns_li:first-child>.mm_blocks_ul>.mm_blocks_li .ets_mm_block_content>.ets_mm_categories>li>ul{
        padding-left: 0px!important;
        padding-right: 0px!important;
    }
    .ets_mm_megamenu .ets_mm_megamenu_content .ets_mm_megamenu_content_content .mm_menus_ul .mm_menus_li .mm_columns_ul .mm_columns_li:first-child>.mm_blocks_ul>.mm_blocks_li .ets_mm_block_content>.ets_mm_categories>li>ul a{
        padding: 16px 28px!important;
    }

    .mm_menus_li.mm_has_sub.producenci_menu > ul{
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100dvw !important;
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        height: 100dvh !important;
        display: flex !important;

        z-index: 10001 !important;
        background: white !important;
        transition: transform 0.3s ease !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-100%) !important;
        overscroll-behavior: contain !important;
        flex-direction: row !important;
        flex-wrap: wrap;
    }
    .mm_menus_li.mm_has_sub.producenci_menu > ul.active{
        transform: translateX(0%) !important;
    }
    .mm_menus_li.mm_has_sub.producenci_menu > ul li{
        flex-grow: 1;
    }
    .mm_menus_li.mm_has_sub.producenci_menu .mm_blocks_ul{
        display: flex;
        flex-direction: column;
    }
    .mm_menus_li.mm_has_sub.producenci_menu .mm_blocks_ul li{
        width: 100%;
        padding:0;
    }
    .mm_menus_li.mm_has_sub.producenci_menu .mm_blocks_ul li .ets_mm_categories a{
        padding: 16px 28px!important;
    }
  
    .mm_menus_li.mm_has_sub.producenci_menu ul .ets_mm_categories  .mm-mobile-heading-row{
        display: none!important;
    }
    .mm_menus_li.mm_has_sub.producenci_menu .ets_mm_block>.h4{
        display: block;
        padding:1rem 0.5rem!important;
    }
    .ets_mm_megamenu .ets_mm_megamenu_content .ets_mm_megamenu_content_content .mm_menus_ul .mm_menus_li .arrow.closed{
        transform: rotate(-90deg)!important;
    }
    .ets_mm_megamenu .ets_mm_megamenu_content .ets_mm_megamenu_content_content .mm_menus_ul .mm_menus_li .arrow.opened{
        transform: rotate(-90deg)!important;
    }
  
}

/* header mm_blocks_ul + ets_mm_categories when mm_columns_ul.active */
@media (max-width: 767px) {
    .mm_columns_ul .mm_blocks_ul .mm-mobile-heading-row,
    .mm_columns_contents_ul.active .mm_blocks_ul .mm-mobile-heading-row,
    .mm_columns_ul .mm_blocks_ul .ets_mm_categories .mm-mobile-heading-row,
    .mm_columns_contents_ul.active .mm_blocks_ul .ets_mm_categories .mm-mobile-heading-row {
        display: flex !important;
        align-items: center;
        gap: 12px;
        flex-shrink: 0;
        background: #FC661E !important;
        padding: 8px 20px !important;
        border-bottom: 1px solid #e5e5e5 !important;
        list-style: none !important;
        margin: 0 !important;
        -webkit-tap-highlight-color: transparent;
    }


    .mm-mobile-back-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        padding: 0;
        margin: 0 0 0 auto;
        border: none;
        background: transparent;
        cursor: pointer;
        flex-shrink: 0;
        border-radius: 4px;
    }

    .mm-mobile-back-btn:hover,
    .mm-mobile-back-btn:focus {
        background: rgba(0, 0, 0, 0.06);
    }

    .mm-mobile-back-arrow {
        display: block;
        width: 20px;
        height: 20px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32' fill='none'%3E%3Cmask id='mask0_2223_583' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='0' y='0' width='32' height='32'%3E%3Crect x='32' width='32' height='32' transform='rotate(90 32 0)' fill='%23D9D9D9'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_2223_583)'%3E%3Cpath d='M16.0002 17.2613L22.1336 11.1279L23.5386 12.5329L16.0002 20.0713L8.46191 12.5329L9.86691 11.1279L16.0002 17.2613Z' fill='white'/%3E%3C/g%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        transform: rotate(90deg);
    }

    .mm-mobile-heading {
        flex: 1;
        color: #FFF;
    font-size: 13px;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* strzałki – dostępność */
.ets_mm_megamenu.ets_mm_megamenu .mm_menus_ul li > .arrow {
    z-index: 100 !important;
}
/* .ets_mm_megamenu.ets_mm_megamenu li:not(:has(>ul.active)) + li > .arrow,
.ets_mm_megamenu.ets_mm_megamenu li:not(:has(>ul.active)) > .arrow {
    z-index: 20!important;
}
.ets_mm_megamenu.ets_mm_megamenuli > ul.active .arrow {
    z-index: 30!important;
} */

