/* SelSup shared header v2: one component, explicit dark/light design tokens. */
.selsup-site-header-wrap,
.selsup-site-header-wrap * {
  box-sizing: border-box;
}

.selsup-site-header-wrap {
  --sh-accent: #51d6ff;
  --sh-cta-bg: linear-gradient(135deg, #12aee8, #3478ff);
  --sh-cta-shadow: 0 10px 24px rgba(18, 174, 232, .22);
  --sh-focus: #63d9ff;
  z-index: 1200;
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  color: var(--sh-text);
  background: var(--sh-wrap-bg);
  box-shadow: var(--sh-wrap-shadow);
  font-family: 'Montserrat', Arial, sans-serif;
  font-synthesis: none;
  transition: background .2s ease, box-shadow .2s ease;
}

.selsup-site-header-wrap--dark {
  --sh-container: 1280px;
  --sh-wrap-bg: rgba(7, 12, 28, .3);
  --sh-wrap-sticky-bg: rgba(7, 12, 28, .97);
  --sh-wrap-shadow: none;
  --sh-wrap-sticky-shadow: 0 12px 36px rgba(0, 0, 0, .22);
  --sh-surface-bg: rgba(7, 12, 29, .72);
  --sh-surface-border: rgba(255, 255, 255, .1);
  --sh-surface-shadow: 0 12px 34px rgba(0, 0, 0, .13);
  --sh-text: #d4dced;
  --sh-text-strong: #fff;
  --sh-action-text: #dce5f5;
  --sh-login-border: rgba(255, 255, 255, .16);
  --sh-menu-bg: #10182f;
  --sh-menu-border: rgba(255, 255, 255, .14);
  --sh-menu-text: #cad4e8;
  --sh-mobile-bg: #0d152d;
  --sh-mobile-rule: rgba(255, 255, 255, .08);
  --sh-toggle-bg: rgba(255, 255, 255, .05);
  --sh-toggle-border: rgba(255, 255, 255, .18);
}

.selsup-site-header-wrap--light {
  --sh-container: 1280px;
  --sh-wrap-bg: rgba(255, 255, 255, .98);
  --sh-wrap-sticky-bg: rgba(255, 255, 255, .98);
  --sh-wrap-shadow: 0 1px 0 rgba(16, 23, 47, .08);
  --sh-wrap-sticky-shadow: 0 10px 28px rgba(16, 23, 47, .1);
  --sh-surface-bg: transparent;
  --sh-surface-border: transparent;
  --sh-surface-shadow: none;
  --sh-text: #34405b;
  --sh-text-strong: #10172f;
  --sh-action-text: #26324d;
  --sh-login-border: rgba(16, 23, 47, .12);
  --sh-menu-bg: #fff;
  --sh-menu-border: rgba(16, 23, 47, .1);
  --sh-menu-text: #34405b;
  --sh-mobile-bg: #fff;
  --sh-mobile-rule: rgba(16, 23, 47, .1);
  --sh-toggle-bg: #f5f8fc;
  --sh-toggle-border: rgba(16, 23, 47, .12);
  --sh-accent: #08a8dc;
  --sh-cta-bg: #08a8dc;
  --sh-cta-shadow: 0 6px 16px rgba(8, 168, 220, .14);
}

.selsup-site-header-wrap--overlay {
  position: absolute;
}

.selsup-site-header-wrap--flow {
  position: relative;
  min-height: 72px;
}

.selsup-site-header-wrap--overlay.is-sticky {
  position: fixed;
}

.selsup-site-header-wrap.is-sticky {
  background: var(--sh-wrap-sticky-bg);
  box-shadow: var(--sh-wrap-sticky-shadow);
}

.selsup-site-header-wrap--flow.is-sticky {
  background: transparent;
  box-shadow: none;
}

.selsup-site-header-wrap--flow.is-sticky::before {
  position: fixed;
  z-index: 0;
  top: 0;
  right: 0;
  left: 0;
  height: 64px;
  background: var(--sh-wrap-sticky-bg);
  box-shadow: var(--sh-wrap-sticky-shadow);
  content: '';
}

.selsup-site-header-wrap--flow.is-sticky .selsup-site-header {
  position: fixed;
  z-index: 1;
  top: 0;
  right: 0;
  left: 0;
  height: 64px;
  background: var(--sh-wrap-sticky-bg);
}

.selsup-site-header {
  position: relative;
  display: flex;
  width: min(var(--sh-container, 1280px), calc(100% - 48px));
  height: 72px;
  align-items: center;
  gap: 18px;
  margin-inline: auto;
  padding: 0 12px 0 18px;
  border: 1px solid var(--sh-surface-border);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  color: var(--sh-text-strong);
  background: var(--sh-surface-bg);
  box-shadow: var(--sh-surface-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: height .2s ease, border-radius .2s ease, background .2s ease, box-shadow .2s ease;
}

.selsup-site-header-wrap--light .selsup-site-header {
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.selsup-site-header-wrap--overlay.is-sticky .selsup-site-header {
  height: 64px;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.selsup-site-header a {
  text-decoration: none;
}

.selsup-site-header button,
.selsup-site-header a {
  font-family: inherit;
}

.selsup-site-header :focus-visible {
  outline: 3px solid var(--sh-focus);
  outline-offset: 3px;
}

.selsup-site-header__sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.selsup-site-header__logo {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 8px;
}

.selsup-site-header__logo-art {
  display: flex;
  width: 168px;
  height: 52px;
  align-items: center;
}

.selsup-site-header__logo-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 52px;
  object-fit: contain;
  object-position: left center;
}

.selsup-site-header__navigation,
.selsup-site-header__nav {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 15px;
}

.selsup-site-header__nav > a,
.selsup-site-header__platform-button {
  padding: 12px 0;
  border: 0;
  border-radius: 6px;
  color: var(--sh-text);
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s ease;
}

.selsup-site-header__nav > a:hover,
.selsup-site-header__platform-button:hover,
.selsup-site-header__nav > a[aria-current='page'] {
  color: var(--sh-text-strong);
}

.selsup-site-header__nav > a[aria-current='page']::after {
  display: block;
  width: 100%;
  height: 2px;
  margin-top: 4px;
  border-radius: 2px;
  background: var(--sh-accent);
  content: '';
}

.selsup-site-header__platform {
  position: relative;
}

.selsup-site-header__platform-button span {
  margin-left: 3px;
  color: var(--sh-accent);
}

.selsup-site-header__mega {
  position: absolute;
  top: 44px;
  left: 0;
  display: grid;
  width: min(760px, calc(100vw - 40px));
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--sh-menu-border);
  border-radius: 18px;
  color: var(--sh-text-strong);
  background: var(--sh-menu-bg);
  box-shadow: 0 24px 64px rgba(16, 23, 47, .22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.selsup-site-header__platform.is-open .selsup-site-header__mega {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.selsup-site-header__mega strong {
  display: block;
  margin-bottom: 12px;
  color: var(--sh-accent);
  font-size: 12px;
  line-height: 1.3;
  text-transform: uppercase;
}

.selsup-site-header__mega a {
  display: block;
  padding: 7px 0;
  border-radius: 5px;
  color: var(--sh-menu-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.selsup-site-header__mega a:hover,
.selsup-site-header__mega a[aria-current='page'] {
  color: var(--sh-text-strong);
}

.selsup-site-header__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.selsup-site-header__phone {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 0 9px;
  border-radius: 9px;
  color: var(--sh-action-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: color .18s ease;
}

.selsup-site-header__phone:hover,
.selsup-site-header__login:hover {
  color: var(--sh-text-strong);
}

.selsup-site-header__login {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--sh-login-border);
  border-radius: 999px;
  color: var(--sh-action-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.selsup-site-header__try {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #fff;
  background: var(--sh-cta-bg);
  box-shadow: var(--sh-cta-shadow);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease;
}

.selsup-site-header__try:hover {
  color: #fff;
  transform: translateY(-1px);
}

.selsup-site-header__menu-button {
  display: none;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--sh-toggle-border);
  border-radius: 13px;
  background: var(--sh-toggle-bg);
  cursor: pointer;
}

.selsup-site-header__menu-button span {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 2px;
  background: var(--sh-text-strong);
  transition: transform .18s ease, opacity .18s ease;
}

.selsup-site-header.is-menu-open .selsup-site-header__menu-button span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.selsup-site-header.is-menu-open .selsup-site-header__menu-button span:nth-child(2) {
  opacity: 0;
}

.selsup-site-header.is-menu-open .selsup-site-header__menu-button span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

body.selsup-header-v2-active [id] {
  scroll-margin-top: 88px;
}

body.selsup-header-menu-open {
  overflow: hidden;
}

/* The legacy help template reserved 105px for the former fixed header.
 * The light v2 header is already in document flow, so retain only a normal
 * section gap instead of stacking both offsets. */
body.selsup-header-v2-active.selsup-header-v2-flow .help_post.help_main_page {
  margin-top: 32px;
}

/* The tariffs template also reserves 90px for the former fixed header. */
body.selsup-header-v2-active.selsup-header-v2-flow.page-template-tariffs-v3 .tariffs_v3_first_page {
  margin-top: 0;
}

@media (min-width: 783px) {
  body.admin-bar .selsup-site-header-wrap {
    top: 32px;
  }

  body.admin-bar .selsup-site-header-wrap--flow {
    top: 0;
  }

  body.admin-bar .selsup-site-header-wrap--flow.is-sticky {
    top: 0;
  }

  body.admin-bar .selsup-site-header-wrap--flow.is-sticky::before,
  body.admin-bar .selsup-site-header-wrap--flow.is-sticky .selsup-site-header {
    top: 32px;
  }
}

@media (max-width: 1320px) {
  .selsup-site-header__navigation,
  .selsup-site-header__nav {
    gap: 12px;
  }

  .selsup-site-header__nav > a,
  .selsup-site-header__platform-button,
  .selsup-site-header__phone {
    font-size: 14px;
  }

  .selsup-site-header__phone {
    padding-inline: 6px;
  }

  .selsup-site-header__login {
    padding-inline: 12px;
  }

  .selsup-site-header__try {
    padding-inline: 14px;
  }
}

@media (max-width: 1180px) {
  .selsup-site-header__menu-button {
    display: flex;
  }

  .selsup-site-header__navigation {
    position: absolute;
    top: 70px;
    right: 0;
    left: 0;
    display: none;
    max-height: calc(100dvh - 86px);
    padding: 18px;
    border: 1px solid var(--sh-menu-border);
    border-radius: 0 0 20px 20px;
    background: var(--sh-mobile-bg);
    box-shadow: 0 24px 70px rgba(16, 23, 47, .24);
    overflow: auto;
  }

  .selsup-site-header.is-menu-open .selsup-site-header__navigation {
    display: block;
  }

  .selsup-site-header__nav {
    display: grid;
    gap: 2px;
  }

  .selsup-site-header__nav > a,
  .selsup-site-header__platform-button {
    display: block;
    width: 100%;
    padding: 12px;
    color: var(--sh-text-strong);
    text-align: left;
  }

  .selsup-site-header__nav > a[aria-current='page']::after {
    display: none;
  }

  .selsup-site-header__mega {
    position: static;
    display: none;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 4px 0 8px;
    padding: 18px;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .selsup-site-header__platform.is-open .selsup-site-header__mega {
    display: grid;
  }

  .selsup-site-header__actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    margin-top: 12px;
  }

  .selsup-site-header__phone {
    grid-column: 1 / -1;
    min-height: 44px;
    padding: 0 12px;
    border-top: 1px solid var(--sh-mobile-rule);
    border-bottom: 1px solid var(--sh-mobile-rule);
    font-size: 13px;
  }

  .selsup-site-header__login {
    text-align: center;
  }
}

@media (max-width: 782px) {
  body.admin-bar .selsup-site-header-wrap {
    top: 46px;
  }

  body.admin-bar .selsup-site-header-wrap--flow {
    top: 0;
  }

  body.admin-bar .selsup-site-header-wrap--flow.is-sticky {
    top: 0;
  }

  body.admin-bar .selsup-site-header-wrap--flow.is-sticky::before,
  body.admin-bar .selsup-site-header-wrap--flow.is-sticky .selsup-site-header {
    top: 46px;
  }
}

@media (max-width: 650px) {
  .selsup-site-header-wrap--overlay {
    background: transparent;
  }

  .selsup-site-header {
    width: calc(100% - 28px);
    height: 64px;
    padding: 0 10px 0 14px;
    border-radius: 0 0 15px 15px;
  }

  .selsup-site-header-wrap--dark .selsup-site-header {
    background: rgba(7, 12, 29, .94);
  }

  .selsup-site-header-wrap--light .selsup-site-header {
    border-radius: 0;
    background: transparent;
  }

  .selsup-site-header-wrap.is-sticky .selsup-site-header {
    height: 64px;
  }

  .selsup-site-header__logo-art {
    width: 150px;
  }

  .selsup-site-header__menu-button {
    width: 42px;
    height: 42px;
  }

  .selsup-site-header__navigation {
    top: 64px;
    max-height: calc(100dvh - 74px);
  }

  .selsup-site-header__mega {
    grid-template-columns: 1fr;
  }

  .selsup-site-header__actions {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .selsup-site-header-wrap,
  .selsup-site-header,
  .selsup-site-header__mega,
  .selsup-site-header__menu-button span,
  .selsup-site-header__try {
    scroll-behavior: auto;
    transition: none;
  }
}
