/* --- Сброс базовых отступов --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}



body {
  padding-top: 80px; /* Заглушка под фиксированную шапку */
}

/* --- Основная шапка --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 110px;
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: all .3s;
  -webkit-transition: all .3s;
  -moz-transition: all .3s;
  -ms-transition: all .3s;
  -o-transition: all .3s;
}

/* Класс для скрытия шапки при скролле */
.header--hidden {
  transform: translateY(-100%);
}

.header__container {
  width: 100%;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* --- Левая часть: Логотип и Текст --- */
.header__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: fit-content;
}

.header__logo {
  height: 45px;
  width: auto;
  object-fit: contain;
  display: block;
  margin-right: 15px;
  transition: all .3s;
  -webkit-transition: all .3s;
  -moz-transition: all .3s;
  -ms-transition: all .3s;
  -o-transition: all .3s;
}

.header__tagline {
  font-size: 10px;
  line-height: 1.1;
  text-transform: uppercase;
  color: #666666;
  margin-top: 4px;
  width: 100%;
  max-width: 100%; /* Гарантирует, что текст не выйдет за ширину логотипа */
  white-space: normal;
  word-wrap: break-word;
}

/* --- Правая часть --- */
.header__right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Кнопка Гамбургер */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  z-index: 1001;
  &:hover .hamburger__line {
    background-color: var(--main-color);
    transition: all 0.3s ease-in-out;
  }
}

.hamburger__line {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--main-header-color);
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}

/* Анимация крестика при клике */
.hamburger.is-active .hamburger__line:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}

.hamburger.is-active .hamburger__line:nth-child(2) {
  opacity: 0;
}

.hamburger.is-active .hamburger__line:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

/* Вертикальный разделитель */
.header__divider {
  width: 1px;
  height: 36px;
  background-color: #e0e0e0;
}

/* Блок мессенджеров */

.header__messengers__phone {
  margin-left: 30px;
  margin-right: 15px;
  color: var(--main-header-color);
  transition: all .3s;
  -webkit-transition: all .3s;
  -moz-transition: all .3s;
  -ms-transition: all .3s;
  -o-transition: all .3s;
}

.thy__header__phone {
  font-size: 20px;
  transition: all .3s;
  -webkit-transition: all .3s;
  -moz-transition: all .3s;
  -ms-transition: all .3s;
  -o-transition: all .3s;
  &:hover {
    color: var(--main-color);
    transition: all .3s;
    -webkit-transition: all .3s;
    -moz-transition: all .3s;
    -ms-transition: all .3s;
    -o-transition: all .3s;
  }
}

.header__messengers {
  display: flex;
  align-items: center;
  gap: 10px;
}

.messenger-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: #cecfd0;
  text-decoration: none;
  font-size: 11px;
  font-weight: bold;
  transform: perspective(400px) translate3d(0, 0, 0px);
  -webkit-transform: perspective(400px) translate3d(0, 0, 0px);
  -moz-transform: perspective(400px) translate3d(0, 0, 0px);
  -ms-transform: perspective(400px) translate3d(0, 0, 0px);
  -o-transform: perspective(400px) translate3d(0, 0, 0px);
  transition: all .3s;
  -webkit-transition: all .3s;
  -moz-transition: all .3s;
  -ms-transition: all .3s;
  -o-transition: all .3s;
  &:hover {
    background-color: var(--main-color);
    transform: perspective(400px) translate3d(0, 0, 30px);
    -webkit-transform: perspective(400px) translate3d(0, 0, 30px);
    -moz-transform: perspective(400px) translate3d(0, 0, 30px);
    -ms-transform: perspective(400px) translate3d(0, 0, 30px);
    -o-transform: perspective(400px) translate3d(0, 0, 30px);
    transition: all .3s;
    -webkit-transition: all .3s;
    -moz-transition: all .3s;
    -ms-transition: all .3s;
    -o-transition: all .3s;
}
}

.msngr-max {
  mask: url('/assets/img/icon-max.svg') no-repeat center / contain;
}

.msngr-tg {
  mask: url('/assets/img/icon-tg.svg') no-repeat center / contain;
}

.msngr-mail {
  mask: url('/assets/img/icon-mail.svg') no-repeat center / contain;
}

.phone-icon {
  width: 28px;
  height: 28px;
  margin-right: 10px;
  mask: url('/assets/img/icon-phone.svg') no-repeat center / contain;
  background-color: var(--main-color);
}

/* Кнопка "Заказать звонок" */
.btn-call {
  background-color: var(--main-color);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.btn-call:hover {
  background-color: var(--main-color-hover);
}

/* --- Полноэкранное меню --- */
.fullscreen-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #fff;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  overflow-y: auto;
  /*Включаетскролл,еслименюнепомещается*/
  padding: 130px 15px 15px 15px;
  -webkit-transition: opacity 0.4s ease, visibility 0.4s ease;
  -moz-transition: opacity 0.4s ease, visibility 0.4s ease;
  -ms-transition: opacity 0.4s ease, visibility 0.4s ease;
  -o-transition: opacity 0.4s ease, visibility 0.4s ease;
}

.fullscreen-menu.is-active {
  opacity: 1;
  visibility: visible;
}

/* Сетка карточек: 4 колонки на ПК, 2 на планшетах, 1 на смартфонах */
.fullscreen-menu__grid {
  display: grid;
  grid-gap: 12px;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(calc((100vh - 160px) / 2), auto);
  width: calc(100% - 15px);
  min-height: calc(100vh - 160px);
}

/* Карточки пунктов меню */

.menucard__box {
    transition: all .3s;
    -webkit-transition: all .3s;
    -moz-transition: all .3s;
    -ms-transition: all .3s;
    -o-transition: all .3s;
    transform: perspective(400px) translate3d(0, 0, 0px);
    -webkit-transform: perspective(400px) translate3d(0, 0, 0px);
    -moz-transform: perspective(400px) translate3d(0, 0, 0px);
    -ms-transform: perspective(400px) translate3d(0, 0, 0px);
    -o-transform: perspective(400px) translate3d(0, 0, 0px);
}

.menu-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  overflow: hidden;
  color: var(--main-header-color);
  padding: 0 40px;
  /*background-color: #efefef;*/
  background-size: cover;
  background-position: center;
  border: solid 2px #f6f6f6;
  border-radius: 8px;
  -webkit-border-radius: 8px;
  -ms-border-radius: 8px;
  -o-border-radius: 8px;
  transition: all .3s;
  -webkit-transition: all .3s;
  -moz-transition: all .3s;
  -ms-transition: all .3s;
  -o-transition: all .3s;
  &:hover {
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
  }
  &:hover .menucard__box {
    transition: all .3s;
    -webkit-transition: all .3s;
    -moz-transition: all .3s;
    -ms-transition: all .3s;
    -o-transition: all .3s;
    transform: perspective(400px) translate3d(0, 0, 15px);
    -webkit-transform: perspective(400px) translate3d(0, 0, 15px);
    -moz-transform: perspective(400px) translate3d(0, 0, 15px);
    -ms-transform: perspective(400px) translate3d(0, 0, 15px);
    -o-transform: perspective(400px) translate3d(0, 0, 15px);
}
}

.menu-card__icon {
  width: 40px;
  height: 40px;
  background-color: var(--main-color);
}

/* Затемнение фона поверх картинок для читаемости текста */


.menu-card::before {
  content: '';
  position: absolute;
  inset: 0;
  /*
  background: rgba(0, 0, 0, 0.2);
  */
  transition: background 0.3s ease;
}

.menu-card span {
  position: relative;
  z-index: 1;
  
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: transform 0.3s ease;
}

/* Hover эффекты для ПК */
/*
.menu-card:hover::before {
  background: rgba(0, 102, 204, 0.7);
}
*/

.menu-card:hover span {
  transform: scale(1.1);
}

/* --- Адаптивность (Мобильные экраны) --- */
@media (max-width: 1024px) {

  .header {
    height: 80px;
    transition: all .3s;
    -webkit-transition: all .3s;
    -moz-transition: all .3s;
    -ms-transition: all .3s;
    -o-transition: all .3s;
}

  .fullscreen-menu__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px; /* Регулируемая высота карточек на планшете */
    width: 100%;
  }

  .header__messengers__phone {
    display: none!important;
  }
}

@media (max-width: 768px) {
  .header__messengers {
    display: none; /* Скрываем мессенджеры на узких экранах при необходимости */
  }
  
  .fullscreen-menu__grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 140px; /* Высота карточек на смартфонах для корректного скролла */
  }
}

/* --- Адаптивность логотипа для мобильных устройств --- */

/* Планшеты и экраны шириной до 768px */
@media (max-width: 768px) {
  .header__logo {
    height: 35px; /* Уменьшаем высоту логотипа с 45px до 35px */
    transition: all .3s;
  }
  
  .header__tagline {
    font-size: 9px; /* Слегка уменьшаем шрифт подписи */
  }
}

@media (max-width: 576px) {
  /* Скрываем вертикальный разделитель и кнопку "Заказать звонок" */
  .header__divider,
  .btn-call {
    display: none !important;
  }

  /* Настраиваем зазоры в правом блоке для гамбургера */
  .header__right {
    gap: 0;
  }
}

