:root {
    --mg-bg: #171717;
    --mg-accent: #c7a943;
    --mg-accent-hover: #b89935;
    --mg-text: #ffffff;
    --mg-menu-bg: rgba(23, 23, 23, 0.92);
    --mg-container: 1170px;
    --mg-header-height: 100px;
    --mg-font: 'Gilroy', system-ui, -apple-system, sans-serif;
    --mg-scrollbar-track: #121212;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
    scrollbar-color: var(--mg-accent) var(--mg-scrollbar-track);
    scrollbar-width: thin;
}

/* Chrome, Safari, Edge */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: var(--mg-scrollbar-track);
}

*::-webkit-scrollbar-thumb {
    background-color: var(--mg-accent);
    border: 2px solid var(--mg-scrollbar-track);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: var(--mg-accent-hover);
}

*::-webkit-scrollbar-corner {
    background: var(--mg-scrollbar-track);
}

body {
    margin: 0;
    font-family: var(--mg-font);
    background: var(--mg-bg);
    color: var(--mg-text);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.mg-main {
    flex: 1 0 auto;
}

.mg-form-errors {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(169, 68, 68, 0.18);
    color: #ffcaca;
    font-size: 0.875rem;
    list-style: none;
}

.mg-form-errors li + li {
    margin-top: 0.35rem;
}

.mg-speed-match .mg-form-errors {
    background: rgba(0, 0, 0, 0.18);
    color: #fff;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    display: block;
    max-width: 100%;
}

.mg-container {
    width: 100%;
    max-width: calc(var(--mg-container) + 2 * 135px);
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 135px);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */
.mg-header {
    position: relative;
    z-index: 100;
    height: var(--mg-header-height);
    background: var(--mg-bg);
}

.mg-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--mg-header-height);
}

.mg-header__logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    color: var(--mg-text);
}

.mg-header__logo-image {
    display: block;
    width: 189px;
    max-width: min(189px, 42vw);
    height: auto;
}

.mg-header__nav {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.mg-header__menu {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.35rem;
    margin: 0;
    padding: 0.625rem 1.125rem;
    list-style: none;
    max-width: 726px;
    width: 100%;
    min-height: 60px;
    border-radius: 65px;
    background: var(--mg-menu-bg);
}

.mg-header__menu-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.625rem 1rem;
    border-radius: 65px;
    font-size: 0.875rem;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color 0.2s ease, font-weight 0.2s ease;
}

.mg-header__menu-link:hover {
    background: rgba(199, 169, 67, 0.25);
}

.mg-header__menu-link.is-active {
    background: var(--mg-accent);
    font-weight: 700;
}

.mg-header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.mg-header__phone {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 189px;
    min-height: 50px;
    padding: 0.4375rem 1.125rem 0.4375rem 0.8125rem;
    border-radius: 65px;
    background: var(--mg-accent);
    color: var(--mg-text);
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.mg-header__phone:hover {
    background: var(--mg-accent-hover);
}

.mg-header__phone-icon {
    width: 25px;
    height: 25px;
    flex-shrink: 0;
}

.mg-header__phone-icon path {
    fill: #fff;
}

.mg-header__phone-text {
    display: grid;
    gap: 0.125rem;
    line-height: 1.1;
    white-space: nowrap;
}

.mg-header__phone-number {
    font-size: 0.875rem;
    font-weight: 700;
}

.mg-header__phone-label {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.95;
}

.mg-header__burger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--mg-accent);
    border-radius: 12px;
    background: transparent;
    color: var(--mg-text);
    cursor: pointer;
}

.mg-header__burger svg {
    width: 24px;
    height: 24px;
}

.mg-header__overlay {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.mg-header__overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.mg-header__drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 120;
    display: flex;
    flex-direction: column;
    width: min(100%, 360px);
    height: 100%;
    padding: 1.25rem;
    background: rgba(9, 9, 9, 0.98);
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.mg-header__drawer.is-open {
    transform: translateX(0);
}

.mg-header__drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.mg-header__drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--mg-accent);
    border-radius: 12px;
    background: transparent;
    color: var(--mg-text);
    cursor: pointer;
}

.mg-header__menu--mobile {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    max-width: none;
    width: 100%;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    min-height: 0;
}

.mg-header__menu--mobile .mg-header__menu-link {
    justify-content: flex-start;
    width: 100%;
    padding: 0.875rem 1rem;
}

.mg-header__drawer-phone {
    margin-top: auto;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
}

@media (max-width: 1199px) {
    .mg-header__menu {
        gap: 0.15rem;
        padding-inline: 0.75rem;
    }

    .mg-header__menu-link {
        padding-inline: 0.75rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 991px) {
    .mg-header__nav {
        display: none;
    }

    .mg-header__burger {
        display: inline-flex;
    }

    .mg-header__phone--desktop {
        display: none;
    }

    .mg-header__logo-image {
        width: min(189px, 36vw);
    }
}

@media (max-width: 479px) {
    .mg-header__logo-image {
        width: min(160px, 52vw);
    }

    .mg-header__drawer-phone {
        min-width: 0;
    }
}

/* Map */
.mg-map {
    flex-shrink: 0;
    width: 100%;
}

.mg-map__embed {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 350px;
    background: #121212;
}

.mg-map__preview {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    margin: 0;
    pointer-events: none;
}

.mg-map__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    image-rendering: auto;
}

.mg-map__embed.is-loaded .mg-map__preview {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mg-map__embed iframe,
.mg-map__frame {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
}

.mg-map__embed:not(.is-active) .mg-map__frame {
    pointer-events: none;
}

.mg-map__shield {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 0;
    background: linear-gradient(
        180deg,
        rgba(23, 23, 23, 0.18) 0%,
        rgba(23, 23, 23, 0.42) 55%,
        rgba(23, 23, 23, 0.55) 100%
    );
    cursor: pointer;
}

.mg-map__embed.is-active .mg-map__shield {
    display: none;
}

.mg-map__shield-text {
    padding: 0.7rem 1.15rem;
    border-radius: 999px;
    border: 1px solid rgba(199, 169, 67, 0.55);
    background: rgba(23, 23, 23, 0.88);
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.2;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.mg-map__link {
    position: absolute;
    left: 0;
    z-index: 1;
    color: #eee;
    font-size: 12px;
    line-height: 1.2;
}

.mg-map__link--2 {
    top: 14px;
}

.mg-map__link--3 {
    top: 28px;
}

/* Footer */
.mg-footer {
    flex-shrink: 0;
    background: var(--mg-bg);
    padding: 1.5rem 0 2rem;
}

.mg-footer__grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 2rem 3.5rem;
}

.mg-footer__brand {
    flex: 1 1 260px;
    max-width: 302px;
}

.mg-footer__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1.25rem;
    color: var(--mg-text);
}

.mg-footer__logo-icon {
    width: auto;
    height: 2.5rem;
    flex-shrink: 0;
}

.mg-footer__logo-text {
    font-size: 1.25rem;
    line-height: 1;
    letter-spacing: -0.02em;
}

.mg-footer__legal,
.mg-footer__copy,
.mg-footer__address,
.mg-footer__links a {
    font-size: 0.875rem;
    line-height: 1.35;
}

.mg-footer__legal {
    margin: 0 0 1.25rem;
}

.mg-footer__copy {
    margin: 0;
}

.mg-footer__col {
    flex: 0 1 auto;
    min-width: 140px;
}

.mg-footer__title {
    margin: 0 0 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--mg-accent);
}

.mg-footer__links {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mg-footer__links a:hover {
    color: var(--mg-accent);
}

.mg-footer__contacts {
    flex: 1 1 260px;
    max-width: 276px;
    margin-left: auto;
}

.mg-footer__address {
    margin: 0 0 1.25rem;
}

.mg-footer__address strong {
    font-weight: 700;
}

.mg-footer__phones {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
}

.mg-footer__phone {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--mg-accent);
}

.mg-footer__phone:hover {
    opacity: 0.9;
}

.mg-footer__phone-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.mg-footer__phone-icon path {
    fill: var(--mg-accent);
}

.mg-footer__social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mg-footer__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 65px;
    background: var(--mg-accent);
    transition: opacity 0.2s ease;
}

.mg-footer__social-link:hover {
    opacity: 0.9;
}

.mg-footer__social-link img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

@media (max-width: 991px) {
    .mg-footer__contacts {
        margin-left: 0;
        max-width: none;
    }

    .mg-footer__grid {
        gap: 1.75rem 2rem;
    }
}

@media (max-width: 639px) {
    .mg-footer__brand,
    .mg-footer__col,
    .mg-footer__contacts {
        flex: 1 1 100%;
        max-width: none;
    }
}

/* Form success state */
.mg-form-sent {
    display: flex;
    align-items: flex-start;
    gap: clamp(0.875rem, 1.6vw, 1.125rem);
    padding: clamp(1.125rem, 2vw, 1.5rem);
    border-radius: 20px;
    background: rgba(199, 169, 67, 0.1);
    border: 1px solid rgba(199, 169, 67, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.mg-form-sent--centered {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    text-align: center;
}

.mg-form-sent--fill {
    width: 100%;
    min-height: 100%;
}

.mg-form-sent__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--mg-accent);
    color: #171717;
}

.mg-form-sent__icon svg {
    width: 24px;
    height: 24px;
}

.mg-form-sent--centered .mg-form-sent__icon {
    width: 56px;
    height: 56px;
}

.mg-form-sent--centered .mg-form-sent__icon svg {
    width: 28px;
    height: 28px;
}

.mg-form-sent__body {
    min-width: 0;
}

.mg-form-sent__title {
    margin: 0 0 0.4rem;
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
}

.mg-form-sent__text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.86);
}

.mg-form-sent--centered .mg-form-sent__body {
    max-width: 34rem;
}

/* Legal / static pages */
.mg-stub {
    padding: clamp(1.5rem, 3vw, 2.5rem) 0 clamp(3rem, 6vw, 4.5rem);
}

.mg-stub__title {
    margin: 0 0 clamp(1.25rem, 2.5vw, 1.75rem);
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
}

.mg-stub__content {
    max-width: 820px;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.88);
}

.mg-stub__content p {
    margin: 0 0 1rem;
}

.mg-stub__empty {
    margin: 0;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.65);
}
