/* ============================================
   header-v2-base.css
   Базовые стили для всех версий хедера
   ============================================ */

/* Основной контейнер хедера */
.header {
  width: 100%;
  background: #E3E7EA;
  display: flex;
  justify-content: center;
}

.header-container {
  width: 100%;
  max-width: 1440px;
  padding: 24px 60px 8px 60px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== Верхняя строка (видна только на десктопе) ===== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-bottom: 4px;
}

.clinic-phone {
  font-family: 'OpenRunde-Regular', 'OpenRunde', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 150%;
  letter-spacing: -0.011em;
  color: #77797D;
}

.partner-text {
  font-family: 'OpenRunde-Regular', 'OpenRunde', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 150%;
  letter-spacing: -0.011em;
  color: #77797D;
  text-align: center;
}

/* ===== Логотипы ===== */
.logo-panacea {
  flex-shrink: 0;
}

.logo-panacea img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.logo-docfarm {
  flex-shrink: 0;
}

.logo-docfarm img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

/* ===== Кнопка города ===== */
.city-button {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 16px;
  gap: 12px;
  height: 44px;
  background: #F4F6F7;
  border-radius: 16px;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.city-button:hover {
  background: #D4DADE;
}

.city-button span {
  font-family: 'OpenRunde-Medium', 'OpenRunde', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: #1C1F26;
  white-space: nowrap;
}

.city-button img {
  width: 20px;
  height: 20px;
}

/* ===== ПОИСК ===== */
.search-section {
  display: flex;
  flex: 1;
  min-width: 200px;
}

.search-group {
  display: flex;
  flex: 1;
  height: 44px;
  background: #F4F6F7;
  border-radius: 16px;
  padding: 0;
  margin: 0;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}

.search-wrapper {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  padding-left: 16px;
  height: 100%;
}

.search-wrapper img {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: 'OpenRunde-Regular', 'OpenRunde', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #A4A5A8;
  padding: 0;
  margin: 0;
  height: 100%;
}

.search-input:focus {
  color: #1C1F26;
}

.search-input::placeholder {
  color: #A4A5A8;
  opacity: 1;
}

.search-button {
  background: #26445C;
  border-radius: 16px;
  padding: 8px 16px;
  height: 44px;
  border: none;
  cursor: pointer;
  font-family: 'OpenRunde-Medium', 'OpenRunde', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: #F4F4F4;
  white-space: nowrap;
  transition: background 0.2s ease;
  margin: 0;
  flex-shrink: 0;
}

.search-button:hover {
  background: #51697D;
}

/* ===== Иконки действий ===== */
.action-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: #F4F6F7;
  border-radius: 16px;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.icon-btn:hover {
  background: #D4DADE;
}

.icon-btn img {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Кнопка пользователя с текстом - ИСПРАВЛЕНО */
.icon-btn--user {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px 8px 12px;
  width: auto;
  min-width: auto;
  height: 44px;
  background: #F4F6F7;
  border-radius: 16px;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease;
}

.icon-btn--user:hover {
  background: #D4DADE;
}

.icon-btn--user .user-email-text {
  font-family: 'OpenRunde-Medium', 'OpenRunde', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: #1C1F26;
  white-space: nowrap;
  display: inline-block;
}

.icon-btn--user img {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}



/* ===== Навигационное меню ===== */
.nav-menu {
  display: flex;
  padding: 8px;
  gap: 5px;
  background: #F4F6F7;
  border-radius: 24px;
  margin-top: 12px;
}

.nav-item {
  flex: 1;
  padding: 8px 16px;
  height: 40px;
  border-radius: 16px;
  cursor: pointer;
  font-family: 'OpenRunde','OpenRunde-Medium', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 500;
  font-size: 16px;
  background: transparent;
  border: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.nav-item.active {
  background: #EBB738;
  color: #494C51;
}

.nav-item:not(.active) {
  color: #A4A5A8;
}

.nav-item:not(.active):hover {
  background: #D4DADE;
  color: #1C1F26;
}

/* ===== Бургер-кнопка (общая) ===== */
.burger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  background: #F4F6F7;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

.burger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #1C1F26;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.burger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

.burger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.burger-btn {
  display: none;
}

/* ДОПОЛНИТЕЛЬНЫЕ ФИКСЫ ДЛЯ КНОПКИ ЮЗЕРА */
/* Кнопка пользователя с текстом */
.icon-btn--user {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px 8px 12px;
  width: auto;
  min-width: auto;
  height: 44px;
  background: #F4F6F7;
  border-radius: 16px;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease;
}

.desktop-row-main .icon-btn--user {
  flex-shrink: 0;
  white-space: nowrap;
  overflow: visible;
}

.desktop-row-main .icon-btn--user .user-email-text {
  overflow: visible;
  text-overflow: clip;
}

/* Фикс для правильного сжатия input */
.search-group {
  min-width: 0;
  width: 100%;
}

.search-wrapper {
  min-width: 0;
  flex: 1;
}

.search-input {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.search-button {
  flex-shrink: 0;
}

/* ===== ПОВЕДЕНИЕ ХЕДЕРА ПРИ СКРОЛЛЕ ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

/* Когда хедер скрыт — уезжает вверх */
.header.hidden {
  transform: translateY(-100%);
}