/* ============================================================
   ZELTIX AI — HEADER FINAL / DESKTOP + PERFECT MOBILE
   ============================================================ */

.zeltix-header {
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 1000;
  width: min(calc(100% - 20px), var(--zeltix-container, 1280px));
  margin: 10px auto 0;
  box-sizing: border-box;
}

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

.zeltix-header__shell {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(190px, 260px) minmax(0, 1fr) minmax(250px, 332px);
  align-items: center;
  gap: 18px;
  padding: 7px 12px 7px 20px;
  border: 1px solid rgba(15, 23, 42, 0.055);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition:
    background 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    transform 0.22s ease;
}

.zeltix-header.is-scrolled .zeltix-header__shell {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.1);
}

/* ============================================================
   LOGO
   ============================================================ */

.zeltix-logo {
  width: fit-content;
  max-width: 210px;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
  text-decoration: none !important;
}

.zeltix-logo__image {
  width: auto;
  max-width: 190px;
  height: 42px;
  display: block;
  object-fit: contain;
}

.zeltix-logo__mock {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.zeltix-logo__mock-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: linear-gradient(135deg, #6bded0 0%, #6e77ff 54%, #b35cf6 100%);
  box-shadow: 0 8px 16px rgba(76, 104, 255, 0.2);
}

.zeltix-logo__mock-mark svg {
  width: 25px;
  height: 25px;
  display: block;
  fill: #ffffff;
}

.zeltix-logo__mock-text {
  min-width: 0;
  color: #0b1020;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

/* ============================================================
   NAV
   ============================================================ */

.zeltix-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 2.4vw, 32px);
  min-width: 0;
}

.zeltix-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  color: #232b3b;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.015em;
  white-space: nowrap;
  text-decoration: none !important;
  transition: color 0.18s ease;
}

.zeltix-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--zeltix-blue, #2f78ef);
  transform: translateX(-50%);
  transition: width 0.18s ease;
}

.zeltix-nav a:hover,
.zeltix-nav a:focus-visible {
  color: var(--zeltix-blue, #2f78ef);
  outline: none;
}

.zeltix-nav a:hover::after,
.zeltix-nav a:focus-visible::after {
  width: 100%;
}

/* ============================================================
   ACTIONS
   ============================================================ */

.zeltix-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-width: 0;
}

.zeltix-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #151b2b;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.015em;
  white-space: nowrap;
  text-decoration: none !important;
  transition: color 0.18s ease;
}

.zeltix-login:hover,
.zeltix-login:focus-visible {
  color: var(--zeltix-blue, #2f78ef);
  outline: none;
}

.zeltix-start,
.zeltix-site .zeltix-start,
.zeltix-site a.zeltix-start {
  min-width: 124px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 19px;
  border: 0 !important;
  border-radius: 10px !important;
  color: #ffffff !important;
  background: linear-gradient(180deg, #3e86f5 0%, #2c73df 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 7px 16px rgba(44, 115, 223, 0.22) !important;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.012em;
  white-space: nowrap;
  text-decoration: none !important;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.zeltix-start:hover,
.zeltix-start:focus-visible,
.zeltix-site a.zeltix-start:hover,
.zeltix-site a.zeltix-start:focus-visible {
  color: #ffffff !important;
  background: linear-gradient(180deg, #438dfa 0%, #246bda 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 9px 20px rgba(44, 115, 223, 0.28) !important;
  transform: translateY(-1px);
  outline: none;
}

.zeltix-header-icon,
.zeltix-site button.zeltix-header-icon {
  position: relative;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  color: #151b2b !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
  appearance: none;
  transition:
    color 0.18s ease,
    background 0.18s ease;
}

.zeltix-header-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zeltix-header-icon:hover,
.zeltix-header-icon:focus-visible {
  color: var(--zeltix-blue, #2f78ef) !important;
  background: rgba(47, 120, 239, 0.08) !important;
  outline: none;
}

.zeltix-header-icon--bell span {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #ef4356;
}

/* ============================================================
   BURGER
   ============================================================ */

.zeltix-burger,
.zeltix-site button.zeltix-burger {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0 !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 10px !important;
  color: #111827 !important;
  background: #ffffff !important;
  box-shadow: none !important;
  cursor: pointer;
  appearance: none;
}

.zeltix-burger span {
  width: 18px;
  height: 2px;
  display: block;
  border-radius: 999px;
  background: currentColor;
  transition:
    transform 0.22s ease,
    opacity 0.22s ease;
}

.zeltix-header.is-menu-open .zeltix-burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.zeltix-header.is-menu-open .zeltix-burger span:nth-child(2) {
  opacity: 0;
}

.zeltix-header.is-menu-open .zeltix-burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   DESKTOP COMPACT
   ============================================================ */

@media (max-width: 1180px) {
  .zeltix-header__shell {
    grid-template-columns: minmax(170px, 220px) minmax(0, 1fr) minmax(240px, 304px);
    gap: 14px;
  }

  .zeltix-nav {
    gap: 24px;
  }

  .zeltix-logo__image {
    max-width: 170px;
  }

  .zeltix-logo__mock-text {
    font-size: 19px;
  }

  .zeltix-header__actions {
    gap: 13px;
  }
}

/* ============================================================
   TABLET / MOBILE HEADER
   ============================================================ */

@media (max-width: 980px) {
  .zeltix-header {
    top: max(8px, env(safe-area-inset-top));
    width: calc(100% - 16px);
    margin-top: 8px;
  }

  .zeltix-header__shell {
    min-height: 62px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 8px 9px 8px 14px;
    border-radius: 16px;
  }

  .zeltix-logo {
    max-width: min(210px, 42vw);
    min-width: 0;
    overflow: hidden;
  }

  .zeltix-logo__image {
    width: auto;
    max-width: 100%;
    height: 38px;
    object-fit: contain;
  }

  .zeltix-logo__mock {
    gap: 9px;
    min-width: 0;
  }

  .zeltix-logo__mock-mark {
    width: 34px;
    height: 34px;
  }

  .zeltix-logo__mock-text {
    min-width: 0;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 18px;
  }

  .zeltix-nav {
    position: fixed;
    left: 8px;
    right: 8px;
    top: calc(max(8px, env(safe-area-inset-top)) + 72px);
    z-index: 999;
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
    gap: 7px;
    max-height: calc(100svh - 96px);
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 22px 58px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.985);
    pointer-events: none;
    transition:
      opacity 0.2s ease,
      visibility 0.2s ease,
      transform 0.2s ease;
  }

  .zeltix-header.is-menu-open .zeltix-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .zeltix-nav a {
    width: 100%;
    min-height: 48px;
    justify-content: flex-start;
    padding: 0 14px;
    border-radius: 12px;
    background: rgba(246, 248, 252, 0.95);
    color: #172033;
    font-size: 16px;
    font-weight: 600;
  }

  .zeltix-nav a:hover,
  .zeltix-nav a:focus-visible {
    background: rgba(47, 120, 239, 0.08);
  }

  .zeltix-nav a::after {
    display: none;
  }

  .zeltix-header__actions {
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .zeltix-login,
  .zeltix-header-icon {
    display: none !important;
  }

  .zeltix-start,
  .zeltix-site .zeltix-start,
  .zeltix-site a.zeltix-start {
    min-width: 112px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 11px !important;
    font-size: 13.5px;
  }

  .zeltix-burger,
  .zeltix-site button.zeltix-burger {
    display: inline-flex;
  }
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 560px) {
  .zeltix-header {
    width: calc(100% - 12px);
    margin-top: 6px;
  }

  .zeltix-header__shell {
    min-height: 58px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    padding: 7px 7px 7px 10px;
    border-radius: 15px;
  }

  .zeltix-logo {
    max-width: min(176px, 43vw);
  }

  .zeltix-logo__image {
    max-width: 100%;
    height: 35px;
  }

  .zeltix-logo__mock {
    gap: 8px;
  }

  .zeltix-logo__mock-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .zeltix-logo__mock-mark svg {
    width: 23px;
    height: 23px;
  }

  .zeltix-logo__mock-text {
    max-width: 108px;
    font-size: 16px;
  }

  .zeltix-header__actions {
    gap: 6px;
  }

  .zeltix-start,
  .zeltix-site .zeltix-start,
  .zeltix-site a.zeltix-start {
    min-width: 96px;
    min-height: 39px;
    padding: 0 11px;
    border-radius: 10px !important;
    font-size: 13px;
  }

  .zeltix-burger,
  .zeltix-site button.zeltix-burger {
    width: 39px;
    height: 39px;
    min-width: 39px;
    min-height: 39px;
    border-radius: 10px !important;
  }

  .zeltix-nav {
    left: 6px;
    right: 6px;
    top: calc(max(6px, env(safe-area-inset-top)) + 66px);
    border-radius: 17px;
  }
}

/* ============================================================
   SMALL MOBILE
   ============================================================ */

@media (max-width: 430px) {
  .zeltix-header__shell {
    gap: 6px;
  }

  .zeltix-logo {
    max-width: min(160px, 40vw);
  }

  .zeltix-logo__image {
    height: 33px;
  }

  .zeltix-start,
  .zeltix-site .zeltix-start,
  .zeltix-site a.zeltix-start {
    min-width: 92px;
    min-height: 38px;
    padding: 0 10px;
    font-size: 12.5px;
  }

  .zeltix-burger,
  .zeltix-site button.zeltix-burger {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }
}

/* ============================================================
   EXTRA SMALL MOBILE — ничего не вылазит даже на 320px
   ============================================================ */

@media (max-width: 370px) {
  .zeltix-header {
    width: calc(100% - 10px);
  }

  .zeltix-header__shell {
    min-height: 56px;
    padding: 6px 6px 6px 8px;
    gap: 5px;
  }

  .zeltix-logo {
    max-width: min(138px, 38vw);
  }

  .zeltix-logo__image {
    height: 31px;
  }

  .zeltix-logo__mock-mark {
    width: 30px;
    height: 30px;
  }

  .zeltix-logo__mock-text {
    max-width: 82px;
    font-size: 15px;
  }

  .zeltix-start,
  .zeltix-site .zeltix-start,
  .zeltix-site a.zeltix-start {
    min-width: 84px;
    min-height: 36px;
    padding: 0 8px;
    font-size: 12px;
    letter-spacing: -0.02em;
  }

  .zeltix-burger,
  .zeltix-site button.zeltix-burger {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .zeltix-burger span {
    width: 17px;
  }

  .zeltix-header.is-menu-open .zeltix-burger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .zeltix-header.is-menu-open .zeltix-burger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ============================================================
   ULTRA SMALL — если экран прям 320 и меньше
   ============================================================ */

@media (max-width: 330px) {
  .zeltix-logo {
    max-width: 112px;
  }

  .zeltix-logo__image {
    height: 29px;
  }

  .zeltix-start,
  .zeltix-site .zeltix-start,
  .zeltix-site a.zeltix-start {
    min-width: 76px;
    padding: 0 7px;
    font-size: 11.5px;
  }

  .zeltix-burger,
  .zeltix-site button.zeltix-burger {
    width: 35px;
    height: 35px;
    min-width: 35px;
    min-height: 35px;
  }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .zeltix-header *,
  .zeltix-header *::before,
  .zeltix-header *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}