/* =============================================
   SMARTBUILD — Header
   ============================================= */

.header {
  position: absolute;
  top: 50px;
  left: 50px;
  right: 50px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Left block: logo + nav inside a glass pill */
.header__left {
  display: flex;
  align-items: center;
  gap: 60px;
  padding: 10px 40px;
  background-color: var(--color-glass);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Logo */
.header__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.header__logo-img {
  height: 46px;
  width: auto;
}

/* Navigation */
.header__nav {
  display: flex;
  align-items: center;
  gap: 40px;
  height: 100%;
}

/* Nav item — animated underline on hover */
.header__nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  font-size: var(--btn-size);
  font-weight: var(--btn-weight);
  line-height: 1.2;
  color: var(--color-alabaster);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition-fast);
}

/* Animated underline: slides in from left on hover */
.header__nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-alabaster);
  transition: width 0.3s ease;
}

.header__nav-item:hover::after {
  width: 100%;
}

.header__nav-item:hover {
  opacity: 1;
}

/* Arrow icon in nav items with dropdown */
.header__nav-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 7px;
  flex-shrink: 0;
}

.header__nav-arrow img {
  width: 5px;
  height: 7px;
  transform: rotate(90deg);
  vertical-align: middle;
  transition: transform var(--transition-fast);
}

/* Dropdown wrapper — extends hover zone down to cover the gap */
.header__nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

/* Invisible bridge between nav item and dropdown panel */
.header__nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -10px;
  width: calc(100% + 20px);
  height: 14px;
  /* transparent zone to keep hover alive while moving to dropdown */
}

/* Dropdown panel — drops below the glass pill border */
.header__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: -10px;
  display: flex;
  flex-direction: column;
  padding: 14px 0;
  background-color: var(--color-white);
  border-radius: 0 0 14px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast),
              transform var(--transition-fast),
              visibility var(--transition-fast);
  min-width: 220px;
  z-index: 200;
}

.header__nav-dropdown:hover .header__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header__nav-dropdown:hover .header__nav-arrow img {
  transform: rotate(270deg);
}

/* Also show underline on parent nav-item when dropdown is open */
.header__nav-dropdown:hover .header__nav-item::after {
  width: 100%;
}

/* Dropdown item — animated underline instead of background */
.header__dropdown-item {
  position: relative;
  display: block;
  padding: 10px 20px;
  font-size: var(--btn-size);
  font-weight: var(--body-weight);
  line-height: 1.4;
  color: var(--color-dark);
  white-space: nowrap;
  transition: color var(--transition-fast);
}

/* Animated underline for dropdown items: slides from left */
.header__dropdown-item::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 20px;
  width: 0;
  height: 1px;
  background-color: var(--color-dark);
  transition: width 0.3s ease;
}

.header__dropdown-item:hover::after {
  width: calc(100% - 40px);
}

/* Right block: contacts + CTA */
.header__right {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 584px;
  flex-shrink: 0;
}

/* Phone bar with socials */
.header__contacts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1 0 0;
  min-width: 0;
  min-height: 0;
  padding: 17px 20px 17px 17px;
  background-color: var(--color-glass);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header__social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: var(--color-alabaster);
  border-radius: 50%;
  flex-shrink: 0;
  transition: background-color var(--transition-fast);
}

.header__social:hover {
  background-color: var(--color-white);
}

.header__social img {
  width: 18px;
  height: 18px;
}

.header__phone {
  font-size: var(--btn-size);
  font-weight: var(--btn-weight);
  line-height: 1;
  letter-spacing: var(--btn-letter-spacing);
  color: var(--color-alabaster);
  white-space: nowrap;
  transition: opacity var(--transition-fast);
}

.header__phone:hover {
  opacity: 0.7;
}

/* CTA button in header */
.header__cta {
  width: 285px;
  height: 70px;
  text-transform: uppercase;
  font-size: var(--btn-size);
  font-weight: var(--btn-weight);
  letter-spacing: var(--btn-letter-spacing);
}

/* Burger button — hidden on desktop, shown at ≤1024px via responsive.css */
.header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 48px;
  height: 48px;
  padding: 12px;
  background: var(--color-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 101;
}

.header__burger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-white);
  border-radius: 1px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

/* Burger → X animation when open */
.header__burger--open .header__burger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.header__burger--open .header__burger-line:nth-child(2) {
  opacity: 0;
}
.header__burger--open .header__burger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile navigation overlay — hidden by default */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--color-alabaster);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
  flex-direction: column;
  gap: 60px;
  overflow-y: auto;
}

.mobile-nav--open {
  opacity: 1;
  visibility: visible;
}

/* Header: logo + close button */
.mobile-nav__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: #fff;
  flex-shrink: 0;
}

.mobile-nav__logo-img {
  height: 40px;
  width: auto;
}

.mobile-nav__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: #EAEAEA;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}

.mobile-nav__close:hover {
  background: #ddd;
}

/* Nav grid: 2-column, bordered cells */
.mobile-nav__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  flex-shrink: 0;
}

.mobile-nav__cell {
  display: flex;
  align-items: center;
  padding: 35px 24px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.44px;
  color: var(--color-graphite);
  text-decoration: none;
  border-top: 1px solid #ccc;
  transition: color var(--transition-fast), background var(--transition-fast);
}

/* Last row: bottom border */
.mobile-nav__cell:nth-child(5),
.mobile-nav__cell:nth-child(6) {
  border-bottom: 1px solid #ccc;
}

/* Left column: right border */
.mobile-nav__cell:nth-child(odd) {
  border-right: 1px solid #ccc;
}

.mobile-nav__cell:hover {
  color: var(--color-dark);
  background: rgba(0, 0, 0, 0.03);
}

/* Contacts section */
.mobile-nav__contacts {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 0 24px;
  flex-shrink: 0;
}

.mobile-nav__contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-nav__email,
.mobile-nav__phone {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.44px;
  color: var(--color-dark);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.mobile-nav__email:hover,
.mobile-nav__phone:hover {
  color: var(--color-graphite);
}

.mobile-nav__cta {
  width: 100%;
  height: 70px;
}

.mobile-nav__address-row {
  display: flex;
  align-items: center;
  gap: 120px;
}

.mobile-nav__address {
  flex: 1;
  font-style: normal;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.16px;
  color: var(--color-dark);
}

.mobile-nav__socials {
  display: flex;
  gap: 40px;
  align-items: center;
  flex-shrink: 0;
}

.mobile-nav__social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  transition: opacity var(--transition-fast);
}

.mobile-nav__social:hover {
  opacity: 0.7;
}

.mobile-nav__social img {
  width: 60px;
  height: 60px;
}

.mobile-nav__social--rutube {
  background: var(--color-dark);
}

.mobile-nav__social--rutube img {
  width: auto;
  height: 18px;
}

/* Doc links */
.mobile-nav__docs {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 24px;
  flex-shrink: 0;
}

.mobile-nav__doc-link {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.44px;
  color: var(--color-graphite);
  text-decoration: none;
  padding: 5px 0;
  transition: color var(--transition-fast);
}

.mobile-nav__doc-link:hover {
  color: var(--color-dark);
}

/* Bottom bar */
.mobile-nav__bottom {
  display: flex;
  justify-content: space-between;
  padding: 0 24px 24px;
  flex-shrink: 0;
}

.mobile-nav__legal,
.mobile-nav__copyright {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.16px;
  color: var(--color-graphite);
  margin: 0;
}

.mobile-nav__copyright {
  text-align: right;
}
