.header-menu { margin-left: auto; margin-right: auto; }
/* ============================================
   Шапка сайта
   ============================================ */
.site-header {
    background-color: var(--color-white);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    overflow: visible;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

/* Простой блок шапки с фоном и скруглением */
.header-box {
    background: #152333;
    border-radius: 0.3125rem; /* 5px */
    overflow: visible;
}

/* Внутренний контейнер шапки фиксированной ширины */
.header-inner {
    max-width: 87.5%; /* 1120px / 1280px */
    margin: 0 auto;
    overflow: visible;
}

/* Основная строка хедера */
.header-row {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* 24px */
    padding: 0.875rem 0; /* 14px */
    overflow: visible;
}
.site-name { color: #fff; font-weight: 700; font-size: 1.375rem; letter-spacing: 0.0625rem; display: none; }
/* Мобильный второй ряд по умолчанию скрыт на ПК */
.header-mobile-secondary { display: none; }

.logo img {
    display: block;
    height: 1.75rem; /* 28px */
    transition: opacity 0.2s ease;
}

.logo:hover img { opacity: 0.95; }

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 1.75rem; /* 28px */
    align-items: center;
}

.main-nav a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600; /* SemiBold */
    font-size: 0.875rem; /* 14px */
    line-height: 120%;
    padding: 0.375rem 0; /* 6px */
    transition: color 0.2s ease, opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.main-nav a[aria-current="page"] {
    color: var(--color-primary);
}

.main-nav a:hover { color: var(--color-primary); opacity: 1; text-decoration: none; }

/* Dropdown (только в хедере) */
.main-nav .has-dropdown { 
    position: relative; 
    display: flex;
    align-items: center;
}
/* Невидимая безопасная зона между пунктом и выпадающим блоком */
.main-nav .has-dropdown::after {
    content: "";
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    height: 0.75rem; /* 12px - совпадает с зазором появления dropdown */
}
.main-nav .dropdown-toggle { 
    display: inline-flex; 
    align-items: center; 
    gap: 0.5rem; /* 8px */
    padding: 0.375rem 0; /* 6px */
    line-height: 120%;
    height: auto;
}
.main-nav .menu-arrow { width: 0.5625rem; height: 0.375rem; display: inline-block; transition: transform 0.25s ease; background-color: currentColor; -webkit-mask: url('/assets/images/arrowMenu.svg') no-repeat center / contain; mask: url('/assets/images/arrowMenu.svg') no-repeat center / contain; }
.main-nav .has-dropdown:hover > .dropdown-toggle { color: var(--color-primary); }
.main-nav .has-dropdown:hover > .dropdown-toggle .menu-arrow { transform: rotate(180deg); }
.main-nav .has-dropdown .dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    transform: translateY(0.75rem); /* 12px */
    min-width: 20rem; /* 320px */
    background: #ffffff;
    color: var(--color-dark-blue);
    border-radius: 0.625rem; /* 10px */
    border: 1px solid rgba(21, 35, 51, 0.08);
    box-shadow: 0 0.75rem 1.75rem rgba(0, 0, 0, 0.18);
    padding: 0.625rem 0; /* 10px */
    display: block; /* переопределяем flex у .main-nav ul */
    list-style: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1001;
}
.main-nav .has-dropdown:hover .dropdown { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0.75rem); }
.main-nav .dropdown li { padding: 0; }
.main-nav .dropdown li + li { border-top: 1px solid rgba(21, 35, 51, 0.06); }
.main-nav .dropdown a { display: block; padding: 0.625rem 1rem; color: #152333; font-family: 'Montserrat', sans-serif; font-weight: 500; font-size: 0.75rem; line-height: 120%; letter-spacing: 0; }
.main-nav .dropdown a:hover { background: rgba(21, 35, 51, 0.04); color: var(--color-primary); text-decoration: none; }

.header-contacts {
    margin-left: 1.5rem; /* 24px */
    display: flex;
    gap: 1.5rem; /* 24px */
}

.header-contacts a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 600; /* SemiBold */
    font-size: 0.875rem; /* 14px */
    line-height: 120%;
    text-align: center;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.header-contacts a:hover { color: var(--color-primary); opacity: 1; }

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem; /* 10px */
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0.5rem; /* 8px */
    padding: 0.625rem 1rem; /* 10px 16px */
    text-decoration: none;
    font-weight: 600; /* SemiBold */
    font-size: 0.75rem; /* 12px */
    line-height: 120%;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.header-btn:hover { border-color: var(--color-primary); background-color: transparent; color: var(--color-primary); text-decoration: none; }

/* Иконка карты сайта (SVG) */
.icon-sitemap {
    width: 0.9375rem; /* 15px */
    height: 0.9375rem; /* 15px */
    display: inline-block;
    transition: opacity 0.3s ease;
}

.header-btn:hover .icon-sitemap { opacity: 1; }

.mobile-menu-toggle {
    background: transparent;
    border: 0;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem; /* 8px */
    transition: opacity 0.3s ease;
}

.mobile-menu-toggle img {
    width: 1.8125rem; /* 29px */
    height: 1rem; /* 16px */
    display: block;
}

.mobile-menu-toggle:hover { opacity: 0.85; }

/* Насильно показываем бургер справа при любых старых правилах */
.header-row .mobile-menu-toggle { display: block }

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--color-primary);
}

.logo a {
    text-decoration: none;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600; /* SemiBold */
    font-size: 14px;
    line-height: 120%;
    padding: 6px 0;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.main-nav a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--color-dark-blue);
    transition: all 0.3s ease;
}

.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    background-color: #152333;
    padding: 16px 20px 24px;
    z-index: 1200;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu ul {
    list-style: none;
}

.mobile-menu li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-light-gray);
}

.mobile-menu a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 16px;
}
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.mobile-site-name {
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}

.mobile-menu-close {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-list { list-style: none; padding: 0; margin: 8px 0 16px; }
.mobile-menu-list li + li { margin-top: 10px; }

.mobile-cta { width: 100%; justify-content: center; }

.mobile-menu a:hover { color: var(--color-primary); }

.mobile-contacts {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 12px 0 16px;
}

.mobile-contacts a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    text-decoration: none;
}

.mobile-contacts a:hover { color: var(--color-primary); }

/* ============================================
   Адаптив для планшета (768px - 1024px)
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .header-inner {
        max-width: 90%;
    }
    
    .header-row {
        gap: 1.25rem; /* Уменьшаем отступы */
        padding: 0.75rem 0;
    }
    
    .main-nav ul {
        gap: 1.25rem; /* Уменьшаем отступы в меню */
    }
    
    .main-nav a {
        font-size: 0.8125rem; /* 13px */
    }
    
    .header-contacts {
        margin-left: 1rem;
        gap: 1rem;
    }
    
    .header-contacts a {
        font-size: 0.8125rem; /* 13px */
        white-space: nowrap;
    }
    
    .header-btn {
        padding: 0.5rem 0.875rem; /* Уменьшаем padding */
        font-size: 0.6875rem; /* 11px */
        gap: 0.5rem;
    }
    
    .logo img {
        height: 1.5rem; /* 24px */
    }
    
    .main-nav .has-dropdown .dropdown {
        min-width: 18rem; /* 288px */
    }
}

@media (max-width: 768px) {
    .header-inner { max-width: 100%; }
    /* На мобилке фон шапки на 100%, а внутренние поля по 10px */
    .site-header .container-fluid { width: 100%; padding: 0; margin: 0; }
    .site-header .header-box { padding: 0 0.625rem; border-radius: 0; }
    .mobile-menu-toggle { margin-left: auto; }
    .header-row .header-menu,
    .header-row .header-contacts,
    .header-row .header-btn { display: none; }

    .site-name { display: block; font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 1.25rem; line-height: 120%; letter-spacing: 0; }
    .header-mobile-secondary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.625rem 0 0.875rem; }
    .header-mobile-secondary .header-contacts { margin-left: 0; gap: 1.5rem; }
    .header-mobile-secondary .header-btn {
        padding: 0.625rem 1rem;
        font-family: 'Inter', sans-serif;
        font-weight: 500;
        font-size: 0.625rem;
        line-height: 120%;
        letter-spacing: 0;
        text-align: center;
    }

    /* Размер логотипа на мобильной версии */
    .site-header .logo img { width: 3.75rem; height: 1.875rem; }

    /* Типографика контактов на мобильной версии */
    .header-mobile-secondary .header-contacts a {
        font-family: 'Montserrat', sans-serif;
        font-weight: 500;
        font-size: 0.75rem;
        line-height: 120%;
        letter-spacing: 0;
        text-align: center;
    }

    /* Отключаем сглаживание шрифтов и ставим единый межстрочный интервал 120% в мобильной шапке и модалке */
    .site-header,
    .mobile-modal-content {
        -webkit-font-smoothing: auto;
        -moz-osx-font-smoothing: auto;
        text-rendering: optimizeSpeed;
    }
    .site-header, .site-header * { line-height: 120%; }
    .mobile-modal-content, .mobile-modal-content * { line-height: 120%; }

    .mobile-menu-toggle { display: flex; }
    .mobile-menu { display: none; }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* Мобильное модальное меню */
.mobile-modal { position: fixed; left: 0; right: 0; top: 0; bottom: 0; display: block; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; z-index: 1200; overflow: hidden; }
.mobile-modal.open { opacity: 1; pointer-events: auto; }
.mobile-modal-content { position: absolute; left: 0; right: 0; top: 0; bottom: 0; background: #ffffff; padding: 14px 10px 20px; border-top: 1px solid rgba(21,35,51,0.1); overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; transform: translateY(-8px); transition: transform 0.25s ease; }
.mobile-modal.open .mobile-modal-content { transform: translateY(0); }

/* Десктопная версия модального окна с ограничением ширины */
@media (min-width: 769px) {
    .mobile-modal {
        bottom: auto;
    }
    
    .mobile-modal-content {
        left: 50%;
        right: auto;
        top: 0;
        bottom: auto;
        width: 77.5rem; /* 1240px */
        max-width: 95vw; /* Ограничиваем ширину на планшете */
        padding: 1.25rem; /* 20px */
        transform: translateX(-50%);
        border-radius: 0 0 0.625rem 0.625rem;
        box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
        display: flex;
        justify-content: center;
        align-items: flex-start;
        overflow-y: auto;
        overflow-x: hidden;
        max-height: 90vh;
        box-sizing: border-box;
    }
    
    @media (min-width: 769px) and (max-width: 1024px) {
        .mobile-modal-content {
            width: 95vw;
            max-width: 95vw;
            padding: 1rem;
        }
    }
    .mobile-modal.open .mobile-modal-content {
        transform: translateX(-50%);
    }
    .mobile-modal-inner {
        max-width: 1120px;
        width: 100%;
        margin: 0 auto;
    }
    .mm-sections {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 40px;
        align-items: flex-start;
        width: 100%;
        max-width: 1120px;
    }
    
    .mm-section {
        width: 100%;
    }
    
    /* Обертка для второй колонки (Услуги + О компании) */
    .mm-column-wrapper {
        display: flex;
        flex-direction: column;
        gap: 40px;
    }
    
    /* Скрываем секцию "О компании" отдельно, она теперь внутри обертки */
    .mm-section:not([data-section]):not([data-column]):not([data-section="epb"]):not([data-section="services"]):not([data-section="about"]):not([data-section="contacts"]):not([data-section="articles"]) {
        display: none;
    }
    
    /* Скрываем epb и articles, если они не внутри обертки */
    .mm-sections > .mm-section[data-section="epb"],
    .mm-sections > .mm-section[data-section="articles"] {
        display: none;
    }
    
    /* Первая колонка: Экспертиза промбезопасности + Статьи */
    .mm-column-wrapper[data-column="epb-articles"] {
        grid-column: 1;
        display: flex;
        flex-direction: column;
    }
    
    .mm-column-wrapper[data-column="epb-articles"] .mm-section[data-section="articles"] {
        margin-top: 40px;
    }
    
    /* Вторая колонка: Услуги + О компании */
    .mm-column-wrapper[data-column="services-about"] {
        grid-column: 2;
    }
    
    .mm-column-wrapper[data-column="services-about"] .mm-section[data-section="about"] {
        margin-top: 40px;
    }
    
    /* Третья колонка: Контакты - уменьшенный блок */
    .mm-section[data-section="contacts"] {
        grid-column: 3;
        max-width: 240px;
    }
    
    /* Скрываем все toggle на ПК и показываем секции открытыми */
    .mm-section .mm-section-toggle {
        display: block;
        padding: 0;
        margin-bottom: 20px;
        cursor: default;
        pointer-events: none;
        border: none;
        background: transparent;
    }
    
    .mm-section .mm-section-toggle .mm-arrow {
        display: none;
    }
    
    .mm-section .mm-section-body {
        display: block !important;
        max-height: none !important;
        opacity: 1 !important;
    }
    
    /* Стили заголовков для всех секций на ПК */
    .mm-section .mm-title {
        font-family: 'Montserrat', sans-serif;
        font-weight: 700;
        font-style: normal;
        font-size: 22px;
        line-height: 120%;
        color: #152333;
        margin: 0 0 40px 0;
    }
    
    /* Отступ между секциями внутри обертки */
    .mm-column-wrapper .mm-section {
        margin-bottom: 0;
    }
    
    
    /* Стили для списков на ПК */
    .mm-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .mm-list li {
        font-family: 'Montserrat', sans-serif;
        font-weight: 500;
        font-style: normal;
        font-size: 14px;
        line-height: 140%;
        color: #152333;
        padding: 8px 0;
        transition: color 0.2s ease;
    }
    
    .mm-list li:hover {
        color: #E60012;
    }
    
    /* Все ссылки в списке выглядят как обычный текст */
    .mm-list li a {
        color: inherit;
        text-decoration: none;
        transition: color 0.3s ease;
    }
    
    .mm-list li a:hover {
        color: inherit;
        text-decoration: none;
    }
    
    /* Исключение для внешней ссылки sudexp.org */
    .mm-list li a.mm-link-external {
        color: #E60012;
        text-decoration: underline;
        transition: color 0.3s ease;
    }
    
    .mm-list li a.mm-link-external:hover {
        color: #152333;
        text-decoration: underline;
    }
    
    /* Ссылки внутри текста (inline) тоже как обычный текст */
    .mm-list li a.mm-link-inline {
        color: inherit;
        text-decoration: none;
    }
    
    .mm-list li a.mm-link-inline:hover {
        color: inherit;
        text-decoration: none;
    }
    
    /* Стили для секции контактов на ПК */
    
    .mm-section[data-section="contacts"] .mm-contact-label {
        display: flex;
        align-items: center;
        gap: 12px;
        font-family: 'Montserrat', sans-serif;
        font-weight: 500;
        font-size: 14px;
        line-height: 120%;
        color: #152333;
        padding: 0;
        margin-bottom: 8px;
    }
    
    .mm-section[data-section="contacts"] .mm-contact-label img {
        width: 20px;
        height: 20px;
        filter: brightness(0) saturate(100%) invert(13%) sepia(94%) saturate(7158%) hue-rotate(353deg) brightness(92%) contrast(91%);
    }
    
    .mm-section[data-section="contacts"] .mm-contact-value {
        font-family: 'Montserrat', sans-serif;
        font-weight: 600;
        font-size: 16px;
        line-height: 120%;
        color: #152333;
        padding: 0;
        margin-bottom: 20px;
        display: block;
    }
    
    .mm-section[data-section="contacts"] .mm-contact-text {
        font-family: 'Montserrat', sans-serif;
        font-weight: 500;
        font-size: 14px;
        line-height: 140%;
        color: #152333;
        padding: 0;
        margin-bottom: 15px;
    }
    
    .mm-section[data-section="contacts"] .mm-button {
        width: auto;
        padding: 12px 24px;
        margin: 0 0 20px 0;
        font-size: 12px;
        background: #FFFFFF;
        border: 1px solid #91A2B8;
        color: #152333;
    }
    
    .mm-section[data-section="contacts"] .mm-link {
        font-size: 14px;
        margin-top: 0;
    }
}
.mobile-modal-close { display: none; }
.mm-sections { margin-top: 8px; }
.mm-section + .mm-section { margin-top: 8px; }
.mm-section-toggle { width: 100%; background: transparent; border: 0; color: var(--color-dark-blue); font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 18px; line-height: 120%; letter-spacing: 0; padding: 10px 0; display: flex; align-items: center; justify-content: space-between; text-align: left; transition: color 0.2s ease; }
.mm-title { color: var(--color-dark-blue); font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 18px; line-height: 120%; letter-spacing: 0; text-align: left; }
.mm-arrow { width: 15px; height: 8px; background-color: currentColor; -webkit-mask: url('/assets/images/arrowMenu.svg') no-repeat center/contain; mask: url('/assets/images/arrowMenu.svg') no-repeat center/contain; transition: transform 0.25s ease; }

/* Красный цвет только на мобильной версии */
@media (max-width: 768px) {
    .mm-section.is-open > .mm-section-toggle { color: var(--color-primary); }
    .mm-section.is-open > .mm-section-toggle .mm-title { color: var(--color-primary); }
}

.mm-section.is-open > .mm-section-toggle .mm-arrow { transform: rotate(180deg); }
.mm-section-body { display: block; max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.3s ease, opacity 0.3s ease; }
.mm-section.is-open > .mm-section-body { max-height: 1000px; opacity: 1; }
.mm-list { list-style: none; padding: 0; margin: 0; }
.mm-list li { color: var(--color-dark-blue); font-size: 12px; font-weight: 500; padding: 6px 0; transition: color 0.2s ease; }

/* Все ссылки в списке выглядят как обычный текст (мобильная версия) */
.mm-list li a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mm-list li a:hover {
    color: inherit;
    text-decoration: none;
}

/* Исключение для внешней ссылки sudexp.org */
.mm-list li a.mm-link-external {
    color: var(--color-primary);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.mm-list li a.mm-link-external:hover {
    color: var(--color-dark-blue);
    text-decoration: underline;
}

/* Ссылки внутри текста (inline) тоже как обычный текст */
.mm-list li a.mm-link-inline {
    color: inherit;
    text-decoration: none;
}

.mm-list li a.mm-link-inline:hover {
    color: inherit;
    text-decoration: none;
}
.mm-contact { display: flex; align-items: center; gap: 8px; color: var(--color-dark-blue); font-weight: 600; font-size: 12px; padding: 6px 0; }
.mm-contact img { width: 18px; height: 18px; }
.mm-contact-label { display: flex; align-items: center; gap: 8px; color: var(--color-dark-blue); font-family: 'Montserrat', sans-serif; font-weight: 500; font-size: 14px; line-height: 120%; letter-spacing: 0; padding: 8px 0 4px; }
.mm-contact-label img { width: 18px; height: 18px; }
.mm-contact-value { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 18px; line-height: 120%; color: var(--color-dark-blue); padding: 2px 0 10px; }
.mm-contact-text { color: var(--color-dark-blue); font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 12px; line-height: 120%; letter-spacing: 0; padding: 4px 0 10px; }
.mm-accent { color: var(--color-primary); text-decoration: none; }
.mm-button {
    display: block;
    width: 250px;
    text-align: center;
    color: var(--color-dark-blue);
    border: 1px solid var(--color-dark-blue);
    background: transparent;
    border-radius: 5px;
    padding: 12px 16px;
    margin: 12px 0;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 12px;
    line-height: 120%;
    letter-spacing: 0;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.mm-button:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    text-decoration: none;
}
.mm-link { display: inline-flex; align-items: center; gap: 8px; color: var(--color-dark-blue); text-decoration: underline; font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 14px; line-height: 120%; letter-spacing: 0; }
.mm-link:hover { color: var(--color-primary); }
.mm-link-arrow::after { content: ""; width: 10px; height: 10px; display: inline-block; background-color: currentColor; -webkit-mask: url('/assets/images/arrowMob.svg') no-repeat center/contain; mask: url('/assets/images/arrowMob.svg') no-repeat center/contain; }

