:root {
    --color-header-surface: #1f2937;
}

.header {
    --header-menu-top: 108px;

    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--color-header-surface);
    backdrop-filter: blur(14px);
    color: var(--color-text-light);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    transition:
            transform 0.24s ease,
            background 0.24s ease,
            border-color 0.24s ease,
            box-shadow 0.24s ease;
    will-change: transform;
}

.header.header--compact {
    --header-menu-top: 74px;

    background: var(--color-header-surface);
    border-bottom-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.24);
}

.header.header--hidden {
    transform: translateY(-100%);
}

.header.header--hidden:focus-within,
body.menu-open .header {
    transform: translateY(0);
}

.header-inner {
    min-height: 108px;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 430px;
    align-items: center;
    gap: 24px;
    transition:
            min-height 0.24s ease,
            gap 0.24s ease;
}

.header.header--compact .header-inner {
    min-height: 74px;
    gap: 20px;
}

.header.header--compact .brand-logo-mark {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: start;
    width: 260px;
    font-weight: 800;
    line-height: 1.1;
    transition: width 0.24s ease;
}

.brand-logo-mark {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border: 1px solid rgba(191, 219, 254, 0.26);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    transition:
            width 0.24s ease,
            height 0.24s ease,
            flex-basis 0.24s ease,
            border-radius 0.24s ease;
}

.brand-logo-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(1.34);
    transform-origin: center;
}

.brand-logo-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
}

.brand-logo-copy strong {
    color: #ffffff;
    font-size: 27px;
    font-weight: 900;
    letter-spacing: 0.08em;
    transition:
            font-size 0.24s ease,
            letter-spacing 0.24s ease;
}

.brand-logo-copy small {
    color: var(--color-muted-light);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    transition:
            font-size 0.24s ease,
            opacity 0.24s ease;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    color: var(--color-muted-light);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition:
            gap 0.24s ease,
            font-size 0.24s ease;
}

.nav a {
    white-space: nowrap;
}

.nav a:hover {
    color: var(--color-text-light);
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    width: 430px;
    justify-self: end;
    transition:
            gap 0.24s ease,
            width 0.24s ease;
}

.header-phone {
    min-width: 190px;
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
    transition: font-size 0.24s ease;
}

.header .btn {
    min-width: 170px;
    min-height: 56px;
    padding: 0 24px;
    font-size: 15px;
    white-space: nowrap;
    transition:
            min-height 0.24s ease,
            min-width 0.24s ease,
            padding 0.24s ease,
            font-size 0.24s ease,
            background 0.2s ease,
            transform 0.2s ease;
}

.header.header--compact .nav {
    gap: 22px;
    font-size: 13px;
}

.header.header--compact .header-actions {
    gap: 16px;
}

.header.header--compact .header-phone {
    font-size: 14px;
}

.header.header--compact .header-btn {
    min-width: 150px;
    min-height: 44px;
    padding: 0 18px;
    font-size: 14px;
}

.footer {
    padding: 32px 0;
    background: var(--color-bg);
    color: var(--color-text-light);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.footer-inner > * {
    min-width: 0;
}

.footer-brand {
    display: grid;
    gap: 12px;
    max-width: 620px;
}

.footer-brand > p {
    margin: 0;
    padding-left: 0;
}

.footer-contacts {
    width: min(100%, 350px);
    margin-left: auto;
}

.footer-contacts p {
    overflow-wrap: anywhere;
}

.footer p {
    color: var(--color-muted-light);
}

.footer a {
    color: #fbbf24;
}

.footer-messengers a {
    font-weight: 800;
}

.burger {
    display: none;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    transition:
            width 0.24s ease,
            height 0.24s ease,
            background 0.2s ease,
            border-color 0.2s ease;
}

.header.header--compact .burger {
    width: 42px;
    height: 42px;
}

.burger span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--color-text-light);
    transition: 0.2s;
}

.burger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: var(--header-menu-top);
    left: 0;
    right: 0;
    z-index: 19;
    max-height: calc(100dvh - var(--header-menu-top));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--color-header-surface);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 18px 16px 22px;
    transform: translateY(-16px);
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
}

.mobile-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav {
    display: grid;
    gap: 6px;
}

.mobile-nav a {
    display: flex;
    padding: 14px 16px;
    border-radius: 14px;
    color: var(--color-text-light);
    background: rgba(255, 255, 255, 0.06);
}

.mobile-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-footer {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.mobile-menu-footer > a:first-child {
    display: flex;
    justify-content: center;
    padding: 14px 16px;
    border-radius: 14px;
    color: var(--color-text-light);
    background: rgba(255, 255, 255, 0.06);
    font-weight: 700;
}

body.menu-open {
    overflow: hidden;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown::after {
    content: "";
    position: absolute;
    left: 0;
    top: 100%;
    width: 280px;
    height: 18px;
}

.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 30;

    display: grid;
    gap: 4px;

    min-width: 280px;
    max-height: calc(100vh - var(--header-menu-top) - 24px);
    overflow-y: auto;
    padding: 10px;

    background: rgba(15, 28, 47, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(14px);

    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: 0.18s;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-dropdown-menu a {
    display: flex;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--color-muted-light);
    font-size: 14px;
    font-weight: 600;
}

.nav-dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-light);
}

.header.header--compact .brand-logo-copy strong {
    font-size: 22px;
}

.header.header--compact .brand-logo-copy small {
    font-size: 9px;
    opacity: 0.86;
}

.footer .logo {
    font-family: inherit;
}

.footer .brand-logo-mark {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
}

.footer .brand-logo-copy strong {
    font-size: 24px;
}

.footer .brand-logo-copy small {
    font-size: 9px;
}

@media (prefers-reduced-motion: reduce) {
    .header,
    .header-inner,
    .logo,
    .brand-logo-mark,
    .brand-logo-copy strong,
    .brand-logo-copy small,
    .nav,
    .header-actions,
    .header-phone,
    .header .btn,
    .burger {
        transition: none;
    }
}
