.header {
    padding: 40px 8px 0 8px;
    width: 100%;
    margin: auto;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 14;
}

@media screen and (max-width: 750px) {
    .header.header_show-nav .header__line {
        background: #403C68;
        padding: 6px 16px;
    }
}

.header * {
    transition: 0.2s all;
}

.header__line {
    margin: auto;
    max-width: 1360px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 40px;
    position: relative;
}

.header__nav {
    display: flex;
}

.header__nav-list {
    display: flex;
    list-style: none;
    position: relative;
}

.header__nav-list::before {
    content: "";
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
    height: 2px;
    background-color: #f5f4eb;
    top: calc(50% - 1px);
    left: 0;
    position: absolute;
}

.header__nav-list li {
    cursor: pointer;
    margin-left: 50px;
    padding: 10px 36px;
    background: #f5f4eb;
    border-radius: 100px;
    transition:
        box-shadow 0.2s,
        transform 0.2s;
}

.header__nav-item {
    position: relative;
}
.header__nav-list li:first-child {
    margin-left: 0;
}

.share-buttons {
    display: flex;
    gap: 12px;
    flex-direction: row-reverse;
}

.buttons-sharer__list {
    display: flex; /* Для того чтобы анимация opacity работала, элемент должен быть видимым изначально */
    align-items: center;
    gap: 10px;
    opacity: 0; /* Начальная прозрачность */
    transition: opacity 0.3s ease; /* Плавный переход с длительностью 0.3 секунды */
    pointer-events: none; /* Элемент не будет реагировать на события мыши, когда невидим */
}

.share-buttons:hover .buttons-sharer__list {
    opacity: 1; /* При наведении прозрачность становится 1, элемент становится видимым */
    pointer-events: auto; /* Включаем обработку событий мыши при видимом элементе */
}

.button-sharer-main.clicked .buttons-sharer__list {
    opacity: 1; /* При активации класса .clicked также делаем элемент видимым */
}

.header .button {
    border-radius: 50%;
    cursor: pointer;
    width: 58px;
    height: 58px;
    background: #312f53;
    border: 0.879px solid #8e89ca;
    box-shadow:
        0px 4px 8px -1px rgba(17, 8, 0, 0.04),
        0px 2px 4px 0px rgba(17, 8, 0, 0.04),
        0px 1px 2px 0px rgba(17, 8, 0, 0.04);
    display: flex;
    justify-content: center;
    align-items: center;
}

.header .button:hover {
    background: #317474;
}

@media screen and (max-width: 750px) {
    .header__nav-line::after {
        left: 42%;
        top: 57px;
        transform: rotate(90deg);
    }

    .header .button {
        height: 40px;
        width: 40px;
    }

    .header .button img {
        height: 20px;
        width: 20px;
        object-fit: contain;
        object-position: center;
    }
}

@media screen and (max-width: 581px) {
    .header__nav-line::after {
        left: 28%;
        top: 57px;
        transform: rotate(90deg);
    }
}

@media screen and (max-width: 381px) {
    .header__nav-line::after {
        left: 25%;
    }
}

.header__nav-list a {
    color: #24223c;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 21px;
    text-decoration: none;
}

.header__nav-list li:hover {
    box-shadow: 0px 4px 0px 0px #7be6e6;
    transform: translateY(-5px); /* Поднимаем кнопку вверх */
    border-radius: 100px;
}

@media (max-width: 1350px) {
    .header {
        padding: 24px 32px 0;
    }

    .header__nav-list a {
        display: block;
        font-size: 16px;
    }

    .header__line {
        padding: 0;
        padding-bottom: 15px;
    }

    .share-buttons__container {
        padding: 0;
    }
}

@media (max-width: 980px) {
    .header {
        padding: 20px 20px 0 20px;
    }
    .header__nav-list li {
        margin-left: 16px;
    }
    .header__nav-list a {
        font-size: 14px;
    }

    .share-buttons__container {
        padding: 0;
        padding-top: 5px;
    }
}

@media (max-width: 870px) {
    .header__line {
        padding: 8px 20px;
        border-radius: 8px;
        display: -ms-grid;
        display: grid;
        -ms-grid-columns: auto auto;
        grid-template-columns: auto auto;
        grid-template-areas:
            "a c"
            "b b";
    }

    .header__line::before {
        border-radius: 9px;
    }

    .header__nav {
        width: 100%;
        display: block;
        grid-area: b;
        opacity: 0;
        padding: 0px;
    }

    .header__nav-list {
        display: flex;
        list-style: none;
        position: relative;
        flex-direction: column;
        align-items: flex-end;
        margin: -30px 0;
        transition: margin 0.2s;
    }

    .share-buttons {
        margin-top: 10px;
    }

    .header.header_show-nav .header__nav-list {
        margin: 0;
    }

    .header__nav-list::before {
        content: none;
    }

    .header__nav-list li {
        padding: 0px;
        margin: 0px;
        width: 100%;
        margin-top: 20px;
    }

    .header__nav-item:not(:last-child)::after {
        display: none;
    }

    .header__nav-list li:last-child {
        margin-top: 25px;
    }

    .header__nav-list a {
        display: block;
        line-height: 0px;
        transition: 0.2s all;
    }

    .header_show-nav .header__nav {
        opacity: 1;
        padding: 16px 0 12px 0;
    }

    .header_show-nav .header__nav-list a {
        line-height: 20px;
        padding: 14px 0;
        font-size: 12px;
    }

    .header_show-nav .header__nav-list a:hover {
        color: #fff;
    }

    .share-buttons__container {
        padding: 0;
    }

    .header__nav {
        -ms-grid-row: 2;
        -ms-grid-column: 1;
        -ms-grid-column-span: 2;
    }
}

.header__format {
    display: inline-flex;
    gap: 10px;
    justify-content: start;
    align-items: center;
    color: #f5f4eb;
    font-size: 19px;
    font-weight: 800;
    line-height: 120%;
}

.header__format-monitor .header__span {
    border-bottom: 2px dashed #ff769f;
}

.header__format-monitor:before {
    width: 40px;
    height: 40px;
    background: url("../img/monitor-recorder.svg") center center no-repeat;
    content: "";
}

.header__format-calendar:before {
    width: 40px;
    height: 40px;
    background: url("../img/calendar.svg") center center no-repeat;
    content: "";
}

@media (max-width: 980px) {
    .header__line {
        padding: 0;
    }

    .header {
        padding-top: 24px;
    }
}

@media screen and (max-width: 500px) {
    .header__format-calendar::before,
    .header__format-monitor::before {
        height: 25px;
        width: 25px;
        background-size: 25px 25px;
    }

}

