/* Custom popup. Deliberately avoids the .modal class so it cannot collide with the
   Bootstrap modals already used for booking, OTP and the lab report. */

.wac-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.wac-popup[hidden] {
  display: none;
}

.wac-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(13, 24, 52, 0.65);
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
}

.wac-popup-panel {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.25s ease-in-out, transform 0.25s ease-in-out;
}

.wac-popup.is-open .wac-popup-overlay {
  opacity: 1;
}

.wac-popup.is-open .wac-popup-panel {
  opacity: 1;
  transform: translateY(0);
}

.wac-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background 0.3s ease-in-out;
}

.wac-popup-close::before,
.wac-popup-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  margin: -1px 0 0 -7px;
  background: #0d1834;
}

.wac-popup-close::before {
  transform: rotate(45deg);
}

.wac-popup-close::after {
  transform: rotate(-45deg);
}

.wac-popup-close:hover {
  background: #fff;
}

.wac-popup-close:focus-visible {
  outline: 2px solid #158825;
  outline-offset: 2px;
}

/* Visible to screen readers only. */
.wac-popup-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wac-popup-media {
  margin: 0;
}

.wac-popup-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 45vh;
  object-fit: cover;
  border-radius: 6px 6px 0 0;
}

.wac-popup-body {
  display: flex;
  flex-direction: column;
}

.wac-popup-title,
.wac-popup-text,
.wac-popup-btn {
  margin: 0 30px;
}

.wac-popup-title {
  margin-top: 26px;
  font-size: 26px;
  font-weight: 500;
  color: #0d1834;
}

.wac-popup-text {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.6;
  color: #4b5563;
}

.wac-popup-text p:last-child {
  margin-bottom: 0;
}

.wac-popup-btn {
  align-self: flex-start;
  margin-top: 22px;
  margin-bottom: 30px;
  padding: 12px 28px;
  border-radius: 4px;
  background: #0d342e;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.3s ease-in-out;
}

.wac-popup-btn:hover,
.wac-popup-btn:focus {
  background: #158825;
  color: #fff;
}

/* Without an image the panel needs its own top spacing. */
.wac-popup-body > .wac-popup-title:first-child {
  margin-top: 40px;
}

.wac-popup-body > .wac-popup-text:first-child {
  margin-top: 46px;
}

@media (max-width: 767.98px) {
  .wac-popup {
    padding: 14px;
  }
  .wac-popup-title,
  .wac-popup-text,
  .wac-popup-btn {
    margin-left: 20px;
    margin-right: 20px;
  }
  .wac-popup-title {
    margin-top: 20px;
    font-size: 21px;
  }
  .wac-popup-btn {
    align-self: stretch;
    margin-bottom: 22px;
    text-align: center;
  }
  .wac-popup-media img {
    max-height: 35vh;
  }
  .wac-popup--no-mobile {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wac-popup-overlay,
  .wac-popup-panel {
    transition: none;
  }
  .wac-popup-panel {
    transform: none;
  }
}
