/* =========================================================
   NAEKK HEADER

   Architecture:
   - 1024px and wider: one desktop header based on the 1920px layout;
   - below 1024px: one mobile header and full-screen mobile menu;
   - no intermediate compact-desktop rebuilds;
   - the calendar button is supported by CSS, but may remain commented in PHP.
   ========================================================= */

body.naekk-menu-open {
    overflow: hidden;
}

.site-header,
.site-header *,
.site-header *::before,
.site-header *::after,
.site-mobile-menu,
.site-mobile-menu *,
.site-mobile-menu *::before,
.site-mobile-menu *::after {
    box-sizing: border-box;
}

.site-header a,
.site-mobile-menu a {
    text-decoration: none;
}

.site-header__menu,
.site-header__submenu,
.site-mobile-menu__children {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* =========================================================
   DESKTOP HEADER — 1024px+
   Logical layout is always based on the 1920px desktop design.
   ========================================================= */

.site-header {
    --header-height: 95px;
    --header-container-width: 1440px;
    --header-logo-width: 154px;
    --header-logo-height: 37px;
    --header-logo-nav-gap: 56px;
    --header-menu-gap: 28px;
    --header-link-height: 27px;
    --header-dropdown-gap: 12px;

    position: sticky;
    top: 0;
    z-index: 1000;

    display: block;
    width: 100%;
    height: var(--header-height);
    margin: 0;

    overflow: visible;
    border-bottom: 1px solid #e7e7e7;
    background-color: #ffffff;
}

.site-header__container {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;
    column-gap: var(--header-logo-nav-gap);

    width: min(var(--header-container-width), calc(100% - 48px));
    height: var(--header-height);
    margin: 0 auto;

    overflow: visible;
}

.site-header__logo {
    display: block;
    flex: 0 0 var(--header-logo-width);
    width: var(--header-logo-width);
    height: var(--header-logo-height);

    line-height: 0;
    text-decoration: none;
}

.site-header__logo picture {
    display: block;
    width: 100%;
    height: 100%;
}

.site-header__logo-image {
    display: block;
    width: 100%;
    height: 100%;

    object-fit: contain;
    border: 0;
    outline: 0;
    box-shadow: none;
    background-color: transparent;
}

.site-header__nav {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-start;

    min-width: 0;
    height: var(--header-link-height);

    overflow: visible;
}

.site-header__menu {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: var(--header-menu-gap);

    width: max-content;
    max-width: none;
    height: var(--header-link-height);

    overflow: visible;
}

.site-header__item {
    position: relative;

    display: block;
    flex: 0 0 auto;

    margin: 0;
    padding: 0;

    overflow: visible;
}

.site-header__link {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    min-height: var(--header-link-height);
    margin: 0;
    padding: 0;

    color: #1c2331;
    font-family: var(--font-main, "Inter", Arial, sans-serif);
    font-size: 15px;
    font-style: normal;
    font-weight: 600;
    line-height: var(--header-link-height);
    letter-spacing: -0.01em;
    white-space: nowrap;

    cursor: pointer;
    transition: color 0.2s ease;
}

.site-header__link:visited {
    color: #1c2331;
}

.site-header__link:hover,
.site-header__item--dropdown:hover > .site-header__link,
.site-header__item--dropdown:focus-within > .site-header__link {
    color: #d2232a;
}

.site-header__link--disabled {
    color: #1c2331;
    cursor: default;
    pointer-events: none;
}

.site-header__link--dropdown-text {
    color: #1c2331;
    cursor: default;
    pointer-events: auto;
}

.site-header__arrow {
    display: block;
    flex: 0 0 10px;

    width: 10px;
    height: 6px;

    color: currentColor;
    transition: transform 0.2s ease;
}

.site-header__arrow path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.site-header__item--dropdown:hover .site-header__arrow,
.site-header__item--dropdown:focus-within .site-header__arrow {
    transform: rotate(180deg);
}

/* Transparent bridge prevents dropdown from closing while the cursor moves down. */
.site-header__item--dropdown::after {
    content: "";

    position: absolute;
    top: 100%;
    right: -20px;
    left: -20px;
    z-index: 1;

    display: block;
    height: var(--header-dropdown-gap);

    background: transparent;
    pointer-events: auto;
}

.site-header__submenu {
    position: absolute;
    top: calc(100% + var(--header-dropdown-gap));
    left: 50%;
    z-index: 20;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;

    width: max-content;
    min-width: 210px;
    max-width: 360px;
    padding: 16px 20px;

    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 14px 36px rgba(28, 35, 49, 0.16);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(8px);

    transition:
        opacity 0.16s ease,
        transform 0.16s ease,
        visibility 0s linear 0.16s;
}

.site-header__item--dropdown:hover > .site-header__submenu,
.site-header__item--dropdown:focus-within > .site-header__submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);

    transition-delay: 0s;
}

.site-header__submenu li {
    display: block;
    margin: 0;
    padding: 0;
}

.site-header__submenu a,
.site-header__submenu-link {
    display: block;

    color: #1c2331;
    font-family: var(--font-main, "Inter", Arial, sans-serif);
    font-size: 15px;
    font-style: normal;
    font-weight: 500;
    line-height: 22px;
    letter-spacing: -0.01em;
    white-space: nowrap;

    transition: color 0.2s ease;
}

.site-header__submenu a:visited {
    color: #1c2331;
}

.site-header__submenu a:hover {
    color: #d2232a;
}

.site-header__submenu-link--disabled {
    color: #1c2331;
    cursor: default;
    pointer-events: none;
}

.site-header__calendar {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;

    min-height: 51px;
    padding: 12px 32px;

    border: 0;
    border-radius: 10px;
    background-color: #d2232a;
    color: #ffffff;

    font-family: var(--font-main, "Inter", Arial, sans-serif);
    font-size: 15px;
    font-style: normal;
    font-weight: 900;
    line-height: 27px;
    white-space: nowrap;

    transition: background-color 0.2s ease;
}

.site-header__calendar:visited {
    color: #ffffff;
}

.site-header__calendar:hover {
    background-color: #b91f26;
    color: #ffffff;
}

.site-header__calendar:active {
    background-color: #a91c23;
}

.site-header__burger,
.site-mobile-menu {
    display: none;
}


/* =========================================================
   COMPACT DESKTOP — 1024px–1439px
   Небольшое уплотнение меню без перехода на мобильную шапку.
   ========================================================= */

@media (min-width: 1024px) and (max-width: 1439px) {
    .site-header {
        --header-logo-nav-gap: 40px;
        --header-menu-gap: 18px;
    }

    /*
     * В компактном desktop вся строка шапки собирается в одну
     * центрированную группу. Благодаря этому расстояния:
     * логотип → меню и меню → календарь одинаковые.
     */
    .site-header__container {
        display: flex;
        align-items: center;
        justify-content: center;
        column-gap: var(--header-logo-nav-gap);
    }

    .site-header__logo {
        flex: 0 0 var(--header-logo-width);
    }

    .site-header__nav {
        flex: 0 0 auto;
    }

    .site-header__menu {
        max-width: none;
    }

    .site-header__link {
        gap: 6px;
        font-size: 14px;
        letter-spacing: -0.012em;
    }

    .site-header__arrow {
        flex-basis: 9px;
        width: 9px;
    }

    .site-header__calendar {
        flex: 0 0 auto;
        justify-self: auto;

        min-height: 47px;
        padding: 10px 22px;
        font-size: 14px;
        line-height: 25px;
    }
}

/* =========================================================
   MOBILE HEADER — below 1024px
   ========================================================= */

@media (max-width: 1023px) {
    .site-header {
        --header-height: 60px;

        height: var(--header-height);
    }

    .site-header__container {
        display: flex;
        align-items: center;
        justify-content: space-between;

        width: calc(100% - 40px);
        height: var(--header-height);
    }

    .site-header__logo {
        flex: 0 0 208px;
        width: 208px;
        height: 30px;
    }

    .site-header__logo-image {
        width: 208px;
        height: 30px;
    }

    .site-header__nav,
    .site-header__calendar {
        display: none;
    }

    .site-header__burger {
        display: inline-flex;
        flex: 0 0 30px;
        align-items: center;
        justify-content: center;

        width: 30px;
        height: 30px;
        padding: 0;

        border: 0;
        appearance: none;
        background-color: transparent;
        color: #1c2331;

        cursor: pointer;
    }

    .site-header__burger svg,
    .site-mobile-menu__close svg {
        display: block;
        width: 30px;
        height: 30px;
    }

    .site-header__burger path,
    .site-mobile-menu__close path {
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
    }

    .site-mobile-menu {
        position: fixed;
        inset: 0;
        z-index: 2000;

        display: block;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;

        overflow-x: hidden;
        overflow-y: auto;
        background-color: #1c2331;

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transition:
            opacity 0.3s linear,
            visibility 0s linear 0.3s;
    }

    body.naekk-menu-open .site-mobile-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        transition-delay: 0s;
    }

    .site-mobile-menu__header {
        position: sticky;
        top: 0;
        z-index: 2;

        display: flex;
        align-items: center;
        justify-content: space-between;

        width: 100%;
        height: 60px;
        padding: 0 20px;

        border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
        background-color: #1c2331;
    }

    .site-mobile-menu__logo {
        display: block;
        width: 208px;
        height: 30px;

        line-height: 0;
    }

    .site-mobile-menu__logo img {
        display: block;
        width: 208px;
        height: 30px;

        object-fit: contain;
        border: 0;
        outline: 0;
        box-shadow: none;
        background-color: transparent;
    }

    .site-mobile-menu__close {
        display: inline-flex;
        flex: 0 0 30px;
        align-items: center;
        justify-content: center;

        width: 30px;
        height: 30px;
        padding: 0;

        border: 0;
        appearance: none;
        background-color: transparent;
        color: #ffffff;

        cursor: pointer;
    }

    .site-mobile-menu__content {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 28px;

        width: 100%;
        padding: 22px 20px 40px;
    }

    .site-mobile-menu__links {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;

        width: 100%;
    }

    .site-mobile-menu__group {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .site-mobile-menu__title {
        display: block;

        color: #ffffff;
        font-family: var(--font-display, "Bebas Neue Cyrillic", "Bebas Neue", "Arial Narrow", Arial, sans-serif);
        font-size: 24px;
        font-style: normal;
        font-weight: 400;
        line-height: 29px;
        letter-spacing: 0;
    }

    .site-mobile-menu__title:visited,
    .site-mobile-menu__title--disabled {
        color: #ffffff;
    }

    .site-mobile-menu__title--disabled {
        cursor: default;
        pointer-events: none;
    }

    .site-mobile-menu__children {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;

        margin-top: 10px;
    }

    .site-mobile-menu__children li {
        display: block;
        margin: 0;
        padding: 0;
    }

    .site-mobile-menu__children a,
    .site-mobile-menu__child-disabled {
        display: block;

        color: rgba(255, 255, 255, 0.86);
        font-family: var(--font-main, "Inter", Arial, sans-serif);
        font-size: 14px;
        font-style: normal;
        font-weight: 500;
        line-height: 22px;
    }

    .site-mobile-menu__children a:visited {
        color: rgba(255, 255, 255, 0.86);
    }

    .site-mobile-menu__children a:hover {
        color: #ffffff;
    }

    .site-mobile-menu__child-disabled {
        cursor: default;
        pointer-events: none;
    }

    .site-mobile-menu__calendar {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        width: 100%;
        min-height: 37px;
        padding: 8px 22px;

        border-radius: 6px;
        background-color: #d2232a;
        color: #ffffff;

        font-family: var(--font-main, "Inter", Arial, sans-serif);
        font-size: 13px;
        font-style: normal;
        font-weight: 800;
        line-height: 21px;
        text-align: center;
        white-space: nowrap;
    }
}

@media (max-width: 374px) {
    .site-header__container {
        width: calc(100% - 32px);
    }

    .site-header__logo,
    .site-header__logo-image,
    .site-mobile-menu__logo,
    .site-mobile-menu__logo img {
        width: 188px;
        height: auto;
    }

    .site-header__logo {
        flex-basis: 188px;
    }
}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.site-header__link:focus-visible,
.site-header__calendar:focus-visible,
.site-header__burger:focus-visible {
    outline: 2px solid #d2232a;
    outline-offset: 3px;
}

.site-mobile-menu a:focus-visible,
.site-mobile-menu__close:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .site-header__link,
    .site-header__arrow,
    .site-header__submenu,
    .site-header__calendar,
    .site-mobile-menu {
        transition-duration: 0.01ms;
    }
}




/* =========================================================
   HEADER: clickable dropdown parent links
   ========================================================= */

.site-header__link[href],
.site-header__link--dropdown-text[href],
.site-header__item--dropdown > a.site-header__link {
    cursor: pointer;
}

.site-header__link[href] span,
.site-header__link--dropdown-text[href] span,
.site-header__link[href] svg,
.site-header__link--dropdown-text[href] svg {
    cursor: pointer;
}

.site-header__submenu a {
    cursor: pointer;
}