/* styles/header.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%;
}

.clinic-info,
.partner-text {
  font-family: 'OpenRunde-Regular', 'Open Runde', sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 150%;
  letter-spacing: -0.011em;
  color: #77797D;
}

.partner-text {
  text-align: center;
}

/* ДЕСКТОП (1400px+) */
.main-row-desktop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.main-row-desktop-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.desktop-spacer {
  flex: 1;
}

/* ПЛАНШЕТ (скрыт на десктопе) */
.main-row-tablet {
  display: none;
}

/* МОБИЛЬНЫЙ (скрыт на десктопе) */
.main-row-mobile {
  display: none;
}

/* Логотипы */
.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;
}

/* Бургер-кнопка */
.burger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  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);
}

/* Город */
.city-button {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 16px;
  gap: 12px;
  height: 40px;
  background: #F4F6F7;
  border-radius: 16px;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
}

.city-button span {
  font-family: 'OpenRunde-Medium', 'Open Runde', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: #1C1F26;
  white-space: nowrap;
}

/* Поиск */
.search-section {
  display: flex;
  flex: 1;
  min-width: 200px;
}

.search-group {
  display: flex;
  flex: 1;
  height: 40px;
  background: #F4F6F7;
  border-radius: 16px;
  padding: 8px 0px 8px 16px;
  align-items: center;
  justify-content: space-between;
}

.search-wrapper {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: 'OpenRunde-Regular', 'Open Runde', sans-serif;
  font-size: 14px;
  color: #A4A5A8;
}

.search-button {
  background: #26445C;
  border-radius: 16px;
  padding: 8px 16px;
  height: 40px;
  border: none;
  cursor: pointer;
  font-family: 'OpenRunde-Medium', 'Open Runde', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: #F4F4F4;
  white-space: nowrap;
}

/* Иконки действий */
.action-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Обычная иконка */
.icon-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: #F4F6F7;
  border-radius: 16px;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
}

/* Иконка пользователя - с текстом (для десктопа и планшета) */
.icon-btn--user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 12px;
  width: auto;
  min-width: auto;
  height: 40px;
  background: #F4F6F7;
  border-radius: 16px;
  white-space: nowrap;
}

.icon-btn--user .user-email-text {
  font-family: 'OpenRunde-Medium', 'Open Runde', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: #1C1F26;
  white-space: nowrap;
}

/* Меню навигации */
.nav-menu {
  display: flex;
  padding: 8px;
  gap: 8px;
  background: #F4F6F7;
  border-radius: 24px;
}

.nav-item {
  flex: 1;
  padding: 8px 16px;
  height: 40px;
  border-radius: 16px;
  cursor: pointer;
  font-family: 'OpenRunde-Medium', 'Open Runde', sans-serif;
  font-weight: 500;
  font-size: 16px;
  background: transparent;
  border: none;
  white-space: nowrap;
}

.nav-item.active {
  background: #EBB738;
  color: #494C51;
}

.nav-item:not(.active) {
  color: #A4A5A8;
}

/* Мобильное меню */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #E3E7EA;
  z-index: 90;
  padding: 80px 24px 24px;
  overflow-y: auto;
  flex-direction: column;
  gap: 24px;
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.mobile-menu-title {
  font-family: 'OpenRunde-Bold', 'Open Runde', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #1C1F26;
}

.mobile-menu-close {
  width: 40px;
  height: 40px;
  background: #F4F6F7;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}

.mobile-menu-section {
  margin-bottom: 24px;
}

.mobile-menu-section-title {
  font-family: 'OpenRunde-Medium', 'Open Runde', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #A4A5A8;
  margin-bottom: 8px;
  padding: 0 12px;
}

.mobile-menu-item {
  padding: 12px 16px;
  font-family: 'OpenRunde-Medium', 'Open Runde', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #77797D;
  cursor: pointer;
  border-radius: 16px;
}

.mobile-menu-item.active {
  background: #EBB738;
  color: #494C51;
}

.tablet-spacer {
  flex: 1;
}

/* ===== ПЛАНШЕТ 1200px - 761px ===== */
@media (max-width: 1200px) and (min-width: 761px) {
  .top-bar {
    display: none;
  }
  
  .main-row-desktop,
  .main-row-desktop-bottom {
    display: none;
  }
  
  .main-row-mobile {
    display: none;
  }
  
  .main-row-tablet {
    display: block;
  }
  
  .nav-menu {
    display: none;
  }
  
  .header-container {
    padding: 16px 40px 8px 40px;
  }
  
  .tablet-row-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
  }
  
  .tablet-row-top .logo-panacea {
    flex-shrink: 0;
  }
  
  .tablet-row-top .search-section {
    flex: 1;
  }
  
  .tablet-row-top .logo-docfarm {
    flex-shrink: 0;
  }
  
  .tablet-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  
  .tablet-row-bottom .city-button {
    flex-shrink: 0;
  }
  
  .tablet-row-bottom .action-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  
  /* На планшете показываем текст email */
  .tablet-row-bottom .icon-btn--user .user-email-text {
    display: inline-block;
  }
  
  .burger-btn {
    display: flex;
    width: 40px;
    height: 40px;
    background: #F4F6F7;
    border-radius: 16px;
  }
}

/* ===== МОБИЛЬНЫЙ 760px и меньше (ВАРИАНТ А) ===== */
@media (max-width: 760px) {
  .top-bar {
    display: none;
  }
  
  .main-row-desktop,
  .main-row-desktop-bottom {
    display: none;
  }
  
  .main-row-tablet {
    display: none;
  }
  
  .main-row-mobile {
    display: block;
  }
  
  .nav-menu {
    display: none;
  }
  
  .header-container {
    padding: 12px 20px;
  }
  
  .mobile-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }
  
  .mobile-row-top .action-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  
  /* ВАРИАНТ А: Скрываем текст email на мобильном */
  .mobile-row-top .icon-btn--user .user-email-text {
    display: none;
  }
  
  /* Иконка пользователя становится квадратной как остальные */
  .mobile-row-top .icon-btn--user {
    width: 36px;
    height: 36px;
    padding: 8px;
  }
  
  .mobile-row-bottom {
    display: block;
    width: 100%;
  }
  
  .mobile-row-bottom .search-section {
    width: 100%;
  }
  
  .mobile-row-bottom .search-group {
    width: 100%;
  }
  
  .city-button {
    display: none;
  }
  
  .burger-btn {
    display: flex;
    width: 36px;
    height: 36px;
    background: #F4F6F7;
    border-radius: 16px;
  }
  
  .burger-btn span {
    width: 18px;
    height: 2px;
  }
  
  .icon-btn {
    width: 36px;
    height: 36px;
  }
}

/* 479px и меньше */
@media (max-width: 479px) {
  .header-container {
    padding: 12px 16px;
  }
  
  .search-input {
    font-size: 11px;
  }
  
  .search-button {
    font-size: 13px;
    padding: 8px 10px;
  }
  
  .mobile-row-top .icon-btn--user {
    width: 32px;
    height: 32px;
    padding: 6px;
  }
  
  .icon-btn {
    width: 32px;
    height: 32px;
  }
  
  .burger-btn {
    width: 32px;
    height: 32px;
  }
  
  .burger-btn span {
    width: 16px;
    height: 2px;
  }
}

@media (max-width: 360px) {
  .header-container {
    padding: 10px 12px;
  }
  
  .search-button {
    font-size: 11px;
    padding: 6px 8px;
  }
  
  .mobile-row-top .icon-btn--user {
    width: 28px;
    height: 28px;
    padding: 5px;
  }
  
  .icon-btn {
    width: 28px;
    height: 28px;
  }
  
  .burger-btn {
    width: 28px;
    height: 28px;
  }
  
  .burger-btn span {
    width: 14px;
    height: 2px;
  }
}