/* ==========================================================================
   СТИЛІ ШАПКИ САЙТУ (css/header.css)
   Компанія: APFEL GROUP | $1M Tech-Brutalism
   ========================================================================== */

:root {
  --primary-green: #63AF38;
  --bg-dark-header: rgba(5, 8, 10, 0.95); /* Глибокий інженерний чорний (з hero.css) */
  --border-color: rgba(255, 255, 255, 0.05); /* Ледь помітна сітка */
  --text-light: #F8FAFC;
  --text-light-muted: #64748B;
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   ГОЛОВНИЙ КОНТЕЙНЕР ШАПКИ (ПК)
   ========================================================================== */
.header {
  position: fixed;
  top: 0 !important;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 18px 0; 
  background-color: transparent;
  box-shadow: none;
  font-family: 'Inter', sans-serif;
  border-bottom: 1px solid transparent; 
  
  /* Апаратне прискорення GPU */
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  will-change: background-color, backdrop-filter, border-color;
  transition: var(--transition);
}

/* Стан при скролі: Жорстка скляна панель радара */
.header.is-scrolled {
  background-color: var(--bg-dark-header);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8); /* Жорстка тінь для відокремлення від фону */
}

/* ІНЖЕНЕРНИЙ СТИК (TECH SEAM) ПРИ СКРОЛІ */
.header.is-scrolled::after {
  content: ''; position: absolute; bottom: -1px; left: 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(99, 175, 56, 0.6) 50%, transparent 100%);
  box-shadow: 0 0 15px rgba(99, 175, 56, 0.4); z-index: -1;
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  width: 100%;
  max-width: 1400px; /* Збільшена ширина для B2B (узгоджено з base.css) */
  margin: 0 auto;
  padding: 0 40px;
}

body.admin-bar .header { top: 32px !important; }
@media (max-width: 782px) { body.admin-bar .header { top: 46px !important; } }

/* ==========================================================================
   ЛОГОТИП
   ========================================================================== */
.header__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
  z-index: 1100;
}

.logo__img {
  max-height: 32px;
  width: auto;
  object-fit: contain;
  filter: grayscale(100%) brightness(1.5); /* Металевий срібний логотип */
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.header__logo:hover .logo__img {
  filter: grayscale(0%) brightness(1); /* Повертає колір при наведенні */
  transform: scale(1.05);
}

/* ==========================================================================
   ДЕСКТОПНА НАВІГАЦІЯ (SYSTEM DIRECTORIES)
   ========================================================================== */
.header__nav {
  flex-grow: 1;
  display: flex;
  justify-content: center;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 35px;
  list-style: none;
  margin: 0; padding: 0;
}

.nav__list li a {
  color: var(--text-light-muted);
  font-family: monospace; /* Індустріальний шрифт для навігації */
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  position: relative;
}

.nav__list li a::before {
  content: 'SYS //';
  color: rgba(255, 255, 255, 0.2);
  margin-right: 6px;
  transition: color 0.3s ease;
}

.nav__list li a:hover,
.nav__list li.current-menu-item a {
  color: var(--text-light);
  transform: translateY(-2px);
}

.nav__list li a:hover::before,
.nav__list li.current-menu-item a::before {
  color: var(--primary-green);
}

.nav__mobile-footer { display: none; }

/* ==========================================================================
   ПРАВИЙ БЛОК НА ПК (COMMUNICATION NODES)
   ========================================================================== */
.header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 260px;
}

.header__contacts {
  display: flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
}

.header__phone {
  color: var(--text-light);
  font-family: monospace;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  letter-spacing: 0.1em;
  transition: var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Блимаюча точка з'єднання біля телефону */
.header__phone::before {
  content: ''; width: 6px; height: 6px; 
  background-color: var(--primary-green); border-radius: 50%;
  animation: blink 2s infinite;
}

.header__phone:hover {
  color: var(--primary-green);
  text-shadow: 0 0 15px rgba(99, 175, 56, 0.4);
}

.header__messengers {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Суворі інженерні кнопки месенджерів (Без заокруглень) */
.messenger-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.02);
  border-radius: 0; 
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.messenger-icon-link img {
  width: 16px; height: 16px; object-fit: contain;
  transition: var(--transition);
}

.messenger-icon-link:hover {
  background-color: var(--primary-green);
  border-color: var(--primary-green);
  box-shadow: 0 0 15px rgba(99, 175, 56, 0.4);
}

.messenger-icon-link:hover img {
  filter: brightness(0) invert(1);
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ==========================================================================
   БУРГЕР-КНОПКА
   ========================================================================== */
.burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1100;
}

.burger__line {
  width: 100%; height: 2px;
  background-color: var(--text-light);
  border-radius: 0;
  transition: var(--transition);
}

.burger.is-active .burger__line:nth-child(1) { transform: translateY(9px) rotate(45deg); background-color: var(--primary-green); }
.burger.is-active .burger__line:nth-child(2) { opacity: 0; }
.burger.is-active .burger__line:nth-child(3) { transform: translateY(-9px) rotate(-45deg); background-color: var(--primary-green); }

/* ==========================================================================
   МОБІЛЬНИЙ АДАПТИВ
   ========================================================================== */
@media screen and (max-width: 1024px) {
  .header__actions { display: none !important; }
  .burger { display: flex; }
  .header__container { padding: 0 30px; }

  /* Мобільне меню (Terminal Panel) */
  .header__nav {
    position: fixed; top: 0; left: 0;
    transform: translateX(-100%);
    width: 100%; max-width: 450px;
    height: 100vh; height: 100svh;
    background-color: #05080A; 
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; flex-direction: column; justify-content: flex-start;
    padding: 120px 40px 40px; z-index: 1050; overflow-y: auto;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    box-shadow: 20px 0 50px rgba(0,0,0,0.8);
  }

  .header__nav.is-open { transform: translateX(0); }

  .nav__list {
    flex-direction: column; align-items: flex-start;
    gap: 30px; width: 100%; margin-bottom: 50px;
  }

  .nav__list li { width: 100%; }
  
  .nav__list li a { 
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem; 
    font-weight: 900; 
    color: var(--text-light); 
    letter-spacing: -0.02em;
  }
  
  .nav__list li a::before {
    font-size: 1rem; margin-right: 15px; transform: translateY(-3px);
  }

  /* Мобільний футер меню */
  .nav__mobile-footer {
    display: flex; flex-direction: column; gap: 20px;
    margin-top: auto; padding-top: 30px;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
    width: 100%;
  }

  .nav__mobile-phone { 
    font-size: 1.5rem; font-weight: 800; color: var(--text-light); 
    text-decoration: none; font-family: monospace; display: flex; align-items: center; gap: 10px;
  }
  
  .nav__mobile-phone::before {
    content: ''; width: 8px; height: 8px; background-color: var(--primary-green); 
    border-radius: 50%; animation: blink 2s infinite;
  }

  .nav__mobile-address { font-size: 0.85rem; color: var(--text-light-muted); line-height: 1.5; font-family: monospace; }
  .nav__mobile-messengers { display: flex; gap: 15px; margin: 10px 0 20px; }
  
  /* Брутальна мобільна кнопка */
  .nav__mobile-btn { 
    width: 100%; justify-content: space-between; border-radius: 0; text-transform: uppercase; font-weight: 800;
  }
}

@media screen and (max-width: 480px) {
  .header { padding: 16px 0; }
  .header__container { padding: 0 20px; }
  .logo__img { max-height: 26px; }
  .header__nav { max-width: 100%; padding: 100px 25px 30px; }
  .nav__list li a { font-size: 1.5rem; }
}