/**
 * Krasnodvir Header & Navigation Styles
 *
 * @package Krasnodvir
 */

.kd-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--kd-milk);
  border-bottom: 1px solid var(--kd-border);
  transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

.kd-header.is-scrolled {
  background-color: rgba(244, 240, 232, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(35, 35, 33, 0.06);
}

.kd-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--kd-header-height);
}

/* Brand Logo */
.kd-header__brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.kd-brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.kd-brand-logo__title {
  font-family: var(--kd-font-serif);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--kd-graphite);
  line-height: 1;
}

/* Desktop Navigation */
.kd-header__nav {
  display: flex;
  align-items: center;
}

.kd-menu {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 28px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.kd-menu > li > a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--kd-graphite);
  position: relative;
  padding: 6px 0;
  text-decoration: none;
}

.kd-menu > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--kd-terracotta);
  transition: width 0.25s ease;
}

.kd-menu > li > a:hover::after,
.kd-menu > li.current-menu-item > a::after {
  width: 100%;
}

.kd-menu > li.current-menu-item > a {
  color: var(--kd-terracotta);
  font-weight: 600;
}

/* Header Actions */
.kd-header__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.kd-lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--kd-muted);
}

.kd-lang-item--active {
  color: var(--kd-graphite);
}

.kd-lang-sep {
  opacity: 0.4;
}

/* Mobile Burger Button */
.kd-burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.kd-burger-line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--kd-graphite);
  transition: var(--kd-transition);
}

/* Mobile Off-canvas Navigation */
.kd-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 380px;
  height: 100vh;
  background-color: var(--kd-milk);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  transition: right 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
  overflow-y: auto;
}

.kd-mobile-menu.is-open {
  right: 0;
}

.kd-mobile-menu__inner {
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.kd-mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--kd-border);
}

.kd-mobile-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--kd-graphite);
  cursor: pointer;
  padding: 4px 8px;
}

.kd-mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: auto;
}

.kd-mobile-nav-list a {
  font-family: var(--kd-font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--kd-graphite);
}

.kd-mobile-nav-list a:hover {
  color: var(--kd-terracotta);
}

.kd-mobile-menu__footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--kd-border);
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .kd-header__nav {
    display: none;
  }
  .kd-burger-btn {
    display: flex;
  }
}

@media (max-width: 600px) {
  .kd-header__cta {
    display: none;
  }
  .kd-lang-switcher {
    display: none;
  }
}
