.custom-category-nav-wrapper {
    border-bottom: 1px solid #e5e5e5;
    height: fit-content;
    margin: auto 0 auto auto;
    width:fit-content
}

.custom-category-nav {
    max-width: 1200px;
    margin: 0 auto;
}

.custom-category-nav .nav-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: flex-end;
    gap: 30px;
}

.custom-category-nav .nav-link {
    display: flex;
    padding: 15px 0;
    color: #232323;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    align-items: center;
    gap:4px;
}

.custom-category-nav .nav-link img{
    height:24px;
    color:red;
    fill:red
}

/* Submenu styles */
.custom-category-nav .submenu {
    display: none;
    position: absolute;
    left: 0%;
    top: 100%;
    width: 100%;
    background: white;
    padding: 30px;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--cornero-border-light);
    gap: 20px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    border-bottom-right-radius: 32px;
    border-bottom-left-radius: 32px;
}

/* Show submenu on hover */
.custom-category-nav .nav-item:hover > .submenu,
.custom-category-nav .nav-item.hover > .submenu {
    display: grid;
    opacity: 1;
    visibility: visible;
}

.custom-category-nav .nav-item:hover > .submenu:after,
.custom-category-nav .nav-item.hover > .submenu:after{
    content:'';
    bottom:100%;
    left:0;
    position:absolute;
    width:100%;
    height:30px

}

.custom-category-nav .subcategory-column {
    min-width: 200px;
}

.custom-category-nav .subcategory-title {
    display: block;
    font-weight: 600;
    color: #232323;
    text-decoration: none;
    font-size: 14px;
}

.custom-category-nav .third-level {
    list-style: none;
    padding: 0;
    margin: 0;
}

.custom-category-nav .third-level li {
    margin: 5px 0;
}

.custom-category-nav .third-level .nav-link {
    padding: 5px 0;
    font-weight: normal;
    text-transform: none;
    color: #666;
    font-size: 13px;
}

/* Hover effects */
.custom-category-nav .nav-link:hover {
    color: #cc0033;
}

.custom-category-nav .nav-item:hover > .nav-link {
    color: #cc0033;
}

/* Arrow indicator */
/*.custom-category-nav .nav-item.has-submenu.category > .nav-link::after {*/
/*    content: '';*/
/*    display: inline-block;*/
/*    width: 0;*/
/*    height: 0;*/
/*    border-style: solid;*/
/*    border-width: 0 7px 7px 0;*/
/*    border-color: transparent #606060 transparent transparent;*/
/*    -webkit-transform: rotate(135deg);*/
/*    -moz-transform: rotate(135deg);*/
/*    -o-transform: rotate(135deg);*/
/*    -ms-transform: rotate(135deg);*/
/*    transform: rotate(135deg);*/
/*    margin-bottom: 3px;*/
/*    margin-left: 3px*/
/*}*/
.nav-item.category .nav-link,
.nav-item.custom_html .nav-link {
    position: relative;
    text-decoration: none;
    width: fit-content;
}

@media (min-width: 1201px) {
    .custom-category-nav .desktop-nav > .nav-item > .nav-link {
        padding: 5.5px 12px !important;
        margin: 0 -12px;
        border-radius: 10px;
    }

    .custom-category-nav .desktop-nav > .nav-item:hover > .nav-link,
    .custom-category-nav .desktop-nav > .nav-item > .nav-link:focus-visible {
        background: #f1ece6;
        color: #232323;
    }
}


/* Add these new styles */
.custom-category-nav .custom-html-submenu {
    display: none;
    position: absolute;
    left: 50%;
    top: 100%;
    width: 1450px;
    max-width: 95vw;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 24px 22px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    transform: translateX(-50%);
    border-radius:0 0 10px 10px;
}

.custom-category-nav .nav-item:hover > .custom-html-submenu {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Add admin styles */
.custom-html-editor {
    min-width: 500px;
    margin: 10px 0;
}

.custom-html-item {
    flex-wrap: wrap;
}

.custom-html-item textarea {
    width: 100%;
    margin-top: 10px;
}


/* Burger Button */
.mobile-nav-toggle {
    display: none;
    width: 24px;
    height: 24px;
    position: relative;
    cursor: pointer;
    padding: 10px;
    /* margin: 10px; */
}

.burger-icon,
.burger-icon:before,
.burger-icon:after {
    content: "";
    display: block;
    width: 100%;
    height: 2px;
    background: #232323;
    position: absolute;
    transition: all 0.3s;
}

.burger-icon:before {
    top: -7px;
}
.burger-icon:after {
    bottom: -7px;
}

/* Original mobile category content, separate from desktop mega menus. */
.customnav-legacy-mobile {
    display: none;
}

@media (max-width: 1200px) {
    .mobile-custom-html-content .narozniki-mega,
    .mobile-custom-html-content .lozka-mega,
    .mobile-custom-html-content .szafy-mega {
        display: none;
    }
    .mobile-custom-html-content .customnav-legacy-mobile {
        display: block;
    }
    .customnav-legacy-mobile .lozka-kategorie {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
        padding: 16px;
    }
    .customnav-legacy-mobile .lozka-kolumny { display: flex; gap: 24px; }
    .customnav-legacy-mobile .lozka-tapicerowane,
    .customnav-legacy-mobile .lozka-kontynentalne {
        display: flex;
        flex: 1;
        min-width: 0;
        flex-direction: column;
        gap: 12px;
    }
    .customnav-legacy-mobile .lozka-tapicerowane-header,
    .customnav-legacy-mobile .lozka-kontynentalne-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 4px;
    }
    .customnav-legacy-mobile .lozka-tapicerowane-header p,
    .customnav-legacy-mobile .lozka-kontynentalne-header p {
        margin: 0;
        color: #1a1a1a;
        font-size: 18px;
        font-weight: 700;
    }
    .customnav-legacy-mobile .lozka-tapicerowane-header svg,
    .customnav-legacy-mobile .lozka-kontynentalne-header svg,
    .customnav-legacy-mobile .lozka-tapicerowane-header img,
    .customnav-legacy-mobile .lozka-kontynentalne-header img { width: 32px; height: 32px; }
    .customnav-legacy-mobile .lozka-linki {
        display: flex;
        flex-direction: column;
        gap: 12px;
        list-style: none;
        padding: 0;
        margin: 0;
    }
    .customnav-legacy-mobile .lozka-linki li a { font-size: 14px; color: #a0a0a0 !important; text-decoration: none; }
    .customnav-legacy-mobile .szafy-kategorie .lozka-linki { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
    .customnav-legacy-mobile .lozka-bestseller {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-width: 0;
        overflow: hidden;
        position: relative;
        background: #f9f7f5;
        border-radius: 16px;
        padding: 16px;
    }
    .customnav-legacy-mobile .bestseller-left { display: flex; flex: 1; flex-direction: column; gap: 8px; z-index: 1; padding: 16px; }
    .customnav-legacy-mobile .bestseller-badge { background: #2c2c2c; color: #fff; font-size: 13px; font-weight: 600; padding: 5px 14px; border-radius: 12px; width: fit-content; }
    .customnav-legacy-mobile .bestseller-badge p { margin: 0; color: white; font-size: 13px; }
    .customnav-legacy-mobile .bestseller-top-title { font-size: 14px; color: #555; margin: 8px 0 0; }
    .customnav-legacy-mobile .bestseller-title { font-size: 24px; font-weight: 700; margin: 0; color: #1a1a1a; }
    .customnav-legacy-mobile .bestseller-subtitle { font-size: 13px; color: #888; margin: 0; }
    .customnav-legacy-mobile .bestseller-price { font-size: 20px; color: #000; margin: auto 0 0; padding-top: 8px; font-weight: 600; }
    .customnav-legacy-mobile .bestseller-right { width: 100%; margin-top: 12px; overflow: hidden; border-radius: 12px; }
    .customnav-legacy-mobile .bestseller-image img { width: 100%; display: block; object-fit: cover; aspect-ratio: 16 / 9; border-radius: 12px; }
    .customnav-legacy-mobile .szafy-kategorie .bestseller-image img { height: auto; aspect-ratio: auto; }
}

@media (max-width: 480px) {
    .customnav-legacy-mobile .lozka-kategorie { gap: 20px; }
    .customnav-legacy-mobile .lozka-kolumny { flex-direction: column; }
    .customnav-legacy-mobile .lozka-linki { gap: 8px; }
    .customnav-legacy-mobile .szafy-kategorie .lozka-linki { grid-template-columns: 1fr; }
    .customnav-legacy-mobile .lozka-tapicerowane-header p,
    .customnav-legacy-mobile .lozka-kontynentalne-header p { font-size: 14px; }
    .customnav-legacy-mobile .bestseller-title { font-size: 20px; }
    .customnav-legacy-mobile .bestseller-price { font-size: 16px; }
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    max-width:900px;
    background: white;
    z-index: 1001;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.mobile-menu-overlay.active {
    display: block;
}

.mobile-menu-header {
    padding: 15px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-title {
    font-weight: 600;
    font-size: 18px;
}

.mobile-menu-close {
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
}

@media (max-width: 1200px) {
    .mobile-menu { background: #f9f7f3; }
    .mobile-menu.is-opening-gesture {
        left: 0 !important;
        transition: none !important;
        will-change: transform;
    }
    .mobile-menu-overlay.is-opening-gesture { display: block; }
    body:has(.mobile-menu.is-opening-gesture) { overflow: hidden; }
    .mobile-menu .mobile-menu-header { background: #fff; }
    .mobile-menu .mobile-menu-header > .mobile-menu-close {
        display: flex;
        flex: 0 0 32px !important;
        align-items: center;
        justify-content: center;
        width: 32px !important;
        height: 32px;
        padding: 0;
        border: 1px solid #412a22;
        border-radius: 50%;
        background: #f9f7f5;
        color: #412a22;
        font-size: 20px;
        line-height: 1;
    }
    .mobile-menu .main-panel { min-height: calc(100vh - 70px); padding: 16px 16px 130px; background: #f9f7f3; }
    .mobile-menu .mobile-categories-title {
        margin: 0 0 10px;
        color: #161211;
        font: 600 18px/1.4 Poppins, sans-serif;
        text-transform: none;
    }
    .mobile-menu .main-panel .mobile-category-tiles {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        margin: 0;
        padding: 0;
        list-style: none;
    }
    .mobile-menu .main-panel .mobile-category-tiles > .mobile-nav-item {
        min-width: 0;
        margin: 0;
        border: 1px solid #e5dfd7;
        border-radius: 11px;
        background: #fff;
    }
    .mobile-menu .main-panel .mobile-nav-item-wrapper,
    .mobile-menu .main-panel .mobile-category-direct { min-height: 56px; }
    .mobile-menu .main-panel .mobile-nav-item-wrapper > .mobile-nav-link,
    .mobile-menu .main-panel .mobile-category-direct {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
        padding: 12px;
        color: #161211 !important;
        text-decoration: none;
    }
    .mobile-menu .main-panel .mobile-nav-item-wrapper > .panel-trigger {
        flex: 0 0 auto;
        padding: 12px;
    }
    .mobile-menu .main-panel .mobile-category-label { min-width: 0; overflow-wrap: anywhere; }
    .mobile-menu .main-panel .mobile-category-icon {
        display: flex;
        flex: 0 0 32px;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #f9f7f3;
    }
    .mobile-menu .main-panel .mobile-category-icon img { display: block; width: 20px; height: 20px; object-fit: contain; }
    .mobile-menu .main-panel .mobile-category-arrow {
        display: block;
        flex: 0 0 14px;
        width: 14px;
        height: 14px;
        margin-left: auto;
    }
}

/* Mobile Panels */
.mobile-panel {
    display: none;
    padding: 15px 0 130px;
}

.mobile-panel.active {
    display: block;
}

.panel-header {
    padding: 0 15px 15px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    gap: 15px;
}

.back-button {
    border: none;
    background: none;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 5px 0;
}

.mobile-arrow-left {
    border: solid #232323;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(135deg);
}

.mobile-arrow {
    border: solid #232323;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(-45deg);
    margin-left: auto;
}

.mobile-nav-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-item {
    border-bottom: 1px solid #e5e5e5;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 15px;
    color: #232323;
    text-decoration: none;
    cursor: pointer;
}

.mobile-nav-link:hover{
    color: var(--eliq-blue) !important;
}

/* Media Queries */
@media (max-width: 1200px) {
    .mobile-nav-toggle {
        display: flex;
    }

    .custom-category-nav .nav-items.desktop-nav {
        display: none;
    }

    .custom-category-nav-wrapper {
        width: auto;
        border: none;
        margin: 0;
    }

    .mobile-menu {
        display: block;
    }
}

.mobile-nav-item-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
}

.mobile-nav-item-wrapper .mobile-nav-link {
    flex: 1;
}

.mobile-nav-item-wrapper .panel-trigger {
    padding: 10px;
    cursor: pointer;
}

.mobile-nav-item-wrapper .mobile-arrow {
    border: solid #000;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(-45deg);
}

/* Category drilldown: applies only to product categories, not the language picker. */
@media (max-width: 1200px) {
    .mobile-menu .mobile-category-panel {
        min-height: calc(100vh - 70px);
        padding: 16px 16px 130px;
        background: #f9f7f3;
        font-family: Poppins, sans-serif;
    }
    .mobile-menu .mobile-category-panel .panel-header {
        min-height: 42px;
        gap: 10px;
        padding: 0 0 10px;
        border: 0;
    }
    .mobile-menu .mobile-category-panel .back-button {
        color: #452e26;
        font-weight: 600;
    }
    .mobile-menu .mobile-category-panel .mobile-arrow-left {
        border-color: #452e26;
    }
    .mobile-menu .mobile-category-panel .panel-title {
        padding-left: 10px;
        border-left: 1px solid #e5dfd7;
        color: #6e6661;
    }
    .mobile-category-panel .customnav-legacy-mobile .lozka-kategorie {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 0;
    }
    .mobile-category-panel .customnav-legacy-mobile .lozka-kolumny {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .mobile-category-panel .customnav-legacy-mobile .lozka-tapicerowane,
    .mobile-category-panel .customnav-legacy-mobile .lozka-kontynentalne {
        display: block;
        min-width: 0;
        overflow: hidden;
        border: 1px solid #e5dfd7;
        border-radius: 14px;
        background: #f9f7f3;
    }
    .mobile-category-panel .customnav-legacy-mobile .lozka-tapicerowane-header,
    .mobile-category-panel .customnav-legacy-mobile .lozka-kontynentalne-header {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 74px;
        margin: 0;
        padding: 12px;
        background: #f1ece6;
    }
    .mobile-category-panel .customnav-legacy-mobile .lozka-tapicerowane-header > svg,
    .mobile-category-panel .customnav-legacy-mobile .lozka-kontynentalne-header > svg,
    .mobile-category-panel .customnav-legacy-mobile .lozka-tapicerowane-header > img,
    .mobile-category-panel .customnav-legacy-mobile .lozka-kontynentalne-header > img {
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        padding: 3px;
        border-radius: 50%;
        background: #e9dfd4;
    }
    .mobile-category-panel .customnav-legacy-mobile .lozka-tapicerowane-header p,
    .mobile-category-panel .customnav-legacy-mobile .lozka-kontynentalne-header p { flex: 1; min-width: 0; margin: 0; font-size: 16px !important; font-weight: 600; }
    .mobile-category-panel .customnav-legacy-mobile .lozka-tapicerowane-header p a,
    .mobile-category-panel .customnav-legacy-mobile .lozka-kontynentalne-header p a { color: #161211 !important; font-size: inherit !important; text-decoration: none; }
    .mobile-category-panel .customnav-legacy-mobile .mobile-category-all {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 8px;
        color: #452e26 !important;
        font-size: 12px !important;
        font-weight: 500;
        text-decoration: none;
    }
    .mobile-category-panel .customnav-legacy-mobile .lozka-linki,
    .mobile-category-panel .customnav-legacy-mobile .szafy-kategorie .lozka-linki {
        display: block;
        list-style: none;
        margin: 0;
        padding: 0 14px;
    }
    .mobile-category-panel .customnav-legacy-mobile .lozka-linki li { margin: 0; border-bottom: 1px solid #e5dfd7; }
    .mobile-category-panel .customnav-legacy-mobile .lozka-linki li:last-child { border-bottom: 0; }
    .mobile-category-panel .customnav-legacy-mobile .lozka-linki li a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 56px;
        padding: 12px 0;
        color: #161211 !important;
        text-decoration: none;
    }
    .mobile-category-panel .customnav-legacy-mobile .mobile-detail-arrow { display: block; flex: 0 0 14px; width: 14px; height: 14px; }
    .mobile-category-panel .customnav-legacy-mobile .bestseller-link { display: block; color: #fff; text-decoration: none; }
    .mobile-category-panel .customnav-legacy-mobile .lozka-bestseller {
        display: block;
        position: relative;
        height: 214px;
        min-width: 0;
        padding: 0;
        overflow: hidden;
        border: 1px solid #e0d9cf;
        border-radius: 14px;
        background: #6e6661;
    }
    .mobile-category-panel .customnav-legacy-mobile .lozka-bestseller::after {
        content: '';
        position: absolute;
        inset: auto 0 0;
        height: 80px;
        max-height: 100%;
        z-index: 1;
        background: linear-gradient(to top, rgba(0,0,0,.8), rgba(0,0,0,.35) 32%, transparent 65%);
        pointer-events: none;
    }
    .mobile-category-panel .customnav-legacy-mobile .bestseller-right,
    .mobile-category-panel .customnav-legacy-mobile .bestseller-image { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; }
    .mobile-category-panel .customnav-legacy-mobile .bestseller-image img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
    .mobile-category-panel .customnav-legacy-mobile .szafy-kategorie .lozka-bestseller { height: auto; }
    .mobile-category-panel .customnav-legacy-mobile .szafy-kategorie .lozka-bestseller::after {
        height: 120px;
        background: linear-gradient(to top, rgba(0,0,0,.88), rgba(0,0,0,.65) 40%, transparent);
    }
    .mobile-category-panel .customnav-legacy-mobile .szafy-kategorie .bestseller-right,
    .mobile-category-panel .customnav-legacy-mobile .szafy-kategorie .bestseller-image { position: relative; inset: auto; height: auto; }
    .mobile-category-panel .customnav-legacy-mobile .szafy-kategorie .bestseller-image img { height: auto; }
    .mobile-category-panel .customnav-legacy-mobile .bestseller-left { position: absolute; z-index: 2; left: 14px; right: 55px; bottom: 14px; display: block; padding: 0; }
    .mobile-category-panel .customnav-legacy-mobile .lozka-bestseller > .bestseller-badge { position: absolute; z-index: 2; left: 12px; top: 12px; width: max-content; padding: 5px 8px; border: 1px solid #e0d9cf; border-radius: 99px; background: #fff; }
    .mobile-category-panel .customnav-legacy-mobile .bestseller-badge p { color: #452e26 !important; font-size: 10px; font-weight: 600; text-transform: uppercase; }
    .mobile-category-panel .customnav-legacy-mobile .bestseller-top-title,
    .mobile-category-panel .customnav-legacy-mobile .bestseller-title { display: inline; margin: 0; color: #fff !important; font-size: 16px; font-weight: 600; }
    .mobile-category-panel .customnav-legacy-mobile .bestseller-subtitle { margin: 2px 0 0; color: #fff !important; font-size: 12px; }
    .mobile-category-panel .customnav-legacy-mobile .bestseller-more,
    .mobile-category-panel .customnav-legacy-mobile .bestseller-price { display: none; }
    .mobile-category-panel .customnav-legacy-mobile .mobile-promo-arrow { position: absolute; z-index: 2; right: 16px; bottom: 16px; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; }
}







