.tlp-mega-menu {
    position: static;
    width: 0;
    height: 0;
    overflow: visible;
    --tlp-mega-offset-x: 0px;
    --tlp-mega-offset-y: 14px;
}

.elementor-widget-tlp-mega-menu,
.elementor-widget-tlp-mega-menu > .elementor-widget-container {
    position: static !important;
    overflow: visible !important;
    min-width: 0;
}

.tlp-mega-menu__panel {
    position: fixed;
    top: 0;
    left: 0;
    width: min(980px, calc(100vw - 32px));
    max-width: 1180px;
    --tlp-grid-columns: 3;
    --tlp-auto-column-width: 280px;
    padding: 44px 28px 28px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 18px 55px rgba(31, 39, 52, .14);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
    z-index: 9999;
}

.tlp-mega-menu__panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.tlp-mega-menu__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: stretch;
}

.tlp-mega-menu__card {
    --tlp-card-bg: #f8f8f6;
    --tlp-card-accent: #ef806f;
    position: relative;
    min-width: 0;
    background: var(--tlp-card-bg);
    border-radius: 20px;
    padding: 54px 22px 24px;
}

.tlp-mega-menu__card::before {
    content: '';
    position: absolute;
    left: 22px;
    right: 22px;
    top: 0;
    height: 3px;
    border-radius: 999px;
    background: var(--tlp-card-accent);
    opacity: .7;
}

.tlp-mega-menu__image-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.tlp-mega-menu__card--overlap .tlp-mega-menu__image-wrap {
    position: absolute;
    top: -36px;
    left: 0;
    right: 0;
    margin-bottom: 0;
}

.tlp-mega-menu__image-wrap a {
    display: inline-flex;
}

.tlp-mega-menu__image {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    border-style: solid;
    border-width: 5px;
    border-color: #fff;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 8px 24px rgba(31, 39, 52, .12);
    transition: transform .2s ease, box-shadow .2s ease;
}

.tlp-mega-menu__image-wrap a:hover .tlp-mega-menu__image,
.tlp-mega-menu__image-wrap a:focus-visible .tlp-mega-menu__image {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 12px 30px rgba(31, 39, 52, .16);
}

.tlp-mega-menu__title {
    margin: 0 0 16px;
    text-align: center;
    font: inherit;
    font-weight: 700;
    color: #172033;
}

.tlp-mega-menu__title a {
    color: inherit;
    text-decoration: none;
    transition: color .18s ease;
}

.tlp-mega-menu__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tlp-mega-menu__item {
    margin: 0;
    padding: 0;
    line-height: 1.35;
    color: #343b48;
}

.tlp-mega-menu__item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    transition: color .18s ease, transform .18s ease;
}

.tlp-mega-menu__item a:hover,
.tlp-mega-menu__item a:focus-visible {
    color: var(--tlp-card-accent);
    transform: translateX(2px);
}

.tlp-mega-menu--arrows .tlp-mega-menu__item a::after {
    content: '\203A';
    flex: 0 0 auto;
    font-size: 1.25em;
    line-height: 1;
    color: var(--tlp-card-accent);
}

.tlp-mega-menu--separators .tlp-mega-menu__item:not(:last-child) {
    padding-bottom: 10px;
    border-bottom: 1px solid #e7e7e1;
}

/* Pomost miedzy pozycja menu a panelem, zeby hover nie zrywal sie na malej szczelinie. */
.tlp-mega-menu__panel::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -24px;
    height: 24px;
}

@media (max-width: 1024px) {
    .tlp-mega-menu__panel {
        --tlp-grid-columns: 2;
        --tlp-auto-column-width: 260px;
    }

    .tlp-mega-menu__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .tlp-mega-menu__panel {
        --tlp-grid-columns: 1;
        --tlp-auto-column-width: 280px;
        max-height: calc(100vh - 24px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-top: 42px;
    }

    .tlp-mega-menu__grid {
        grid-template-columns: 1fr;
    }

    .tlp-mega-menu__card {
        padding-top: 50px;
    }
}

/* Zastepujemy standardowe podmenu tylko na pozycji wskazanej jako trigger. */
.tlp-mega-menu-trigger--replace > ul.sub-menu,
.tlp-mega-menu-trigger--replace > .sub-menu {
    display: none !important;
}
