/* =========================
   1. Header base
========================= */

#header.tdi-site-header {
  --tdi-header-height: 94px;
  --tdi-header-bg: rgba(5, 5, 6, 0.95);
  --tdi-header-bg-front: rgba(5, 5, 6, 0.74);
  --tdi-red: #e31e24;
  --tdi-red-light: #ff3939;
  --tdi-white: #ffffff;
  --tdi-dark: #050506;

  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--tdi-header-bg);
  border-bottom: 1px solid rgba(160, 18, 24, 0.45);
  box-shadow: none;
  font-family: Arial, Helvetica, sans-serif;
}

body.front-page #header.tdi-site-header {
  position: absolute;
  left: 0;
  right: 0;
  background: var(--tdi-header-bg-front);
}

.admin-bar #header.tdi-site-header {
  top: 32px;
}

#header .tdi-header {
  width: 100%;
}

#header .tdi-header__inner {
  width: min(1160px, calc(100% - 32px));
  min-height: var(--tdi-header-height);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 44px;
}

/* =========================
   2. Logo
========================= */

#header .tdi-logo {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

#header .tdi-logo__image {
  display: block;
  width: 86px;
  height: auto;
  max-height: 46px;
}

/* =========================
   3. Desktop navigation
========================= */

#header .tdi-nav {
  flex: 1 1 auto;
  min-width: 0;
}

#header .tdi-nav-list,
#header .tdi-nav-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#header .tdi-nav > .tdi-nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

#header .tdi-nav .nav-menu-element {
  position: relative;
}

#header .tdi-nav a {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0;
  color: var(--tdi-white);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: color 0.2s ease;
}

#header .tdi-nav a:hover,
#header .tdi-nav .current-menu-item > a,
#header .tdi-nav .current-menu-ancestor > a {
  color: var(--tdi-red);
}

#header .tdi-nav .nav-menu-element:has(> .sub-menu) > a::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

#header .tdi-nav .nav-menu-element:has(> .sub-menu)::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 14px;
}

#header .tdi-nav .sub-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 1002;
  width: max-content;
  min-width: 200px;
  max-width: 320px;
  padding: 12px 14px;
  background: var(--tdi-dark);
  border: 1px solid rgba(227, 30, 36, 0.38);
  border-radius: 3px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

#header .tdi-nav .nav-menu-element:hover > .sub-menu,
#header .tdi-nav .nav-menu-element:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

#header .tdi-nav .sub-menu a {
  min-height: auto;
  padding: 6px 0;
  color: var(--tdi-white);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
}

#header .tdi-nav .sub-menu a:hover {
  color: var(--tdi-red);
}

/* =========================
   4. Header right side
========================= */

#header .tdi-header__end {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

#header .tdi-messengers {
  display: flex;
  align-items: center;
  gap: 10px;
}

#header .tdi-messengers a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--tdi-white);
  background: transparent;
  border-radius: 50%;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

#header .tdi-messengers a:hover {
  color: var(--tdi-red);
  transform: translateY(-1px);
}

#header .tdi-messengers svg,
#header .tdi-messengers img {
  display: block;
  width: 21px;
  height: 21px;
  object-fit: contain;
}

#header .tdi-messengers svg,
#header .tdi-messengers svg path,
#header .Header-module__tPtrlq__messengerIcon,
#header .Header-module__tPtrlq__messengerIcon path {
  fill: currentColor;
}

#header .tdi-messengers img {
  filter: brightness(0) invert(1);
  transition: filter 0.2s ease;
}

#header .tdi-messengers a:hover img {
  filter: brightness(0) saturate(100%) invert(18%) sepia(98%) saturate(2877%) hue-rotate(346deg) brightness(96%) contrast(88%);
}

#header .tdi-phone {
  color: var(--tdi-white);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

#header .tdi-phone:hover {
  color: var(--tdi-red);
}

/* =========================
   5. Burger button
========================= */

#header .tdi-burger.burger.open_menu {
  display: none;
  position: static;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(220, 38, 38, 0.72);
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.1);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#header .tdi-burger.burger.open_menu span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  border-radius: 2px;
  background: var(--tdi-red-light);
  pointer-events: none;
}

#header .tdi-burger.burger.open_menu:hover,
#header .tdi-burger.burger.open_menu.clicked {
  border-color: var(--tdi-red-light);
  background: rgba(220, 38, 38, 0.22);
}

#header .tdi-burger.burger.open_menu.clicked span {
  background: var(--tdi-white);
}

/* =========================
   6. Mobile menu panel
========================= */

body.mobile-menu-open {
  overflow: hidden;
}

#header #mobile-mnu.tdi-mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  width: min(390px, 92vw);
  height: 100dvh;
  padding: 22px 18px 24px;
  border-right: 1px solid rgba(220, 38, 38, 0.52);
  background:
    radial-gradient(circle at 100% 0, rgba(220, 38, 38, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 28%),
    #070808;
  box-shadow: 24px 0 70px rgba(0, 0, 0, 0.62);
  transform: translateX(calc(-100% - 30px));
  transition: transform 0.32s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#header #mobile-mnu.tdi-mobile-menu.opened {
  transform: translateX(0);
}

#header #mobile-mnu.tdi-mobile-menu ul,
#header #mobile-mnu.tdi-mobile-menu li {
  list-style: none;
  margin: 0;
  padding: 0;
}

#header #mobile-mnu.tdi-mobile-menu a {
  color: var(--tdi-white);
  text-decoration: none;
}

/* =========================
   7. Mobile menu header
========================= */

#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__logo {
  display: inline-flex;
  align-items: center;
  max-width: 175px;
  min-height: 60px;
  margin-bottom: 28px;
}

#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__logo img {
  display: block;
  width: 100%;
  height: auto;
  filter: none;
}

#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__close {
  position: absolute;
  top: 32px;
  right: 18px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(220, 38, 38, 0.72);
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.12);
  color: transparent;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__close::before,
#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--tdi-white);
}

#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__close:hover {
  border-color: var(--tdi-red-light);
  background: rgba(220, 38, 38, 0.24);
  transform: rotate(90deg);
}

/* =========================
   8. Mobile navigation
========================= */

#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 20px;
}

#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__nav > li > a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--tdi-white);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__nav > li > a:hover,
#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__nav > li.active > a,
#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__nav > li.current-menu-item > a,
#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__nav > li.current-menu-ancestor > a {
  background: rgba(220, 38, 38, 0.92);
  color: var(--tdi-white);
  transform: translateX(3px);
}

#header #mobile-mnu.tdi-mobile-menu .sub-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 10px 12px;
  padding: 10px 0 10px 12px;
  border-left: 1px solid rgba(220, 38, 38, 0.42);
}

#header #mobile-mnu.tdi-mobile-menu .sub-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 7px;
  color: #d4d4d4;
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.25;
  transition: background 0.2s ease, color 0.2s ease;
}

#header #mobile-mnu.tdi-mobile-menu .sub-menu a:hover {
  background: rgba(220, 38, 38, 0.12);
  color: var(--tdi-white);
}

/* =========================
   9. Mobile contacts
========================= */

#header #mobile-mnu.tdi-mobile-menu .phones__holder {
  margin: 18px 0 10px;
  padding-top: 18px;
  border-top: 1px solid rgba(220, 38, 38, 0.32);
}

#header #mobile-mnu.tdi-mobile-menu .phone__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(220, 38, 38, 0.72);
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.92);
  color: var(--tdi-white);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.2);
}

#header #mobile-mnu.tdi-mobile-menu .email__holder {
  margin-bottom: 10px;
}

#header #mobile-mnu.tdi-mobile-menu .email__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(220, 38, 38, 0.38);
  border-radius: 8px;
  background: #121313;
  color: var(--tdi-white);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#header #mobile-mnu.tdi-mobile-menu .email__item:hover {
  border-color: rgba(239, 68, 68, 0.78);
  background: rgba(220, 38, 38, 0.12);
}

/* =========================
   10. Mobile socials
========================= */

#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__socials {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(220, 38, 38, 0.32);
}

#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--tdi-white);
}

#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__socials svg,
#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__socials img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__socials svg,
#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__socials svg path {
  fill: currentColor;
}

#header #mobile-mnu.tdi-mobile-menu .tdi-mobile-menu__socials img {
  filter: brightness(0) invert(1);
}

/* =========================
   11. Mobile overlay
========================= */

.mobile-mnu-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-mnu-overlay.opened {
  opacity: 1;
  pointer-events: auto;
}
/* Верхняя панель */
.topbar {
  border-bottom: 1px solid rgba(255,255,255,.11);
  font-size: 14px;
  color: var(--muted);
  padding-bottom: 10px;
}

.topbar .container {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  flex-wrap: wrap;
}

.topbar span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

/* Контакты в topbar */
.top-contacts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 15px;
  line-height: 1.4;
  width: 100%;
}

.top-contact-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.contact-icon {
  width: 17px;
  height: 17px;
  fill: #d71920;
  flex-shrink: 0;
}

.top-contact-item a {
  color: inherit;
  text-decoration: none;
}

.top-contact-item a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Социальные иконки */
.social-icons {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.topbar .social-icons {
  margin-top: 0;
}

.social-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .2s ease;
  flex-shrink: 0;
  color: #fff;
}

.social-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-icon:hover {
  color: #fff;
  box-shadow: 0 14px 32px rgba(227, 31, 47, .18);
  transform: translateY(-2px);
}

.social-icon:focus-visible {
  outline: 3px solid rgba(227, 31, 47, .36);
  outline-offset: 3px;
}

.social-icon.telegram,
.social-icon.whatsapp,
.social-icon.viber {
  color: #fff;
}

.social-icon.telegram svg,
.social-icon.whatsapp svg,
.social-icon.viber svg {
  filter: drop-shadow(0 0 10px rgba(227, 31, 47, .2));
}

/* Мобильная версия */
@media (max-width: 640px) {
  .container {
    width: min(var(--max), calc(100% - 22px));
  }

  .social-icons {
    gap: 10px;
  }

  .social-icon {
    width: 32px;
    height: 32px;
  }

  .social-icon svg {
    width: 23px;
    height: 23px;
  }

  .top-contact-item.mail,
  .top-contact-item.work,
  .topbar .social-icons {
    display: none;
  }

  .top-contact-item.address,.top-contact-item.time {
    font-size: 12px;
  }
}
/* =========================
   12. Responsive
========================= */

@media (max-width: 1180px) {
  #header .tdi-header__inner {
    position: relative;
    gap: 24px;
  }

  #header .tdi-nav > .tdi-nav-list {
    gap: 20px;
  }

  #header .tdi-nav a {
    font-size: 13px;
  }
}

@media (max-width: 980px) {
  #header.tdi-site-header {
    --tdi-header-height: 70px;
  }

  #header .tdi-nav {
    display: none;
  }

  #header .tdi-burger.burger.open_menu {
    position: absolute;
    right: 10px;
    display: inline-block;
    
  }
}

@media (max-width: 640px) {
  .admin-bar #header.tdi-site-header {
    top: 46px;
  }

  #header .tdi-header__inner {
    width: min(100% - 20px, 1240px);
    gap: 10px;
  }

  #header .tdi-logo__image {
    width: 82px;
  }

  #header .tdi-phone {
    display: none;
  }

  #header .tdi-header__end {
    gap: 12px;
    margin-left: auto;
    margin-right: 60px;
  }

  #header .tdi-messengers {
    gap: 6px;
  }

  #header .tdi-messengers a {
    width: 32px;
    height: 32px;
  }
}