/* ---------------------------------------------------------------------------
   Hyundai Promise information popups (inc/promise-info.php,
   assets/js/promise-info.js).

   The frame is ours; what is inside is an Elementor page built from the old
   design's widgets, so it brings its own styles (styles.css). Only what a
   page laid out for a full window gets wrong inside a dialog is corrected
   here.
--------------------------------------------------------------------------- */
html.promise-modal-open{
  overflow: hidden;
}

.promise-modal{
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}
.promise-modal[hidden]{
  display: none;
}

.promise-modal__backdrop{
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
}

.promise-modal__dialog{
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1264px;
  max-height: calc(100vh - 80px);
  max-height: calc(100dvh - 80px);
  background-color: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.promise-modal__body{
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 56px 24px 32px;
}

.promise-modal__close{
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: pointer;
}
.promise-modal__close::before,
.promise-modal__close::after{
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 2px;
  background-color: #000;
}
.promise-modal__close::before{
  transform: translate(-50%, -50%) rotate(45deg);
}
.promise-modal__close::after{
  transform: translate(-50%, -50%) rotate(-45deg);
}
.promise-modal__close:focus-visible{
  outline: 2px solid #00aad2;
  outline-offset: 2px;
}

/* The teaser prints its link whether or not it has one. */
.promise-modal .picture-text__cta:has(a[href=""]),
.promise-modal .picture-text__cta:has(a:not([href])){
  display: none;
}

/* The advantages, ticked like the source's. */
.promise-modal ul.promise-checklist{
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.promise-modal ul.promise-checklist li{
  position: relative;
  margin: 0 0 14px;
  padding-left: 34px;
}
.promise-modal ul.promise-checklist li::before{
  content: "";
  position: absolute;
  top: 0.25em;
  left: 0;
  width: 18px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='14' viewBox='0 0 18 14'%3E%3Cpath d='M1 7.2 6.2 12.4 17 1.6' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") no-repeat;
}

/* "Нашите обещания" is a portrait poster: full width it would be taller than
   any screen. */
.promise-modal .elementor-widget-image img{
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  margin: 0 auto;
}

/* A page's sections are spaced for a page, not for a dialog. */
.promise-modal .u-section{
  margin-top: 0;
  margin-bottom: 0;
}

@media (max-width: 767px){
  .promise-modal{
    padding: 0;
  }
  .promise-modal__dialog{
    max-height: 100vh;
    max-height: 100dvh;
    height: 100%;
  }
  .promise-modal__body{
    padding: 56px 16px 24px;
  }
}
