/* Header — 1:1 from Obmin21.dc.html */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: calc(20px * var(--scale));
  padding: calc(18px * var(--scale)) 0;
  position: relative;
  z-index: 40;
  min-width: 0;
  max-width: 100%;
  background: var(--color-bg);
  color: var(--color-text);
}

.site-header__logo {
  display: flex;
  align-items: center;
  flex: none;
}

.site-header__logo img {
  height: calc(40px * var(--scale));
  width: auto;
  display: block;
}

.site-header__logo-word,
.mobile-menu__logo-word {
  display: block;
  font-size: calc(22px * var(--scale));
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--color-text);
}

.site-header__nav {
  display: none;
  gap: calc(32px * var(--scale));
  font-size: calc(14px * var(--scale));
  font-weight: 600;
  letter-spacing: calc(0.3px * var(--scale));
}

.site-header__nav a {
  color: var(--color-text);
}

.site-header__nav a:hover,
.site-header__nav a[aria-current="page"] {
  color: var(--color-accent-hover);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: calc(18px * var(--scale));
  flex-wrap: wrap;
}

.site-header__phone {
  display: none;
  align-items: center;
  gap: calc(8px * var(--scale));
  font-size: calc(14px * var(--scale));
  color: var(--color-text-muted);
}

.site-header__phone:hover {
  color: var(--color-accent-hover);
}

.site-header__cta {
  display: none;
  background: var(--btn-primary-bg);
  color: var(--color-accent-ink);
  font-weight: 600;
  font-size: calc(16px * var(--scale));
  padding: calc(16px * var(--scale)) calc(29px * var(--scale));
  border-radius: calc(6px * var(--scale));
  min-height: 0;
  line-height: 1.2;
  white-space: nowrap;
}

.site-header__cta:hover,
.mobile-menu .btn--accent:hover {
  background: var(--color-accent-hover);
  color: var(--color-accent-ink);
}

.site-header__menu-toggle:hover,
.mobile-menu__close:hover {
  background: var(--color-accent-hover);
}

.site-header__menu-toggle {
  width: calc(50px * var(--scale));
  height: calc(50px * var(--scale));
  border: 0;
  border-radius: calc(8px * var(--scale));
  background: var(--btn-primary-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(7px * var(--scale));
  cursor: pointer;
  padding: 0;
}

.site-header__menu-toggle span {
  width: calc(22px * var(--scale));
  height: 2px;
  background: var(--color-accent-ink);
  border-radius: 1px;
  display: block;
}

.city-select {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.city-select__btn {
  display: flex;
  align-items: center;
  gap: calc(6px * var(--scale));
  border: 0;
  background: transparent;
  padding: calc(6px * var(--scale)) 0;
  cursor: pointer;
  font-family: inherit;
  font-size: calc(17px * var(--scale));
  font-weight: 600;
  color: var(--color-text);
  min-width: 0;
  max-width: min(calc(220px * var(--scale)), calc(100vw - calc(140px * var(--scale))));
  -webkit-tap-highlight-color: transparent;
}

.city-select__pin,
.city-select__chevron {
  flex: none;
}

.city-select__btn [data-city-label] {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-select__chevron {
  margin-left: 2px;
  transition: transform 0.25s ease;
}

.city-select__btn[aria-expanded="true"] .city-select__chevron {
  transform: rotate(180deg);
}

.city-select__menu {
  position: absolute;
  top: calc(100% + calc(12px * var(--scale)));
  right: calc(-20px * var(--scale));
  z-index: 50;
  width: min(calc(240px * var(--scale)), calc(100vw - calc(24px * var(--scale))));
  max-height: min(calc(70vh - var(--safe-bottom, 0px)), calc(420px * var(--scale)));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--color-bg);
  border-radius: calc(8px * var(--scale));
  box-shadow: 0 calc(12px * var(--scale)) calc(36px * var(--scale)) rgba(5, 33, 69, 0.14);
  padding: calc(10px * var(--scale)) calc(18px * var(--scale)) calc(12px * var(--scale));
}

.city-select__menu form + form .city-select__option {
  border-top: 1px solid #eef0f3;
}

.city-select__option {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: calc(8px * var(--scale));
  padding: calc(7px * var(--scale)) 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: calc(14px * var(--scale));
  color: var(--color-text);
  text-align: left;
}

.city-select__option span {
  min-width: 0;
  white-space: normal;
  line-height: 1.25;
}

.city-select__option:hover,
.city-select__option.is-active {
  color: var(--color-accent-hover);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  padding: calc(calc(18px * var(--scale)) + var(--safe-top)) calc(16px * var(--scale)) calc(calc(16px * var(--scale)) + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu.is-open,
.mobile-menu:not([hidden]) {
  display: flex;
}

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

.mobile-menu__logo img {
  height: calc(40px * var(--scale));
  width: auto;
  display: block;
}

.mobile-menu__close {
  width: calc(54px * var(--scale));
  height: calc(54px * var(--scale));
  border: 0;
  border-radius: calc(8px * var(--scale));
  background: var(--btn-primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-menu__nav {
  margin-top: calc(32px * var(--scale));
  display: flex;
  flex-direction: column;
}

.mobile-menu__nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: calc(16px * var(--scale));
  padding: calc(16px * var(--scale)) 0;
  border-bottom: 1px solid #d5d9df;
  font-size: calc(22px * var(--scale));
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: calc(-0.5px * var(--scale));
  color: var(--color-text);
  transition: color 0.25s ease;
}

.mobile-menu__nav a:hover,
.mobile-menu__nav a[aria-current="page"] {
  color: var(--color-accent-hover);
}

.mobile-menu__bottom {
  margin-top: auto;
  padding-top: calc(40px * var(--scale));
  display: flex;
  flex-direction: column;
  gap: calc(16px * var(--scale));
}

.mobile-menu__phone {
  display: flex;
  align-items: center;
  gap: calc(8px * var(--scale));
  font-size: calc(15px * var(--scale));
  color: var(--color-text);
}

@media (max-width: 767px) {
  /* Лого, місто і бургер лишаються в одному ряду. Довга назва стискається. */
  .site-header {
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--space-2);
  }

  .site-header__logo {
    flex: 0 0 auto;
  }

  .site-header__actions {
    flex: 0 1 auto;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    min-width: 0;
    margin-left: auto;
    max-width: 100%;
  }

  .city-select {
    flex: 0 1 auto;
    min-width: 0;
  }

  .city-select__btn {
    width: auto;
    max-width: 100%;
    gap: calc(4px * var(--scale));
    font-size: calc(14px * var(--scale));
  }

  .site-header__menu-toggle {
    flex: none;
  }

  .city-select__menu {
    right: 0;
    left: auto;
    width: min(calc(240px * var(--scale)), calc(100vw - calc(16px * var(--scale))));
  }

  .mobile-menu__nav a {
    font-size: calc(22px * var(--scale));
  }
}

@media (max-width: 360px) {
  .site-header__logo img {
    height: calc(32px * var(--scale));
  }

  .city-select__btn {
    font-size: calc(13px * var(--scale));
  }
}

@supports (-webkit-touch-callout: none) {
  .site-header__actions,
  .city-select,
  .city-select__btn,
  .city-select__btn [data-city-label] {
    min-width: 0;
  }
}

@media (min-width: 768px) {
  .site-header__logo img {
    height: calc(52px * var(--scale));
  }

  .site-header__phone {
    display: flex;
  }

  .site-header__cta {
    display: inline-flex;
  }

  .site-header__menu-toggle {
    display: none;
  }
}

@media (min-width: 1025px) {
  .site-header__nav {
    display: flex;
  }
}
