/* Загальні стилі */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.header {
  background: #1a1a1a;
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  height: 72px;
}

/* Додаємо відступ для контенту під хедером */
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header__logo img {
  max-width: 230px;
  vertical-align: middle;
}

/* Десктопне меню */
.header__nav-list {
  display: flex;
  list-style: none;
  gap: 30px;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.header__nav-list > li {
  position: relative;
  opacity: 0;
  animation: fade-in 0.5s ease forwards;
  overflow: visible;
}

/* Додаємо затримку для послідовної появи пунктів */
.header__nav-list > li:nth-child(1) {
  animation-delay: 0.1s;
}
.header__nav-list > li:nth-child(2) {
  animation-delay: 0.2s;
}
.header__nav-list > li:nth-child(3) {
  animation-delay: 0.3s;
}
.header__nav-list > li:nth-child(4) {
  animation-delay: 0.4s;
}
.header__nav-list > li:nth-child(5) {
  animation-delay: 0.5s;
}
.header__nav-list > li:nth-child(6) {
  animation-delay: 0.6s;
}
.header__nav-list > li:nth-child(7) {
  animation-delay: 0.7s;
}

/* Анітація плавної появи */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header__nav-list > li > a {
  text-decoration: none;
  color: #fff;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  height: 72px;
  padding: 0;
  cursor: pointer;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  position: relative;
  overflow: visible;
}

/* Disable clicking on the "Services" link (2nd item) in desktop view */
.header__nav-list > li:nth-child(2) > a {
  pointer-events: none; /* Prevents clicking */
  cursor: default; /* Indicates it's not clickable */
}

/* Ensure "About Us" (6th item) is clickable */
.header__nav-list > li:nth-child(6) > a {
  pointer-events: auto; /* Explicitly allow clicking */
  cursor: pointer; /* Ensure it looks clickable */
}

/* Ensure "Contact Us" (7th item) is clickable */
.header__nav-list > li:nth-child(7) > a {
  pointer-events: auto; /* Explicitly allow clicking */
  cursor: pointer; /* Ensure it looks clickable */
}

/* Глітч-ефект і глоу */
.header__nav-list > li:hover > a,
.header__nav-list > li:has(.sub-menu:hover) > a {
  color: #008eca;
  text-shadow: 0 0 5px rgba(0, 142, 202, 0.5), 0 0 10px rgba(0, 142, 202, 0.3);
}

/* Стилі для маячка */
.header__nav-beacon {
  position: absolute;
  left: -13px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  display: none;
  z-index: 3;
  background: #fff;
  border-radius: 50%;
}

/* Активна версія маячка (з яскравішим неоновим кольором) */
.header__nav-beacon.active {
  background: #00bfff;
  box-shadow: 0 0 5px #00bfff, 0 0 10px #00bfff;
}

/* Показуємо маячок при ховері або коли субменю відкрите */
.header__nav-list > li:hover .header__nav-beacon,
.header__nav-list > li:has(.sub-menu:hover) .header__nav-beacon {
  display: block;
  animation: neon-flicker 1.5s infinite;
}

/* Приховуємо маячки для елементів субменю */
.sub-menu .header__nav-beacon {
  display: none !important;
}

/* Анітація неонового миготіння */
@keyframes neon-flicker {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 5px #00bfff, 0 0 10px #00bfff;
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 2px #00bfff, 0 0 5px #00bfff;
  }
}

/* Глітч-ефект */
.header__nav-list > li:hover > a::before,
.header__nav-list > li:has(.sub-menu:hover) > a::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: #fff;
  text-shadow: 0 0 2px #49fc00, -1px 0 #49fc00;
  clip-path: inset(0 0 100% 0);
  animation: glitch-anim 2s infinite linear alternate-reverse;
}

.header__nav-list > li:hover > a::after,
.header__nav-list > li:has(.sub-menu:hover) > a::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: #fff;
  text-shadow: 0 0 2px #b300fc, 1px 0 #b300fc;
  clip-path: inset(0 0 100% 0);
  animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

/* Генерація ключових кадрів для глітч-ефекту */
@keyframes glitch-anim {
  0% {
    clip-path: inset(42px 0 28px 0);
  }
  5% {
    clip-path: inset(12px 0 58px 0);
  }
  10% {
    clip-path: inset(65px 0 5px 0);
  }
  15% {
    clip-path: inset(31px 0 39px 0);
  }
  20% {
    clip-path: inset(98px 0 0 0);
  }
  25% {
    clip-path: inset(23px 0 47px 0);
  }
  30% {
    clip-path: inset(54px 0 16px 0);
  }
  35% {
    clip-path: inset(76px 0 0 0);
  }
  40% {
    clip-path: inset(19px 0 51px 0);
  }
  45% {
    clip-path: inset(61px 0 9px 0);
  }
  50% {
    clip-path: inset(88px 0 0 0);
  }
  55% {
    clip-path: inset(27px 0 43px 0);
  }
  60% {
    clip-path: inset(45px 0 25px 0);
  }
  65% {
    clip-path: inset(73px 0 0 0);
  }
  70% {
    clip-path: inset(36px 0 34px 0);
  }
  75% {
    clip-path: inset(95px 0 0 0);
  }
  80% {
    clip-path: inset(16px 0 54px 0);
  }
  85% {
    clip-path: inset(58px 0 12px 0);
  }
  90% {
    clip-path: inset(82px 0 0 0);
  }
  95% {
    clip-path: inset(39px 0 31px 0);
  }
  100% {
    clip-path: inset(14px 0 56px 0);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip-path: inset(65px 0 5px 0);
  }
  5% {
    clip-path: inset(31px 0 39px 0);
  }
  10% {
    clip-path: inset(98px 0 0 0);
  }
  15% {
    clip-path: inset(23px 0 47px 0);
  }
  20% {
    clip-path: inset(54px 0 16px 0);
  }
  25% {
    clip-path: inset(76px 0 0 0);
  }
  30% {
    clip-path: inset(19px 0 51px 0);
  }
  35% {
    clip-path: inset(61px 0 9px 0);
  }
  40% {
    clip-path: inset(88px 0 0 0);
  }
  45% {
    clip-path: inset(27px 0 43px 0);
  }
  50% {
    clip-path: inset(45px 0 25px 0);
  }
  55% {
    clip-path: inset(73px 0 0 0);
  }
  60% {
    clip-path: inset(36px 0 34px 0);
  }
  65% {
    clip-path: inset(95px 0 0 0);
  }
  70% {
    clip-path: inset(16px 0 54px 0);
  }
  75% {
    clip-path: inset(58px 0 12px 0);
  }
  80% {
    clip-path: inset(82px 0 0 0);
  }
  85% {
    clip-path: inset(39px 0 31px 0);
  }
  90% {
    clip-path: inset(14px 0 56px 0);
  }
  95% {
    clip-path: inset(67px 0 3px 0);
  }
  100% {
    clip-path: inset(42px 0 28px 0);
  }
}

/* Стилі для першого пункту (Home) */
.header__nav-list > li:nth-child(1) {
  --before-opacity: 0;
  --after-opacity: 1;
}

.header__nav-list > li:nth-child(1)::before {
  content: '';
  position: absolute;
  bottom: 15px;
  left: -99px;
  width: 124px;
  height: 72px;
  background: url('../images/header/1line-home.png') no-repeat top center;
  background-size: 100% 100%;
  opacity: var(--before-opacity);
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.header__nav-list > li:nth-child(1)::after {
  content: '';
  position: absolute;
  bottom: 15px;
  left: -99px;
  width: 124px;
  height: 72px;
  background: url('../images/header/1line-home-active.png') no-repeat top center;
  background-size: 100% 100%;
  opacity: var(--after-opacity);
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Стилі для другого пункту (Services) */
.header__nav-list > li:nth-child(2) {
  --before-opacity: 0;
  --after-opacity: 1;
}

.header__nav-list > li:nth-child(2)::before {
  content: '';
  position: absolute;
  bottom: 15px;
  left: -44px;
  width: 88px;
  height: 9px;
  background: url('../images/header/6line-services.png') no-repeat center bottom;
  background-size: 100% 100%;
  opacity: var(--before-opacity);
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.header__nav-list > li:nth-child(2)::after {
  content: '';
  position: absolute;
  bottom: 15px;
  left: -44px;
  width: 88px;
  height: 9px;
  background: url('../images/header/6line-services-active.png') no-repeat center
    bottom;
  background-size: 100% 100%;
  opacity: var(--after-opacity);
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Стилі для третього пункту (Blog) */
.header__nav-list > li:nth-child(3) {
  --before-opacity: 0;
  --after-opacity: 1;
}

.header__nav-list > li:nth-child(3)::before {
  content: '';
  position: absolute;
  bottom: 15px;
  left: -34px;
  width: 54px;
  height: 9px;
  background: url('../images/header/2line-blog.png') no-repeat center bottom;
  background-size: 100% 100%;
  opacity: var(--before-opacity);
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.header__nav-list > li:nth-child(3)::after {
  content: '';
  position: absolute;
  bottom: 15px;
  left: -34px;
  width: 54px;
  height: 9px;
  background: url('../images/header/2line-blog-active.png') no-repeat center
    bottom;
  background-size: 100% 100%;
  opacity: var(--after-opacity);
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Стилі для четвертого пункту (Gallery) */
.header__nav-list > li:nth-child(4) {
  --before-opacity: 0;
  --after-opacity: 1;
}

.header__nav-list > li:nth-child(4)::before {
  content: '';
  position: absolute;
  bottom: 15px;
  left: -32px;
  width: 64px;
  height: 9px;
  background: url('../images/header/3line-gallery.png') no-repeat center bottom;
  background-size: 100% 100%;
  opacity: var(--before-opacity);
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.header__nav-list > li:nth-child(4)::after {
  content: '';
  position: absolute;
  bottom: 15px;
  left: -32px;
  width: 64px;
  height: 9px;
  background: url('../images/header/3line-gallery-active.png') no-repeat center
    bottom;
  background-size: 100% 100%;
  opacity: var(--after-opacity);
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Стилі для п'ятого пункту (Purchase Options) */
.header__nav-list > li:nth-child(5) {
  --before-opacity: 0;
  --after-opacity: 1;
}

.header__nav-list > li:nth-child(5)::before {
  content: '';
  position: absolute;
  bottom: 15px;
  left: -49px;
  width: 125px;
  height: 9px;
  background: url('../images/header/4line-purchase-option.png') no-repeat center
    bottom;
  background-size: 100% 100%;
  opacity: var(--before-opacity);
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.header__nav-list > li:nth-child(5)::after {
  content: '';
  position: absolute;
  bottom: 15px;
  left: -49px;
  width: 125px;
  height: 9px;
  background: url('../images/header/4line-purchase-option-active.png') no-repeat
    center bottom;
  background-size: 100% 100%;
  opacity: var(--after-opacity);
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Стилі для шостого пункту (About Us) */
.header__nav-list > li:nth-child(6) {
  --before-opacity: 0;
  --after-opacity: 1;
}

.header__nav-list > li:nth-child(6)::before {
  content: '';
  position: absolute;
  bottom: 15px;
  left: -83px;
  width: 120px;
  height: 9px;
  background: url('../images/header/5line-about-us.png') no-repeat center bottom;
  background-size: 100% 100%;
  opacity: var(--before-opacity);
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.header__nav-list > li:nth-child(6)::after {
  content: '';
  position: absolute;
  bottom: 15px;
  left: -83px;
  width: 120px;
  height: 9px;
  background: url('../images/header/5line-about-us-active.png') no-repeat center
    bottom;
  background-size: 100% 100%;
  opacity: var(--after-opacity);
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Стилі для сьомого пункту (Contact Us) */
.header__nav-list > li:nth-child(7) {
  --before-opacity: 0;
  --after-opacity: 1;
}

.header__nav-list > li:nth-child(7)::before {
  content: '';
  position: absolute;
  bottom: 15px;
  left: -44px;
  width: 88px;
  height: 9px;
  background: url('../images/header/6line-services.png') no-repeat center bottom;
  background-size: 100% 100%;
  opacity: var(--before-opacity);
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.header__nav-list > li:nth-child(7)::after {
  content: '';
  position: absolute;
  bottom: 15px;
  left: -44px;
  width: 88px;
  height: 9px;
  background: url('../images/header/6line-services-active.png') no-repeat center
    bottom;
  background-size: 100% 100%;
  opacity: var(--after-opacity);
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Hover ефект для ліній */
.header__nav-list > li:hover,
.header__nav-list > li:has(.sub-menu:hover) {
  --before-opacity: 1;
  --after-opacity: 0;
}

/* Стилі для підменю на десктопі */
.header__nav-list > li {
  position: relative;
}

.header__nav-item--has-sub-menu:hover .sub-menu {
  display: block;
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.sub-menu {
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  background: #222;
  list-style: none;
  padding: 10px 0;
  margin: 0;
  min-width: 200px;
  z-index: 999;
  border: 1px solid #444;
  box-shadow: 0 0 10px rgba(0, 142, 202, 0.3);
}

/* Ensure the submenu under "Services" is still clickable */
.sub-menu li {
  margin: 0;
  position: relative;
}

.sub-menu a {
  color: #fff;
  text-decoration: none;
  padding: 8px 15px;
  display: block;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  transition: color 0.3s ease, background 0.3s ease;
}

.sub-menu a:hover {
  color: #008eca;
  background: #333;
  text-shadow: 0 0 5px rgba(0, 142, 202, 0.5);
}

/* Стилі для бургер-кнопки */
.header__burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1001;
}

.header__burger-line {
  display: block;
  width: 25px;
  height: 3px;
  background: #fff;
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Трансформація бургера в хрестик */
.header__burger[aria-expanded='true'] .header__burger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.header__burger[aria-expanded='true'] .header__burger-line:nth-child(2) {
  opacity: 0;
}

.header__burger[aria-expanded='true'] .header__burger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Мобільне меню */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  z-index: 1000;
}

.mobile-menu[aria-hidden='false'] {
  display: block;
}

.mobile-menu__list {
  list-style: none;
  padding: 20px;
  margin: 0;
}

.mobile-menu__item {
  margin-bottom: 15px;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.mobile-menu[aria-hidden='false'] .mobile-menu__item {
  opacity: 1;
  transform: translateX(0);
}

/* Затримка для послідовної анітації появи пунктів */
.mobile-menu__item:nth-child(1) {
  transition-delay: 0.1s;
}
.mobile-menu__item:nth-child(2) {
  transition-delay: 0.2s;
}
.mobile-menu__item:nth-child(3) {
  transition-delay: 0.3s;
}
.mobile-menu__item:nth-child(4) {
  transition-delay: 0.4s;
}
.mobile-menu__item:nth-child(5) {
  transition-delay: 0.5s;
}
.mobile-menu__item:nth-child(6) {
  transition-delay: 0.6s;
}
.mobile-menu__item:nth-child(7) {
  transition-delay: 0.7s;
}

.mobile-menu__link,
.mobile-menu__toggle {
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  display: block;
  padding: 12px 0;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.mobile-menu__link:hover,
.mobile-menu__toggle:hover {
  color: #008eca;
}

/* Стилі для підменю в мобільному меню */
.mobile-menu__item.has-submenu > .mobile-menu__toggle::after {
  content: '▼';
  display: inline-block;
  margin-left: 10px;
  font-size: 14px;
  transition: transform 0.3s ease;
}

.mobile-menu__item.has-submenu[aria-expanded='true']
  > .mobile-menu__toggle::after {
  transform: rotate(180deg);
}

.mobile-menu__sub-menu {
  max-height: 0;
  overflow: hidden;
  list-style: none;
  padding: 0 0 0 20px;
  margin: 0;
  transition: max-height 0.3s ease;
}

.mobile-menu__sub-menu.active {
  max-height: 300px;
}

.mobile-menu__sub-menu li {
  margin: 0;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.mobile-menu__sub-menu.active li {
  opacity: 1;
  transform: translateX(0);
}

/* Затримка для субменю */
.mobile-menu__sub-menu li:nth-child(1) {
  transition-delay: 0.1s;
}
.mobile-menu__sub-menu li:nth-child(2) {
  transition-delay: 0.2s;
}
.mobile-menu__sub-menu li:nth-child(3) {
  transition-delay: 0.3s;
}
.mobile-menu__sub-menu li:nth-child(4) {
  transition-delay: 0.4s;
}
.mobile-menu__sub-menu li:nth-child(5) {
  transition-delay: 0.5s;
}

.mobile-menu__sub-menu a {
  color: #bbb;
  text-decoration: none;
  font-size: 18px;
  display: block;
  padding: 10px 0;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.mobile-menu__sub-menu a:hover {
  color: #008eca;
}

/* Медіа-запити для адаптивності */
@media (max-width: 1024px) {
  .header__nav-list {
    display: none;
  }

  .header__burger {
    display: block;
  }

  .header__logo img {
    max-width: 200px;
  }
}

@media (max-width: 768px) {
  .header {
    height: 60px;
  }

  .header__nav-list > li > a {
    height: 60px;
  }

  .header__logo img {
    max-width: 200px;
  }
}

@media (max-width: 480px) {
  .mobile-menu__link,
  .mobile-menu__toggle {
    font-size: 18px;
  }

  .mobile-menu__sub-menu a {
    font-size: 16px;
  }
}
