.dynamic-header-navigation .dynamic-header-mega {
    padding: 0;
    box-sizing: border-box;
}

.dynamic-header-navigation .dynamic-header-mega--wide,
.dynamic-header-navigation .dynamic-header-mega.rbt-width-fullscreen {
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    transform: none;
}

.dynamic-header-navigation .dynamic-header-mega--narrow {
    left: 50%;
    right: auto;
    width: min(1120px, calc(100% - 32px));
    max-width: calc(100% - 32px);
    margin: 0;
    transform: translateX(-50%);
}

.dynamic-header-mega__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    align-items: start;
    gap: 24px;
    padding: 20px 24px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.dynamic-header-mega--narrow .dynamic-header-mega__grid {
    /* Match admin "dar mega" banner: 280 × 340 */
    grid-template-columns: minmax(0, 1fr) 280px;
}

.dynamic-header-mega--wide .dynamic-header-mega__grid {
    /* Match admin "geniş mega" banner: 976 × 990 (portrait) */
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
}

.dynamic-header-mega__sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px 24px;
    min-width: 0;
    align-content: start;
}

.dynamic-header-mega--wide .dynamic-header-mega__sections {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.dynamic-header-mega--narrow .dynamic-header-mega__sections {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.dynamic-header-mega__sections .single-mega-item {
    min-width: 0;
    position: relative;
    z-index: 0;
}

.dynamic-header-mega__image {
    position: relative;
    z-index: 1;
    min-width: 0;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 280 / 340;
    justify-self: stretch;
    overflow: hidden;
    border-radius: 8px;
    background: var(--color-gray-100, #f3f3f3);
}

.dynamic-header-mega--narrow .dynamic-header-mega__image {
    width: 280px;
    max-width: 100%;
    aspect-ratio: 280 / 340;
    height: auto;
}

.dynamic-header-mega--wide .dynamic-header-mega__image {
    aspect-ratio: 976 / 990;
    max-height: min(480px, 70vh);
}

.dynamic-header-mega__image a {
    display: block;
    width: 100%;
    height: 100%;
}

.dynamic-header-mega__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.dynamic-header-navigation .dynamic-header-dropdown {
    min-width: 240px;
}

@media (min-width: 1200px) {
    /*
     * Keep the in-flow header above page modules. Do not isolate the outer
     * .rbt-header: the scroll clone is position:fixed and would otherwise be
     * trapped in a stacking context that leaves the viewport.
     */
    .rbt-header {
        z-index: 1000;
    }

    .rbt-header .rbt-header-middle,
    .rbt-header .rbt-wrapper-middle,
    .rbt-header .rbt-header-search-layer {
        isolation: isolate;
        z-index: 1001;
    }

    /* Mega panel must escape the narrow nav; use the full middle bar. */
    .rbt-header .rbt-header-middle {
        overflow: visible;
    }

    .rbt-header .rbt-header-middle > .container,
    .rbt-header .rbt-header-middle > .container > .rbt-header-sec,
    .rbt-header .rbt-header-middle .rbt-main-navigation {
        overflow: visible;
        position: static;
    }

    /* Center menu items; keep the phone on the right edge. */
    .rbt-header .rbt-header-middle > .container > .rbt-header-sec {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
        align-items: center;
        gap: 16px;
        width: 100%;
    }

    .rbt-header .rbt-header-middle .rbt-main-navigation {
        display: flex !important;
        grid-column: 2;
        justify-content: center;
        justify-self: center;
        width: max-content;
        max-width: 100%;
        min-width: 0;
    }

    /*
     * Never put transform on the nav: it becomes the containing block for
     * absolute mega menus and crushes them to the menu-bar width.
     */
    .rbt-header .rbt-header-middle .rbt-mainmenu-nav {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: visible;
        transform: none !important;
    }

    .rbt-header .rbt-header-middle .rbt-mainmenu-nav .mainmenu {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0;
        gap: 2px var(--dynamic-menu-fit-gap, 6px);
    }

    .rbt-header .rbt-header-middle .rbt-mainmenu-nav .mainmenu > li {
        flex: 0 0 auto;
    }

    .rbt-header .rbt-header-middle .rbt-header-sec-col.rbt-header-right {
        grid-column: 3;
        justify-self: end;
        margin-left: 0 !important;
    }

    .rbt-header .rbt-header-middle .rbt-main-navigation .rbt-mainmenu-nav .mainmenu > li > a,
    .rbt-header .rbt-header-middle .rbt-mainmenu-nav .mainmenu > li > a,
    .rbt-header .rbt-header-middle .mainmenu > li > a {
        display: inline-flex;
        align-items: center;
        height: auto;
        min-height: 48px;
        line-height: 1.25;
        white-space: nowrap;
        font-size: var(--theme-header-menu-font-size, 16px) !important;
        font-weight: var(--theme-header-menu-font-weight, 500) !important;
        letter-spacing: var(--theme-header-menu-letter-spacing, 0);
        padding-inline: var(--dynamic-menu-fit-padding, 8px);
    }

    /*
     * Theme sets li.with-rbt-megamenu to position:relative, which traps the
     * absolute mega panel inside the narrow trigger link. Keep the item static
     * so the panel anchors to .rbt-header-middle instead.
     */
    .rbt-header .rbt-header-middle .rbt-main-navigation .rbt-mainmenu-nav .mainmenu > li.with-rbt-megamenu,
    .rbt-header .rbt-header-middle .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu {
        position: static !important;
    }

    .rbt-header .rbt-header-middle .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu > .dynamic-header-mega,
    .rbt-header .rbt-header-middle .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu > .rbt-megamenu {
        position: absolute !important;
        /* Overlap the bar so the cursor never hits the page backdrop in a gap. */
        top: calc(100% - 6px);
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 6px 0 0 !important;
        transform: none !important;
        z-index: 1002;
        pointer-events: none;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }

    .rbt-header .rbt-header-middle .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu > .dynamic-header-mega > .rbt-megamenu-wrapper,
    .rbt-header .rbt-header-middle .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu > .rbt-megamenu > .rbt-megamenu-wrapper {
        background: var(--color-white, #fff);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
        border-radius: 0 0 10px 10px;
    }

    .rbt-header .rbt-header-middle .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu:hover > .dynamic-header-mega,
    .rbt-header .rbt-header-middle .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu.is-open > .dynamic-header-mega,
    .rbt-header .rbt-header-middle .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu:hover > .rbt-megamenu,
    .rbt-header .rbt-header-middle .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu.is-open > .rbt-megamenu {
        pointer-events: auto !important;
    }

    .rbt-header .rbt-header-middle .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu > .dynamic-header-mega--narrow {
        left: 50% !important;
        right: auto !important;
        width: min(1120px, calc(100% - 32px)) !important;
        max-width: calc(100% - 32px) !important;
        transform: translateX(-50%) !important;
    }

    .rbt-header .rbt-header-middle .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu > .dynamic-header-mega .rbt-megamenu-wrapper,
    .rbt-header .rbt-header-middle .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu > .dynamic-header-mega .container-fluid {
        width: 100%;
        max-width: none;
        margin: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .rbt-header .rbt-header-common-sticky-activation.rbt-sticky {
        isolation: isolate;
        z-index: 1100;
        overflow: visible;
        width: 100%;
        height: auto;
        background-color: var(--color-white, #fff);
        pointer-events: auto;
    }

    /* Use nearly full viewport so logo/icons sit at the edges and all categories fit. */
    .rbt-header .rbt-header-common-sticky-activation > .container,
    .rbt-header .rbt-header-common-sticky-activation.rbt-sticky > .container {
        width: 100%;
        max-width: none;
        padding-left: clamp(8px, 1.2vw, 20px);
        padding-right: clamp(8px, 1.2vw, 20px);
        overflow: visible;
        background-color: var(--color-white, #fff);
        position: relative;
    }

    .rbt-header .rbt-header-common-sticky-activation .mainbar-row,
    .rbt-header .rbt-header-common-sticky-activation.rbt-sticky .mainbar-row {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        flex-wrap: nowrap;
        gap: 4px 10px !important;
        min-height: 64px;
        width: 100%;
        overflow: visible;
        background-color: var(--color-white, #fff);
        position: static;
    }

    .rbt-header .rbt-header-common-sticky-activation .header-left,
    .rbt-header .rbt-header-common-sticky-activation.rbt-sticky .header-left {
        flex: 0 0 auto;
        margin-right: 0;
        justify-self: start;
        z-index: 4;
        background-color: var(--color-white, #fff);
    }

    .rbt-header .rbt-header-common-sticky-activation .header-left .logo,
    .rbt-header .rbt-header-common-sticky-activation.rbt-sticky .header-left .logo {
        max-width: min(168px, 14vw);
    }

    .rbt-header .rbt-header-common-sticky-activation .header-left .logo img,
    .rbt-header .rbt-header-common-sticky-activation.rbt-sticky .header-left .logo img {
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: 42px;
        object-fit: contain;
    }

    .rbt-header .rbt-header-common-sticky-activation .header-left .header-info.p-0.d-none.d-xxl-flex,
    .rbt-header .rbt-header-common-sticky-activation.rbt-sticky .header-left .header-info.p-0.d-none.d-xxl-flex {
        display: none !important;
    }

    .rbt-header .rbt-header-common-sticky-activation .header-right,
    .rbt-header .rbt-header-common-sticky-activation.rbt-sticky .header-right {
        flex: 0 0 auto;
        justify-self: end;
        z-index: 4;
        background-color: var(--color-white, #fff);
    }

    .rbt-header .rbt-header-common-sticky-activation .mainbar-row > .rbt-header-content.d-xl-block,
    .rbt-header .rbt-header-common-sticky-activation.rbt-sticky .rbt-header-content.d-xl-block {
        display: block !important;
        min-width: 0;
        max-width: 100%;
        width: auto;
        padding-left: 0;
        padding-right: 0;
        overflow: visible;
        z-index: 2;
        position: static;
    }

    .rbt-header .rbt-header-common-sticky-activation .rbt-mainmenu-nav,
    .rbt-header .rbt-header-common-sticky-activation.rbt-sticky .rbt-mainmenu-nav {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: visible;
        transform: none !important;
    }

    .rbt-header .rbt-header-common-sticky-activation .rbt-mainmenu-nav .mainmenu,
    .rbt-header .rbt-header-common-sticky-activation.rbt-sticky .rbt-mainmenu-nav .mainmenu {
        display: flex;
        flex-wrap: nowrap !important;
        align-items: center;
        justify-content: center;
        gap: 2px var(--dynamic-menu-fit-gap, 4px);
        margin: 0;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: visible;
    }

    .rbt-header .rbt-header-common-sticky-activation .rbt-mainmenu-nav .mainmenu > li,
    .rbt-header .rbt-header-common-sticky-activation.rbt-sticky .rbt-mainmenu-nav .mainmenu > li {
        flex: 0 0 auto;
    }

    .rbt-header .rbt-header-common-sticky-activation .rbt-mainmenu-nav .mainmenu > li > a,
    .rbt-header .rbt-header-common-sticky-activation.rbt-sticky .rbt-mainmenu-nav .mainmenu > li > a {
        display: inline-flex;
        align-items: center;
        height: auto;
        min-height: 64px;
        padding-inline: var(--dynamic-menu-fit-padding, 6px);
        font-size: var(--theme-header-menu-font-size, 16px) !important;
        font-weight: var(--theme-header-menu-font-weight, 500) !important;
        letter-spacing: var(--theme-header-menu-letter-spacing, 0);
        line-height: 1.25;
        white-space: nowrap;
    }

    .rbt-header .rbt-header-common-sticky-activation .rbt-mainmenu-nav .mainmenu > li > a > i,
    .rbt-header .rbt-header-common-sticky-activation.rbt-sticky .rbt-mainmenu-nav .mainmenu > li > a > i {
        flex: 0 0 auto;
        margin-left: 4px;
    }

    .rbt-header .rbt-header-common-sticky-activation .mainbar-row .rbt-mainmenu-nav .mainmenu > li.with-rbt-megamenu,
    .rbt-header .rbt-header-common-sticky-activation .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu {
        position: static !important;
    }

    .rbt-header .rbt-header-common-sticky-activation .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu > .dynamic-header-mega,
    .rbt-header .rbt-header-common-sticky-activation .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu > .rbt-megamenu {
        position: absolute !important;
        top: calc(100% - 6px);
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 6px 0 0 !important;
        transform: none !important;
        z-index: 1002;
        pointer-events: none;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }

    .rbt-header .rbt-header-common-sticky-activation .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu > .dynamic-header-mega > .rbt-megamenu-wrapper,
    .rbt-header .rbt-header-common-sticky-activation .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu > .rbt-megamenu > .rbt-megamenu-wrapper {
        background: var(--color-white, #fff);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
        border-radius: 0 0 10px 10px;
    }

    .rbt-header .rbt-header-common-sticky-activation .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu:hover > .dynamic-header-mega,
    .rbt-header .rbt-header-common-sticky-activation .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu.is-open > .dynamic-header-mega,
    .rbt-header .rbt-header-common-sticky-activation .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu:hover > .rbt-megamenu,
    .rbt-header .rbt-header-common-sticky-activation .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu.is-open > .rbt-megamenu {
        pointer-events: auto !important;
    }

    .rbt-header .rbt-header-common-sticky-activation .dynamic-header-navigation .mainmenu > li.with-rbt-megamenu > .dynamic-header-mega--narrow {
        left: 50% !important;
        right: auto !important;
        width: min(1120px, calc(100% - 32px)) !important;
        max-width: calc(100% - 32px) !important;
        transform: translateX(-50%) !important;
    }

    .dynamic-header-navigation .dynamic-header-mega,
    .dynamic-header-navigation .dynamic-header-dropdown {
        z-index: 1002;
        pointer-events: none;
    }

    .rbt-main-navigation .dynamic-header-navigation li.with-rbt-megamenu:hover > .dynamic-header-mega,
    .mainbar-row .dynamic-header-navigation li.with-rbt-megamenu:hover > .dynamic-header-mega,
    .rbt-main-navigation .dynamic-header-navigation li.with-rbt-megamenu:focus-within > .dynamic-header-mega,
    .mainbar-row .dynamic-header-navigation li.with-rbt-megamenu:focus-within > .dynamic-header-mega,
    .rbt-main-navigation .dynamic-header-navigation li.with-rbt-megamenu.is-open > .dynamic-header-mega,
    .mainbar-row .dynamic-header-navigation li.with-rbt-megamenu.is-open > .dynamic-header-mega,
    .rbt-main-navigation .dynamic-header-navigation li.has-dropdown:hover > .dynamic-header-dropdown,
    .mainbar-row .dynamic-header-navigation li.has-dropdown:hover > .dynamic-header-dropdown,
    .rbt-main-navigation .dynamic-header-navigation li.has-dropdown:focus-within > .dynamic-header-dropdown,
    .mainbar-row .dynamic-header-navigation li.has-dropdown:focus-within > .dynamic-header-dropdown,
    .rbt-main-navigation .dynamic-header-navigation li.has-dropdown.is-open > .dynamic-header-dropdown,
    .mainbar-row .dynamic-header-navigation li.has-dropdown.is-open > .dynamic-header-dropdown,
    .rbt-main-navigation .dynamic-header-navigation li.has-dropdown:hover > .submenu,
    .mainbar-row .dynamic-header-navigation li.has-dropdown:hover > .submenu,
    .rbt-main-navigation .dynamic-header-navigation li.has-dropdown.is-open > .submenu,
    .mainbar-row .dynamic-header-navigation li.has-dropdown.is-open > .submenu {
        top: calc(100% - 6px);
        z-index: 1002;
        visibility: visible;
        opacity: 1;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        pointer-events: auto !important;
    }
}

.rbt-main-navigation .dynamic-header-navigation li.with-rbt-megamenu:focus-within > .dynamic-header-mega,
.mainbar-row .dynamic-header-navigation li.with-rbt-megamenu:focus-within > .dynamic-header-mega,
.rbt-main-navigation .dynamic-header-navigation li.has-dropdown:focus-within > .dynamic-header-dropdown,
.mainbar-row .dynamic-header-navigation li.has-dropdown:focus-within > .dynamic-header-dropdown {
    top: 100%;
    z-index: 5;
    visibility: visible;
    opacity: 1;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

@media (max-width: 1199.98px) {
    .popup-mobile-menu .dynamic-header-mega,
    .popup-mobile-menu .dynamic-header-mega__image,
    .popup-mobile-menu .dynamic-header-mega__grid {
        display: none !important;
    }

    .popup-mobile-menu .dynamic-header-navigation--mobile .mainmenu > li,
    .popup-mobile-menu .mobile-category-nav .mainmenu > li {
        display: block;
        width: 100%;
    }

    .popup-mobile-menu .dynamic-header-navigation--mobile .mainmenu > li > a,
    .popup-mobile-menu .mobile-category-nav .mainmenu > li > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        white-space: normal;
        writing-mode: horizontal-tb;
        text-orientation: mixed;
    }

    .popup-mobile-menu .inner-top .content {
        position: relative;
        justify-content: center;
    }

    .popup-mobile-menu .inner-top .rbt-btn-close {
        position: absolute;
        top: 50%;
        right: 0;
        transform: translateY(-50%);
    }

    .popup-mobile-menu .inner-top .logo {
        position: static;
        margin: 0 auto;
        text-align: center;
        transform: none;
    }

    .popup-mobile-menu .inner-top .logo a,
    .popup-mobile-menu .inner-top .logo img {
        display: block;
        margin-inline: auto;
    }

    .popup-mobile-menu .inner-top .description {
        text-align: center;
    }

    .popup-mobile-menu .rbt-round-shape-tab .nav-tabs .nav-item .nav-link.active,
    .popup-mobile-menu .rbt-round-shape-tab .nav-tabs .nav-item .nav-link.active i {
        color: #fff !important;
    }

    .popup-mobile-menu .dynamic-header-mega {
        position: static;
        width: 100%;
        max-width: none;
        transform: none;
        padding: 0;
        box-shadow: none;
    }

    .popup-mobile-menu .dynamic-header-mega__grid,
    .popup-mobile-menu .dynamic-header-mega__sections {
        display: block;
        padding: 0;
    }

    .popup-mobile-menu .dynamic-header-mega > .rbt-megamenu-wrapper > .container-fluid {
        padding-right: 4px;
        padding-left: 4px;
    }

    .popup-mobile-menu .dynamic-header-mega__sections .single-mega-item {
        padding: 4px 0;
    }

    .popup-mobile-menu .dynamic-header-mega__sections .single-mega-item + .single-mega-item {
        margin-top: 6px !important;
    }

    .popup-mobile-menu .dynamic-header-mega__sections .mega-menu-item > li {
        margin: 0;
    }

    .popup-mobile-menu .dynamic-header-mega__sections .mega-menu-item > li > a {
        padding: 6px 8px !important;
        line-height: 20px;
    }

    .popup-mobile-menu .dynamic-header-mega__image {
        min-height: 0;
        max-height: none;
        margin-top: 6px;
        aspect-ratio: 280 / 340;
        max-width: 100%;
    }

    .popup-mobile-menu .dynamic-header-mega__image img {
        max-height: none;
        height: 100%;
        object-fit: cover;
        object-position: center center;
    }

    .popup-mobile-menu .dynamic-header-navigation .rbt-short-title {
        margin-bottom: 3px;
        font-size: 14px;
    }
}
