/* Blaek Mega Menu Widget Styles */

/* All buttons: default hover with transparent background */
.elementor-widget-blaek-mega-menu button,
.elementor-widget-blaek-mega-menu button:hover,
.elementor-widget-blaek-mega-menu button:focus {
    background-color: transparent;
}

.blaek-mega-menu {
    position: relative;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
    margin-inline: auto;
}

.blaek-menu-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    align-items: center;
}

.blaek-menu-list__main-wrapper {
    width: 100%;
    /* background-color: rgba(255, 255, 255, 0.8); */
    /* box-shadow: 0px 8px 24px 0px rgba(0, 0, 0, 0.08); */
    /* backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); */
}

.blaek-menu-search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    color: inherit;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    font: inherit;
    transition:color 0.3s ease;
    flex-shrink: 0;
}

.blaek-menu-search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    position: relative;
    bottom: 3px;
}

.blaek-menu-search-icon svg {
    width: 18px;
    height: 18px;
}

.blaek-menu-search-text {
    white-space: nowrap;
}

.blaek-menu-list__main{
    justify-content: center;
    column-gap: 40px;
}

.blaek-menu-list__main > li > a{
    padding-block: 10px;
}

.blaek-menu-item {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.blaek-menu-item a {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    outline: none; /* Remove default outline, we'll add custom focus styles */
}

.blaek-menu-item a:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-radius: 2px;
}

.blaek-menu-arrow {
    display: none;
    align-items: center;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.blaek-menu-item.has-children:hover .blaek-menu-arrow {
    transform: rotate(180deg);
}

.blaek-menu-arrow svg {
    width: 14px;
    height: 14px;
}

/* Disable header backdrop-filter when mega menu dropdown is open so dropdown's backdrop-filter works */
.blaek-header-backdrop-disabled {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Mega Menu Dropdown */
/* position: absolute when hidden = out of flow, no extra height on .blaek-mega-menu */
/* position: relative when active = backdrop-filter works (absolute breaks it) */
.blaek-mega-menu-dropdown {
    position: absolute;
    top: calc(100%);
    left: 0;
    width: calc(100vw - 8px);
    padding-inline: 30px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    margin-left: calc(-50vw + 50%);
    padding-top: 0; /* Remove gap between menu and dropdown */
    /* background: rgba(255, 255, 255, 0.8); */
    box-shadow: inset 0 0 25px 0 rgba(0, 0, 0, 0.1);
    max-height: 75vh;
    overflow-x: hidden; /* Allow posts slider to extend to screen edge */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #b8c2cc #eef2f5;
    /* backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); */
    pointer-events: none; /* Allow clicks to pass through when hidden */
    isolation: isolate; /* Create stacking context so backdrop-filter works when parent header also has it */
    /* backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); */
}

.blaek-mega-menu-dropdown::-webkit-scrollbar {
    width: 8px;
}

.blaek-mega-menu-dropdown::-webkit-scrollbar-track {
    background: #eef2f5;
    border-radius: 8px;
}

.blaek-mega-menu-dropdown::-webkit-scrollbar-thumb {
    background: #b8c2cc;
    border-radius: 8px;
}

.blaek-mega-menu-dropdown::-webkit-scrollbar-thumb:hover {
    background: #aab6c2;
}

/* Ensure mega menu works in Elementor editor */
.elementor-editor-active .blaek-mega-menu-dropdown,
.elementor-editor-preview .blaek-mega-menu-dropdown {
    z-index: 99999 !important;
}

.blaek-mega-menu-dropdown.active {
    pointer-events: auto; /* Enable interactions when active */
    opacity: 1;
    visibility: visible;
    position: relative;
}

/* Hiding state: keep position relative during fade-out so transition is smooth */
.blaek-mega-menu-dropdown.hiding {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.blaek-mega-menu-container {
    position: relative;
    width: 100%;
    max-width: 1140px;
    margin-inline: auto;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow: visible; /* Allow posts slider to extend to screen edge */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}

/* Show animation */
.blaek-mega-menu-dropdown.active .blaek-mega-menu-container {
    transform: translateY(0);
    opacity: 1;
}

/* Hide animation - handled by transition when active class is removed */

.blaek-mega-menu-title-wrapper {
    grid-column: 1 / -1;
    padding: 40px 0 0;
    display: grid;
    /* 2 logical columns: col1 = menu (1fr), col2 = slider (2fr) - aligns with content grid */
    grid-template-columns: 2fr 1fr;
    gap: 120px;
    align-items: end;
}

.blaek-mega-menu-title-wrapper.hidden {
    display: none !important;
}

.blaek-mega-menu-title {
    grid-column: 1;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
}

.blaek-mega-menu-post-slider-title {
    grid-column: 2;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    display: none;
}

.blaek-mega-menu-post-slider-title:not(:empty) {
    display: block;
}

.blaek-mega-menu-content {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: min-content; /* Prevent rows from expanding beyond content */
    gap: 60px;
    min-height: 460px;
    padding: 0 0 40px;
    align-items: start; /* Align all grid items to start to prevent stretching */
    overflow: visible; /* Allow posts slider to extend to screen edge */
}

.blaek-mega-menu-level2 {
    grid-column: 1;
    min-width: 0;
    padding-right: 0;
}

.blaek-mega-menu-teaser-boxes {
    grid-column: 2 / 4;
    min-width: 0;
    padding-left: 0;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow: visible; /* Allow slider to extend to screen edge */
}

/* Posts slider (newsroom-slider) should be in column 3 and extend to screen edge */
.blaek-mega-menu-teaser-boxes:has(.blaek-newsroom-slider) {
    grid-column: 3;
}

.blaek-mega-menu-teaser-boxes.hiding {
    opacity: 0;
    visibility: hidden;
}

/* When level 3 is active, teaser boxes move to column 3 */
.blaek-mega-menu-level3.active ~ .blaek-mega-menu-teaser-boxes {
    grid-column: 3;
}

/* When level 4 is active, hide teaser boxes completely */
.blaek-mega-menu-level4.active ~ .blaek-mega-menu-teaser-boxes {
    display: none !important;
}

.blaek-mega-menu-teaser-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.blaek-mega-menu-teaser-swiper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    position: relative;
}

.blaek-mega-menu-teaser-swiper .swiper-wrapper {
    align-items: stretch;
}

.blaek-mega-menu-teaser-swiper .swiper-slide {
    height: auto;
    display: flex;
    box-sizing: border-box;
}

.blaek-teaser-swiper-pagination {
    margin-top: 16px;
    text-align: center;
    position: relative;
}

/* Hide pagination when only 1 slide */
.blaek-mega-menu-teaser-swiper:has(.swiper-slide:only-child) .blaek-teaser-swiper-pagination {
    display: none;
}

/* Posts slider (newsroom-slider) in mega menu - allow extending to screen edge */
.blaek-mega-menu-teaser-boxes .blaek-newsroom-slider {
    width: 100%;
    margin-right: 0;
    margin-top: 12px;
}

.blaek-mega-menu-teaser-boxes .blaek-newsroom-swiper {
    margin-right: 0;
    /* Swiper needs overflow hidden, but we'll make the container wider via JS */
}

/* Max width constraint for slide items in post slider - will be overridden by inline style from JS */
.blaek-mega-menu-teaser-boxes .blaek-newsroom-slide {
    max-width: 400px;
}

/* Transition for slidesPerView auto: prev slide fade and last slide edge position (like sl-teaser-slider) */
.blaek-mega-menu-teaser-boxes .blaek-newsroom-slider .swiper-slide {
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

/* Hide teaser boxes (post slider, grid, etc.) on tablet and mobile - desktop only */
@media (max-width: 1024px) {
    .blaek-mega-menu-teaser-boxes {
        display: none !important;
    }
    
    .blaek-mega-menu-post-slider-title {
        display: none !important;
    }
}

/* Position navigation under the first slide */
.blaek-mega-menu-teaser-boxes .blaek-newsroom-nav {
    margin-top: 14px;
}

.blaek-mega-menu-teaser-boxes .blaek-newsroom-nav__inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    border-radius: 100px;
    padding: 20px 24px;
    gap: 32px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background-color: transparent !important;
}

.blaek-mega-menu-teaser-boxes .blaek-newsroom-nav__btn {
    width: auto;
    height: auto;
    padding: 0;
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 0;
}

.blaek-mega-menu-teaser-boxes .blaek-newsroom-nav__btn:hover,
.blaek-mega-menu-teaser-boxes .blaek-newsroom-nav__btn:focus {
    background: transparent;
}

.blaek-mega-menu-teaser-boxes .blaek-newsroom-nav__btn svg {
    width: 10px;
    height: 20px;
}

.blaek-mega-menu-teaser-boxes .blaek-newsroom-nav__btn.blaek-newsroom-prev {
    transform: rotate(180deg);
}

.blaek-teaser-box-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.blaek-teaser-box-image {
    width: 100%;
    overflow: hidden;
    border-radius: 0;
}

.blaek-teaser-box-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}


.blaek-teaser-box-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blaek-teaser-box-title,
.blaek-teaser-box-title-link {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    line-height: 1.3;
}

.blaek-teaser-box-title-link:hover {
    color: #007bff;
}

.blaek-teaser-box-title-link h4 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.blaek-teaser-box-description {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.blaek-teaser-box-link {
    display: inline-block;
    margin-top: 5px;
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.blaek-teaser-box-link:hover {
    text-decoration: underline;
}

/* Grid Layout for Teaser Boxes */
.blaek-mega-menu-teaser-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    width: 100%;
}

/* When there's only 1 item, position it on the right */
.blaek-mega-menu-teaser-grid > .blaek-teaser-box-grid-item:only-child {
    grid-column: 2;
    justify-self: end;
}

.blaek-teaser-box-grid-item {
    position: relative;
    display: block;
    width: 100%;
    height: 420px;
    background: #f1f1f1;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.blaek-teaser-box-grid-item * {
    text-decoration: none;
}

.blaek-teaser-box-grid-item:focus-visible {
    outline: 2px solid #1a4d7a;
    outline-offset: 3px;
}

/* Grid item image styling - covers entire card */
.blaek-teaser-box-grid-item .blaek-teaser-box-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 0;
    margin: 0;
    z-index: 0;
}

.blaek-teaser-box-grid-item .blaek-teaser-box-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}


/* Grid item content styling - positioned at bottom */
.blaek-teaser-box-grid-item .blaek-teaser-box-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 -10px 30px rgba(17, 24, 39, 0.12);
    z-index: 2;
    justify-content: flex-end;
}

.blaek-teaser-box-grid-item .blaek-teaser-box-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1a4d7a;
    text-decoration: none;
    line-height: 1.3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.blaek-teaser-box-grid-item .blaek-teaser-box-description {
    margin: 0;
    font-size: 15px;
    color: #6b8ba8;
    line-height: 1.6;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@media (max-width: 768px) {
    .blaek-mega-menu-teaser-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .blaek-teaser-box-grid-item {
        height: 380px;
    }

    .blaek-teaser-box-grid-item .blaek-teaser-box-content {
        padding: 18px;
    }
}

/* Shared styles for dropdown menu levels (2, 3, 4) */
.blaek-mega-menu-dropdown .blaek-menu-list,
.blaek-mega-menu-level3 .blaek-menu-list,
.blaek-mega-menu-level4 .blaek-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.blaek-menu-dropdown-list {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
}

.blaek-mega-menu-level2 {
    grid-column: 1;
    min-width: 0;
    padding-right: 0;
    display: none !important;
}

.blaek-mega-menu-level2.active,
.blaek-mega-menu-level2[style*="display: block"],
.blaek-mega-menu-level2[style*="display:block"] {
    display: block !important;
}

/* Shared styles for dropdown menu items (levels 2, 3, 4) - different class from level 1 */
.blaek-dropdown-menu-item {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.blaek-mega-menu-level3 .blaek-dropdown-menu-item,
.blaek-mega-menu-level4 .blaek-dropdown-menu-item {
    margin-bottom: 8px;
}

/* Animation for dropdown menu items when container is active */
.blaek-mega-menu-dropdown.active .blaek-dropdown-menu-item,
.blaek-mega-menu-level3.active .blaek-dropdown-menu-item,
.blaek-mega-menu-level4.active .blaek-dropdown-menu-item {
    animation: blaekMenuItemSlideIn 0.5s ease forwards;
}

/* Staggered animation delays for dropdown menu items */
.blaek-mega-menu-dropdown.active .blaek-dropdown-menu-item:nth-child(1),
.blaek-mega-menu-level3.active .blaek-dropdown-menu-item:nth-child(1),
.blaek-mega-menu-level4.active .blaek-dropdown-menu-item:nth-child(1) {
    animation-delay: 0.1s;
}

.blaek-mega-menu-dropdown.active .blaek-dropdown-menu-item:nth-child(2),
.blaek-mega-menu-level3.active .blaek-dropdown-menu-item:nth-child(2),
.blaek-mega-menu-level4.active .blaek-dropdown-menu-item:nth-child(2) {
    animation-delay: 0.15s;
}

.blaek-mega-menu-dropdown.active .blaek-dropdown-menu-item:nth-child(3),
.blaek-mega-menu-level3.active .blaek-dropdown-menu-item:nth-child(3),
.blaek-mega-menu-level4.active .blaek-dropdown-menu-item:nth-child(3) {
    animation-delay: 0.2s;
}

.blaek-mega-menu-dropdown.active .blaek-dropdown-menu-item:nth-child(4),
.blaek-mega-menu-level3.active .blaek-dropdown-menu-item:nth-child(4),
.blaek-mega-menu-level4.active .blaek-dropdown-menu-item:nth-child(4) {
    animation-delay: 0.25s;
}

.blaek-mega-menu-dropdown.active .blaek-dropdown-menu-item:nth-child(5),
.blaek-mega-menu-level3.active .blaek-dropdown-menu-item:nth-child(5),
.blaek-mega-menu-level4.active .blaek-dropdown-menu-item:nth-child(5) {
    animation-delay: 0.3s;
}

.blaek-mega-menu-dropdown.active .blaek-dropdown-menu-item:nth-child(6),
.blaek-mega-menu-level3.active .blaek-dropdown-menu-item:nth-child(6),
.blaek-mega-menu-level4.active .blaek-dropdown-menu-item:nth-child(6) {
    animation-delay: 0.35s;
}

.blaek-mega-menu-dropdown.active .blaek-dropdown-menu-item:nth-child(7),
.blaek-mega-menu-level3.active .blaek-dropdown-menu-item:nth-child(7),
.blaek-mega-menu-level4.active .blaek-dropdown-menu-item:nth-child(7) {
    animation-delay: 0.4s;
}

.blaek-mega-menu-dropdown.active .blaek-dropdown-menu-item:nth-child(8),
.blaek-mega-menu-level3.active .blaek-dropdown-menu-item:nth-child(8),
.blaek-mega-menu-level4.active .blaek-dropdown-menu-item:nth-child(8) {
    animation-delay: 0.45s;
}

.blaek-mega-menu-dropdown.active .blaek-dropdown-menu-item:nth-child(9),
.blaek-mega-menu-level3.active .blaek-dropdown-menu-item:nth-child(9),
.blaek-mega-menu-level4.active .blaek-dropdown-menu-item:nth-child(9) {
    animation-delay: 0.5s;
}

.blaek-mega-menu-dropdown.active .blaek-dropdown-menu-item:nth-child(10),
.blaek-mega-menu-level3.active .blaek-dropdown-menu-item:nth-child(10),
.blaek-mega-menu-level4.active .blaek-dropdown-menu-item:nth-child(10) {
    animation-delay: 0.55s;
}

.blaek-mega-menu-dropdown.active .blaek-dropdown-menu-item:nth-child(n+11),
.blaek-mega-menu-level3.active .blaek-dropdown-menu-item:nth-child(n+11),
.blaek-mega-menu-level4.active .blaek-dropdown-menu-item:nth-child(n+11) {
    animation-delay: 0.6s;
}

/* Shared menu link styles for dropdown items (levels 2, 3, 4) */
.blaek-dropdown-menu-link {
    display: flex;
    align-items: center;
    padding: 0;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-shadow: none;
    outline: none; /* Remove default outline, we'll add custom focus styles */
}

/* Ensure dropdown links are focusable */
.blaek-dropdown-menu-link:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.blaek-level2-menu-link {
    justify-content: flex-start;
    color: #333;
    cursor: pointer;
}

.blaek-level3-menu-link,
.blaek-level4-menu-link {
    justify-content: space-between;
    color: #666;
}

/* Hover and active states for dropdown menu links */
.blaek-dropdown-menu-link:hover,
.blaek-dropdown-menu-link.active {
    color: #007bff;
    /* Faux-bold effect without changing font-weight */
    text-shadow:
        0.02em 0 0 currentColor,
        -0.02em 0 0 currentColor;
}

/* Visual indication for active menu items with children (clicking is prevented via JS) */
.blaek-dropdown-menu-link.has-children.active {
    opacity: 0.8; /* Slightly dimmed to indicate it's already active */
}

/* Shared icon styles */
.blaek-dropdown-menu-icon {
    display: inline-flex;
    align-items: center;
    width: 6px;
    margin-left: 10px;
    vertical-align: middle;
    position: relative;
}

.blaek-mega-menu-level3 {
    grid-column: 2;
    min-width: 0;
    padding-left: 0;
    display: none !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.blaek-mega-menu-level3.active {
    display: block !important;
    opacity: 1;
    visibility: visible;
    animation: blaek-fade-in 0.3s ease;
}

/* When level 3 is active, teaser boxes move to column 3 */
.blaek-mega-menu-level3.active ~ .blaek-mega-menu-teaser-boxes {
    grid-column: 3;
}

@keyframes blaek-fade-in {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Keyframes for menu item slide-in animation */
@keyframes blaekMenuItemSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Reset dropdown menu items when container is not active */
.blaek-mega-menu-dropdown:not(.active) .blaek-dropdown-menu-item,
.blaek-mega-menu-level3:not(.active) .blaek-dropdown-menu-item,
.blaek-mega-menu-level4:not(.active) .blaek-dropdown-menu-item {
    opacity: 0;
    transform: translateX(-30px);
    animation: none;
}

.blaek-mega-menu-level4 {
    grid-column: 3;
    min-width: 0;
    padding-left: 0;
    display: none !important;
    align-self: start;
    overflow-y: auto; /* Allow scrolling if content exceeds height */
}

.blaek-mega-menu-level4.active {
    display: block !important;
    animation: blaek-fade-in 0.3s ease;
}

/* When level 4 is active, hide teaser boxes completely */
.blaek-mega-menu-level4.active ~ .blaek-mega-menu-teaser-boxes {
    display: none !important;
}

.blaek-mega-menu-level3:not(.active) .blaek-level3-menu-item {
    opacity: 0;
    transform: translateX(-30px);
    animation: none;
}

.blaek-mega-menu-level4:not(.active) .blaek-level4-menu-item {
    opacity: 0;
    transform: translateX(-30px);
    animation: none;
}

/* Level 4 specific styles are now in shared styles above */

/* Responsive */
@media (max-width: 768px) {
    .blaek-menu-list {
        flex-direction: column;
        align-items: flex-start;
    }

    .blaek-menu-item {
        width: 100%;
    }

    .blaek-menu-item:not(:last-child) {
        margin-bottom: 10px;
    }

    .blaek-mega-menu-content {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 20px;
    }

    .blaek-mega-menu-level2 {
        grid-column: 1;
        width: 100%;
        padding-right: 0;
        padding-bottom: 20px;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .blaek-mega-menu-teaser-boxes {
        grid-column: 1;
        padding-left: 0;
        padding-top: 20px;
    }

    .blaek-mega-menu-level3 {
        grid-column: 1;
        padding-left: 0;
        padding-top: 20px;
    }

    .blaek-mega-menu-level4 {
        grid-column: 1;
        padding-left: 0;
        padding-top: 20px;
    }
}

/* Hide mega menu dropdown in Elementor sticky spacer (prevents duplicate menu when header is sticky) */
/* .elementor-sticky__spacer .blaek-mega-menu-dropdown {
    display: none !important;
} */

/* ========================================
   Tablet & Mobile: Hide horizontal menu, show vertical mobile menu
   ======================================== */
@media (max-width: 1024px) {
    /* Hide horizontal menu bar and desktop dropdown on tablet/mobile */
    .blaek-mega-menu > .blaek-menu-list__main-wrapper {
        display: none !important;
    }
    
    .blaek-mega-menu-dropdown {
        display: none !important;
    }
    
    /* Mobile menu container - shown when hamburger opens (via .active on parent) */
    .blaek-mega-menu-mobile {
        display: block;
        width: 100%;
        position: relative;
        overflow: hidden;
        backdrop-filter: blur(10px);
        background-color: #fff;
        height: 0;
        transition: 0.3s ease;
    }

    .mega-active .blaek-mega-menu-mobile {
        height: calc(100vh - 140px);
    }

    /* Default: no min-height when closed (avoids whitespace). Panels are position:absolute so need parent height when open. */
    .blaek-mega-menu-mobile-levels {
        position: relative;
        width: 100%;
        min-height: 0;
        transition: min-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    /* When menu open (hamburger target has .active): give height so absolute panels are visible */
    [data-blaek-menu-target].active .blaek-mega-menu-mobile-levels {
        min-height: calc(100vh - 150px);
    }
    
    /* Base panel state - like sl-menu-level */
    .blaek-mega-menu-mobile-panel {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        max-height: calc(100vh - 250px);
        overflow-y: auto;
        padding: 20px 40px;
        background: inherit;
        opacity: 0;
        visibility: hidden;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.35s ease, visibility 0.35s ease;
        z-index: 1;
    }
    
    /* Open (visible) panel */
    .blaek-mega-menu-mobile-panel.blaek-mobile-panel-open {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        z-index: 10;
        pointer-events: auto;
    }
    
    /* Forward: target enters from right */
    .blaek-mega-menu-mobile-panel.blaek-sliding-in {
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
        z-index: 5;
    }
    
    /* Forward: current slides out to left */
    .blaek-mega-menu-mobile-panel.blaek-sliding-out {
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        z-index: 1;
    }
    
    /* Back: target enters from left */
    .blaek-mega-menu-mobile-panel.blaek-sliding-in-left {
        transform: translateX(-100%);
        z-index: 5;
    }
    
    /* Back: current slides out to right */
    .blaek-mega-menu-mobile-panel.blaek-sliding-out-right {
        transform: translateX(100%);
        z-index: 1;
    }
    
    /* Parked left after forward navigation */
    .blaek-mega-menu-mobile-panel.blaek-hidden-left {
        transform: translateX(-100%) !important;
        opacity: 0;
        visibility: hidden;
        z-index: 1;
    }
    
    .blaek-mega-menu-mobile-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .blaek-mega-menu-mobile-item {
        margin: 0;
        padding: 0;
    }
    
    .blaek-mega-menu-mobile-link {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        padding: 14px 0;
        background: none;
        border: none;
        font: inherit;
        color: inherit;
        text-decoration: none;
        text-align: left;
        cursor: pointer;
        transition: color 0.2s ease;
    }
    
    .blaek-mega-menu-mobile-link:hover,
    .blaek-mega-menu-mobile-link:focus {
        color: #007bff;
    }
    
    .blaek-mega-menu-mobile-arrow {
        display: inline-flex;
        width: 6px;
        height: 12px;
        margin-left: 20px;
    }
    
    .blaek-mega-menu-mobile-arrow svg {
        width: 100%;
        height: 100%;
    }
    
    .blaek-mega-menu-mobile-item:not(.has-children) .blaek-mega-menu-mobile-arrow {
        display: none;
    }
    
    .blaek-mega-menu-mobile-nav {
        margin-bottom: 12px;
    }
    
    /* Zurück button */
    .blaek-mega-menu-mobile-zuruck {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 0 16px;
        margin-bottom: 8px;
        background: none;
        border: none;
        font: inherit;
        color: inherit;
        cursor: pointer;
        text-decoration: none;
        transition: color 0.2s ease;
    }
    
    .blaek-mega-menu-mobile-zuruck:hover,
    .blaek-mega-menu-mobile-zuruck:focus {
        color: #007bff;
    }
    
    .blaek-mega-menu-mobile-zuruck-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 6px;
        height: 12px;
        transform: rotate(180deg);
    }
    
    .blaek-mega-menu-mobile-zuruck-icon svg {
        width: 100%;
        height: 100%;
    }
    
    .blaek-mega-menu-mobile-level-title {
        font-size: inherit;
        margin-bottom: 16px;
    }
    
    .blaek-mega-menu-mobile-panel:not(.blaek-mega-menu-mobile-level-0) .blaek-mega-menu-mobile-link {
        padding: 12px 0;
    }
}

@media screen and (max-width: 767px) {
    .blaek-mega-menu-mobile-panel{
        padding-inline: 20px;
    }
}

/* Desktop: hide mobile menu */
@media (min-width: 1025px) {
    .blaek-mega-menu-mobile {
        display: none !important;
    }
}

/* Hide mega menu dropdown in Elementor sticky spacer (prevents duplicate menu when header is sticky) */
.elementor-sticky__spacer .blaek-mega-menu-dropdown {
    display: none !important;
}