/* =========================================================
   STAKE KZ — HEADER
========================================================= */

:root {
  --stake-header-height: 64px;
}

/* =========================================================
   HEADER
========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;

  width: 100%;
  min-height: var(--stake-header-height);

  background: transparent;
}

.site-header--with-sidebar {
  display: grid;
  grid-template-columns:
    var(--stake-sidebar-width)
    minmax(0, 1fr);
}

/* =========================================================
   DESKTOP SIDEBAR RAIL
========================================================= */

.site-header__rail {
  display: flex;
  align-items: center;

  min-width: 0;
  min-height: var(--stake-header-height);

  padding: 0 14px;

  border-right: 1px solid rgba(151, 198, 224, 0.045);

  border-bottom: 1px solid rgba(151, 198, 224, 0.055);

  background: linear-gradient(180deg, #0a2230 0%, #091f2c 100%);
}

/* =========================================================
   SIDEBAR TOP ACTIONS
========================================================= */

.site-header__rail-actions {
  display: flex;
  align-items: center;

  gap: 6px;

  width: 100%;

  margin: 0;
  padding: 0;
}

/* =========================================================
   SIDEBAR TOP ACTION
========================================================= */

.site-header__rail-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 7px;

  min-width: 0;
  min-height: 38px;

  padding: 0 12px;

  border: 1px solid transparent;

  border-radius: 7px;

  background: transparent;

  color: #c2d3dd;

  font-size: 12px;
  line-height: 1;
  font-weight: 700;

  white-space: nowrap;

  text-decoration: none !important;

  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

/* =========================================================
   LABEL
========================================================= */

.site-header__rail-action .site-sidebar__label {
  flex: 0 1 auto;

  min-width: 0;

  color: inherit;

  overflow: hidden;

  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================================================
   ICON
========================================================= */

.site-header__rail-action .site-sidebar__icon {
  flex: 0 0 16px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 16px;
  height: 16px;

  color: #82aabd;
}

.site-header__rail-action .site-sidebar__icon svg {
  display: block;

  width: 16px;
  height: 16px;

  fill: none;

  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-header__rail-action .site-sidebar__icon-image {
  display: block;

  width: 16px;
  height: 16px;

  object-fit: contain;
}

/* =========================================================
   HOVER
========================================================= */

@media (hover: hover) and (pointer: fine) {
  .site-header__rail-action:hover {
    color: #ffffff;

    border-color: rgba(102, 184, 239, 0.1);

    background: rgba(255, 255, 255, 0.045);

    transform: translateY(-1px);
  }

  .site-header__rail-action:hover .site-sidebar__icon {
    color: #8dccfa;
  }
}

/* =========================================================
   MAIN HEADER
========================================================= */

.site-header__main {
  min-width: 0;

  border-bottom: 1px solid rgba(151, 198, 224, 0.065);

  background: linear-gradient(180deg, rgba(16, 45, 60, 0.98) 0%, rgba(13, 39, 53, 0.98) 100%);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow: 0 6px 24px rgba(2, 18, 27, 0.1);
}

/* =========================================================
   CONTAINER
========================================================= */

.site-header__container {
  display: flex;
  align-items: center;

  width: min(calc(100% - 48px), 1040px);

  min-height: var(--stake-header-height);

  margin: 0 auto;

  gap: 20px;
}

/* =========================================================
   SIDEBAR TOGGLE
========================================================= */

.site-header__menu-toggle {
  display: none;

  flex: 0 0 auto;

  align-items: center;
  justify-content: center;
  flex-direction: column;

  width: 40px;
  height: 40px;

  padding: 8px;

  border: 1px solid rgba(147, 190, 216, 0.13);

  border-radius: 7px;

  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));

  box-shadow: 0 5px 16px rgba(2, 17, 25, 0.12);

  cursor: pointer;

  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.site-header__menu-toggle span {
  display: block;

  width: 20px;
  height: 2px;

  margin: 2.5px 0;

  border-radius: 5px;

  background: #dceaf2;

  transform-origin: center;

  transition:
    background 0.18s ease,
    transform 0.22s ease,
    opacity 0.18s ease;
}

.site-header__menu-toggle.is-active {
  border-color: rgba(102, 184, 239, 0.24);

  background: rgba(255, 255, 255, 0.075);
}

.site-header__menu-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header__menu-toggle.is-active span:nth-child(2) {
  opacity: 0;

  transform: scaleX(0);
}

.site-header__menu-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (hover: hover) and (pointer: fine) {
  .site-header__menu-toggle:hover {
    border-color: rgba(102, 184, 239, 0.26);

    background: rgba(255, 255, 255, 0.075);

    box-shadow: 0 7px 20px rgba(2, 17, 25, 0.16);

    transform: translateY(-1px);
  }

  .site-header__menu-toggle:hover span {
    background: #ffffff;
  }
}

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

.site-header__logo {
  flex: 0 0 auto;

  display: inline-flex;
  align-items: center;

  min-width: 0;

  text-decoration: none;
}

.site-header__logo img {
  display: block;

  width: auto;
  max-width: 118px;
  max-height: 38px;
}

.site-logo__text {
  color: #ffffff;

  font-size: 23px;
  line-height: 1;
  font-weight: 800;

  letter-spacing: -0.7px;
}

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

.site-header__nav {
  display: flex;
  align-items: center;

  margin-left: 24px;
}

.site-header__nav-list {
  display: flex;
  align-items: center;

  gap: 4px;

  margin: 0;
  padding: 0;

  list-style: none;
}

.site-header__nav-list li {
  margin: 0;
  padding: 0;
}

.site-header__nav-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 38px;

  padding: 0 14px;

  border-radius: 6px;

  color: #aebfca;

  font-size: 13px;
  line-height: 1;
  font-weight: 650;

  text-decoration: none;

  transition:
    color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

@media (hover: hover) and (pointer: fine) {
  .site-header__nav-list a:hover {
    color: #ffffff;

    background: rgba(255, 255, 255, 0.045);

    transform: translateY(-1px);
  }
}

.site-header__nav-list .current-menu-item > a,
.site-header__nav-list .current_page_item > a {
  color: #dce9f0;

  background: transparent;
}

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

.site-header__actions {
  display: flex;
  align-items: center;

  gap: 8px;

  margin-left: auto;
}

/* =========================================================
   LANGUAGE
========================================================= */

.site-header__language {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 40px;
  height: 38px;

  padding: 0 11px;

  border: 1px solid rgba(168, 206, 230, 0.12);

  border-radius: 7px;

  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.025) 100%);

  color: #b8ccd8;

  font-size: 12px;
  line-height: 1;
  font-weight: 750;

  text-decoration: none;

  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .site-header__language:hover {
    color: #ffffff;

    border-color: rgba(130, 190, 232, 0.22);

    background: rgba(255, 255, 255, 0.075);

    transform: translateY(-1px);
  }
}

/* =========================================================
   BUTTON
========================================================= */

.site-header__button {
  position: relative;
  isolation: isolate;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 40px;

  padding: 0 19px;

  overflow: hidden;

  border-radius: 7px;

  font-size: 13px;
  line-height: 1;
  font-weight: 750;

  letter-spacing: -0.1px;

  text-decoration: none !important;

  white-space: nowrap;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.site-header__button::before {
  position: absolute;

  top: 0;
  left: -80%;

  z-index: -1;

  width: 55%;
  height: 100%;

  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.12), transparent);

  content: '';

  transform: skewX(-20deg);

  transition: left 0.45s ease;
}

/* =========================================================
   LOGIN
========================================================= */

.site-header__button--secondary {
  min-width: 82px;

  border: 1px solid rgba(94, 170, 229, 0.22);

  background: linear-gradient(180deg, rgba(33, 107, 164, 0.24) 0%, rgba(25, 78, 119, 0.2) 100%);

  color: #e8f4fb;

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

/* =========================================================
   REGISTER
========================================================= */

.site-header__button--primary {
  min-width: 112px;

  border: 1px solid rgba(85, 176, 246, 0.32);

  background: linear-gradient(180deg, #2190ec 0%, #1478d6 100%);

  color: #ffffff;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 6px 16px rgba(13, 101, 177, 0.16);
}

/* =========================================================
   BUTTON HOVER
========================================================= */

@media (hover: hover) and (pointer: fine) {
  .site-header__button:hover {
    transform: translateY(-2px);
  }

  .site-header__button:hover::before {
    left: 130%;
  }

  .site-header__button--secondary:hover {
    border-color: rgba(103, 184, 243, 0.36);

    background: linear-gradient(180deg, rgba(38, 124, 190, 0.34) 0%, rgba(28, 87, 132, 0.29) 100%);

    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.05),
      0 7px 18px rgba(3, 23, 35, 0.15);
  }

  .site-header__button--primary:hover {
    border-color: rgba(119, 199, 255, 0.48);

    background: linear-gradient(180deg, #2a9cf8 0%, #1985e4 100%);

    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      0 8px 22px rgba(15, 112, 195, 0.24);
  }
}

.site-header__button:active {
  transform: translateY(0) scale(0.98);
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {
  :root {
    --stake-header-height: 60px;
  }

  .site-header,
  .site-header--with-sidebar {
    display: block;
  }

  .site-header__rail {
    display: none;
  }

  .site-header__main {
    width: 100%;
  }

  .site-header__container {
    width: 100%;
    min-height: var(--stake-header-height);

    padding: 0 14px;

    gap: 10px;
  }

  .site-header__menu-toggle {
    display: flex;
  }

  .site-header__nav {
    display: none;
  }

  .site-header__logo img {
    max-width: 112px;
    max-height: 34px;
  }

  .site-header__actions {
    flex: 0 0 auto;

    gap: 6px;

    margin-left: auto;
  }

  .site-header__language {
    min-width: 38px;
    height: 36px;

    padding: 0 9px;

    font-size: 11px;
  }

  .site-header__button {
    min-height: 36px;

    padding: 0 13px;

    font-size: 11px;

    border-radius: 6px;
  }

  .site-header__button--secondary {
    min-width: 66px;
  }

  .site-header__button--primary {
    min-width: 86px;
  }
}

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

@media (max-width: 600px) {
  :root {
    --stake-header-height: 58px;
  }

  .site-header__container {
    min-height: var(--stake-header-height);

    padding: 0 10px;

    gap: 7px;
  }

  .site-header__menu-toggle {
    width: 38px;
    height: 38px;

    padding: 7px;
  }

  .site-header__logo img {
    max-width: 96px;
    max-height: 30px;
  }

  .site-logo__text {
    font-size: 18px;
  }

  .site-header__actions {
    gap: 5px;
  }

  .site-header__language {
    min-width: 34px;
    height: 34px;

    padding: 0 7px;

    font-size: 10px;
  }

  .site-header__button {
    min-height: 34px;

    padding: 0 10px;

    font-size: 10.5px;

    border-radius: 6px;
  }

  .site-header__button--secondary {
    min-width: 56px;
  }

  .site-header__button--primary {
    min-width: 72px;
  }
}

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

@media (max-width: 420px) {
  .site-header__container {
    padding: 0 8px;

    gap: 5px;
  }

  .site-header__menu-toggle {
    width: 36px;
    height: 36px;

    padding: 7px;
  }

  .site-header__menu-toggle span {
    width: 18px;
  }

  .site-header__logo img {
    max-width: 82px;
    max-height: 27px;
  }

  .site-header__actions {
    gap: 4px;
  }

  .site-header__language {
    min-width: 31px;
    height: 32px;

    padding: 0 6px;

    font-size: 9.5px;
  }

  .site-header__button {
    min-height: 32px;

    font-size: 9.5px;
  }

  .site-header__button--secondary {
    min-width: 48px;

    padding: 0 7px;
  }

  .site-header__button--primary {
    min-width: 64px;

    padding: 0 7px;
  }
}

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

@media (max-width: 350px) {
  .site-header__container {
    padding: 0 6px;

    gap: 4px;
  }

  .site-header__menu-toggle {
    width: 34px;
    height: 34px;

    padding: 6px;
  }

  .site-header__logo img {
    max-width: 72px;
  }

  .site-header__language {
    min-width: 28px;

    padding: 0 5px;
  }

  .site-header__button--secondary {
    min-width: 43px;

    padding: 0 5px;
  }

  .site-header__button--primary {
    min-width: 58px;

    padding: 0 5px;
  }

  .site-header__button,
  .site-header__language {
    font-size: 8.8px;
  }
}

/* =========================================================
   404 HEADER
========================================================= */

body.error404 .site-header__rail {
  display: none;
}

body.error404 .site-header--with-sidebar {
  grid-template-columns: minmax(0, 1fr);
}

body.error404 .site-header__inner {
  grid-column: 1 / -1;
}

/* =========================================================
   404 MOBILE HEADER
========================================================= */

body.error404 .js-stake-sidebar-toggle,
body.error404 .site-header__burger,
body.error404 .site-header__menu-toggle {
  display: none !important;
}

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

@media (prefers-reduced-motion: reduce) {
  .site-header__menu-toggle,
  .site-header__menu-toggle span,
  .site-header__language,
  .site-header__button,
  .site-header__nav-list a,
  .site-header__rail-action {
    transition: none !important;
  }
}
