/* ======================
   HEADER STYLES - ФІНАЛЬНА ВЕРСІЯ
   Повністю працюючий header з тінню та адаптивністю
====================== */

:root {
  /* Висоти header для різних екранів */
  --header-min-height-desktop: 80px;
  --header-min-height-large-desktop: 100px;
  --header-min-height-tablet: 100px;
  --header-min-height-mobile: 90px;
  --header-min-height-small: 80px;
  
  /* Кольори для градуального переходу */
  --header-bg-solid: var(--bg-dark, #121212);
  --header-bg-transparent: rgba(18, 18, 18, 0);
  --header-bg-semi: rgba(18, 18, 18, 0.3);
  --header-bg-medium: rgba(18, 18, 18, 0.6);
  --header-bg-almost: rgba(18, 18, 18, 0.9);
  
  /* Тіні header */
  --header-shadow-orange: 0 4px 20px rgba(255, 152, 0, 0.15), 0 2px 8px rgba(255, 152, 0, 0.1), 0 2px 10px rgba(0, 0, 0, 0.3);
  --header-shadow-light: 0 1px 5px rgba(0, 0, 0, 0.1);
  --header-shadow-medium: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ======================
   BODY PADDING ADJUSTMENTS
====================== */
body:not(.has-hero) {
  padding-top: var(--header-min-height-desktop);
  transition: padding-top 0.3s ease;
}

@media (min-width: 1600px) {
  body:not(.has-hero) {
    padding-top: var(--header-min-height-large-desktop);
  }
}

@media (max-width: 1279px) {
  body:not(.has-hero) {
    padding-top: var(--header-min-height-tablet);
  }
}

@media (max-width: 480px) {
  body:not(.has-hero) {
    padding-top: var(--header-min-height-mobile);
  }
}

@media (max-width: 320px) {
  body:not(.has-hero) {
    padding-top: var(--header-min-height-small);
  }
}

body.has-hero {
  padding-top: 0;
}

/* ======================
   БАЗОВИЙ HEADER - З ПОМАРАНЧЕВОЮ ТІННЮ
====================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--header-bg-solid);
  box-shadow: var(--header-shadow-orange);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  min-height: var(--header-min-height-desktop);
  padding: 1rem 2rem;
}

/* HERO СТОРІНКИ - без тіні */
body.has-hero header {
  background: var(--header-bg-transparent);
  backdrop-filter: blur(0px);
  box-shadow: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Стадії скролу */
body.has-hero header.scroll-stage-1 {
  background: var(--header-bg-semi);
  backdrop-filter: blur(2px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 1px 5px rgba(255, 152, 0, 0.08);
}

body.has-hero header.scroll-stage-2 {
  background: var(--header-bg-medium);
  backdrop-filter: blur(5px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.1), var(--header-shadow-light);
}

body.has-hero header.scroll-stage-3 {
  background: var(--header-bg-almost);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 3px 15px rgba(255, 152, 0, 0.12), var(--header-shadow-medium);
}

body.has-hero header.scrolled {
  background: var(--header-bg-solid);
  backdrop-filter: blur(10px);
  border-bottom: none;
  box-shadow: var(--header-shadow-orange);
}

/* ======================
   ЕЛЕМЕНТИ HEADER
====================== */
.logo-img {
  height: 60px;
  width: auto;
  transition: all 0.4s ease;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8)) 
          drop-shadow(0 0 25px rgba(0, 0, 0, 0.6));
}

body.has-hero .logo-img {
  filter: drop-shadow(0 6px 15px rgba(0, 0, 0, 0.9)) 
          drop-shadow(0 0 30px rgba(0, 0, 0, 0.7))
          drop-shadow(0 0 50px rgba(0, 0, 0, 0.4));
}

.logo-img:hover {
  transform: scale(1.05);
}

body.has-hero header.scrolled .logo-img {
  height: 50px;
}

.header-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(15px);
  border-radius: 25px;
  padding: 0.5rem 1rem;
  color: var(--light);
  text-decoration: none;
  transition: all 0.4s ease;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  font-family: 'Titillium Web', sans-serif;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

/* HEADER ІКОНКИ - ІДЕАЛЬНЕ ЦЕНТРУВАННЯ */
.header-btn .icon,
.header-btn svg,
.header-btn .menu-icon {
  width: 1em !important;
  height: 1em !important;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  margin: 0 !important;
}

body.has-hero header.scrolled .header-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  text-shadow: none;
}

.header-btn:hover {
  background: rgba(255, 152, 0, 0.3);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

.header-btn .menu-icon {
  transition: transform 0.3s ease;
}

.header-btn:hover .menu-icon {
  transform: rotate(180deg);
}

.contact-btn {
  color: var(--primary);
  background: rgba(255, 152, 0, 0.2);
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.contact-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.5);
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(15px);
  border-radius: 25px;
  padding: 0.5rem 1rem;
  transition: all 0.4s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.has-hero header.scrolled .language-switcher {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.language-switcher:hover {
  background: rgba(255, 152, 0, 0.3);
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

.language-switcher button {
  width: 24px;
  height: 24px;
  font-size: 0.65rem;
  padding: 0;
  background: none;
  border: none;
  color: var(--light);
  cursor: pointer;
  border-radius: 15px;
  transition: all 0.3s ease;
  font-weight: 500;
  font-family: 'Titillium Web', sans-serif;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

body.has-hero header.scrolled .language-switcher button {
  text-shadow: none;
}

.language-switcher button.active,
.language-switcher button:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.05);
  text-shadow: none;
}

/* ======================
   DESKTOP (1280px+) - GRID LAYOUT
====================== */
@media (min-width: 1280px) {
  header {
    min-height: var(--header-min-height-desktop);
    padding: 1rem 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  .header-left {
    justify-self: start;
    display: flex;
    align-items: center;
  }

  .logo-container {
    justify-self: center;
  }

  .header-right {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .header-controls {
    display: none;
  }
}

/* ======================
   LARGE DESKTOP (1600px+)
====================== */
@media (min-width: 1600px) {
  header {
    min-height: var(--header-min-height-large-desktop);
    padding: 1.5rem 3rem;
  }

  .logo-img {
    height: 75px;
  }

  body.has-hero header.scrolled .logo-img {
    height: 65px;
  }

  .header-btn {
    padding: 0.7rem 1.3rem;
    font-size: 1rem;
  }

  .language-switcher {
    padding: 0.7rem 1.3rem;
  }

  .language-switcher button {
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
    width: auto;
    height: auto;
    min-width: 40px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header-right {
    gap: 1.5rem;
  }
}

/* ======================
   TABLET (768px - 1279px) - ДВОХРЯДНА СТРУКТУРА
====================== */
@media (max-width: 1279px) and (min-width: 768px) {
  header {
    min-height: var(--header-min-height-tablet);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column-reverse;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }

  .header-left,
  .header-right {
    display: none;
  }

  .logo-container {
    order: 1;
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .header-controls {
    order: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 0.3rem 1rem;
    background: rgba(0, 0, 0, 0.1);
  }

  .header-controls .burger-menu {
    order: 1;
  }

  .header-controls .language-switcher {
    order: 2;
    margin-left: auto;
    margin-right: 1rem;
  }

  .header-controls .contact-btn {
    order: 3;
  }

  .logo-img {
    height: 50px;
  }

  body.has-hero header.scrolled .logo-img {
    height: 45px;
  }

  .header-btn {
    border-radius: 20px;
    height: 40px;
    min-height: 40px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .header-btn .btn-text {
    display: inline;
  }

  .language-switcher {
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    height: 40px;
    min-height: 40px;
  }

  .language-switcher button {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    height: 32px;
    min-height: 32px;
    min-width: 32px;
  }
}

/* ======================
   MOBILE (481px - 767px) - ВИПРАВЛЕНІ ІКОНКИ
====================== */
@media (max-width: 767px) and (min-width: 481px) {
  header {
    min-height: var(--header-min-height-mobile);
    padding: 0.6rem 0.8rem;
    display: flex;
    flex-direction: column-reverse;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
  }

  .header-left,
  .header-right {
    display: none;
  }

  .logo-container {
    order: 1;
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .header-controls {
    order: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 0.25rem 0.8rem;
    background: rgba(0, 0, 0, 0.1);
  }

  .header-controls .burger-menu {
    order: 1;
  }

  .header-controls .language-switcher {
    order: 2;
    margin-left: auto;
    margin-right: 0.5rem;
  }

  .header-controls .contact-btn {
    order: 3;
  }

  .logo-img {
    height: 42px;
  }

  body.has-hero header.scrolled .logo-img {
    height: 38px;
  }

  .header-btn {
    border-radius: 50%;
    padding: 0;
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header-btn .btn-text {
    display: none;
  }

  .header-btn .icon,
  .header-btn svg,
  .header-btn .menu-icon {
    width: 16px !important;
    height: 16px !important;
    font-size: 0.8rem;
    margin: 0 !important;
  }

  .language-switcher {
    border-radius: 15px;
    padding: 0.1rem 0.25rem;
    height: 30px;
  }

  .language-switcher button {
    font-size: 0.65rem;
    width: 26px;
    height: 26px;
  }
}

/* ======================
   SMALL MOBILE (≤480px) - ВИПРАВЛЕНІ ІКОНКИ
====================== */
@media (max-width: 480px) {
  header {
    min-height: var(--header-min-height-mobile);
    padding: 0.5rem 0.6rem;
    display: flex;
    flex-direction: column-reverse;
    justify-content: center;
    align-items: center;
    gap: 0.3rem;
  }

  .header-left,
  .header-right {
    display: none;
  }

  .logo-container {
    order: 1;
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .header-controls {
    order: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 0.2rem 0.6rem;
    background: rgba(0, 0, 0, 0.1);
  }

  .header-controls .burger-menu {
    order: 1;
  }

  .header-controls .language-switcher {
    order: 2;
    margin-left: auto;
    margin-right: 0.4rem;
  }

  .header-controls .contact-btn {
    order: 3;
  }

  .logo-img {
    height: 36px;
  }

  body.has-hero header.scrolled .logo-img {
    height: 32px;
  }

  .header-btn {
    border-radius: 50%;
    padding: 0;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header-btn .btn-text {
    display: none;
  }

  .header-btn .icon,
  .header-btn svg,
  .header-btn .menu-icon {
    width: 14px !important;
    height: 14px !important;
    font-size: 0.7rem;
    margin: 0 !important;
  }

  .language-switcher {
    border-radius: 14px;
    padding: 0.1rem 0.2rem;
    height: 28px;
  }

  .language-switcher button {
    font-size: 0.6rem;
    width: 24px;
    height: 24px;
  }
}

/* ======================
   MENU OVERLAY & SLIDING MENU
====================== */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

.sliding-menu {
  position: fixed;
  top: 0;
  left: -350px;
  width: 350px;
  height: 100vh;
  background: var(--bg-light);
  z-index: 1000;
  transition: left 0.3s ease;
  overflow-y: auto;
  box-shadow: 5px 0 20px rgba(0, 0, 0, 0.3);
}

.sliding-menu.active {
  left: 0;
}

.menu-header {
  padding: 2rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-header h3 {
  color: var(--primary);
  margin: 0;
  font-size: 1.5rem;
}

.close-menu {
  background: none;
  border: none;
  color: var(--light);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-menu:hover {
  color: var(--primary);
  background: rgba(255, 152, 0, 0.1);
  transform: scale(1.1);
}

.menu-content {
  padding: 2rem 0;
}

.menu-section {
  margin-bottom: 2rem;
}

.menu-section h4 {
  color: var(--primary);
  margin-bottom: 1rem;
  padding: 0 1.5rem;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.menu-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-links li {
  margin: 0;
}

.menu-links a {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  color: var(--light);
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.menu-links a:hover {
  background: rgba(255, 152, 0, 0.1);
  border-left-color: var(--primary);
  color: var(--primary);
  transform: translateX(5px);
}

.menu-links a i {
  margin-right: 1rem;
  width: 20px;
  font-size: 1.1rem;
}

@media (max-width: 480px) {
  .sliding-menu {
    width: 280px;
    left: -280px;
  }
  
  .menu-header {
    padding: 1.5rem 1rem 0.5rem;
  }
  
  .menu-header h3 {
    font-size: 1.3rem;
  }
  
  .menu-links a {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
  }
  
  .menu-links a i {
    font-size: 1rem;
  }
}