.mg-site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    direction: rtl;
    background: rgba(5, 5, 5, 0.92);
    border-bottom: 1px solid rgba(212, 175, 55, 0.16);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.mg-site-header,
.mg-site-header * {
    box-sizing: border-box;
}

.mg-site-header a {
    text-decoration: none;
}

.mg-site-header__inner {
    width: min(calc(100% - 32px), 1180px);
    min-height: 86px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 22px;
}

.mg-brand {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #fff;
}

.mg-brand__logo {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(247, 213, 106, 0.24);
    border-radius: 16px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.18), rgba(255, 255, 255, 0.04));
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.15);
}

.mg-brand__logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transform: scale(1.12);
}

.mg-brand__copy {
    display: block;
    white-space: nowrap;
}

.mg-brand__copy strong,
.mg-brand__copy small {
    display: block;
}

.mg-brand__copy strong {
    color: #f3d77c;
    font-size: 15px;
    line-height: 1.35;
    letter-spacing: 0.4px;
}

.mg-brand__copy small {
    margin-top: 3px;
    color: #9f9f9f;
    font-size: 13px;
    line-height: 1.4;
}

.mg-desktop-nav {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 17px;
}

.mg-desktop-nav a {
    position: relative;
    padding: 10px 0;
    color: #e8e8e8;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.mg-desktop-nav a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 3px;
    width: 0;
    height: 1px;
    background: #f3d77c;
    transition: width 0.2s ease;
}

.mg-desktop-nav a:hover,
.mg-desktop-nav a.is-active {
    color: #f3d77c;
}

.mg-desktop-nav a:hover::after,
.mg-desktop-nav a.is-active::after {
    width: 100%;
}

.mg-header-actions,
.mg-mobile-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mg-social-link {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(247, 213, 106, 0.88);
    border: 1px solid rgba(247, 213, 106, 0.28);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mg-social-link svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.mg-social-link:hover {
    transform: translateY(-1px);
    color: #f7d56a;
    border-color: rgba(247, 213, 106, 0.55);
}

.mg-telegram-link,
.mg-mobile-telegram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    color: #111;
    border: 1px solid #d6a419;
    border-radius: 12px;
    background: #d6a419;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
    transition: transform 0.2s ease, background 0.2s ease;
}

.mg-telegram-link:hover,
.mg-mobile-telegram:hover {
    transform: translateY(-1px);
    background: #f3d77c;
}

.mg-mobile-actions {
    display: none;
    margin-inline-start: auto;
}

.mg-mobile-menu {
    position: relative;
}

.mg-mobile-menu summary {
    width: 44px;
    height: 44px;
    display: grid;
    place-content: center;
    gap: 5px;
    cursor: pointer;
    list-style: none;
    border: 1px solid rgba(247, 213, 106, 0.28);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
}

.mg-mobile-menu summary::-webkit-details-marker {
    display: none;
}

.mg-mobile-menu summary span {
    width: 20px;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: #f3d77c;
}

.mg-mobile-menu__panel {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: min(330px, calc(100vw - 28px));
    padding: 14px;
    border: 1px solid rgba(247, 213, 106, 0.22);
    border-radius: 18px;
    background: rgba(12, 12, 12, 0.985);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.mg-mobile-menu__panel nav {
    display: grid;
}

.mg-mobile-menu__panel nav a {
    padding: 12px 13px;
    color: #e8e8e8;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 800;
}

.mg-mobile-menu__panel nav a:hover,
.mg-mobile-menu__panel nav a.is-active {
    color: #f3d77c;
    background: rgba(247, 213, 106, 0.08);
}

.mg-mobile-telegram {
    width: 100%;
    margin-top: 12px;
}

@media (max-width: 1120px) {
    .mg-desktop-nav,
    .mg-header-actions {
        display: none;
    }

    .mg-mobile-actions {
        display: flex;
    }
}

@media (max-width: 640px) {
    .mg-site-header__inner {
        width: min(calc(100% - 28px), 1180px);
        min-height: 72px;
        gap: 10px;
    }

    .mg-brand {
        min-width: 0;
        gap: 10px;
    }

    .mg-brand__logo {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        border-radius: 14px;
    }

    .mg-brand__copy strong {
        max-width: 150px;
        overflow: hidden;
        font-size: 13px;
        text-overflow: ellipsis;
    }

    .mg-brand__copy small {
        display: none;
    }

    .mg-mobile-actions {
        gap: 8px;
    }

    .mg-social-link {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
    }

    .mg-mobile-menu summary {
        width: 39px;
        height: 39px;
    }
}

@media (max-width: 380px) {
    .mg-brand__copy strong {
        max-width: 112px;
        font-size: 12px;
    }

    .mg-mobile-actions .mg-social-link {
        display: none;
    }
}
