/* Shared sticky header for all pages. */

:root {
  --fh-global-promo-height: 50px;
  --fh-global-header-height: 76px;
  --fh-global-ink: #1f173b;
  --fh-global-purple: #8d3ee6;
  --fh-global-gold: #f2c943;
}

body {
  overflow-x: hidden;
}

.promo-bar {
  position: sticky;
  top: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  isolation: isolate;
  overflow: hidden;
  box-sizing: border-box;
  width: 100vw;
  max-width: 100vw;
  min-height: var(--fh-global-promo-height);
  padding: 8px 24px;
  background:
    radial-gradient(circle at 18% 50%, rgba(255,255,255,0.22), transparent 16%),
    radial-gradient(circle at 82% 50%, rgba(255,255,255,0.18), transparent 18%),
    linear-gradient(90deg, #7c2ce0 0%, #9d42eb 48%, #7d2dd9 100%);
  background-size: 180% 100%, 180% 100%, 220% 100%;
  box-shadow: 0 4px 20px rgba(99, 37, 173, 0.22);
  animation: fh-promo-gradient 9s ease-in-out infinite;
}

.promo-bar::before,
.promo-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.promo-bar::before {
  inset: -70% -24%;
  background: linear-gradient(108deg, transparent 36%, rgba(255,255,255,0.26) 48%, transparent 60%);
  transform: translateX(-76%) skewX(-12deg);
  animation: fh-promo-sweep 7.2s ease-in-out infinite;
}

.promo-bar::after {
  background:
    radial-gradient(circle at 24% 50%, rgba(255,231,131,0.22), transparent 22%),
    radial-gradient(circle at 76% 50%, rgba(255,255,255,0.18), transparent 24%);
  opacity: 0.58;
  animation: fh-promo-glow 5.8s ease-in-out infinite;
}

.promo-bar > * {
  position: relative;
  z-index: 1;
}

.promo-bar__sparkles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.promo-bar__sparkles i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: block;
  width: var(--s);
  height: var(--s);
  color: rgba(255, 255, 255, 0.88);
  font-style: normal;
  line-height: 1;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.42) rotate(var(--r));
  animation: fh-promo-random-sparkle var(--t) ease-in-out infinite;
  animation-delay: var(--d);
}

.promo-bar__sparkles i::before {
  content: "\2726";
  display: block;
  font-size: var(--s);
  filter: drop-shadow(0 0 7px rgba(255,255,255,0.7)) drop-shadow(0 0 14px rgba(255,231,131,0.32));
}

.promo-bar__sparkles i:nth-child(3n)::before {
  color: rgba(255, 238, 165, 0.92);
  font-size: calc(var(--s) * 0.82);
}

.promo-bar__sparkles i:nth-child(4n) {
  animation-name: fh-promo-random-sparkle-soft;
}

.promo-bar__sparkles i:nth-child(5n) {
  animation-duration: calc(var(--t) + 1200ms);
}

.promo-bar__text {
  position: relative;
  z-index: 2;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.promo-bar__text::before,
.promo-bar__text::after {
  content: "\2726";
  display: inline-block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  margin: 0 14px;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.36));
  transform-origin: center;
  animation: fh-promo-star-twinkle 2.8s ease-in-out infinite;
}

.promo-bar__text::after {
  animation-delay: 1.35s;
}

.promo-bar .btn-cta {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  min-width: 178px;
  min-height: 30px;
  border-radius: 999px;
  color: #21133f !important;
  background: linear-gradient(180deg, #ffe783 0%, var(--fh-global-gold) 100%) !important;
  box-shadow: 0 8px 18px rgba(74, 37, 112, 0.18);
  font-weight: 800;
  line-height: 1;
  text-decoration: none !important;
  animation: fh-promo-cta-breathe 4.8s ease-in-out infinite;
}

.promo-bar .btn-cta::after {
  content: "";
  position: absolute;
  top: -35%;
  bottom: -35%;
  left: -70%;
  z-index: 0;
  width: 48%;
  background: linear-gradient(104deg, transparent, rgba(255,255,255,0.62), transparent);
  transform: translateX(-20%) skewX(-16deg);
  pointer-events: none;
  animation: fh-promo-button-shine 5.6s ease-in-out infinite;
}

.promo-bar .btn-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 22px rgba(74, 37, 112, 0.24);
}

#masthead,
.site-header {
  position: sticky;
  top: var(--fh-global-promo-height);
  z-index: 10010;
  left: 0;
  right: 0;
  width: 100vw;
  max-width: 100vw;
  background: rgba(255, 255, 255, 0.985);
  border-bottom: 1px solid rgba(215, 189, 120, 0.22);
  box-shadow: 0 1px 0 rgba(41, 26, 78, 0.03);
}

.ast-primary-header-bar {
  min-height: var(--fh-global-header-height);
  background: transparent;
}

.ast-builder-grid-row-container,
.ast-builder-grid-row {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
}

.site-primary-header-wrap .ast-builder-grid-row {
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr) !important;
}

.site-header-primary-section-right {
  justify-content: flex-end;
}

.main-header-menu .menu-link,
.ast-builder-menu-1 .menu-item > .menu-link {
  color: var(--fh-global-ink);
  font-weight: 600;
  font-size: 15px;
}

.main-header-menu .menu-link:hover,
.ast-builder-menu-1 .menu-item:hover > .menu-link {
  color: #7d36d8;
}

.site-title a {
  display: block;
  width: 260px;
  height: 78px;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0;
  text-decoration: none !important;
  background: url("../img/Logo_text_ru.svg?v=5") left center / contain no-repeat;
}

.site-title a::before {
  content: "";
  display: none;
}

.site-title a::after {
  content: "";
  display: none;
}

@media (min-width: 922px) {
  :root {
    --fh-global-header-height: 92px;
  }

  #ast-desktop-header .ast-builder-grid-row-container,
  #ast-desktop-header .ast-builder-grid-row {
    width: 100%;
    max-width: none;
  }

  #ast-desktop-header .ast-primary-header-bar,
  #ast-desktop-header .ast-builder-grid-row-container {
    min-height: 92px !important;
    height: 92px;
    overflow: visible;
  }

  #ast-desktop-header .ast-builder-grid-row-container {
    padding-left: 48px;
    padding-right: 48px;
  }

  #ast-desktop-header .site-primary-header-wrap .ast-builder-grid-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 400px;
    grid-template-columns: none !important;
    transform: scale(0.7);
    transform-origin: center center;
  }

  #ast-desktop-header .site-header-primary-section-left {
    flex: 0 0 auto;
    min-width: 0;
  }

  #ast-desktop-header .site-header-primary-section-right {
    flex: 0 0 auto;
    min-width: 0;
    justify-content: flex-start;
  }

  #ast-desktop-header .site-branding,
  #ast-desktop-header .ast-builder-layout-element[data-section="title_tagline"],
  #ast-desktop-header .ast-site-title-wrap {
    width: 100%;
  }

  #ast-desktop-header .site-title {
    position: relative;
    display: block;
    width: 430px;
    min-height: 90px;
    line-height: 1;
  }

  #ast-desktop-header .site-title a {
    display: block;
    width: 430px;
    height: 90px;
    min-height: 0;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0;
    background: url("../img/Logo_text_ru.svg?v=5") left center / contain no-repeat;
    transform: scale(1.422);
    transform-origin: left center;
  }

  #ast-desktop-header .site-title a::before {
    display: none;
  }

  #ast-desktop-header .site-title a::after {
    display: none;
  }

  #ast-desktop-header .site-title::before {
    content: "";
    display: none;
  }

  #ast-desktop-header .site-title::after {
    content: "";
    display: none;
  }

  #ast-desktop-header .ast-builder-menu-1,
  #ast-desktop-header .ast-main-header-bar-alignment,
  #ast-desktop-header .main-header-bar-navigation,
  #ast-desktop-header .main-navigation,
  #ast-desktop-header .main-header-menu {
    width: auto;
  }

  #ast-desktop-header .main-header-menu {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 22px;
  }

  #ast-desktop-header .main-header-menu > .menu-item {
    position: relative;
    margin: 0;
  }

  #ast-desktop-header .ast-builder-menu-1 .menu-item > .menu-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    min-height: 44px;
    padding: 0 17px;
    border-radius: 999px;
    color: #24133f;
    background: transparent;
    font-family: "Inter", Arial, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  }

  #ast-desktop-header .ast-builder-menu-1 .menu-item > .menu-link::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -10px;
    width: 104px;
    height: 10px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-2px);
    transition: opacity 180ms ease, transform 180ms ease;
    background: url("../img/menu_line.svg?v=1") center / contain no-repeat;
  }

  #ast-desktop-header .ast-builder-menu-1 .menu-item:hover > .menu-link,
  #ast-desktop-header .ast-builder-menu-1 .menu-item.current-menu-item > .menu-link,
  #ast-desktop-header .ast-builder-menu-1 .menu-item.current-menu-ancestor > .menu-link,
  #ast-desktop-header .ast-builder-menu-1 .menu-item.current_page_item > .menu-link,
  #ast-desktop-header .ast-builder-menu-1 .menu-item.current_page_parent > .menu-link {
    color: #24133f;
    background: linear-gradient(180deg, rgba(247, 242, 255, 0.95) 0%, rgba(237, 225, 252, 0.86) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  }

  #ast-desktop-header .ast-builder-menu-1 .menu-item.current-menu-item > .menu-link::after,
  #ast-desktop-header .ast-builder-menu-1 .menu-item.current-menu-ancestor > .menu-link::after,
  #ast-desktop-header .ast-builder-menu-1 .menu-item.current_page_item > .menu-link::after,
  #ast-desktop-header .ast-builder-menu-1 .menu-item.current_page_parent > .menu-link::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  #ast-desktop-header .main-header-menu .sub-menu {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    z-index: 10030;
    display: grid;
    gap: 4px;
    min-width: 236px;
    padding: 12px;
    border: 1px solid rgba(139, 62, 228, 0.14);
    border-radius: 14px;
    background:
      radial-gradient(circle at 100% 0%, rgba(139, 62, 228, 0.08), transparent 34%),
      rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 52px rgba(42, 25, 82, 0.16);
    list-style: none;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(8px);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
    visibility: hidden;
  }

  #ast-desktop-header .main-header-menu .menu-item:hover > .sub-menu,
  #ast-desktop-header .main-header-menu .menu-item:focus-within > .sub-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    visibility: visible;
  }

  #ast-desktop-header .main-header-menu .sub-menu .menu-item {
    margin: 0;
  }

  #ast-desktop-header .ast-builder-menu-1 .sub-menu .menu-link {
    justify-content: flex-start;
    min-height: 36px;
    width: 100%;
    padding: 0 12px;
    border-radius: 9px;
    color: #2b1a48;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
  }

  #ast-desktop-header .ast-builder-menu-1 .sub-menu .menu-link::after {
    display: none;
  }

  #ast-desktop-header .ast-builder-menu-1 .sub-menu .menu-item:hover > .menu-link,
  #ast-desktop-header .ast-builder-menu-1 .sub-menu .menu-item.current-menu-item > .menu-link {
    color: #24133f;
    background: rgba(237, 225, 252, 0.78);
    box-shadow: none;
  }
}

@media (max-width: 921px) {
  #ast-mobile-header .main-header-menu .menu-item-has-children > .menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  #ast-mobile-header .main-header-menu .menu-item-has-children > .menu-link::after {
    content: "";
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transform-origin: center;
    transition: transform 180ms ease;
  }

  #ast-mobile-header .main-header-menu .menu-item-has-children.is-mobile-submenu-open > .menu-link {
    color: #7d36d8;
  }

  #ast-mobile-header .main-header-menu .menu-item-has-children.is-mobile-submenu-open > .menu-link::after {
    transform: rotate(225deg) translateY(-2px);
  }

  #ast-mobile-header .main-header-menu .sub-menu {
    position: static;
    display: none !important;
    gap: 2px;
    margin: 2px 0 8px 16px;
    padding: 6px 0 6px 12px;
    border-left: 1px solid rgba(139, 62, 228, 0.18);
    background: transparent;
    box-shadow: none;
    list-style: none;
    opacity: 1;
    visibility: visible;
  }

  #ast-mobile-header .main-header-menu .menu-item-has-children.is-mobile-submenu-open > .sub-menu {
    display: grid !important;
  }

  #ast-mobile-header .main-header-menu .sub-menu .menu-link {
    min-height: 34px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 14px;
    transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
  }

  #ast-mobile-header .main-header-menu .sub-menu .menu-link:hover,
  #ast-mobile-header .main-header-menu .sub-menu .menu-link:focus-visible,
  #ast-mobile-header .main-header-menu .sub-menu .menu-link:active,
  #ast-mobile-header .main-header-menu .sub-menu .current-menu-item > .menu-link,
  #ast-mobile-header .main-header-menu .sub-menu .current_page_item > .menu-link {
    color: #24133f;
    background: linear-gradient(180deg, rgba(247, 242, 255, 0.96) 0%, rgba(237, 225, 252, 0.9) 100%);
    box-shadow: inset 0 0 0 1px rgba(139, 62, 228, 0.08);
  }
}

@media (min-width: 922px) and (max-width: 1360px) {
  :root {
    --fh-global-header-height: 76px;
  }

  #ast-desktop-header .ast-primary-header-bar,
  #ast-desktop-header .ast-builder-grid-row-container {
    min-height: 76px !important;
    height: 76px;
  }

  #ast-desktop-header .ast-builder-grid-row-container,
  #ast-desktop-header .ast-builder-grid-row {
    width: 100%;
  }

  #ast-desktop-header .ast-builder-grid-row-container {
    padding-left: 28px;
    padding-right: 28px;
  }

  #ast-desktop-header .site-primary-header-wrap .ast-builder-grid-row {
    gap: 54px;
  }

  #ast-desktop-header .site-title {
    width: 360px;
    min-height: 75px;
  }

  #ast-desktop-header .site-title a {
    width: 360px;
    height: 75px;
    min-height: 0;
    transform: scale(1.427);
  }

  #ast-desktop-header .site-title a::before {
    display: none;
  }

  #ast-desktop-header .site-title a::after {
    display: none;
  }

  #ast-desktop-header .site-title::before {
    display: none;
  }

  #ast-desktop-header .site-title::after {
    display: none;
  }

  #ast-desktop-header .main-header-menu {
    gap: 8px;
  }

  #ast-desktop-header .ast-builder-menu-1 .menu-item > .menu-link {
    min-height: 40px;
    padding: 0 12px;
    font-size: 15px;
  }

  #ast-desktop-header .ast-builder-menu-1 .menu-item > .menu-link::after {
    width: 84px;
    bottom: -8px;
  }
}

body.admin-bar .promo-bar {
  top: 32px;
}

body.admin-bar #masthead,
body.admin-bar .site-header {
  top: calc(var(--fh-global-promo-height) + 32px);
}

@keyframes fh-promo-gradient {
  0%, 100% {
    background-position: 0% 50%, 100% 50%, 0% 50%;
  }
  50% {
    background-position: 100% 50%, 0% 50%, 100% 50%;
  }
}

@keyframes fh-promo-sweep {
  0%, 54% {
    transform: translateX(-76%) skewX(-12deg);
    opacity: 0;
  }
  68% {
    opacity: 0.95;
  }
  86%, 100% {
    transform: translateX(118%) skewX(-12deg);
    opacity: 0;
  }
}

@keyframes fh-promo-glow {
  0%, 100% {
    opacity: 0.42;
  }
  50% {
    opacity: 0.72;
  }
}

@keyframes fh-promo-star-twinkle {
  0%, 100% {
    opacity: 0.45;
    transform: scale(0.86) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.08) rotate(18deg);
  }
}

@keyframes fh-promo-random-sparkle {
  0%, 100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.36) rotate(var(--r));
  }
  18% {
    opacity: 0.9;
  }
  48% {
    opacity: 0.35;
  }
  70% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(1) rotate(calc(var(--r) + 18deg));
  }
}

@keyframes fh-promo-random-sparkle-soft {
  0%, 100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5) rotate(var(--r));
  }
  44% {
    opacity: 0.58;
    transform: translate(-50%, -50%) scale(0.86) rotate(calc(var(--r) - 14deg));
  }
}

@keyframes fh-promo-cta-breathe {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
}

@keyframes fh-promo-button-shine {
  0%, 48% {
    left: -70%;
  }
  72%, 100% {
    left: 125%;
  }
}

@media (max-width: 900px) {
  .promo-bar__text::before,
  .promo-bar__text::after {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --fh-global-promo-height: 80px;
    --fh-global-header-height: 68px;
  }

  #ast-mobile-header,
  #ast-mobile-header .ast-primary-header-bar,
  #ast-mobile-header .ast-builder-grid-row {
    width: 100%;
    max-width: 100%;
  }

  #ast-mobile-header .site-title {
    max-width: calc(100vw - 96px);
    overflow: hidden;
  }

  #ast-mobile-header .site-title a {
    width: 230px;
    height: 68px;
    max-width: 100%;
  }

  #ast-mobile-header .site-title a::before {
    display: none;
  }

  #ast-mobile-header .site-title a::after {
    display: none;
  }

  .promo-bar {
    width: 100vw;
    max-width: 100vw;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 14px;
  }

  .promo-bar__text {
    flex: 0 1 100%;
    min-width: 0;
    width: 100%;
    text-align: center;
    font-size: 12px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .promo-bar .btn-cta {
    min-width: 156px;
    max-width: calc(100vw - 28px);
  }
}

@media (max-width: 389px) {
  :root {
    --fh-global-promo-height: 100px;
  }
}

@media (max-width: 782px) {
  body.admin-bar .promo-bar {
    top: 46px;
  }

  body.admin-bar #masthead,
  body.admin-bar .site-header {
    top: calc(var(--fh-global-promo-height) + 46px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .promo-bar,
  .promo-bar::before,
  .promo-bar::after,
  .promo-bar__sparkles i,
  .promo-bar__text::before,
  .promo-bar__text::after,
  .promo-bar .btn-cta,
  .promo-bar .btn-cta::after {
    animation: none !important;
    transition: none !important;
  }

  .promo-bar .btn-cta:hover {
    transform: none;
  }
}
