/* === Header Base === */
.site-header {
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  top: 0;
  z-index: 1000;
  overflow-x: clip;
  position: fixed;
  left: 0;
  width: 100%;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.site-header .container .site-name {  
  text-transform: uppercase;
  color: var(--text-color);
  font-size: 0.8em; 
}

.logo {
  display: flex;
  align-items: center;
  gap: clamp(6px, 2vw, 12px); /* ✅ динамический отступ */
  font-weight: bold;
  text-decoration: none;
}

.logo img {

  height: 50px;
  max-width: 60px;
  object-fit: contain;
}


/* === Desktop Navigation === */
.desktop-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.desktop-nav a {
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-color);
  font-size: 1em;
  padding: 10px 12px;
}

/* === Header Right === */
.header-right {
  display: flex;
  align-items: center;
  gap: clamp(12px, 4vw, 40px);
  flex-wrap: wrap;
}
#themeToggle,
#burger,
#langToggle {
  background: none;
  border: none;
  font-size: 1.3em;
  cursor: pointer;
  color: var(--text-color);
}

/* === Телефон как кнопка === */
.phone {
  display: inline-block;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(0, 87, 217, 0.1);
  color: var(--accent);
  text-decoration: none !important;
  box-shadow: 0 2px 6px rgba(0, 87, 217, 0.2);
  transition: all 0.3s ease;
  white-space: nowrap;
}
.phone:hover,
.phone:focus,
.phone:visited,
.phone:active {
  text-decoration: none !important;
  background: rgba(0, 87, 217, 0.2);
  box-shadow: 0 4px 12px rgba(0, 87, 217, 0.25);
}
[data-theme="dark"] .phone {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 6px rgba(255, 255, 255, 0.15);
}
[data-theme="dark"] .phone:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.25);
}

/* === Language Toggle === */
.language-toggle {
  position: relative;
}
.language-toggle .dropdown {
  position: absolute;
  top: 130%;
  right: 0;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  border-radius: 6px;
  overflow: hidden;
  display: none;
  flex-direction: column;
  z-index: 1000;
}
.language-toggle .dropdown.open {
  display: flex;
}
.language-toggle .dropdown a {
  padding: 10px 14px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-color);
}
.language-toggle .dropdown a:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* === Burger + Mobile Panel === */
#burger {
  display: none;
}
.mobile-panel {
  position: fixed;
  top: 0;
  left: -100%;
  width: 80%;
  max-width: 300px;
  height: 100%;
  background: var(--card-bg);
  box-shadow: 4px 0 16px rgba(0,0,0,0.2);
  z-index: 2000;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
  padding: 20px;
}
.mobile-panel.open {
  left: 0;
}
.mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#closeMobileNav {
  background: none;
  border: none;
  font-size: 1.5em;
  color: var(--text-color);
  cursor: pointer;
}
.mobile-menu {
  display: flex;
  flex-direction: column;
  margin-top: 30px;
}
.mobile-menu a {
  padding: 12px 0;
  font-size: 1.1em;
  font-weight: 500;
  color: var(--text-color);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.mobile-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
  padding-top: 10px;
}



.mobile-footer .mobile-btn {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 10px auto;
  text-align: center;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(0, 87, 217, 0.1);
  color: var(--accent);
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 87, 217, 0.2);
  transition: background 0.3s ease;
}

[data-theme="dark"] .mobile-footer .mobile-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 2px 6px rgba(255, 255, 255, 0.15);
}

.mobile-footer .mobile-btn:hover {
  background: rgba(0, 87, 217, 0.2);
}


.lang-select {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 10px 0;
  font-weight: 500;
}

.lang-select a:hover {
  text-decoration: underline;
}

.lang-select a {
  margin: 0 5px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}
.social-icons {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.social-icons a {
  font-size: 1.2em;
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s;
}
.social-icons a:hover {
  color: var(--accent);
}

.social-icons a svg {
  width: 24px;
  height: 24px;
  color: var(--text-color);
  transition: transform 0.2s ease;
}
.social-icons a:hover svg {
  transform: scale(1.1);
}

/* === Theme Switch (Toggle) === */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}
.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 34px;
  transition: background 0.3s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
}
.theme-switch input:checked + .toggle-slider {
  background-color: var(--accent);
}
.theme-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* === Темный логотип === */
.logo-light {
  display: block;
}
.logo-dark {
  display: none;
}
[data-theme="dark"] .logo-light {
  display: none;
}
[data-theme="dark"] .logo-dark {
  display: block;
}

.site-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  font-size: clamp(0.8em, 2vw, 1.1em);
  transition: all 0.3s ease;
}

/* === Adaptive Media === */
@media (max-width: 1024px) {
  .desktop-nav a {
    font-size: 0.9em;
    padding: 6px 8px;
  }
  .phone {
    font-size: 0.9em;
    padding: 6px 10px;
  }
  .site-header .container {
    display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: center;
      gap: 10px;  
     
  }
}

@media (max-width: 768px) {
  .desktop-nav,
  .phone,
  .language-toggle 
  .language-toggle:not(.mobile-lang-toggle) {
    display: none;
  }

  #burger {
    display: inline-block;
  }
}

.horizontal-menu-wrapper {
  position: relative;
}

#desktopBurger {
  font-size: 1.4em;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
}

.horizontal-flyout-menu {
  position: absolute;
  top: -3px;
  right: calc(100% + 250px); /* ← появится на 40px дальше от кнопки */
  display: flex;
  gap: 20px;
  background: var(--card-bg);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 10px 20px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.horizontal-flyout-menu.show {
  opacity: 20;
  pointer-events: all;
  transform: translateX(0);
}

.horizontal-flyout-menu a {
  font-weight: 400;
  text-transform: uppercase;
  color: var(--text-color);
  text-decoration: none;
}
.horizontal-flyout-menu a:hover {
  text-decoration: underline;
}

/* === Второе меню — вниз под бургером === */
.social-flyout-menu {
  position: absolute;
  top: 165%; /* ниже кнопки */
  right: -115px;
  background: var(--card-bg);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-radius: 0px 0px 8px 8px; /* если хочешь, например, скругление только сверху/снизу */
  padding: 0px 0px 5px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 999;
  flex-direction: row; /* по умолчанию, но можно указать явно */
  justify-content: center; /* или flex-start / space-between */
  align-items: center;
  
}
.social-flyout-menu.show {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  transition: transform 0.2s ease;
}
.social-icon:hover {
  transform: scale(1.1);
}
.social-icon img {
  width: 24px;
  height: 24px;
}

.social-flyout-menu a {
  font-weight: 500;
  color: var(--text-color);
  text-decoration: none;
}
.social-flyout-menu a:hover {
  color: var(--accent);
}

.light-icon {
  display: block;
}
.dark-icon {
  display: none;
}

[data-theme="dark"] .light-icon {
  display: none;
}
[data-theme="dark"] .dark-icon {
  display: block;
}

.social-icon svg {
  width: 24px;
  height: 24px;
  color: var(--text-color);
}

[data-theme="dark"] .social-icon svg {
  color: #fff;
}

/* Определим цвет через переменные */
:root {
  --divider-color: #000; /* чёрная полупрозрачная в светлой теме */
}

[data-theme="dark"] {
  --divider-color: #fff; /* белая полупрозрачная в тёмной теме */
}

/* === Линии в моб. меню === */
.divider {
  height: 2px;
  border: none;
  margin: 12px 0;
  width: 100%;
  background: var(--divider-color);
  opacity: 0.3;
}

.mobile-header .language-toggle {
    display: none;
  }

@media (max-width: 768px) {
  .horizontal-flyout-menu,
  .social-flyout-menu,
  #desktopBurger {
    display: none !important;
    pointer-events: none;
    opacity: 0;
  }
  
  .mobile-lang-toggle {
    display: none;
  }

.mobile-lang-toggle {
  position: relative;
  margin-left: auto;
  margin-right: 10px;
}
#langToggleMobile {
  background: none;
  border: none;
  font-size: 1.6em;
  cursor: pointer;
  color: var(--text-color);
}
#langDropdownMobile {
  position: absolute;
  top: 120%;
  right: 0;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  border-radius: 6px;
  display: none;
  flex-direction: column;
  z-index: 1000;
}
#langDropdownMobile.open {
  display: flex;
}
#langDropdownMobile a {
  padding: 10px 14px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-color);
}
#langDropdownMobile a:hover {
  background: rgba(0, 0, 0, 0.05);
}
}
@media (min-width: 1025px) {
  .logo img {
    height: 60px !important;
    max-width: 90px !important;
  }
}