header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: var(--z-header);
}

header.shrink .header__hero {
  height: var(--header-hero-height-shrink);
}

header.shrink .header__text-wrapper {
  gap: var(--space-1);
}

header.shrink .header__logo {
  width: 4.5rem;
}

header.shrink .header__title {
  font-size: var(--font-size-2xl);
}

header.shrink .header__subtitle {
  font-size: var(--font-size-xs);
}

/* ------------------ Hero Section ------------------ */

.header__hero {
  position: relative;
  width: 100%;
  height: var(--header-hero-height);
  overflow: hidden;
  transition: height var(--transition-base);
}

.header__hero-image {
  width: 100%;
  height: 100%;
  filter: blur(2px);
  scale: 1.1;
  object-fit: cover;
  object-position: center 80%;
}

[data-theme="dark"] .header__hero-image {
  filter: brightness(0.7), blur(2px);
}

.header__hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, hsl(from var(--color-primary) h s calc(l * 2) / 0.7) 0%, hsl(from var(--color-primary) h s calc(l + 50) / 0.9) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .header__hero-overlay {
  background: linear-gradient(180deg, hsl(from var(--color-primary) h s calc(l / 3) / 0.5) 0%, hsl(from var(--color-primary) h s calc(l / 3) / 0.8) 100%);
}

.header__hero-content-wrapper {
  position: absolute;
  inset: 0;
}

.header__hero-content {
  position: absolute;
  width: max-content;
  height: fit-content;
  display: flex;
  gap: var(--space-3);
  align-items: center;
  inset: 50%;
  transform: translate(50%, calc(-50% - calc(var(--header-height) / 2)));
  padding: var(--space-4);
  z-index: 1;
  transition: transform var(--transition-base), gap var(--transition-base), inset var(--transition-base);
}

.header__logo {
  width: 7.5rem;
  aspect-ratio: 1/1;
  transition: width var(--transition-base);
  filter: drop-shadow(0px 2px 1px var(--shadow-color));
}

.header__text-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: gap var(--transition-base);
}

.header__title {
  font-size: var(--font-size-5xl);
  color: var(--text-primary);
  text-shadow: 0 1px 2px var(--shadow-color);
  transition: font-size var(--transition-base);
}

.header__subtitle {
  font-size: var(--font-size-sm);
  max-width: 380px;
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  text-wrap-mode: wrap;
  text-shadow: 0 1px 1px var(--shadow-color);
  transition: font-size var(--transition-base);
}

/* ------------------ Navigation ------------------ */

.header__nav {
  width: 100%;
  position: absolute;
  bottom: 0;
  height: var(--header-height);
  background: var(--bg-nav);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: var(--z-sticky);
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.header__nav--scrolled {
  box-shadow: var(--shadow-md);
}

.header__nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--space-4);
}

/* ------------------ Slogan ------------------ */

.header__slogan {
  flex: 1;
}

.header__slogan-text {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header__slogan-text::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.2);
  }
}

/* ------------------ Phone Numbers ------------------ */

.header__phones {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.header__phone {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  background: transparent;
  border: 1px solid transparent;
}

.header__phone:hover {
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.05);
  border-color: rgba(var(--color-primary-rgb), 0.2);
}

[data-theme="dark"] .header__phone:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.header__phone svg {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
  transition: transform var(--transition-fast);
}

.header__phone:hover svg {
  transform: rotate(15deg);
}

/* ------------------ Responsive ------------------ */

@media (max-width: 768px) {
  .header__text-wrapper {
    gap: var(--space-2);
  }

  .header__logo {
    width: 7rem;
  }

  .header__title {
    font-size: var(--font-size-4xl);
  }

  .header__subtitle {
    font-size: var(--font-size-sm);
    max-width: 310px;
  }

  .header__nav-inner {
    flex-direction: column;
    height: auto;
    padding: var(--space-3) 0;
    gap: var(--space-3);
  }

  .header__nav {
    height: auto;
  }

  .header__slogan-text {
    font-size: var(--font-size-sm);
  }

  .header__phones {
    gap: var(--space-3);
  }

  .header__phone {
    font-size: var(--font-size-xs);
    padding: var(--space-1) var(--space-2);
  }

  .theme-toggle {
    width: 40px;
    height: 40px;
    top: var(--space-3);
    left: var(--space-3);
  }

  .theme-toggle svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .header__text-wrapper {
    gap: var(--space-1);
  }

  .header__title {
    font-size: var(--font-size-3xl);
  }

  .header__subtitle {
    font-size: var(--font-size-xs);
    max-width: 210px;
  }

  .header__logo {
    width: 5.5rem;
  }

  header.shrink .header__logo {
    width: 5.3rem;
  }

  .header__phones {
    flex-wrap: wrap;
    justify-content: center;
  }
}