:root {
  --v2-shell-ink: #171a17;
  --v2-shell-forest: #20351f;
  --v2-shell-pale: #f2f8eb;
  --v2-shell-paper: #f5f3ed;
  --v2-shell-lime: #86d524;
  --v2-shell-line: rgba(23, 26, 23, .14);
  --v2-shell-width: min(1180px, calc(100vw - 64px));
  --v2-shell-display: "DM Sans", Arial, sans-serif;
  --v2-shell-body: "Manrope", Arial, sans-serif;
  --v2-shell-ease: cubic-bezier(.2, .75, .25, 1);
}

body.v2-shell-menu-open { overflow: hidden !important; }

:where(.ht-skip, .v2c-skip, .v2-skip):focus {
  z-index: 3200 !important;
}

[data-page-loader] {
  z-index: 2500 !important;
}

.v2-shell-header {
  position: fixed;
  z-index: 1300;
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  min-height: 78px;
  border-bottom: 1px solid var(--v2-shell-line);
  background: rgba(245, 243, 237, .96);
  box-shadow: 0 8px 30px rgba(16, 25, 15, .045);
  transform: translateY(0);
  transition: transform .3s var(--v2-shell-ease), box-shadow .25s ease;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.v2-shell-header.is-shell-hidden {
  transform: translateY(calc(-100% - 2px));
}

.v2-shell-header:has(:focus-visible) {
  transform: translateY(0);
}

/* Reserve the same space as the former in-flow header on inner pages. */
.v2-shell-header + main { padding-top: var(--v2-shell-header-height, 78px); }
.homepage-test .v2-shell-header + main { padding-top: 0; }

:where(.v2-shell-header, .v2-shell-footer, .v2-shell-mobile-cta) :where(a, button):focus-visible {
  outline: 3px solid var(--v2-shell-forest);
  outline-offset: 3px;
}

:where(.v2-shell-footer, .v2-shell-mobile-cta) a:focus-visible {
  outline-color: var(--v2-shell-lime);
}

.v2-shell-mobile-cta .v2-shell-mobile-cta__mark:focus-visible {
  outline-color: #fff;
}

.v2-shell-menu-open .v2-shell-header {
  transform: translateY(0);
}

.v2-shell-header__inner {
  width: var(--v2-shell-width);
  min-height: 77px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(18px, 2.3vw, 34px);
}

.v2-shell-logo {
  position: relative;
  z-index: 2;
  display: block;
  width: 158px;
}

.v2-shell-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.v2-shell-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(10px, 1.15vw, 18px);
}

.v2-shell-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 1px;
  color: #303630;
  font: 700 11.5px/1 var(--v2-shell-body);
  text-decoration: none;
  white-space: nowrap;
}

.v2-shell-nav a::after {
  position: absolute;
  right: 0;
  bottom: 3px;
  left: 0;
  height: 2px;
  background: var(--v2-shell-lime);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .22s var(--v2-shell-ease);
}

.v2-shell-nav a:is(:hover, :focus-visible, [aria-current="page"])::after {
  transform: scaleX(1);
  transform-origin: left;
}

.v2-shell-nav a[href="/ver2/nabidka-bytu/"] {
  min-height: 42px;
  padding-inline: 16px;
  border-radius: 999px;
  background: var(--v2-shell-lime);
  color: var(--v2-shell-ink);
}

.v2-shell-nav a[href="/ver2/nabidka-bytu/"]::after { display: none; }

.v2-shell-nav a[href="/ver2/nabidka-bytu/"]:is(:hover, :focus-visible) {
  background: #95e535;
  transform: translateY(-1px);
}

.v2-shell-broker {
  display: grid;
  grid-template-columns: 40px auto 18px;
  align-items: center;
  gap: 9px;
  min-width: 188px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--v2-shell-line);
  border-radius: 999px;
  background: #fff;
  color: var(--v2-shell-ink);
  text-decoration: none;
  box-shadow: 0 7px 24px rgba(23, 26, 23, .04);
}

.v2-shell-broker > img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
}

.v2-shell-broker > span {
  display: grid;
  color: #5f675f;
  font: 500 10px/1.25 var(--v2-shell-body);
}

.v2-shell-broker strong {
  margin-bottom: 3px;
  color: var(--v2-shell-ink);
  font-size: 11px;
}

.v2-shell-broker svg {
  width: 18px;
  fill: none;
  stroke: var(--v2-shell-lime);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.v2-shell-menu {
  position: relative;
  z-index: 3;
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--v2-shell-line);
  border-radius: 50%;
  background: transparent;
  color: var(--v2-shell-ink);
  cursor: pointer;
}

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

.v2-shell-menu__icon,
.v2-shell-menu__icon::before,
.v2-shell-menu__icon::after {
  position: absolute;
  left: 50%;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  content: "";
  transform: translateX(-50%);
  transition: transform .24s var(--v2-shell-ease), opacity .18s ease, top .24s var(--v2-shell-ease);
}

.v2-shell-menu__icon { top: 22px; }
.v2-shell-menu__icon::before { top: -6px; }
.v2-shell-menu__icon::after { top: 6px; }
.v2-shell-menu[aria-expanded="true"] .v2-shell-menu__icon { background: transparent; }
.v2-shell-menu[aria-expanded="true"] .v2-shell-menu__icon::before { top: 0; transform: translateX(-50%) rotate(45deg); }
.v2-shell-menu[aria-expanded="true"] .v2-shell-menu__icon::after { top: 0; transform: translateX(-50%) rotate(-45deg); }

.v2-shell-footer {
  position: relative;
  z-index: 1;
  padding: 72px max(32px, calc((100vw - 1180px) / 2)) 30px;
  color: #fff;
  background: var(--v2-shell-ink);
  font-family: var(--v2-shell-body);
}

.v2-shell-footer__grid {
  display: grid;
  grid-template-columns: 1.35fr .8fr 1fr 1fr;
  gap: clamp(34px, 5vw, 72px);
}

.v2-shell-footer__brand img {
  display: block;
  width: 176px;
  height: auto;
}

.v2-shell-footer__brand p {
  max-width: 310px;
  margin: 26px 0 0;
  color: rgba(255, 255, 255, .56);
  font-size: 13px;
}

.v2-shell-footer__column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.v2-shell-footer__column h2 {
  margin: 0 0 17px;
  color: var(--v2-shell-lime);
  font: 800 10px/1.2 var(--v2-shell-body);
  letter-spacing: .15em;
  text-transform: uppercase;
}

.v2-shell-footer__column :is(a, span) {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
}

.v2-shell-footer__column a:is(:hover, :focus-visible) { color: #fff; }

.v2-shell-footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 58px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .64);
  font-size: 11px;
}

.v2-shell-footer__legal { display: flex; flex-wrap: wrap; gap: 20px; }
.v2-shell-footer__legal a { color: inherit; text-decoration: none; }
.v2-shell-footer__legal a:is(:hover, :focus-visible) { color: #fff; }

.v2-shell-mobile-cta { display: none; }

.v2-shell-menu-open .v2-shell-mobile-cta {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 1080px) {
  :root { --v2-shell-width: min(940px, calc(100vw - 40px)); }

  .v2-shell-header,
  .v2-shell-header__inner { min-height: 72px; }

  .v2-shell-header__inner {
    grid-template-columns: 142px 1fr 46px;
    gap: 16px;
  }

  .v2-shell-logo { width: 142px; }
  .v2-shell-broker { display: none; }
  .v2-shell-menu { display: block; grid-column: 3; }

  .v2-shell-nav {
    position: fixed;
    z-index: 1;
    top: 72px;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    height: calc(100dvh - 72px);
    padding: 28px max(20px, calc((100vw - 940px) / 2)) 120px;
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    background:
      radial-gradient(circle at 88% 92%, rgba(134, 213, 36, .18), transparent 34%),
      linear-gradient(180deg, rgba(23, 26, 23, .99), rgba(25, 43, 25, .97));
    transform: translateY(-12px);
    transition: opacity .22s ease, transform .32s var(--v2-shell-ease), visibility .32s;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .v2-shell-nav.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .v2-shell-nav a {
    min-height: 62px;
    padding: 17px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
    color: #fff;
    font: 600 clamp(22px, 5vw, 34px)/1 var(--v2-shell-display);
    letter-spacing: -.035em;
  }

  .v2-shell-nav a::after { display: none; }

  .v2-shell-nav a:focus-visible { outline-color: var(--v2-shell-lime); }

  .v2-shell-nav a[aria-current="page"]:not([href="/ver2/nabidka-bytu/"]) {
    color: var(--v2-shell-lime);
  }

  .v2-shell-nav a[href="/ver2/nabidka-bytu/"] {
    min-height: 64px;
    margin: 0 0 10px;
    padding-inline: 20px;
    border: 0;
    border-radius: 0;
  }

  .v2-shell-footer__grid { grid-template-columns: 1fr 1fr; }
  .v2-shell-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  :root {
    --v2-shell-width: calc(100vw - 28px);
    --v2-mobile-header-height: clamp(62px, 9svh, 70px);
  }
  body { padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important; }

  .v2-shell-header {
    display: block;
    min-height: var(--v2-mobile-header-height);
    background: rgba(245, 243, 237, .97);
    box-shadow: 0 5px 22px rgba(16, 25, 15, .07);
  }

  .v2-shell-header__inner {
    min-height: var(--v2-mobile-header-height);
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 14px;
  }

  .v2-shell-logo { width: min(132px, 36vw); }

  .v2-shell-menu {
    grid-column: 2;
    width: 44px;
    height: 44px;
  }

  .v2-shell-menu__icon { top: 21px; }

  .v2-shell-nav {
    top: var(--v2-mobile-header-height);
    height: calc(100dvh - var(--v2-mobile-header-height));
    padding: 22px 18px 110px;
  }

  .v2-shell-footer { padding: 58px 20px 104px; }
  .v2-shell-footer__grid { grid-template-columns: 1fr; gap: 38px; }
  .v2-shell-footer__brand { grid-column: auto; }
  .v2-shell-footer__bottom { flex-direction: column; margin-top: 44px; }

  .v2-shell-mobile-cta {
    position: fixed;
    z-index: 1500;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: minmax(0, 1fr) 66px minmax(0, 1fr);
    align-items: center;
    min-height: 62px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 999px;
    background: rgba(23, 26, 23, .97);
    box-shadow: 0 12px 38px rgba(0, 0, 0, .3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .v2-shell-mobile-cta > a {
    min-width: 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 999px;
    color: #fff;
    font: 800 12px/1 var(--v2-shell-body);
    text-decoration: none;
  }

  .v2-shell-mobile-cta > a:last-child { color: var(--v2-shell-lime); }
  .v2-shell-mobile-cta svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

  .v2-shell-mobile-cta__mark {
    position: relative;
    z-index: 2;
    width: 66px;
    height: 66px;
    margin-block: -8px;
    border: 4px solid var(--v2-shell-ink);
    border-radius: 50%;
    background: var(--v2-shell-lime);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
  }

  .v2-shell-mobile-cta__mark img {
    width: 25px;
    height: 36px;
    object-fit: contain;
    filter: grayscale(1) brightness(.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .v2-shell-header,
  .v2-shell-nav,
  .v2-shell-nav a::after,
  .v2-shell-menu__icon,
  .v2-shell-menu__icon::before,
  .v2-shell-menu__icon::after { transition-duration: .01ms !important; }
}
