/* ===== СТИЛИ HEADER ИЗ MAIN.CSS ===== */

/* CSS переменные */
:root {
  --font-family: 'Manrope', sans-serif;
  --content-width: 1920px;
  --container-offset: 15px;
  --container-width: calc(var(--content-width) + (var(--container-offset) * 2));
  --light-color: #1E1E1E;
  --primary: #972635;
  --primary-light: #f8e9ec;
  --secondary: #264773;
  --secondary-light: #e9eef7;
  --black: #1A1C1F;
  --dark-grey: #455062;
  --grey: #596780;
  --light-grey: #F5F7FA;
  --white: #FFFFFF;
  --border: #E7EBEF;
  --gold: #FFAC30;
}

/* Основные стили header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  transition: transform 0.3s ease-in-out;
}

/* Верхняя часть header */
.header__upper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.header__upper-list {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
}

.header__upper-item {
  display: flex;
  align-items: center;
  flex-direction: column;
  align-items: flex-start;
}

.header__upper-logo {
  display: flex;
  align-items: center;
}

.header__upper-logo img {
  height: 44px;
  width: auto;
  margin-right: 10px;
}

.logo-text {
  padding-left: 7px;
  border-left: 5px solid var(--primary);
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.logo-subtitle {
  font-size: 12px;
  color: var(--grey);
  letter-spacing: 0.3px;
}

.header__upper-location {
  font-size: 12px;
  color: var(--grey);
  margin-top: 2px;
}

.header__upper-adress {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
}

.header__upper-mail {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
}

.header__upper-email {
  font-size: 14px;
  color: var(--primary);
  margin-top: 2px;
}

.rating__link {
  display: flex;
  align-items: center;
}

.rating__container {
  display: flex;
  align-items: center;
  background: var(--light-grey);
  border-radius: 8px;
  padding: 8px 12px;
  gap: 8px;
}

.rating__zone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--gold);
  border-radius: 6px;
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
}

.rating__main {
  margin: 0;
  line-height: 1;
}

.rating__block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rating__stars {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stars__block {
  display: flex;
  gap: 2px;
}

.stars {
  width: 16px;
  height: 16px;
}

.stars__text {
  font-size: 10px;
  color: var(--grey);
  line-height: 1.2;
  margin-top: 2px;
}

.header__upper-work {
  font-size: 12px;
  color: var(--grey);
}

.header__upper-tel {
  margin-bottom: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
  margin-top: 2px;
  transition: color 0.3s;
}

.header__upper-tel:hover {
  color: var(--primary);
}

.header__upper-button {
  display: flex;
  align-items: center;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(151, 38, 53, 0.2);
}

.header__upper-button:hover {
  background: #801f2d;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(151, 38, 53, 0.3);
}

.icon-wrapper {
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.call-svg {
  width: 12px;
  height: 12px;
}

/* Нижняя часть header */
.header__lower {
  background: var(--white);
  transition: max-height 0.3s ease-in-out, opacity 0.2s ease-in-out, visibility 0.3s;
  max-height: 50px; /* Предполагаемая высота меню */
  opacity: 1;
  visibility: visible;
  overflow: hidden;
}

.header__lower-list {
  display: flex;
  justify-content: center;
}

.header__lower-item {
  margin: 0 5px;
}

.header__lower-link {
  display: block;
  padding: 16px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark-grey);
  position: relative;
  transition: color 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header__lower-link:hover {
  color: var(--primary);
}

.header__lower-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background-color: var(--primary);
  transition: width 0.3s;
}

.header__lower-link:hover::after {
  width: 100%;
}

/* Логотип */
.logo-img {
  height: 50px;
  width: auto;
}

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

/* Селектор города */
.city-selector {
  position: relative;
}

.city-select-wrapper {
  cursor: pointer;
}

.city-select-trigger {
  display: flex;
  align-items: center;
  color: var(--primary);
  transition: color 0.3s;
}

.city-select-trigger:hover {
  color: var(--gold);
}

.current-city {
  margin-right: 5px;
}

.current-city.default-text {
  font-size: 12px;
  color: var(--grey);
}

.city-select-wrapper::after {
  content: "Выбрать город";
  display: none;
  position: absolute;
  bottom: -15px;
  left: 0;
  font-size: 10px;
  color: var(--primary);
  transition: opacity 0.3s;
  opacity: 0;
}

.city-arrow {
  margin-left: 5px;
  transition: transform 0.3s ease;
}

.city-select-wrapper:hover .city-arrow {
  transform: rotate(180deg);
}

/* Бургер-меню */
.burger-container {
  display: none;
}

.burger {
  position: relative;
  width: 30px;
  height: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.burger__line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #1A1C1F;
  border-radius: 1px;
  transition: all 0.3s ease;
}

.burger.is-active .burger__line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
  background-color: #fff;
}

.burger.is-active .burger__line:nth-child(2) {
  opacity: 0;
}

.burger.is-active .burger__line:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
  background-color: #fff;
}

/* Мобильное меню */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 85%;
  height: 100%;
  background-color: #1c1e25;
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.77, 0, 0, 0.175, 1);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  color: #F5F7FA;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mobile-menu.is-active {
  transform: translateX(0);
}

.mobile-menu__container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 15px;
}

.mobile-menu__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 1px solid #2a2d38;
}

.mobile-menu__logo-block {
  display: flex;
  align-items: center;
}

.mobile-menu__logo {
  height: 36px;
  width: auto;
}

.mobile-menu__close {
  width: 32px;
  height: 32px;
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-menu__close:hover {
  background-color: #972635;
  color: #FFFFFF;
  transform: rotate(90deg);
}

.mobile-menu__main {
  display: flex;
  flex-direction: column;
  height: calc(100% - 52px);
  overflow: hidden;
}

.mobile-menu__nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

.mobile-menu__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu__item {
  margin-bottom: 0;
}

.mobile-menu__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  color: #F5F7FA;
  text-decoration: none;
  border-bottom: 1px solid #2a2d38;
  transition: color 0.3s ease;
}

.mobile-menu__link:hover {
  color: #972635;
}

.mobile-menu__contact {
  padding-top: 20px;
  border-top: 1px solid #2a2d38;
}

.mobile-menu__contact-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.mobile-menu__contact-col {
  flex: 1;
}

.mobile-menu__tel {
  display: block;
  color: #F5F7FA;
  text-decoration: none;
  margin-bottom: 8px;
  font-weight: 600;
}

.mobile-menu__email {
  display: block;
  color: #F5F7FA;
  text-decoration: none;
  font-size: 14px;
}

.mobile-menu__work-time {
  display: block;
  color: #596780;
  font-size: 12px;
  margin-bottom: 8px;
}

.mobile-menu__buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-menu__buttons-row {
  display: flex;
  gap: 12px;
}

/* Класс для скрытия нижней части header */
.header--menu-hidden .header__lower {
  max-height: 0;
  opacity: 0;
  visibility: hidden;
}

/* Добавляем отступы для компенсации исчезновения нижней части */
.header--menu-hidden {
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1); /* Уменьшаем тень при скрытом меню */
}

/* Плавный переход при показе меню */
.header:hover .header__lower {
  max-height: 50px; /* Предполагаемая высота меню */
  opacity: 1;
  visibility: visible;
}

/* Мобильные стили */
@media (max-width: 768px) {
  /* Мобильное меню */
  .header__lower {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    height: 100vh;
    background-color: var(--white);
    z-index: 999;
    transition: all 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    overflow-y: auto;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    padding-top: 70px;
    display: flex;
    flex-direction: column;
  }
  
  .header__lower.active {
    right: 0;
  }
  
  .header__lower-list {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    margin-top: 20px;
  }
  
  .header__lower-item {
    margin: 5px 0;
    width: 100%;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    transition-delay: calc(0.05s * var(--item-index, 0));
  }
  
  .header__lower.active .header__lower-item {
    opacity: 1;
    transform: translateX(0);
  }
  
  .header__lower-link {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 8px;
    width: 100%;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease, padding 0.3s ease;
    position: relative;
  }
  
  .header__lower-link:active {
    background-color: var(--primary-light);
    color: var(--primary);
  }
  
  .header__lower-link::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--grey);
    border-right: 2px solid var(--grey);
    transform: rotate(45deg);
    transition: transform 0.3s ease, border-color 0.3s ease;
  }
  
  .header__lower-link:hover::after {
    transform: rotate(45deg) scale(1.2);
    border-color: var(--primary);
  }
  
  /* Верхняя часть хедера */
  .header__upper {
    padding: 10px 0;
    z-index: 1001;
    position: relative;
    background-color: var(--white);
  }
  
  .header__upper-list {
    flex-wrap: wrap;
    justify-content: space-between;
  }
  
  /* Управление отображением элементов в мобильном хедере */
  .header__upper-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  
  .header__upper-item:not(.header__upper-item:first-child):not(.header__upper-item:nth-last-child(2)) {
    display: none;
  }
  
  .header__upper-logo img {
    height: 36px;
  }
  
  .logo-title {
    font-size: 14px;
  }
  
  .logo-subtitle {
    font-size: 10px;
  }
  
  /* Стили overlay для затемнения при открытом меню */
  .menu-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(3px);
  }
  
  .menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  /* Hero section */
  .hero {
    margin-top: 69px;
    height: auto;
    min-height: auto;
  }
  
  .slideshow {
    height: calc(100vh - 69px);
  }
  
  .hero__inner {
    flex-direction: column;
    padding: 20px;
  }
  
  .hero__content {
    max-width: 100%;
  }
  
  .hero__form-container {
    position: relative !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100%;
    margin: 30px 0 !important;
    right: auto !important;
    top: auto !important;
  }
  
  .slide__title {
    font-size: 24px;
    margin-bottom: 20px;
  }
  
  /* Показываем бургер-меню на мобильных */
  .burger-container {
    display: flex !important;
  }
  
  /* Скрываем нижнюю навигацию на мобильных */
  .header__lower {
    display: none !important;
  }
}

/* Дополнительные стили для очень маленьких экранов */
@media (max-width: 480px) {
  .header__upper {
    padding: 8px 0;
  }
  
  .header__upper-logo img {
    height: 32px;
  }
  
  .logo-title {
    font-size: 12px;
  }
  
  .logo-subtitle {
    font-size: 9px;
  }
  
  .header__upper-tel {
    font-size: 12px;
  }
  
  .header__upper-button {
    padding: 10px 16px;
    font-size: 12px;
  }
}
