.mega-menu {
    position: relative;
    display: inline-block;
}

.mega-menu .btn-header-catalog {
    border: 1px solid #0052a6;
    color: white;
    background-color: #0052a6;
    font-size: 0.825rem;
    border-radius: 10px;
    padding: 12px 16px;
    line-height: inherit;
    display: flex;
    align-items: center;
    height: 44px;
    justify-content: center;
    transition: all .4s;
    text-decoration: none;
    cursor: pointer;
}

.mega-menu .btn-header-catalog:hover {
    background-color: #034486;
    color: white;
    text-decoration: none;
}

.mega-menu .btn-header-catalog span.btn-header-catalog-text {
    font-size: 15px;
    text-transform: uppercase;
    line-height: 18px;
    margin-left: 2px;
    font-weight: 500;
}

.mega-menu .btn-header-catalog span.animated-burger-icon {
    width: 18px;
    height: 12px;
    position: relative;
    display: inline-block;
    margin-right: 8px;
}

.mega-menu .btn-header-catalog span.animated-burger-icon:before,
.mega-menu .btn-header-catalog span.animated-burger-icon:after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: white;
    transition: all .4s;
}

.mega-menu .btn-header-catalog span.animated-burger-icon:before {
    top: 0;
}

.mega-menu .btn-header-catalog span.animated-burger-icon:after {
    bottom: 0;
}

.mega-menu .btn-header-catalog span.animated-burger-icon {
    width: 18px;
    height: 2px;
    background-color: white;
    position: relative;
    display: inline-block;
    margin-right: 8px;
}

.mega-menu .btn-header-catalog.show span.animated-burger-icon {
    background-color: transparent;
}

.mega-menu .btn-header-catalog.show span.animated-burger-icon:before {
    width: 13px;
    top: 0;
    left: 0;
    transform: rotate(45deg);
}

.mega-menu .btn-header-catalog.show span.animated-burger-icon:after {
    width: 13px;
    top: 0;
    left: 0;
    transform: rotate(-45deg);
}

.mega-menu__overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mega-menu__overlay.active {
    display: block;
    opacity: 1;
}

.mega-menu__dropdown {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    z-index: 10000;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
}

.mega-menu__dropdown.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.header-js-sticky .mega-menu__dropdown {
    top: 64px;
    height: calc(100vh - 64px);
}

.mega-menu__container {
    display: flex;
    min-height: 100%;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

.mega-menu__sidebar {
    width: 300px;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

.mega-menu__sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #0052a6;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mega-menu__sidebar-header:hover {
    background: #004085;
}

.mega-menu__sidebar-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.mega-menu__close {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.mega-menu__close:hover {
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.mega-menu__close-icon {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
}

.mega-menu__close-icon:before,
.mega-menu__close-icon:after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.mega-menu__close-icon:before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.mega-menu__close-icon:after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.mega-menu__close:hover .mega-menu__close-icon:before,
.mega-menu__close:hover .mega-menu__close-icon:after {
    background-color: #f0f0f0;
}

.mega-menu__sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

.mega-menu__sidebar-item {
    border-bottom: 1px solid #d0d7e0;
}

.mega-menu__sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: #252525;
    text-decoration: none;
    transition: all 0.2s ease;
    background: transparent;
}

.mega-menu__sidebar-item--active .mega-menu__sidebar-link,
.mega-menu__sidebar-link:hover {
    background: #f7f7f7;
    color: #252525;
}

.mega-menu__sidebar-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.mega-menu__sidebar-item--active .mega-menu__sidebar-icon,
.mega-menu__sidebar-link:hover .mega-menu__sidebar-icon {
    filter: brightness(0) invert(1);
}

.mega-menu__sidebar-text {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
}

.mega-menu__content {
    flex: 1;
    padding: 30px 40px;
    overflow-y: auto;
    background: #fff;
}

.mega-menu__category-panel {
    display: none;
}

.mega-menu__category-panel--active {
    display: block;
}

.mega-menu__widgets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e5e9f2;
}

.mega-menu__widget {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e5e9f2;
}

.mega-menu__widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #0052a6;
}

.mega-menu__widget-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.mega-menu__widget-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mega-menu__widget-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.mega-menu__widget-content {
    padding: 15px;
}

.mega-menu__widget-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.mega-menu__widget-description {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.mega-menu__columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.mega-menu__column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mega-menu__category-item {
    margin-bottom: 0;
}

.mega-menu__category-link {
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
    color: #252525;
    margin-bottom: 12px;
    transition: color 0.2s ease;
}

.mega-menu__category-link:hover {
    color: #0052a6;
}

.mega-menu__category-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.mega-menu__category-count {
    font-size: 14px;
    font-weight: 400;
    color: #666;
}

.mega-menu__category-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
    margin-top: 8px;
}

.mega-menu__category-subitem {
    margin-bottom: 8px;
}

.mega-menu__category-sublink {
    display: block;
    padding: 6px 0;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.mega-menu__category-sublink:hover {
    color: #0052a6;
    padding-left: 8px;
}

.mega-menu__empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

@media (max-width: 1200px) {
    .mega-menu__columns {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .mega-menu__sidebar {
        width: 250px;
        min-width: 250px;
    }

    .mega-menu__widgets {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .mega-menu__container {
        flex-direction: column;
    }

    .mega-menu__sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 200px;
    }

    .mega-menu__columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mega-menu__content {
        padding: 20px;
    }

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