
.popup {
  position: fixed;
  z-index: 999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(var(--color-blue-100--rgb), 0);
  overflow: hidden;
  color: var(--color-white);
  -webkit-transition: background 0.5s ease;
  transition: background 0.5s ease;
}

.popup._opened {
  background-color: rgba(var(--color-blue-100--rgb), 0.88);
}

.popup.popup-burger {
  display: none;
}

@media (min-width: 1200px) {
  .popup.popup-burger {
    display: none !important;
  }
}

.popup__scroll {
  width: 100%;
  height: auto;
  max-height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-transform: translate(100%, 0);
  transform: translate(100%, 0);
  -ms-overflow-style: none;
  scrollbar-width: none;
}

._popup-menu._opened .popup__scroll {
  transform: translate(0, 0);
}

.popup__scroll::-webkit-scrollbar {
  display: none;
}

@media (min-width: 1200px) {
  .popup__scroll {
    max-width: 40%;
    margin: 0 0 0 auto;
  }
}

@media (min-width: 900px) and (max-width: 1199px) {
  .popup__scroll {
    max-width: 40%;
    margin: 0 0 0 auto;
  }
}

@media (max-width: 899px) {
  .popup__scroll {
    margin: 0 0 0 auto;
  }
}

.popup__wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: var(--color-blue-200);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 2.5rem 1.5rem 3.25rem;
}

@media (min-width: 900px) {
  .popup__wrapper {
    padding: 3.75rem 4rem 5rem;
  }
}

@media (min-width: 1200px) {
  .popup__wrapper {
    padding: 3.25rem 4.5rem 4.75rem;
  }
}

.popup__close {
  position: absolute;
  width: 2rem;
  height: 2rem;
  padding: unset;
  border: unset;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.3s ease,
    color 0.3s ease;
}

.popup__close:hover {
  transform: rotate(90deg) scale(1.2);
  color: #ff0000;
}

@media (min-width: 900px) {
  .popup__close {
    top: 1.5625rem;
    right: 1.375rem;
  }
}

@media (max-width: 899px) {
  .popup__close {
    top: 0.5rem;
    right: 0.625rem;
  }
}

@media (max-width: 899px) and (max-width: 550px) {
  .popup__close {
    top: 0.625rem;
    right: 0.625rem;
  }
}

.popup__close img {
  width: 100%;
  height: auto;
}

.popup__content {
  width: 100%;
}

@media (min-width: 900px) {
  .popup__content {
    margin-right: auto;
  }
}

@media (max-width: 899px) {
  .popup__content {
    max-width: 80%;
    margin: 0 auto;
  }
}

@media (max-width: 899px) and (max-width: 550px) {
  .popup__content {
    max-width: unset;
  }
}

.popup.popup-callback:not(._opened),
.popup.popup-product:not(._opened) {
  display: none !important;
}

._popup-callback._opened .popup__scroll,
._popup-product._opened .popup__scroll {
  transform: translate(0, 0);
}

.popup__title {
  font-size: 32px;
  line-height: 114%;
}

.popup__form {
  margin-top: 40px;
}

.popup__form form {
  display: grid;
  gap: 12px;
}

.popup__form input[type="text"],
.popup__form input[type="tel"],
.popup__form input[type="email"] {
  border-bottom: 1px solid var(--color-grey-100);
  color: var(--color-white);
}

.popup__form input[type="submit"] {
  margin-top: 20px;
}

.popup__subtitle {
  display: none;
  text-align: start;
  margin-top: 0.5rem;
  opacity: 0.8;
}

@media (max-width: 1199px) {
  ._popup-menu .popup__wrapper {
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding-top: 0 !important;
    height: auto !important;
    min-height: 100% !important;
  }
  ._popup-menu .popup__scroll {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
}


#toTop {
  position: fixed;
  z-index: 9980;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-blue-200);

  border: 1px solid var(--color-white, #ffffff);
  color: var(--color-white);
  text-decoration: none;
  cursor: pointer;
  outline: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  padding: 10px;
}

#toTop.is-visible {
  opacity: 1;
  visibility: visible;
}

#toTop:hover {
  background: var(--color-blue-100);
}

@media (min-width: 769px) {
  #toTop {
    right: 10px;
    bottom: 15px;
    width: 44px;
    height: 44px;
  }
  #toTop:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(38, 90, 166, 0.15);
  }
  #toTop svg {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 768px) {
  #toTop {
    right: 0;
    bottom: 10px;
    width: 34px;
    height: 34px;
    box-shadow: -2px 5px 10px rgba(0, 0, 0, 0.05);
  }
  #toTop svg {
    width: 24px;
    height: 24px;
  }
}

.popup.popup-burger .popup__scroll {
  background: linear-gradient(145deg, var(--color-blue-200) 0%, #0a1332 100%);
  box-shadow: -15px 0 50px rgba(0, 0, 0, 0.5);
  -webkit-transform: translateX(100%) !important;
  transform: translateX(100%) !important;
  -webkit-transition: -webkit-transform 0.7s cubic-bezier(0.32, 0.72, 0, 1) !important;
  transition: transform 0.7s cubic-bezier(0.32, 0.72, 0, 1) !important;
  will-change: transform;
  height: 100%;
}

.popup.popup-burger .popup__wrapper {
  background: transparent !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  padding: 3rem 1.5rem 5rem !important;
  flex-direction: column;
}

.popup.popup-burger .popup__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  color: #fff;
  transition: background-color 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

.popup.popup-burger .popup__close:hover {
  background: var(--color-error, #ef4444);
  transform: rotate(90deg) scale(1.1);
}

.popup.popup-burger .popup__content {
  width: 100%;
}

.popup.popup-burger .menu__mobile > .menu__list {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  padding: 0 !important;
  margin: 0 !important;
  align-items: stretch !important;
}

.popup.popup-burger .menu__list > .menu-item:not(.special-faculties-item) {
  width: 100% !important;
}

.popup.popup-burger .menu__list > .menu-item:not(.special-faculties-item):last-child:nth-child(even) {
  grid-column: 1 / -1 !important;
}

.popup.popup-burger .menu__list > .menu-item:not(.special-faculties-item) .menu-row {
  height: 100% !important;
}

.popup.popup-burger .menu__list > .menu-item:not(.special-faculties-item) .menu__link {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  height: 100% !important;
  min-height: 65px !important;
  padding: 10px 12px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 0 !important; /* Убрал скругления */
  color: var(--color-white) !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  text-decoration: none !important;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.popup.popup-burger .menu__list > .menu-item:not(.special-faculties-item) .menu__link:active,
.popup.popup-burger .menu__list > .menu-item:not(.special-faculties-item) .menu__link:hover {
  background: var(--color-blue-100) !important;
  border-color: var(--color-blue-100) !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
  color: #fff !important;
}

.popup.popup-burger .menu__list > .special-faculties-item {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  margin-bottom: 5px !important;
}

.popup.popup-burger .special-faculties-item > .menu-row {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding-left: 15px !important;
}

.popup.popup-burger .special-faculties-item > .menu-row > .menu__link {
  color: var(--color-white) !important;
  font-size: 1.15rem !important;
  font-weight: 500 !important;
  padding: 10px 0 !important;
  text-decoration: none !important;
  flex-grow: 1 !important;
}

.popup.popup-burger .menu-arrow {
  background: transparent !important;
  border: none !important;
  color: #fff !important;
  width: 44px !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.popup.popup-burger .menu-item._open > .menu-row > .menu-arrow {
  transform: rotate(180deg) !important;
}

.popup.popup-burger .sub-menu {
  display: none !important; 
  padding: 10px 5px 10px 15px !important;
}

.popup.popup-burger .menu-item._open > .sub-menu {
  display: block !important;
  animation: mobileSubMenuFadeIn 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
}

.popup.popup-burger .sub-menu .menu-item {
  margin-bottom: 5px !important;
  width: 100% !important;
}

.popup.popup-burger .sub-menu .menu-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  padding: 0 !important;
  height: auto !important;
}

.popup.popup-burger .sub-menu .menu__link {
  font-size: 0.95rem !important;
  font-weight: 400 !important;
  color: rgba(255, 255, 255, 0.8) !important;
  padding: 12px 0 !important;
  padding-left: 10px !important;
  text-align: left !important;
  text-decoration: none !important;
  transition: color 0.3s ease, transform 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.popup.popup-burger .sub-menu .menu__link:hover,
.popup.popup-burger .sub-menu .menu__link:active {
  color: #fff !important;
  transform: translateX(5px) !important;
}

.popup.popup-burger {
  display: block !important;
  opacity: 1 !important;
  background-color: rgba(15, 23, 42, 0) !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: background-color 0.3s ease, visibility 0s linear 0.7s !important;
}

.popup.popup-burger._opened {
  background-color: rgba(15, 23, 42, 0.6) !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transition: background-color 0.3s ease, visibility 0s linear 0s !important;
}

.popup.popup-burger._opened .popup__scroll {
  -webkit-transform: translateX(0) !important;
  transform: translateX(0) !important;
}
