
.popup {
  position: fixed;
  z-index: 999999;
  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;
}

/* The open dialog receives focus from script; a ring around the whole screen
   would only get in the way. Its controls keep their own focus rings. */
.popup:focus {
  outline: none;
}

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

.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 {
  -webkit-transform: translate3d(0, 0, 0) !important;
  transform: translate3d(0, 0, 0) !important;
}

.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: var(--color-red);
}

@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(var(--color-blue-100--rgb), 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%);
  -webkit-transform: translate3d(100%, 0, 0) !important;
  transform: translate3d(100%, 0, 0) !important;
  /* 0.5s: with this curve the drawer is visually home by then, and the dim layer
     behind it runs on the same clock so both settle together. */
  -webkit-transition: -webkit-transform 0.5s cubic-bezier(0.32, 0.72, 0, 1) !important;
  transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1) !important;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  height: 100%;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

.popup.popup-burger .popup__scroll::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0);
  width: 120%;
  height: 120%;
  background-image: url('../../media/general/nuzp-gerb.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.015;
  pointer-events: none;
  z-index: 0;
}

.popup.popup-burger .popup__wrapper {
  background: transparent !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  padding: 1.5rem 1rem 1rem !important;
  flex-direction: column;
  position: relative;
  z-index: 1;
  min-height: 0 !important;
  height: auto !important;
  box-sizing: border-box !important;
}

.popup.popup-burger .popup-burger__header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  gap: 15px;
}

.popup.popup-burger .popup-burger__btn {
  position: relative !important;
  top: 0 !important;
  right: 0 !important;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  color: var(--color-white);
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.3s ease;
  z-index: 2;
  cursor: pointer;
}

.popup.popup-burger .popup-burger__search-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-grow: 1;
  height: 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0 15px;
  gap: 12px;
  cursor: text;
  transition: all 0.3s ease;
  color: rgba(255, 255, 255, 0.5);
}

.popup.popup-burger .popup-burger__search-trigger svg {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0;
}

.popup.popup-burger .popup-burger__search-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
}

.popup.popup-burger .popup-burger__search-trigger span {
  font-size: 1rem;
  font-weight: 400;
  user-select: none;
}

.popup.popup-burger .popup-burger__btn svg {
  width: 24px !important;
  height: 24px !important;
}

.popup.popup-burger .popup-burger__btn:hover {
  opacity: 0.7;
}

.popup.popup-burger .popup__close:hover {
  transform: rotate(90deg) scale(1.05);
}

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

.popup.popup-burger .popup-burger__quick-links {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin-bottom: 10px !important;
}

.popup.popup-burger .popup-burger__quick-links .menu-item.ql-half {
  flex: 1 1 calc(50% - 5px) !important;
  max-width: calc(50% - 5px) !important;
  list-style: none !important;
}

.popup.popup-burger .popup-burger__quick-links .menu-item.ql-full {
  flex: 1 1 100% !important;
  max-width: 100% !important;
  list-style: none !important;
}

.popup.popup-burger .popup-burger__quick-links .menu-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
  min-height: 44px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  transition: all 0.3s ease !important;
}

.popup.popup-burger .popup-burger__quick-links .menu-row:hover,
.popup.popup-burger .popup-burger__quick-links .menu-row:active {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.popup.popup-burger .popup-burger__quick-links .menu__link {
  color: var(--color-white) !important;
  font-size: 0.95rem !important;
  text-decoration: none !important;
  text-align: center !important;
  padding: 10px !important;
  width: 100% !important;
  display: block !important;
}

.popup.popup-burger .menu__mobile {
  margin: 0 !important;
  padding: 0 !important;
}

.popup.popup-burger .menu__mobile > .menu__list {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  align-items: stretch !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.popup.popup-burger .menu__list > .menu-item {
  width: 100% !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  transition: background 0.3s ease !important;
}

.popup.popup-burger .menu__list > .menu-item:last-child {
  border-bottom: none !important;
}

.popup.popup-burger .menu__list > .menu-item > .menu-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: stretch !important;
  padding-left: 10px !important;
  min-height: 48px !important;
  background: transparent !important;
  border: none !important;
}

.popup.popup-burger .menu__list > .menu-item > .menu-row:hover,
.popup.popup-burger .menu__list > .menu-item._open {
  background: rgba(255, 255, 255, 0.03) !important;
}

.popup.popup-burger .menu__list > .menu-item > .menu-row > .menu__link {
  display: flex !important;
  align-items: center !important;
  color: var(--color-white) !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  padding: 12px 0 !important;
  text-decoration: none !important;
  flex-grow: 1 !important;
  transition: padding-left 0.3s ease !important;
}

.popup.popup-burger .menu__list > .menu-item > .menu-row > .menu__link:hover {
  padding-left: 5px !important;
}

.popup-burger__decoration {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 40px;
  width: 100%;
}
.popup-burger__decoration-line {
  height: 1px;
  flex-grow: 1;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
}

.popup.popup-burger .menu__link {
  min-width: 0 !important;
}

.popup.popup-burger .menu__link span {
  word-break: break-word !important;
  white-space: normal !important;
}

.popup.popup-burger .menu-arrow {
  background: transparent !important;
  border: none !important;
  border-left: 1px solid rgba(255, 255, 255, 0.06) !important;
  color: var(--color-white) !important;
  width: 50px !important;
  height: auto !important;
  align-self: stretch !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), background 0.3s ease !important;
}

.popup.popup-burger .menu-arrow:active {
  background: rgba(255, 255, 255, 0.05) !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 15px 12px 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;
  word-break: break-word !important;
  white-space: normal !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.popup.popup-burger .sub-menu .menu__link:hover,
.popup.popup-burger .sub-menu .menu__link:active {
  color: var(--color-white) !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.5s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.5s !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.5s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0s !important;
}

/* There is no burger on desktop. This must come after the display:block above
   (same specificity, both !important), or the hidden drawer stays rendered and
   doubles the cost of every style recalculation on wide screens. */
@media (min-width: 1200px) {
  .popup.popup-burger {
    display: none !important;
  }
}

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

/*
 * Floating buttons step aside while the page is scrolled down on a phone
 * (assets/js/layout/floating-controls.js). They fade and sink a little rather
 * than slide away: the Telegram card hangs off its button and would cross the
 * text on its way out. Visibility waits for the fade so a tap on a fading
 * button still lands, and comes back at once when they return. "html" lifts
 * these over each widget's own rules, whichever stylesheet loads last.
 */
@media (max-width: 899px) {
  html #cw-launcher,
  html .tg-widget-wrapper {
    transition: opacity 0.25s ease, translate 0.25s ease, visibility 0s linear 0s;
  }

  html .calendar-widget-btn {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease,
      opacity 0.25s ease, translate 0.25s ease, visibility 0s linear 0s;
  }

  html #cw-launcher[data-tucked],
  html .tg-widget-wrapper[data-tucked],
  html .calendar-widget-btn[data-tucked] {
    opacity: 0;
    translate: 0 12px;
    visibility: hidden;
    pointer-events: none;
    transition-delay: 0s, 0s, 0s, 0s, 0.25s;
  }

  html #cw-launcher[data-tucked],
  html .tg-widget-wrapper[data-tucked] {
    transition-delay: 0s, 0s, 0.25s;
  }

  /* "To top" has its own fade (to-top.php); it only needs to be told to use it. */
  html #toTop[data-tucked] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}
