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

html, body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
  background: #ffffff;
}

body {
  margin: 0;
  margin-top: 0 !important;
  font-family: 'Formular', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #292929;
  background: #ffffff;
  line-height: 1.4;
}

html.side-menu-open,
body.side-menu-open {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
}

:root {
  --menu-bg: #ffffff;
  --menu-text: #292929;
  --accent-color: #d94747;
  --submenu-bg: #f2f5f7;
  --menu-height: 68px;
  --menu-width: 1160px;
  --menu-radius: 20px;
  --shadow-header: 0 10px 30px rgba(105, 102, 117, 0.30);
  --shadow-soft: 0 10px 28px rgba(105, 102, 117, 0.20);
  --dropdown-gap: 3px;
  --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --side-anim: 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}

/* HEADER DESKTOP */
.custom-nav {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 40px), var(--menu-width));
  height: var(--menu-height);
  background: var(--menu-bg);
  border-radius: var(--menu-radius);
  box-shadow: var(--shadow-header);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 34px;
  padding-right: 17px;
}

.custom-nav__logo {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  margin-right: 51px;
}

.custom-nav__logo img {
  display: block;
  width: 196px;
  height: 24px;
  object-fit: contain;
}

.custom-nav__list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 30px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  min-width: 0;
}

.custom-nav__item {
  position: relative;
  flex: 0 0 auto;
}

.custom-nav__item:nth-child(1) .nav-link { width: 58px; }
.custom-nav__item:nth-child(2) .nav-link { width: 48px; }
.custom-nav__item:nth-child(3) .nav-link { width: 83px; }
.custom-nav__item:nth-child(4) .nav-link { width: 64px; }
.custom-nav__item:nth-child(5) .nav-link { width: 78px; }
.custom-nav__item:nth-child(6) .nav-link { width: 70px; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 68px;
  text-decoration: none;
  color: #292929;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-decoration-skip-ink: auto;
  transition: color var(--transition), font-weight var(--transition);
}

.nav-link::after {
  display: none;
}

.nav-link:hover {
  color: #292929;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.nav-link--services:hover {
  color: #292929;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.mobile-link-row {
  display: block;
}

.mobile-link-row > .nav-link {
  display: inline-flex;
}

.top-toggle,
.mobile-cta-wrap,
.burger__icon {
  display: none;
}

.nav-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  margin-left: 67px;
  min-width: 241px;
}

.nav-call {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(105, 102, 117, 0.20);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-right: 29px;
  animation: callPulse 2s ease-in-out infinite;
  transform-origin: center;
  will-change: transform;
}

.nav-call img {
  width: 25px;
  height: 25px;
  display: block;
}

.nav-button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: 168px;
  height: 39px;
  border: none;
  border-radius: 30px;
  background: #d94747;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
  transition: transform 0.22s ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.nav-button a {
  color: #ffffff; /* Убираем синий цвет текста */
  text-decoration: none; /* Убираем подчеркивание */
  font-family: 'Formular', Arial, sans-serif;
  font-weight: 500;
  font-size: 14px;
}

.nav-button a:hover {
  text-decoration: none; /* Убираем подчеркивание при наведении */
}

.nav-button span {
  font-family: 'Formular', sans-serif; /* Шрифт */
  font-weight: 500;  /* Начертание медиум */
  font-size: 14px;   /* Размер */
  color: #ffffff;   /* Цвет */
  text-decoration: none;  /* Убираем подчеркивание */
}

.nav-button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120.6deg, rgba(255,136,136,1) 0%, rgba(217,71,71,1) 100%);
  opacity: 0;
  transition: opacity 0.22s ease;
  z-index: 0;
}

.nav-button span {
  position: relative;
  z-index: 1;
  text-decoration: none;
}

.nav-button:hover {
  transform: scale(1.04);
}

.nav-button:hover::before {
  opacity: 1;
}

.nav-button:focus,
.nav-button:active {
  outline: none;
  box-shadow: none;
}

@keyframes callPulse {
  0%   { transform: scale(0.88); }
  50%  { transform: scale(1.14); }
  100% { transform: scale(0.88); }
}

/* DESKTOP DROPDOWNS */
.custom-has-dropdown::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 100%;
  width: 560px;
  height: 22px;
  background: transparent;
}

.custom-has-dropdown > .dropdown {
  position: absolute;
  top: calc(100% + var(--dropdown-gap));
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 500px;
  min-width: 500px;
  padding: 18px 20px;
  margin: 0;
  list-style: none;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--transition),
    visibility var(--transition),
    transform var(--transition),
    border-radius var(--transition),
    box-shadow var(--transition);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.custom-has-dropdown.is-hovered > .dropdown,
.custom-has-dropdown:hover > .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.dropdown__item {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
}

.dropdown__link {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  text-decoration: none;
  color: #292929;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  border-radius: 0;
  background: transparent !important;
  transition: color var(--transition);
}

.dropdown__link:hover {
  color: #d94747;
  background: transparent !important;
}

.dropdown__link--parent {
  flex: 1 1 auto;
  padding-right: 8px;
}

.submenu-toggle {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: 0;
  border: none;
  background: transparent;
  border-radius: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.submenu-arrow {
  width: 9px;
  height: 9px;
  border-top: 1.8px solid #292929;
  border-right: 1.8px solid #292929;
  transform: rotate(45deg);
  transition:
    transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    border-color var(--transition);
}

.submenu-toggle.active .submenu-arrow,
.custom-has-nested.is-open .submenu-arrow {
  transform: rotate(225deg);
  border-color: #d94747;
}

.submenu-toggle:hover .submenu-arrow {
  border-color: #d94747;
}

.nested {
  position: absolute;
  top: -18px;
  left: calc(100% + 20px);
  width: 400px;
  min-width: 400px;
  margin: 0;
  padding: 18px 20px;
  list-style: none;
  background: #f2f5f7;
  box-shadow: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 20px;
  border-bottom-right-radius: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(0);
  transition:
    opacity var(--transition),
    visibility var(--transition),
    transform var(--transition);
  z-index: 130;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.custom-has-nested.is-open > .nested::before {
  content: "";
  position: absolute;
  top: 0;
  left: -500px;
  width: 900px;
  height: 100%;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  background: transparent;
  z-index: -1;
  pointer-events: none;
}

.custom-has-nested.is-open > .nested,
.custom-has-nested.is-open {
  z-index: 130;
}

.custom-has-nested.is-open > .dropdown__row .dropdown__link,
.custom-has-nested.is-open > .dropdown__row .submenu-toggle {
  position: relative;
  z-index: 2;
}

.custom-has-dropdown .custom-has-nested.is-open ~ .dropdown__item {
  position: relative;
  z-index: 2;
}

.custom-has-dropdown.is-hovered > .dropdown:has(.custom-has-nested.is-open),
.custom-has-dropdown:hover > .dropdown:has(.custom-has-nested.is-open) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: none;
}

.custom-has-nested.is-open > .nested {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nested .dropdown__link {
  font-weight: 400;
  background: transparent !important;
}

.nested .dropdown__link:hover {
  color: #d94747;
  background: transparent !important;
}

/* BURGER */
.burger {
  display: none;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.burger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--menu-text);
  border-radius: 2px;
  transition: all 0.3s;
}

.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.burger span:nth-child(3) { bottom: 0; }

.burger.active span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

/* MOBILE HEADER */
@media (max-width: 980px) {
  body {
     margin-top: 0 !important;
  }

  .custom-nav {
    top: 17px;
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100% - 20px), 360px);
    height: 54px;
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(105, 102, 117, 0.30);
    display: block;
    position: fixed;
  }

  .custom-nav__logo {
    position: absolute;
    left: 23px;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 0;
    width: 168px;
    height: 20px;
    display: inline-flex;
    align-items: center;
  }

  .custom-nav__logo img {
    width: 168px;
    height: 20px;
    object-fit: contain;
    display: block;
  }

  .nav-actions {
    position: absolute;
    left: 240px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    min-width: 38px;
    height: 38px;
  }

  .nav-call {
    width: 38px;
    height: 38px;
    margin-right: 0;
    box-shadow: 0 8px 20px rgba(105, 102, 117, 0.20);
  }

  .nav-call img {
    width: 21px;
    height: 21px;
  }

  .nav-button {
    display: none;
  }

  .burger {
    display: inline-flex;
    position: absolute;
    right: 21px;
    top: 50%;
    transform: translateY(-50%);
    width: 33px;
    height: 24px;
    align-items: center;
    justify-content: center;
  }

  .burger span {
    display: none;
  }

  .burger__icon {
    display: block;
    width: 33px;
    height: auto;
  }

  .custom-nav__list,
  .mobile-link-row,
  .top-toggle {
    display: none !important;
  }
}

/* SIDE MENU */
body.side-menu-open {
  overflow: hidden !important;
}

.side-menu {
  position: fixed;
  inset: 0;
  z-index: 10050;
  pointer-events: none;
}

.side-menu.is-open {
  pointer-events: auto;
}

.side-menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.14);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.side-menu.is-open .side-menu__backdrop {
  opacity: 1;
}

.side-menu__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  height: 100dvh;
  width: 260px;
  background: #d94747;
  color: #ffffff;
  transform: translateX(100%);
  transition: transform var(--side-anim);
  padding: 22px 18px 0;
  overflow: hidden;
}

.side-menu.is-open .side-menu__panel {
  transform: translateX(0);
}

.side-menu__scroll {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0;
}

.side-menu__content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.side-menu__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}

.side-menu__close span {
  position: absolute;
  left: 4px;
  top: 13px;
  width: 20px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
}

.side-menu__close span:first-child {
  transform: rotate(45deg);
}

.side-menu__close span:last-child {
  transform: rotate(-45deg);
}

.side-menu__nav {
  margin-top: 52px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.side-menu__link,
.side-menu__sublink {
  color: #ffffff;
  text-decoration: none;
  font-family: 'Formular', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.side-menu__link {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
}

.side-menu__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.side-menu__toggle {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
}

.side-menu__arrow {
  width: 8px;
  height: 8px;
  border-right: 1.8px solid #ffffff;
  border-bottom: 1.8px solid #ffffff;
  transform: rotate(45deg);
  transition: transform var(--side-anim);
}

.side-menu__item.is-open > .side-menu__row .side-menu__arrow,
.side-menu__submenu-block--has-submenu.is-open > .side-menu__row .side-menu__arrow {
  transform: rotate(225deg);
}

.side-menu__submenu {
  display: block;
  margin-top: 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height var(--side-anim),
    opacity 0.22s ease,
    margin-top var(--side-anim);
}

.side-menu__item.is-open > .side-menu__submenu,
.side-menu__submenu-block--has-submenu.is-open > .side-menu__submenu {
  max-height: 2200px;
  opacity: 1;
  margin-top: 14px;
}

.side-menu__submenu-frame {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: translateY(-8px);
  transition: transform var(--side-anim);
}

.side-menu__item.is-open > .side-menu__submenu .side-menu__submenu-frame,
.side-menu__submenu-block--has-submenu.is-open > .side-menu__submenu .side-menu__submenu-frame {
  transform: translateY(0);
}

.side-menu__submenu-block {
  display: block;
}

.side-menu__row--nested {
  min-height: 22px;
}

.side-menu__sublink {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.32;
}

.side-menu__submenu--nested {
  margin-top: 0;
}

.side-menu__submenu-block.is-open > .side-menu__submenu--nested {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 16px;
}

.side-menu__sublink--deep {
  display: block;
  padding-left: 36px;
}

.side-menu__socials {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  padding-top: 22px;
  padding-left: 0;
  margin-top: auto;
  padding-bottom: 20px;
}

.side-menu__social {
  width: 30px;
  height: 30px;
  background: transparent;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex: 0 0 30px;
}

.side-menu__social img {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
}

@media (min-width: 981px) {
  .side-menu {
    display: none !important;
  }
}

@media (min-width: 981px) {
  .custom-has-nested:hover > .nested {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}