/* ========== НАВИГАЦИЯ ========== */
.nav-bar {
  background: var(--bg);
  transition: box-shadow var(--transition);
}

.nav-bar.sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }

  to {
    transform: translateY(0);
  }
}

.burger-nav {
  display: flex;
  justify-content: right;
}

.logo-nav img {
  width: 40px;
}

.nav-container {
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  justify-content: center;
}

.sticky-logo {
  display: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}

/* Десктопное меню */
.nav-menu {
  display: flex;
  list-style: none;
  gap: 4px;
}

.nav-menu li {
  position: relative;
}

.nav-menu > li > a {
  display: block;
  padding: 10px 16px;
  color: var(--text);
  font-weight: 500;
  border-radius: var(--radius);
  transition:
    background var(--transition),
    color var(--transition),
    transform var(--transition);
  white-space: nowrap;
}

.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.12);
}

.nav-menu > li > a:active {
  transform: scale(0.96);
}

.menu-item-has-children > a::after {
  content: "▾";
  font-size: 0.7em;
  margin-left: 4px;
  display: inline-block;
  transition: transform var(--transition);
}

.nav-menu li:hover > .menu-item-has-children > a::after {
  transform: rotate(180deg);
}

/* Подменю */
.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--primary);
  border-radius: var(--radius);
  padding: 8px 0;
  list-style: none;
  box-shadow: var(--shadow);
  animation: fadeDown 0.2s ease;
  z-index: 5;
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-menu li:hover > .sub-menu {
  display: block;
}

.sub-menu a {
  display: block;
  padding: 8px 20px;
  color: #cbd5e1;
  transition:
    background var(--transition),
    color var(--transition),
    padding-left var(--transition);
}

.sub-menu a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding-left: 24px;
}

/* ========== БУРГЕР ========== */
.burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 10px 6px;
  background: none;
  border: none;
  border-radius: var(--radius);
  transition: background var(--transition);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
}

.burger:hover {
  background: rgba(0, 0, 0, 0.04);
}

.burger span {
  display: block;
  height: 2.5px;
  background: var(--text);
  border-radius: 3px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.burger span:nth-child(1),
.burger span:nth-child(3) {
  width: 28px;
}

.burger span:nth-child(2) {
  width: 18px;
  align-self: flex-end;
}

.burger:hover span:nth-child(2) {
  width: 22px;
}

.burger:active span:nth-child(2) {
  width: 14px;
}

.burger.active span:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
  width: 28px;
}

.burger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
  width: 0;
}

.burger.active span:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
  width: 28px;
}

/* ========== МОБИЛЬНОЕ МЕНЮ ========== */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: 1100;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.mobile-overlay.active {
  display: flex;
}

.mobile-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-shrink: 0;
}

.mobile-overlay-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

.close-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition:
    background var(--transition),
    transform var(--transition);
  flex-shrink: 0;
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.close-btn:active {
  transform: scale(0.88);
}

.close-btn::before,
.close-btn::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    background var(--transition);
}

.close-btn::before {
  transform: rotate(45deg);
}

.close-btn::after {
  transform: rotate(-45deg);
}

.close-btn:hover::before,
.close-btn:hover::after {
  background: var(--primary);
}

/* Мобильное меню — вертикальный список */
.mobile-overlay .nav-menu {
  flex-direction: column;
  gap: 0;
}

.mobile-overlay .nav-menu,
.mobile-overlay .nav-menu li,
.mobile-overlay .nav-menu > li > a {
  /* сброс десктопных стилей */
}

.mobile-overlay .nav-menu > li > a {
  font-size: 1.25rem;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text);
  transition:
    color var(--transition),
    padding-left var(--transition);
  background: transparent;
}

.mobile-overlay .nav-menu > li > a:hover {
  color: var(--primary);
  padding-left: 8px;
  background: transparent;
}

.mobile-overlay .nav-menu > li > a:active {
  color: var(--secondary);
}

/* Мобильное подменю */
.mobile-overlay .sub-menu {
  display: none;
  position: static;
  background: transparent;
  box-shadow: none;
  padding: 0 0 8px 20px;
  animation: none;
  min-width: auto;
}

.mobile-overlay .sub-menu.open {
  display: block;
  animation: fadeDown 0.2s ease;
}

.mobile-overlay .sub-menu a {
  padding: 8px 0;
  font-size: 1.05rem;
  color: #4a5568;
}

.mobile-overlay .sub-menu a:hover {
  color: var(--primary);
  padding-left: 8px;
  background: transparent;
}

.mobile-overlay .menu-item-has-children > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Заглушка для sticky */
.nav-placeholder {
  display: none;
}

.nav-placeholder.active {
  display: block;
  height: 56px;
}

/* ========== АДАПТИВ ========== */
@media (max-width: 768px) {
  .nav-bar .nav-menu {
    display: none;
  }

  .burger {
    display: flex;
  }

  .header-phone {
    display: none;
  }

  /* В обычном состоянии скрываем бургер в nav-container */
  .burger-desktop {
    display: none;
  }

  /* Sticky-плашка на мобильных */
  .nav-bar.sticky {
    display: block;
  }

  .nav-bar.sticky .nav-container {
    justify-content: space-between;
  }

  .nav-bar.sticky .sticky-logo {
    display: flex;
    gap: 10px;
    align-items: center;
  }

  .booking-button-nav a {
    margin: 0;
    font-size: 0.8rem;
    padding: 8px 15px;
  }

  .nav-bar.sticky .burger-desktop {
    display: flex;
  }
}
