/* Кнопка «Услуги» в навбаре */
.site-header__menu-item--services {
    order: -1;
    margin-right: 8px;
}

.site-header__menu-link--services {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px 8px 14px;
    border: none;
    border-radius: var(--header-radius-pill, 999px);
    background: var(--header-accent, #4a8c88);
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.site-header__menu-link--services:hover,
.site-header__menu-link--services.is-open {
    background: var(--header-accent-dark, #3d7572);
    color: #ffffff !important;
}

.site-header__services-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.site-header__nav {
    position: relative;
    z-index: 110;
}

/* Мега-меню */
.services-mega {
    --services-mega-top: 140px;

    position: fixed;
    inset: var(--services-mega-top) 0 0 0;
    z-index: 105;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.services-mega.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.services-mega__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30, 40, 40, 0.35);
}

.services-mega__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.services-mega__sidebar {
    flex-shrink: 0;
    width: min(320px, 32vw);
    background: #f4f6f6;
    border-right: 1px solid #e8ecec;
    overflow-y: auto;
}

.services-mega__categories {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.services-mega__category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 14px 20px 14px 24px;
    border: none;
    border-right: 3px solid transparent;
    background: transparent;
    color: #4a4a4a;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.services-mega__category:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--header-text, #333333);
}

.services-mega__category.is-active {
    background: #ffffff;
    border-right-color: var(--header-accent, #4a8c88);
    color: var(--header-accent, #4a8c88);
    font-weight: 600;
}

.services-mega__category-arrow {
    display: flex;
    color: currentColor;
    opacity: 0.5;
}

.services-mega__category.is-active .services-mega__category-arrow {
    opacity: 1;
    color: var(--header-accent, #4a8c88);
}

.services-mega__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 28px 40px 40px;
    overflow-y: auto;
}

.services-mega__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.services-mega__title {
    margin: 0;
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    line-height: 1.2;
    color: var(--header-text, #333333);
}

.services-mega__title.is-hidden {
    display: none;
}

.services-mega__close {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border: none;
    background: none;
    color: #8a8a8a;
    font-size: 13px;
    font-weight: 500;
    text-transform: lowercase;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.services-mega__close:hover {
    color: var(--header-text, #333333);
}

.services-mega__subpanel {
    display: none;
    flex: 1;
    flex-direction: column;
}

.services-mega__subpanel.is-active {
    display: flex;
}

.services-mega__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 48px;
    column-gap: 48px;
}

.services-mega__links-item {
    margin: 0;
    border-bottom: 1px solid #efefef;
}

.services-mega__link {
    display: block;
    padding: 16px 0;
    color: var(--header-text, #333333);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
    transition: color 0.2s ease;
}

.services-mega__link:hover {
    color: var(--header-accent, #4a8c88);
}

.services-mega__all {
    display: inline-flex;
    margin-top: 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--header-accent, #4a8c88);
    text-decoration: none;
}

.services-mega__all:hover {
    color: var(--header-accent-dark, #3d7572);
}

body.services-mega-open {
    overflow: hidden;
}

body.services-mega-open .site-header {
    z-index: 120;
}

/* Мобильное аккордеон-меню услуг */
.site-header__menu-item--services-mobile {
    margin: 0 -20px;
}

.site-header__mobile-menu {
    display: flex;
    flex-direction: column;
}

.site-header__mobile-menu .site-header__menu-link--services-mobile {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0;
    background: var(--header-accent, #4a8c88);
    color: #ffffff !important;
    font-size: 18px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.site-header__mobile-menu .site-header__menu-link--services-mobile[aria-expanded="true"] {
    background: var(--header-accent-dark, #3d7572);
}

.site-header__mobile-services {
    padding: 0 20px 8px 28px;
}

.site-header__mobile-services-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-header__mobile-services-item + .site-header__mobile-services-item {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.site-header__mobile-services-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 0;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--header-text, #333333);
    text-align: left;
    cursor: pointer;
}

.site-header__mobile-services-category--link {
    display: block;
    text-decoration: none;
}

.site-header__mobile-services-category--link:hover {
    color: var(--header-accent, #4a8c88);
}

.site-header__mobile-services-category[aria-expanded="true"] .site-header__services-chevron {
    transform: rotate(-135deg);
    margin-top: 4px;
}

.site-header__services-chevron {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.site-header__mobile-services-children {
    list-style: none;
    margin: 0;
    padding: 0 0 8px 12px;
}

.site-header__mobile-services-children a {
    display: block;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 500;
    color: #6d6d6d;
    text-decoration: none;
}

.site-header__mobile-services-children a:hover {
    color: var(--header-accent, #4a8c88);
}

.site-header__mobile-services-parent {
    font-weight: 600;
    color: var(--header-text, #333333) !important;
}

.site-header__mobile-services-parent:hover {
    color: var(--header-accent, #4a8c88) !important;
}

@media (max-width: 991px) {
    .services-mega {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .services-mega__links {
        grid-template-columns: 1fr;
    }

    .services-mega__content {
        padding: 20px 20px 32px;
    }

    .services-mega__sidebar {
        width: min(260px, 40vw);
    }
}

@media (prefers-reduced-motion: reduce) {
    .services-mega {
        transition: none;
    }
}
