/* header.css */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&display=swap');/* Стили для нового хедера */
.header-new {
  width: 100%;
  background-color: #f8f9fc; /* bg-background-light */
  position: sticky;
  top: 0;
  z-index: 50; /* z-50 */
  border-bottom: 1px solid #e7ebf3; /* border-b border-solid border-[#e7ebf3] */
  backdrop-filter: blur(4px); /* backdrop-blur-sm */
}

.header-new.dark {
  background-color: rgba(16, 22, 34, 0.8); /* dark:bg-background-dark/80 */
  border-color: #2a303c; /* dark:border-[#2a303c] */
}

.header-new-container {
  max-width: 1280px; /* container */
  margin: 0 auto; /* mx-auto */
  padding-left: 1rem; /* px-4 */
  padding-right: 1rem; /* px-4 */
}

.header-content {
  display: flex; /* flex */
  height: 4rem; /* h-16 (16 * 0.25rem = 4rem) */
  align-items: center; /* items-center */
  justify-content: space-between; /* justify-between */
  white-space: nowrap; /* whitespace-nowrap */
}

.header-brand {
  display: flex; /* flex */
  align-items: center; /* items-center */
  gap: 0.7rem; /* gap-4 (4 * 0.25rem = 1rem) */
  color: #0d121b; /* text-[#0d121b] */
  flex: 1; /* Занимает оставшееся пространство */
  justify-content: flex-start; /* Выравнивание по левому краю */
}

.header-brand.dark {
  color: #f8f9fc; /* dark:text-[#f8f9fc] */
}

.Brand__logo {
  width: 2rem; /* size-8 (8 * 0.25rem = 2rem) */
  height: 2rem; /* size-8 */
}

.brand-title {
  font-optical-sizing: auto;
  font-style: normal;
  font-weight: 700;              /* font-bold [web:32] */
  font-size: 1.2rem;           /* text-lg (18px) [web:34][web:23] */
  line-height: 1.25;             /* аналог tight line-height [web:38] */
  letter-spacing: -0.015em;      /* кастомный tracking [web:47][web:50] */
  margin: 0;
}

.brand-title-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-title-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

@media (min-width: 768px) {
  .brand-title-wrapper {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }
}

.unofficial-tag {
  font-size: 0.69rem;
  font-weight: 600;
  color: #1e40af;
  background-color: #dbeafe;
  padding: 0.20rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid #bfdbfe; /* Легкая граница для лучшего контраста */
  align-self: center; /* Лучшее выравнивание */
  display: inline-block;
}

/* Адаптация тега "Неофіційний сайт" для мобильных устройств */
@media (max-width: 767px) {
  .unofficial-tag {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    margin-left: 0.25rem;
  }

  .brand-title-container {
    flex-direction: row;
    align-items: center;
  }
}

/* Дополнительная адаптация для очень маленьких экранов */
@media (max-width: 480px) {
  .unofficial-tag {
    font-size: 0.55rem;
    padding: 0.1rem 0.3rem;
    display: none; /* Скрываем тег на очень маленьких экранах */
  }

  .brand-title {
    font-size: 1rem; /* Уменьшаем размер основного заголовка */
  }

  .header-content {
    height: 3.5rem; /* Уменьшаем высоту хедера */
  }

  .mobile-menu-toggle {
    width: 1.75rem;
    height: 1.75rem;
  }

  .hamburger-line {
    width: 1.25rem;
  }
}


.header-nav {
  display: none; /* hidden */
  align-items: center; /* items-center */
  gap: 2.25rem; /* gap-9 (9 * 0.25rem = 2.25rem) */
  margin-left: auto; /* Перемещаем навигацию вправо */
}

/* Для адаптивности на мобильных устройствах */
@media (min-width: 768px) { /* md:flex */
  .header-nav {
    display: flex;
  }
}

.nav-link {
  font-size: 0.875rem; /* text-sm */
  font-weight: 500; /* font-medium */
  line-height: 1.5; /* leading-normal */
  color: inherit; /* default color */
}

.nav-link:hover {
  color: #135bec; /* hover:text-primary */
}

.nav-link.dark:hover {
  color: #135bec; /* dark:hover:text-primary */
}

.nav-link.active {
  font-weight: 700; /* font-bold */
  color: #135bec; /* text-primary */
}

.nav-link.active.dark {
  color: #135bec; /* dark:text-primary */
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
  display: none; /* hidden by default */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 2rem;
  height: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  margin-left: 0.5rem;
  z-index: 60; /* Higher than header */
}

.mobile-menu-toggle:hover {
  background-color: rgba(14, 42, 71, 0.06);
}

.hamburger-line {
  width: 1.5rem;
  height: 2px;
  background-color: #0d121b;
  margin: 0.15rem 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* Animation for hamburger to cross */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(0.4rem, 0.4rem);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(0.4rem, -0.4rem);
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 80%;
  max-width: 300px;
  background-color: white;
  z-index: 55;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

/* Backdrop for mobile menu */
.mobile-menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 54; /* Just below the mobile menu */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu.active {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1rem 1rem;
  border-bottom: 1px solid #e7ebf3;
}

.mobile-menu-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-menu-brand img {
  width: 2rem;
  height: 2rem;
}

.mobile-menu-brand .brand-title {
  font-size: 1rem;
}

.mobile-menu-brand .unofficial-tag {
  display: none; /* Скрываем тег "Неофіційний сайт" в мобильном меню */
}

.close-menu-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
}

.close-menu-btn:hover {
  background-color: rgba(14, 42, 71, 0.06);
}

.mobile-menu-nav {
  padding: 1rem;
  flex: 1;
  overflow-y: auto;
}

.mobile-menu-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu-nav li {
  margin-bottom: 0.25rem;
}

.mobile-menu-nav a {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #0d121b;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

.mobile-menu-nav a:hover {
  background-color: #f0f5ff;
  color: #135bec;
}

.mobile-menu-nav a.active {
  background-color: #e6f0ff;
  color: #135bec;
  font-weight: 600;
}

.mobile-menu-socials {
  padding: 1rem;
  border-top: 1px solid #e7ebf3;
  display: flex;
  gap: 0.75rem;
}

.mobile-menu-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: #f0f5ff;
  color: #135bec;
  text-decoration: none;
  transition: all 0.2s ease;
}

.mobile-menu-socials a:hover {
  background-color: #135bec;
  color: white;
  transform: scale(1.1);
}

/* Show mobile menu toggle on mobile */
@media (max-width: 767px) {
  .mobile-menu-toggle {
    display: flex !important;
  }

  .header-nav {
    display: none !important;
  }
}

/* Стили для старого хедера - оставляем для совместимости */
.Header{
  position:sticky;top:0;z-index:50;background:rgba(255,255,255,.7);
  backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid rgba(14,42,71,.06);
}
.Header__inner{display:flex;align-items:center;justify-content:space-between;min-height:64px;gap:1rem}
@media (min-width: 901px){
  .Nav{flex:1;display:flex;justify-content:center}
  .Header__cta{margin-left:0}
}
.Brand{display:flex;align-items:center;gap:.75rem}
.Brand__logo{width:42px;height:42px}
.Brand__brandtext{display:flex;flex-direction:column;gap:.12rem}
.Brand__title{font-weight:700;font-size:1.08rem;line-height:1.05}
.Brand__subtitle{font-weight:700;font-size:.8rem;color:var(--muted);display:inline-flex;align-items:center;gap:.45rem}
.Brand__subtitle::before{content:"";display:inline-block;width:3px;height:12px;border-radius:3px;background:var(--accent)}
.Nav__menu{display:flex;align-items:center;gap:.2rem}
.Nav__menu li{position:relative}
.Nav__menu a{display:inline-flex;align-items:center;padding:.5rem .7rem;border-radius:10px;font-weight:600;color:var(--brand-800)}
.Nav__menu a:hover{background:rgba(14,42,71,.05)}
.Nav__menu a:focus-visible{outline:2px solid color-mix(in oklab, var(--brand) 35%, white);outline-offset:2px}
.Nav__menu li+li::before{content:"";position:absolute;left:-.3rem;top:50%;transform:translateY(-50%);width:1px;height:16px;background:rgba(14,42,71,.12)}
.Nav__menu a.is-active,.Nav__menu a[aria-current="page"]{color:var(--brand)}
.Nav__menu a.is-active::after,.Nav__menu a[aria-current="page"]::after{content:"";display:block;height:3px;border-radius:3px;background:var(--brand);margin-top:.25rem;transform:translateY(2px)}
@media (min-width: 901px){
  .Nav__menu{justify-content:center}
}
.Nav__toggle{display:none;background:none;border:0;padding:.4rem;border-radius:.5rem}
.Nav__toggle:hover{background:rgba(14,42,71,.06)}
.Header__cta{margin-left:auto}

@media (max-width: 900px){
  .Header__cta{display:none}
  .Nav__toggle{display:inline-flex}
  .Nav__menu{
    position:fixed;inset:68px var(--gutter) auto var(--gutter);
    display:none;flex-direction:column;gap:.8rem;padding:1rem;border-radius:var(--radius-3);
    background:rgba(255,255,255,.9);backdrop-filter:blur(10px);box-shadow:var(--shadow-2);
  }
}